tx · GwcgBC5c2pCaSgFTQUpQzXFamqEFyQ1rzgbyvdSaWW8w

3N9tj3b2djcaZozn97VkYchL9S1i6cdEbC1:  -0.00500000 Waves

2022.06.27 18:04 [2114998] smart account 3N9tj3b2djcaZozn97VkYchL9S1i6cdEbC1 > SELF 0.00000000 Waves

{ "type": 13, "id": "GwcgBC5c2pCaSgFTQUpQzXFamqEFyQ1rzgbyvdSaWW8w", "fee": 500000, "feeAssetId": null, "timestamp": 1656342326861, "version": 2, "chainId": 84, "sender": "3N9tj3b2djcaZozn97VkYchL9S1i6cdEbC1", "senderPublicKey": "YjNSeXGvvuyi7zZ1dR6t1m8EuszvAMtoqyqbMAFExAE", "proofs": [ "56oAKXr1VEJd7GKyeZWaXWMWmoNEnMHpEgmTosSxa1kkWua46Wpri7uSsriU41ZNWpsKfPTR44vjfXWjdZ2nNG49" ], "script": "base64:AAIFAAAAAAAAAB8IAhIPCg0IAQgBAQEEBAgIAQQBEgQKAggIEgQKAggIAAAAFwAAAAAKc2hpbnl3Z2dpZAEAAAAgiWnPAv+2urnUcZbXebiZdiawdNB3efRzbobw9HOfBiYAAAAAD3RyZWFzdXJ5QWRkcmVzcwEAAAAaAVRl+PAWCwTAWUJwGp5IjJf/ftwcYvLdu/0AAAAADWFzc2V0c0FkZHJlc3MBAAAAGgFUy+a0wXfXHSctaxYQS8qRSOspiwoalaeaAAAAABJtYXJrZXRwbGFjZUFkZHJlc3MBAAAAGgFUHSG5k/H8GMOnG0lxFkOWUXTrrFQuJbzvAAAAABRjb25maWd1cmF0aW9uQWRkcmVzcwEAAAAaAVTbIMuXkVY/Qg5sp2U1gothv7V0cji00C4AAAAADm5hdGlvbnNBZGRyZXNzAQAAABoBVE2F6N70+ERrWRA7cF/Dt7llDlH1REZtoAAAAAALYWRtaW5XYWxsZXQJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAECAAAAIzNNcE50aVBTUlNxNk5uYVFZazM4QmZXU3paY2dBWVR5clE5AAAAABZkYWlse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AAAANrZXkFAAAAA3ZhbAUAAAADbmlsAAAAAK9EUrs=", "height": 2114998, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CcfJcUG8LCqPk5bZQ3E1ewzCGEdwfVXHQjLwAvHo5NE3 Next: 9URjJpN5jBa3jPBnh6bSnBZjpzwuJjRzkyAsga35qXaQ Diff:
OldNewDifferences
1919
2020 let dailyStakingRewardsWallet = addressFromStringValue("3Mv3mr3uNXdpgkVPApbGEJjMQXqau37DY5i")
2121
22-func checkAdmin (caller) = if (if (if (if ((caller == adminWallet))
22+func checkAdmin (caller) = if (if (if (if (if ((caller == adminWallet))
2323 then true
2424 else (caller == this))
2525 then true
2727 then true
2828 else (caller.bytes == treasuryAddress))
2929 then true
30- else (caller.bytes == marketplaceAddress)
30+ else (caller.bytes == marketplaceAddress))
31+ then true
32+ else (caller.bytes == nationsAddress)
3133
3234
3335 func tryGetInteger (key) = match getInteger(this, key) {
136138 }
137139
138140
141+
142+@Callable(i)
143+func UpdKeyString (key,val) = if (!(checkAdmin(i.caller)))
144+ then throw("")
145+ else [StringEntry(key, val)]
146+
147+
148+
149+@Callable(i)
150+func UpdKeyInt (key,val) = if (!(checkAdmin(i.caller)))
151+ then throw("")
152+ else [StringEntry(key, val)]
153+
154+
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
22-func checkAdmin (caller) = if (if (if (if ((caller == adminWallet))
22+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
30- else (caller.bytes == marketplaceAddress)
30+ else (caller.bytes == marketplaceAddress))
31+ then true
32+ else (caller.bytes == nationsAddress)
3133
3234
3335 func tryGetInteger (key) = match getInteger(this, key) {
3436 case b: Int =>
3537 b
3638 case _ =>
3739 0
3840 }
3941
4042
4143 func tryGetBoolean (key) = match getBoolean(this, key) {
4244 case b: Boolean =>
4345 b
4446 case _ =>
4547 false
4648 }
4749
4850
4951 func tryGetString (key) = match getString(this, key) {
5052 case b: String =>
5153 b
5254 case _ =>
5355 ""
5456 }
5557
5658
5759 func getALKey (Name,Level) = ((Name + "_lvl") + toString(Level))
5860
5961
6062 func confTryGetInteger (key) = match getInteger(Address(configurationAddress), key) {
6163 case b: Int =>
6264 b
6365 case _ =>
6466 0
6567 }
6668
6769
6870 func confTryGetString (key) = match getString(Address(configurationAddress), key) {
6971 case b: String =>
7072 b
7173 case _ =>
7274 ""
7375 }
7476
7577
7678 func confTryGetBoolean (key) = match getBoolean(Address(configurationAddress), key) {
7779 case b: Boolean =>
7880 b
7981 case _ =>
8082 false
8183 }
8284
8385
8486 func getTreasuryKey (nationid) = (nationid + "_Treasury")
8587
8688
8789 func treasuryTryGetInteger (key) = match getInteger(Address(treasuryAddress), key) {
8890 case b: Int =>
8991 b
9092 case _ =>
9193 0
9294 }
9395
9496
9597 func nationsTryGetInteger (key) = match getInteger(Address(nationsAddress), key) {
9698 case b: Int =>
9799 b
98100 case _ =>
99101 0
100102 }
101103
102104
103105 func nationsTryGetBoolean (key) = match getBoolean(Address(nationsAddress), key) {
104106 case b: Boolean =>
105107 b
106108 case _ =>
107109 false
108110 }
109111
110112
111113 func nationsTryGetString (key) = match getString(Address(nationsAddress), key) {
112114 case b: String =>
113115 b
114116 case _ =>
115117 ""
116118 }
117119
118120
119121 func getAssetOwnerKeyString (assetId) = (assetId + "_Owner")
120122
121123
122124 @Callable(i)
123125 func WriteConfig (AssetOrTecnhology,Level,Description,BuildingTime,Cost,Power,Aggregated,Nft,Technology_Discovered,SacrificeAsset,SacrificeAssetLevel,NationReserved,Sellprice) = if (!(checkAdmin(i.caller)))
124126 then throw("you are not allowed to perform this operation")
125127 else if (if ((Cost > 0))
126128 then (SacrificeAsset != "")
127129 else false)
128130 then throw("you can specify a build cost OR an asset sacrifice, not both")
129131 else if (if (NationReserved)
130132 then (SacrificeAsset != "")
131133 else false)
132134 then throw("you cannot specify a sacrifice for a nation reserved item")
133135 else {
134136 let lk = getALKey(AssetOrTecnhology, Level)
135137 [IntegerEntry((lk + "_BuildTime"), BuildingTime), IntegerEntry((lk + "_Cost"), Cost), IntegerEntry((lk + "_Power"), Power), BooleanEntry((lk + "_Aggregated"), Aggregated), BooleanEntry((lk + "_NFT"), Nft), BooleanEntry((lk + "_NationReserved"), NationReserved), StringEntry((lk + "_Description"), Description), StringEntry((lk + "_Tecnhology_discovered"), Technology_Discovered), StringEntry((lk + "_SacrificeAsset"), SacrificeAsset), IntegerEntry((lk + "_SacrificeAssetLevel"), SacrificeAssetLevel), IntegerEntry((lk + "_SellPrice"), Sellprice)]
136138 }
137139
138140
141+
142+@Callable(i)
143+func UpdKeyString (key,val) = if (!(checkAdmin(i.caller)))
144+ then throw("")
145+ else [StringEntry(key, val)]
146+
147+
148+
149+@Callable(i)
150+func UpdKeyInt (key,val) = if (!(checkAdmin(i.caller)))
151+ then throw("")
152+ else [StringEntry(key, val)]
153+
154+

github/deemru/w8io/169f3d6 
52.38 ms