tx · AGhvEhDz9ZaTGddeeMchzptHK1TvQy3edUUJWbhX7Y9B

3MvyzDtzWWV5MZ1GP8JfQhhQqiGU4Nbifdy:  -0.00500000 Waves

2022.06.27 16:13 [2114892] smart account 3MvyzDtzWWV5MZ1GP8JfQhhQqiGU4Nbifdy > SELF 0.00000000 Waves

{ "type": 13, "id": "AGhvEhDz9ZaTGddeeMchzptHK1TvQy3edUUJWbhX7Y9B", "fee": 500000, "feeAssetId": null, "timestamp": 1656335589678, "version": 2, "chainId": 84, "sender": "3MvyzDtzWWV5MZ1GP8JfQhhQqiGU4Nbifdy", "senderPublicKey": "3o2zJzkX9SQ65BrfAiyV4tuKneQz8eDLocKmiai1L6Tg", "proofs": [ "2xVYLPvH19sMdwX7PK7dVZsThem8JqjA6yfShNJ3RrXoPNPY3gaxM7q4j6N5F5GZRJrfRR7mQMCfBDgDAZhyBjJy" ], "script": "base64:AAIFAAAAAAAAABkIAhIDCgEBEgQKAggBEgQKAggBEgQKAggIAAAAGAAAAAAKc2hpbnl3Z2dpZAEAAAAgiWnPAv+2urnUcZbXebiZdiawdNB3efRzbobw9HOfBiYAAAAAD3RyZWFzdXJ5QWRkcmVzcwEAAAAaAVRl+PAWCwTAWUJwGp5IjJf/ftwcYvLdu/0AAAAADWFzc2V0c0FkZHJlc3MBAAAAGgFUy+a0wXfXHSctaxYQS8qRSOspiwoalaeaAAAAABJtYXJrZXRwbGFjZUFkZHJlc3MBAAAAGgFUHSG5k/H8GMOnG0lxFkOWUXTrrFQuJbzvAAAAABRjb25maWd1cmF0aW9uQWRkcmVzcwEAAAAaAVTbIMuXkVY/Qg5sp2U1gothv7V0cji00C4AAAAADm5hdGlvbnNBZGRyZXNzAQAAABoBVE2F6N70+ERrWRA7cF/Dt7llDlH1REZtoAAAAAALYWRtaW5XYWxsZXQJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAECAAAAIzNNcE50aVBTUlNxNk5uYVFZazM4QmZXU3paY2dBWVR5clE5AAAAABZkY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c2V0c0FkZHJlc3MCAAAADnNldE5hdGlvbk93bmVyCQAETAAAAAIFAAAACU5hdGlvbmtleQkABEwAAAACBQAAAAhzdHJPd25lcgUAAAADbmlsBQAAAANuaWwDCQAAAAAAAAIFAAAAA293bgUAAAADb3duCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACBQAAAAlOYXRpb25rZXkFAAAACG5hdGlvbklkCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAGkAAAAAQUAAAAIbmF0aW9uSWQFAAAACU5hdGlvbmtleQUAAAADbmlsCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAABaQEAAAAYc2V0VGVjbmhub2xvZ3lEaXNjb3ZlcmVkAAAAAgAAAAluYXRpb25LZXkAAAANdGVjaG5vbG9neUtleQMJAQAAAAEhAAAAAQkBAAAACmNoZWNrQWRtaW4AAAABCAUAAAABaQAAAAZjYWxsZXIJAAACAAAAAQIAAAApT25seSB0aGUgYWRtaW4gY2FuIHBlcmZvcm0gdGhpcyBvcGVyYXRpb24EAAAACU5hdGlvbmtleQkAASwAAAACCQABLAAAAAIFAAAACW5hdGlvbktleQIAAAABXwUAAAANdGVjaG5vbG9neUtleQkABRQAAAACCQAETAAAAAIJAQAAAAxCb29sZWFuRW50cnkAAAACBQAAAAlOYXRpb25rZXkGBQAAAANuaWwGAAAAAKYc3Ss=", "height": 2114892, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GFm8dhSqPDmXZrjhmtZmfgfxPaf8MpQMMRFFjdYtj6RS Next: DpjpQZYYvu8acgD54qxAMxmSTkxVE15ybFCxSorbhzmn Diff:
OldNewDifferences
124124 let startNationsSHEG = 90000000000
125125
126126 @Callable(i)
127-func setUserNation (nationId) = [IntegerEntry(toString(i.caller), nationId)]
127+func setUserNation (nationId) = {
128+ let k = toString(i.originCaller)
129+ let p = tryGetInteger((k + "_Power"))
130+[IntegerEntry(k, nationId), IntegerEntry((k + "_Power"), p)]
131+ }
128132
129133
130134
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let shinywggid = base58'AFQS5E4ELtxex3iANtWtUU2V2oWJZSo8VVnK8z3VFmqf'
55
66 let treasuryAddress = base58'3MyDGEoKp1gF4LSRknk9vSuDEyrwuYXcQEQ'
77
88 let assetsAddress = base58'3N8WDKbqGox5Eky326PHHT7rUyrby5MXdmb'
99
1010 let marketplaceAddress = base58'3Mra7mjPipcQd5sJaRmXK8xgS4scb8gPF4A'
1111
1212 let configurationAddress = base58'3N9tj3b2djcaZozn97VkYchL9S1i6cdEbC1'
1313
1414 let nationsAddress = base58'3MvyzDtzWWV5MZ1GP8JfQhhQqiGU4Nbifdy'
1515
1616 let adminWallet = addressFromStringValue("3MpNtiPSRSq6NnaQYk38BfWSzZcgAYTyrQ9")
1717
1818 let dailyGameRewardsWallet = addressFromStringValue("3MuSrXTTiwo9bdoD6FeaBpMUYMiU5saDv2U")
1919
2020 let dailyStakingRewardsWallet = addressFromStringValue("3Mv3mr3uNXdpgkVPApbGEJjMQXqau37DY5i")
2121
2222 func checkAdmin (caller) = if (if (if (if (if ((caller == adminWallet))
2323 then true
2424 else (caller == this))
2525 then true
2626 else (caller.bytes == assetsAddress))
2727 then true
2828 else (caller.bytes == treasuryAddress))
2929 then true
3030 else (caller.bytes == marketplaceAddress))
3131 then true
3232 else (caller.bytes == nationsAddress)
3333
3434
3535 func tryGetInteger (key) = match getInteger(this, key) {
3636 case b: Int =>
3737 b
3838 case _ =>
3939 0
4040 }
4141
4242
4343 func tryGetBoolean (key) = match getBoolean(this, key) {
4444 case b: Boolean =>
4545 b
4646 case _ =>
4747 false
4848 }
4949
5050
5151 func tryGetString (key) = match getString(this, key) {
5252 case b: String =>
5353 b
5454 case _ =>
5555 ""
5656 }
5757
5858
5959 func getALKey (Name,Level) = ((Name + "_lvl") + toString(Level))
6060
6161
6262 func confTryGetInteger (key) = match getInteger(Address(configurationAddress), key) {
6363 case b: Int =>
6464 b
6565 case _ =>
6666 0
6767 }
6868
6969
7070 func confTryGetString (key) = match getString(Address(configurationAddress), key) {
7171 case b: String =>
7272 b
7373 case _ =>
7474 ""
7575 }
7676
7777
7878 func confTryGetBoolean (key) = match getBoolean(Address(configurationAddress), key) {
7979 case b: Boolean =>
8080 b
8181 case _ =>
8282 false
8383 }
8484
8585
8686 func getTreasuryKey (nationid) = (nationid + "_Treasury")
8787
8888
8989 func treasuryTryGetInteger (key) = match getInteger(Address(treasuryAddress), key) {
9090 case b: Int =>
9191 b
9292 case _ =>
9393 0
9494 }
9595
9696
9797 func nationsTryGetInteger (key) = match getInteger(Address(nationsAddress), key) {
9898 case b: Int =>
9999 b
100100 case _ =>
101101 0
102102 }
103103
104104
105105 func nationsTryGetBoolean (key) = match getBoolean(Address(nationsAddress), key) {
106106 case b: Boolean =>
107107 b
108108 case _ =>
109109 false
110110 }
111111
112112
113113 func nationsTryGetString (key) = match getString(Address(nationsAddress), key) {
114114 case b: String =>
115115 b
116116 case _ =>
117117 ""
118118 }
119119
120120
121121 func getAssetOwnerKeyString (assetId) = (assetId + "_Owner")
122122
123123
124124 let startNationsSHEG = 90000000000
125125
126126 @Callable(i)
127-func setUserNation (nationId) = [IntegerEntry(toString(i.caller), nationId)]
127+func setUserNation (nationId) = {
128+ let k = toString(i.originCaller)
129+ let p = tryGetInteger((k + "_Power"))
130+[IntegerEntry(k, nationId), IntegerEntry((k + "_Power"), p)]
131+ }
128132
129133
130134
131135 @Callable(i)
132136 func setUserPower (address,newPower) = if (!(checkAdmin(i.caller)))
133137 then throw("Only the admin can perform this operation")
134138 else $Tuple2([IntegerEntry((address + "_Power"), newPower)], newPower)
135139
136140
137141
138142 @Callable(i)
139143 func setNationDiscovered (strOwner,nationId) = if (!(checkAdmin(i.caller)))
140144 then throw("Only the admin can perform this operation")
141145 else {
142146 let Nationkey = ("Nation_" + toBase58String(i.transactionId))
143147 let deposit = invoke(Address(treasuryAddress), "increaseNationWallet", [Nationkey, startNationsSHEG], i.payments)
144148 if ((deposit == deposit))
145149 then {
146150 let own = invoke(Address(assetsAddress), "setNationOwner", [Nationkey, strOwner], nil)
147151 if ((own == own))
148152 then [IntegerEntry(Nationkey, nationId), StringEntry(toString(nationId), Nationkey)]
149153 else throw("Strict value is not equal to itself.")
150154 }
151155 else throw("Strict value is not equal to itself.")
152156 }
153157
154158
155159
156160 @Callable(i)
157161 func setTecnhnologyDiscovered (nationKey,technologyKey) = if (!(checkAdmin(i.caller)))
158162 then throw("Only the admin can perform this operation")
159163 else {
160164 let Nationkey = ((nationKey + "_") + technologyKey)
161165 $Tuple2([BooleanEntry(Nationkey, true)], true)
162166 }
163167
164168

github/deemru/w8io/169f3d6 
44.61 ms