tx · 12dSCB1G5vd3uEa5nADioP1rao85j6kQ5A34S3BNeC3m

3Mra7mjPipcQd5sJaRmXK8xgS4scb8gPF4A:  -0.00600000 Waves

2022.08.23 13:26 [2197014] smart account 3Mra7mjPipcQd5sJaRmXK8xgS4scb8gPF4A > SELF 0.00000000 Waves

{ "type": 13, "id": "12dSCB1G5vd3uEa5nADioP1rao85j6kQ5A34S3BNeC3m", "fee": 600000, "feeAssetId": null, "timestamp": 1661250485349, "version": 2, "chainId": 84, "sender": "3Mra7mjPipcQd5sJaRmXK8xgS4scb8gPF4A", "senderPublicKey": "HTEmPgvFxYj3ixqqyCZYUX15Z31rMbac2vWaQw8vrPRj", "proofs": [ "5PpbAJfSpD1otv68ucFKvXCvin5nCN6bp2NDD8qkUJiRd6rYiHCrGMZBjC9t7wdabzubtWgkBdS6Bk8LQuWA9Zw" ], "script": "base64:AAIFAAAAAAAAABMIAhIFCgMIAQESAwoBCBIDCgEIAAAAGQAAAAAKc2hpbnl3Z2dpZAEAAAAgiWnPAv+2urnUcZbXebiZdiawdNB3efRzbobw9HOfBiYAAAAAD3RyZWFzdXJ5QWRkcmVzcwEAAAAaAVRl+PAWCwTAWUJwGp5IjJf/ftwcYvLdu/0AAAAADWFzc2V0c0FkZHJlc3MBAAAAGgFUy+a0wXfXHSctaxYQS8qRSOspiwoalaeaAAAAABJtYXJrZXRwbGFjZUFkZHJlc3MBAAAAGgFUHSG5k/H8GMOnG0lxFkOWUXTrrFQuJbzvAAAAABRjb25maWd1cmF0aW9uQWRkcmVzcwEAAAAaAVTbIMuXkVY/Qg5sp2U1gothv7V0cji00C4AAAAADm5hdGlvbnNBZGRyZXNzAQAAABoBVE2F6N70+ERrWRA7cF/Dt7llDlH1REZtoAAAAAALYWRtaW5XYWxsZXQJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAECAAAAIzNNcE50aVBTUlNxNk5uYVFZazM4QmZXU3paY2dBWVR5clE5AAAAABZkYWlseUdhbWVSZXdhcmRzV2F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NzZXRJZAQAAAAFb3duZXIJAQAAAAx0cnlHZXRTdHJpbmcAAAABCQEAAAAWZ2V0QXNzZXRPd25lcktleVN0cmluZwAAAAEFAAAAB2Fzc2V0SWQDCQEAAAACIT0AAAACCQAEJQAAAAEIBQAAAAFpAAAABmNhbGxlcgUAAAAFb3duZXIJAAACAAAAAQIAAAA9T25seSB0aGUgb3duZXIgb2YgdGhlIEl0ZW0gY2FuIHJlbW92ZSBpdCBmcm9tIHRoZSBtYXJrZXRwbGFjZQQAAAAJYXNzZXRzaGVnCQEAAAANdHJ5R2V0SW50ZWdlcgAAAAEFAAAAB2Fzc2V0SWQEAAAAB3RvYXNzZXQJAAP8AAAABAkBAAAAB0FkZHJlc3MAAAABBQAAAA1hc3NldHNBZGRyZXNzAgAAABZBZGRBc3NldEZyb21NYXJrZXBsYWNlCQAETAAAAAIFAAAAB2Fzc2V0SWQJAARMAAAAAgUAAAAFb3duZXIJAARMAAAAAgUAAAAJYXNzZXRzaGVnBQAAAANuaWwFAAAAA25pbAMJAAAAAAAAAgUAAAAHdG9hc3NldAUAAAAFb3duZXIJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkBAAAAFmdldEFzc2V0T3duZXJLZXlTdHJpbmcAAAABBQAAAAdhc3NldElkCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEJAQAAABZnZXRBc3NldFByaWNlS2V5U3RyaW5nAAAAAQUAAAAHYXNzZXRJZAkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABBQAAAAdhc3NldElkBQAAAANuaWwJAAACAAAAAQIAAAAsRXJyb3IgcmVtb3ZpbmcgdGhlIGl0ZW0gZnJvbSB0aGUgbWFya2V0cGxhY2UAAAAAhOZgQw==", "height": 2197014, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5yj7ACi3LQbQqzvzqunsbrtzSGe5xdr5QsezGnDPMfnw Next: Aaej9rab5Z8GttwwkRXxqNwFJSztsCacQnzVgL7a7EXb Diff:
OldNewDifferences
155155 if ((toasset == owner))
156156 then {
157157 let transfer = invoke(Address(assetsAddress), "transferOwnership", [assetId, toString(i.caller), 1], nil)
158+ let shegtoplatform = ((amountIn * 10) / 100)
159+ let ToAdminWallet = ((shegtoplatform * 50) / 100)
160+ let ToGameRewardsWallet = ((shegtoplatform * 25) / 100)
161+ let ToStakingRewardsWallet = ((shegtoplatform * 25) / 100)
162+ let shegtoseller = (amountIn - shegtoplatform)
158163 if ((transfer == toString(i.caller)))
159- then [ScriptTransfer(addressFromStringValue(owner), amountIn, shinywggid), DeleteEntry(getAssetOwnerKeyString(assetId)), DeleteEntry(getAssetPriceKeyString(assetId)), DeleteEntry(assetId)]
164+ then [ScriptTransfer(adminWallet, ToAdminWallet, shinywggid), ScriptTransfer(dailyGameRewardsWallet, ToGameRewardsWallet, shinywggid), ScriptTransfer(dailyStakingRewardsWallet, ToStakingRewardsWallet, shinywggid), ScriptTransfer(addressFromStringValue(owner), shegtoseller, shinywggid), DeleteEntry(getAssetOwnerKeyString(assetId)), DeleteEntry(getAssetPriceKeyString(assetId)), DeleteEntry(assetId)]
160165 else throw("Error transferring the ownership of the item")
161166 }
162167 else throw("Error removing the item from the marketplace")
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 func assetsTryGetInteger (key) = match getInteger(Address(assetsAddress), key) {
125125 case b: Int =>
126126 b
127127 case _ =>
128128 0
129129 }
130130
131131
132132 func getAssetPriceKeyString (assetId) = (assetId + "_Price")
133133
134134
135135 @Callable(i)
136136 func putOnSale (assetId,assetSheg,sellPrice) = {
137137 let strCaller = toString(i.originCaller)
138138 $Tuple2([StringEntry(getAssetOwnerKeyString(assetId), strCaller), IntegerEntry(getAssetPriceKeyString(assetId), sellPrice), IntegerEntry(assetId, assetSheg)], sellPrice)
139139 }
140140
141141
142142
143143 @Callable(i)
144144 func buyItem (assetId) = {
145145 let owner = tryGetString(getAssetOwnerKeyString(assetId))
146146 let assetPrice = tryGetInteger(getAssetPriceKeyString(assetId))
147147 let amountIn = value(i.payments[0].amount)
148148 if ((assetPrice > amountIn))
149149 then throw("You provided less $heg than the needed cost for buying this Item")
150150 else if ((i.payments[0].assetId != shinywggid))
151151 then throw("Only $HEG payments allowed")
152152 else {
153153 let assetsheg = tryGetInteger(assetId)
154154 let toasset = invoke(Address(assetsAddress), "AddAssetFromMarkeplace", [assetId, owner, assetsheg], nil)
155155 if ((toasset == owner))
156156 then {
157157 let transfer = invoke(Address(assetsAddress), "transferOwnership", [assetId, toString(i.caller), 1], nil)
158+ let shegtoplatform = ((amountIn * 10) / 100)
159+ let ToAdminWallet = ((shegtoplatform * 50) / 100)
160+ let ToGameRewardsWallet = ((shegtoplatform * 25) / 100)
161+ let ToStakingRewardsWallet = ((shegtoplatform * 25) / 100)
162+ let shegtoseller = (amountIn - shegtoplatform)
158163 if ((transfer == toString(i.caller)))
159- then [ScriptTransfer(addressFromStringValue(owner), amountIn, shinywggid), DeleteEntry(getAssetOwnerKeyString(assetId)), DeleteEntry(getAssetPriceKeyString(assetId)), DeleteEntry(assetId)]
164+ then [ScriptTransfer(adminWallet, ToAdminWallet, shinywggid), ScriptTransfer(dailyGameRewardsWallet, ToGameRewardsWallet, shinywggid), ScriptTransfer(dailyStakingRewardsWallet, ToStakingRewardsWallet, shinywggid), ScriptTransfer(addressFromStringValue(owner), shegtoseller, shinywggid), DeleteEntry(getAssetOwnerKeyString(assetId)), DeleteEntry(getAssetPriceKeyString(assetId)), DeleteEntry(assetId)]
160165 else throw("Error transferring the ownership of the item")
161166 }
162167 else throw("Error removing the item from the marketplace")
163168 }
164169 }
165170
166171
167172
168173 @Callable(i)
169174 func removeFromSale (assetId) = {
170175 let owner = tryGetString(getAssetOwnerKeyString(assetId))
171176 if ((toString(i.caller) != owner))
172177 then throw("Only the owner of the Item can remove it from the marketplace")
173178 else {
174179 let assetsheg = tryGetInteger(assetId)
175180 let toasset = invoke(Address(assetsAddress), "AddAssetFromMarkeplace", [assetId, owner, assetsheg], nil)
176181 if ((toasset == owner))
177182 then [DeleteEntry(getAssetOwnerKeyString(assetId)), DeleteEntry(getAssetPriceKeyString(assetId)), DeleteEntry(assetId)]
178183 else throw("Error removing the item from the marketplace")
179184 }
180185 }
181186
182187

github/deemru/w8io/873ac7e 
51.68 ms