tx · 5yj7ACi3LQbQqzvzqunsbrtzSGe5xdr5QsezGnDPMfnw

3Mra7mjPipcQd5sJaRmXK8xgS4scb8gPF4A:  -0.00600000 Waves

2022.07.18 15:40 [2145199] smart account 3Mra7mjPipcQd5sJaRmXK8xgS4scb8gPF4A > SELF 0.00000000 Waves

{ "type": 13, "id": "5yj7ACi3LQbQqzvzqunsbrtzSGe5xdr5QsezGnDPMfnw", "fee": 600000, "feeAssetId": null, "timestamp": 1658148125048, "version": 2, "chainId": 84, "sender": "3Mra7mjPipcQd5sJaRmXK8xgS4scb8gPF4A", "senderPublicKey": "HTEmPgvFxYj3ixqqyCZYUX15Z31rMbac2vWaQw8vrPRj", "proofs": [ "28EXHwtD1dSwG5cZY5QqAv8VQrT48tzsAbSazM4StvmjgTyhXUZResPo9o6Zh9g1umYSWMo6dnQZQceaEwjfToQm" ], "script": "base64:AAIFAAAAAAAAABMIAhIFCgMIAQESAwoBCBIDCgEIAAAAGQAAAAAKc2hpbnl3Z2dpZAEAAAAgiWnPAv+2urnUcZbXebiZdiawdNB3efRzbobw9HOfBiYAAAAAD3RyZWFzdXJ5QWRkcmVzcwEAAAAaAVRl+PAWCwTAWUJwGp5IjJf/ftwcYvLdu/0AAAAADWFzc2V0c0FkZHJlc3MBAAAAGgFUy+a0wXfXHSctaxYQS8qRSOspiwoalaeaAAAAABJtYXJrZXRwbGFjZUFkZHJlc3MBAAAAGgFUHSG5k/H8GMOnG0lxFkOWUXTrrFQuJbzvAAAAABRjb25maWd1cmF0aW9uQWRkcmVzcwEAAAAaAVTbIMuXkVY/Qg5sp2U1gothv7V0cji00C4AAAAADm5hdGlvbnNBZGRyZXNzAQAAABoBVE2F6N70+ERrWRA7cF/Dt7llDlH1REZtoAAAAAALYWRtaW5XYWxsZXQJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAECAAAAIzNNcE50aVBTUlNxNk5uYVFZazM4QmZXU3paY2dBWVR5clE5AAAAABZkYWlseUdhbWVSZXdhcmRzV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IHJlbW92aW5nIHRoZSBpdGVtIGZyb20gdGhlIG1hcmtldHBsYWNlAAAAAOQDC8E=", "height": 2145199, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: H972JVnSr1wqKgGResq7VNiXKvV1xMjVzAWKUCkZut4M Next: 12dSCB1G5vd3uEa5nADioP1rao85j6kQ5A34S3BNeC3m Diff:
OldNewDifferences
121121 func getAssetOwnerKeyString (assetId) = (assetId + "_Owner")
122122
123123
124+func assetsTryGetInteger (key) = match getInteger(Address(assetsAddress), key) {
125+ case b: Int =>
126+ b
127+ case _ =>
128+ 0
129+}
130+
131+
124132 func getAssetPriceKeyString (assetId) = (assetId + "_Price")
125133
126134
146154 let toasset = invoke(Address(assetsAddress), "AddAssetFromMarkeplace", [assetId, owner, assetsheg], nil)
147155 if ((toasset == owner))
148156 then {
149- let transfer = invoke(Address(assetsAddress), "transferOwnership", [assetId, toString(i.caller)], nil)
157+ let transfer = invoke(Address(assetsAddress), "transferOwnership", [assetId, toString(i.caller), 1], nil)
150158 if ((transfer == toString(i.caller)))
151159 then [ScriptTransfer(addressFromStringValue(owner), amountIn, shinywggid), DeleteEntry(getAssetOwnerKeyString(assetId)), DeleteEntry(getAssetPriceKeyString(assetId)), DeleteEntry(assetId)]
152160 else throw("Error transferring the ownership of the item")
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
124+func assetsTryGetInteger (key) = match getInteger(Address(assetsAddress), key) {
125+ case b: Int =>
126+ b
127+ case _ =>
128+ 0
129+}
130+
131+
124132 func getAssetPriceKeyString (assetId) = (assetId + "_Price")
125133
126134
127135 @Callable(i)
128136 func putOnSale (assetId,assetSheg,sellPrice) = {
129137 let strCaller = toString(i.originCaller)
130138 $Tuple2([StringEntry(getAssetOwnerKeyString(assetId), strCaller), IntegerEntry(getAssetPriceKeyString(assetId), sellPrice), IntegerEntry(assetId, assetSheg)], sellPrice)
131139 }
132140
133141
134142
135143 @Callable(i)
136144 func buyItem (assetId) = {
137145 let owner = tryGetString(getAssetOwnerKeyString(assetId))
138146 let assetPrice = tryGetInteger(getAssetPriceKeyString(assetId))
139147 let amountIn = value(i.payments[0].amount)
140148 if ((assetPrice > amountIn))
141149 then throw("You provided less $heg than the needed cost for buying this Item")
142150 else if ((i.payments[0].assetId != shinywggid))
143151 then throw("Only $HEG payments allowed")
144152 else {
145153 let assetsheg = tryGetInteger(assetId)
146154 let toasset = invoke(Address(assetsAddress), "AddAssetFromMarkeplace", [assetId, owner, assetsheg], nil)
147155 if ((toasset == owner))
148156 then {
149- let transfer = invoke(Address(assetsAddress), "transferOwnership", [assetId, toString(i.caller)], nil)
157+ let transfer = invoke(Address(assetsAddress), "transferOwnership", [assetId, toString(i.caller), 1], nil)
150158 if ((transfer == toString(i.caller)))
151159 then [ScriptTransfer(addressFromStringValue(owner), amountIn, shinywggid), DeleteEntry(getAssetOwnerKeyString(assetId)), DeleteEntry(getAssetPriceKeyString(assetId)), DeleteEntry(assetId)]
152160 else throw("Error transferring the ownership of the item")
153161 }
154162 else throw("Error removing the item from the marketplace")
155163 }
156164 }
157165
158166
159167
160168 @Callable(i)
161169 func removeFromSale (assetId) = {
162170 let owner = tryGetString(getAssetOwnerKeyString(assetId))
163171 if ((toString(i.caller) != owner))
164172 then throw("Only the owner of the Item can remove it from the marketplace")
165173 else {
166174 let assetsheg = tryGetInteger(assetId)
167175 let toasset = invoke(Address(assetsAddress), "AddAssetFromMarkeplace", [assetId, owner, assetsheg], nil)
168176 if ((toasset == owner))
169177 then [DeleteEntry(getAssetOwnerKeyString(assetId)), DeleteEntry(getAssetPriceKeyString(assetId)), DeleteEntry(assetId)]
170178 else throw("Error removing the item from the marketplace")
171179 }
172180 }
173181
174182

github/deemru/w8io/3ef1775 
45.57 ms