tx · GFm8dhSqPDmXZrjhmtZmfgfxPaf8MpQMMRFFjdYtj6RS 3MvyzDtzWWV5MZ1GP8JfQhhQqiGU4Nbifdy: -0.00500000 Waves 2022.06.21 12:33 [2105978] smart account 3MvyzDtzWWV5MZ1GP8JfQhhQqiGU4Nbifdy > SELF 0.00000000 Waves
{ "type": 13, "id": "GFm8dhSqPDmXZrjhmtZmfgfxPaf8MpQMMRFFjdYtj6RS", "fee": 500000, "feeAssetId": null, "timestamp": 1655804034060, "version": 2, "chainId": 84, "sender": "3MvyzDtzWWV5MZ1GP8JfQhhQqiGU4Nbifdy", "senderPublicKey": "3o2zJzkX9SQ65BrfAiyV4tuKneQz8eDLocKmiai1L6Tg", "proofs": [ "4WDSH47r3uCnx5HymukQSwpvnqYdt5KYTQant4cHZ4ioqKSrBFpmraB9FpJ7VSRG3FdPakNDKUq8rb9yQWC89vN2" ], "script": "base64:AAIFAAAAAAAAABkIAhIDCgEBEgQKAggBEgQKAggBEgQKAggIAAAAGAAAAAAKc2hpbnl3Z2dpZAEAAAAgiWnPAv+2urnUcZbXebiZdiawdNB3efRzbobw9HOfBiYAAAAAD3RyZWFzdXJ5QWRkcmVzcwEAAAAaAVRl+PAWCwTAWUJwGp5IjJf/ftwcYvLdu/0AAAAADWFzc2V0c0FkZHJlc3MBAAAAGgFUy+a0wXfXHSctaxYQS8qRSOspiwoalaeaAAAAABJtYXJrZXRwbGFjZUFkZHJlc3MBAAAAGgFUHSG5k/H8GMOnG0lxFkOWUXTrrFQuJbzvAAAAABRjb25maWd1cmF0aW9uQWRkcmVzcwEAAAAaAVTbIMuXkVY/Qg5sp2U1gothv7V0cji00C4AAAAADm5hdGlvbnNBZGRyZXNzAQAAABoBVE2F6N70+ERrWRA7cF/Dt7llDlH1REZtoAAAAAALYWRtaW5XYWxsZXQJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAECAAAAIzNNcE50aVBTUlNxNk5uYVFZazM4QmZXU3paY2dBWVR5clE5AAAAABZkY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AAAIFAAAACU5hdGlvbmtleQUAAAAIbmF0aW9uSWQJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkAAaQAAAABBQAAAAhuYXRpb25JZAUAAAAJTmF0aW9ua2V5BQAAAANuaWwJAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAAFpAQAAABhzZXRUZWNuaG5vbG9neURpc2NvdmVyZWQAAAACAAAACW5hdGlvbktleQAAAA10ZWNobm9sb2d5S2V5AwkBAAAAASEAAAABCQEAAAAKY2hlY2tBZG1pbgAAAAEIBQAAAAFpAAAABmNhbGxlcgkAAAIAAAABAgAAAClPbmx5IHRoZSBhZG1pbiBjYW4gcGVyZm9ybSB0aGlzIG9wZXJhdGlvbgQAAAAJTmF0aW9ua2V5CQABLAAAAAIJAAEsAAAAAgUAAAAJbmF0aW9uS2V5AgAAAAFfBQAAAA10ZWNobm9sb2d5S2V5CQAFFAAAAAIJAARMAAAAAgkBAAAADEJvb2xlYW5FbnRyeQAAAAIFAAAACU5hdGlvbmtleQYFAAAAA25pbAYAAAAAVtsO4A==", "height": 2105978, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5dPt5PkF8BwD815Q9mCuvpTw9dBy3UWm8omE7izpjrvL Next: AGhvEhDz9ZaTGddeeMchzptHK1TvQy3edUUJWbhX7Y9B Diff:
Old | New | Differences | |
---|---|---|---|
19 | 19 | ||
20 | 20 | let dailyStakingRewardsWallet = addressFromStringValue("3Mv3mr3uNXdpgkVPApbGEJjMQXqau37DY5i") | |
21 | 21 | ||
22 | - | func checkAdmin (caller) = if (if (if (if ((caller == adminWallet)) | |
22 | + | func checkAdmin (caller) = if (if (if (if (if ((caller == adminWallet)) | |
23 | 23 | then true | |
24 | 24 | else (caller == this)) | |
25 | 25 | then true | |
27 | 27 | then true | |
28 | 28 | else (caller.bytes == treasuryAddress)) | |
29 | 29 | then true | |
30 | - | else (caller.bytes == marketplaceAddress) | |
30 | + | else (caller.bytes == marketplaceAddress)) | |
31 | + | then true | |
32 | + | else (caller.bytes == nationsAddress) | |
31 | 33 | ||
32 | 34 | ||
33 | 35 | func tryGetInteger (key) = match getInteger(this, key) { |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let shinywggid = base58'AFQS5E4ELtxex3iANtWtUU2V2oWJZSo8VVnK8z3VFmqf' | |
5 | 5 | ||
6 | 6 | let treasuryAddress = base58'3MyDGEoKp1gF4LSRknk9vSuDEyrwuYXcQEQ' | |
7 | 7 | ||
8 | 8 | let assetsAddress = base58'3N8WDKbqGox5Eky326PHHT7rUyrby5MXdmb' | |
9 | 9 | ||
10 | 10 | let marketplaceAddress = base58'3Mra7mjPipcQd5sJaRmXK8xgS4scb8gPF4A' | |
11 | 11 | ||
12 | 12 | let configurationAddress = base58'3N9tj3b2djcaZozn97VkYchL9S1i6cdEbC1' | |
13 | 13 | ||
14 | 14 | let nationsAddress = base58'3MvyzDtzWWV5MZ1GP8JfQhhQqiGU4Nbifdy' | |
15 | 15 | ||
16 | 16 | let adminWallet = addressFromStringValue("3MpNtiPSRSq6NnaQYk38BfWSzZcgAYTyrQ9") | |
17 | 17 | ||
18 | 18 | let dailyGameRewardsWallet = addressFromStringValue("3MuSrXTTiwo9bdoD6FeaBpMUYMiU5saDv2U") | |
19 | 19 | ||
20 | 20 | let dailyStakingRewardsWallet = addressFromStringValue("3Mv3mr3uNXdpgkVPApbGEJjMQXqau37DY5i") | |
21 | 21 | ||
22 | - | func checkAdmin (caller) = if (if (if (if ((caller == adminWallet)) | |
22 | + | func checkAdmin (caller) = if (if (if (if (if ((caller == adminWallet)) | |
23 | 23 | then true | |
24 | 24 | else (caller == this)) | |
25 | 25 | then true | |
26 | 26 | else (caller.bytes == assetsAddress)) | |
27 | 27 | then true | |
28 | 28 | else (caller.bytes == treasuryAddress)) | |
29 | 29 | then true | |
30 | - | else (caller.bytes == marketplaceAddress) | |
30 | + | else (caller.bytes == marketplaceAddress)) | |
31 | + | then true | |
32 | + | else (caller.bytes == nationsAddress) | |
31 | 33 | ||
32 | 34 | ||
33 | 35 | func tryGetInteger (key) = match getInteger(this, key) { | |
34 | 36 | case b: Int => | |
35 | 37 | b | |
36 | 38 | case _ => | |
37 | 39 | 0 | |
38 | 40 | } | |
39 | 41 | ||
40 | 42 | ||
41 | 43 | func tryGetBoolean (key) = match getBoolean(this, key) { | |
42 | 44 | case b: Boolean => | |
43 | 45 | b | |
44 | 46 | case _ => | |
45 | 47 | false | |
46 | 48 | } | |
47 | 49 | ||
48 | 50 | ||
49 | 51 | func tryGetString (key) = match getString(this, key) { | |
50 | 52 | case b: String => | |
51 | 53 | b | |
52 | 54 | case _ => | |
53 | 55 | "" | |
54 | 56 | } | |
55 | 57 | ||
56 | 58 | ||
57 | 59 | func getALKey (Name,Level) = ((Name + "_lvl") + toString(Level)) | |
58 | 60 | ||
59 | 61 | ||
60 | 62 | func confTryGetInteger (key) = match getInteger(Address(configurationAddress), key) { | |
61 | 63 | case b: Int => | |
62 | 64 | b | |
63 | 65 | case _ => | |
64 | 66 | 0 | |
65 | 67 | } | |
66 | 68 | ||
67 | 69 | ||
68 | 70 | func confTryGetString (key) = match getString(Address(configurationAddress), key) { | |
69 | 71 | case b: String => | |
70 | 72 | b | |
71 | 73 | case _ => | |
72 | 74 | "" | |
73 | 75 | } | |
74 | 76 | ||
75 | 77 | ||
76 | 78 | func confTryGetBoolean (key) = match getBoolean(Address(configurationAddress), key) { | |
77 | 79 | case b: Boolean => | |
78 | 80 | b | |
79 | 81 | case _ => | |
80 | 82 | false | |
81 | 83 | } | |
82 | 84 | ||
83 | 85 | ||
84 | 86 | func getTreasuryKey (nationid) = (nationid + "_Treasury") | |
85 | 87 | ||
86 | 88 | ||
87 | 89 | func treasuryTryGetInteger (key) = match getInteger(Address(treasuryAddress), key) { | |
88 | 90 | case b: Int => | |
89 | 91 | b | |
90 | 92 | case _ => | |
91 | 93 | 0 | |
92 | 94 | } | |
93 | 95 | ||
94 | 96 | ||
95 | 97 | func nationsTryGetInteger (key) = match getInteger(Address(nationsAddress), key) { | |
96 | 98 | case b: Int => | |
97 | 99 | b | |
98 | 100 | case _ => | |
99 | 101 | 0 | |
100 | 102 | } | |
101 | 103 | ||
102 | 104 | ||
103 | 105 | func nationsTryGetBoolean (key) = match getBoolean(Address(nationsAddress), key) { | |
104 | 106 | case b: Boolean => | |
105 | 107 | b | |
106 | 108 | case _ => | |
107 | 109 | false | |
108 | 110 | } | |
109 | 111 | ||
110 | 112 | ||
111 | 113 | func nationsTryGetString (key) = match getString(Address(nationsAddress), key) { | |
112 | 114 | case b: String => | |
113 | 115 | b | |
114 | 116 | case _ => | |
115 | 117 | "" | |
116 | 118 | } | |
117 | 119 | ||
118 | 120 | ||
119 | 121 | func getAssetOwnerKeyString (assetId) = (assetId + "_Owner") | |
120 | 122 | ||
121 | 123 | ||
122 | 124 | let startNationsSHEG = 90000000000 | |
123 | 125 | ||
124 | 126 | @Callable(i) | |
125 | 127 | func setUserNation (nationId) = [IntegerEntry(toString(i.caller), nationId)] | |
126 | 128 | ||
127 | 129 | ||
128 | 130 | ||
129 | 131 | @Callable(i) | |
130 | 132 | func setUserPower (address,newPower) = if (!(checkAdmin(i.caller))) | |
131 | 133 | then throw("Only the admin can perform this operation") | |
132 | 134 | else $Tuple2([IntegerEntry((address + "_Power"), newPower)], newPower) | |
133 | 135 | ||
134 | 136 | ||
135 | 137 | ||
136 | 138 | @Callable(i) | |
137 | 139 | func setNationDiscovered (strOwner,nationId) = if (!(checkAdmin(i.caller))) | |
138 | 140 | then throw("Only the admin can perform this operation") | |
139 | 141 | else { | |
140 | 142 | let Nationkey = ("Nation_" + toBase58String(i.transactionId)) | |
141 | 143 | let deposit = invoke(Address(treasuryAddress), "increaseNationWallet", [Nationkey, startNationsSHEG], i.payments) | |
142 | 144 | if ((deposit == deposit)) | |
143 | 145 | then { | |
144 | 146 | let own = invoke(Address(assetsAddress), "setNationOwner", [Nationkey, strOwner], nil) | |
145 | 147 | if ((own == own)) | |
146 | 148 | then [IntegerEntry(Nationkey, nationId), StringEntry(toString(nationId), Nationkey)] | |
147 | 149 | else throw("Strict value is not equal to itself.") | |
148 | 150 | } | |
149 | 151 | else throw("Strict value is not equal to itself.") | |
150 | 152 | } | |
151 | 153 | ||
152 | 154 | ||
153 | 155 | ||
154 | 156 | @Callable(i) | |
155 | 157 | func setTecnhnologyDiscovered (nationKey,technologyKey) = if (!(checkAdmin(i.caller))) | |
156 | 158 | then throw("Only the admin can perform this operation") | |
157 | 159 | else { | |
158 | 160 | let Nationkey = ((nationKey + "_") + technologyKey) | |
159 | 161 | $Tuple2([BooleanEntry(Nationkey, true)], true) | |
160 | 162 | } | |
161 | 163 | ||
162 | 164 |
github/deemru/w8io/026f985 38.31 ms ◑