tx · rne1ss9hSkKT4oW5vBKQ2AaV3xfwhFiHKauLfWXgw2f 3Mv1y6LxjLCQrEpJGtmn1K5c2zp3cpWD7jw: -0.00900000 Waves 2024.10.03 14:08 [3310593] smart account 3Mv1y6LxjLCQrEpJGtmn1K5c2zp3cpWD7jw > SELF 0.00000000 Waves
{ "type": 13, "id": "rne1ss9hSkKT4oW5vBKQ2AaV3xfwhFiHKauLfWXgw2f", "fee": 900000, "feeAssetId": null, "timestamp": 1727953760361, "version": 2, "chainId": 84, "sender": "3Mv1y6LxjLCQrEpJGtmn1K5c2zp3cpWD7jw", "senderPublicKey": "EJAWE2e8kHyKn8b415wXvbQWa9B8BNwN1io19p5GtKfE", "proofs": [ "3Z2Q9qZaNruNr2vVNrGjFcy9RzBfcGPHLuCYHFoQCixnzvSD8wZxk88s6HwS2j529aCNVvjbhMpoZqrEdKJQLMKQ" ], "script": "base64:BgIZCAISAwoBCBIGCgQIAQEIEgASBgoECAEBCBoBF3N0YXRpY0tleV9vcmFjbGVBZGRyZXNzAAIUc3RhdGljX29yYWNsZUFkZHJlc3MBF3N0YXRpY0tleV9mZWVBZ2dyZWdhdG9yAAIUc3RhdGljX2ZlZUFnZ3JlZ2F0b3IBFHN0YXRpY0tleV9lZ2dBc3NldElkAAIRc3RhdGljX2VnZ0Fzc2V0SWQBF3N0YXRpY0tleV9iYWNrZW5kUHViS2V5AAIUc3RhdGljX2JhY2tlbmRQdWJLZXkBHHN0YXRpY0tleV9yZWZDb250cmFjdEFkZHJlc3MAAhlzdGF0aWNfcmVmQ29udHJhY3RBZGRyZXNzARVzdGF0aWNLZXlfYnVybkFkZHJlc3MAAhJzdGF0aWNfYnVybkFkZHJlc3MBGHN0YXRpY0tleV9jb3Vwb25zQWRkcmVzcwACFXN0YXRpY19jb3Vwb25zQWRkcmVzcwEWc3RhdGljS2V5X2l0ZW1zQWRkcmVzcwACE3N0YXRpY19pdGVtc0FkZHJlc3MBEnN0YXRpY0tleV9leHRyYUZlZQACD3N0Y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ZXRFZ2dBc3NldElkAAUGdG9CdXJuBQNuaWwDCQAAAgUIYnVybkNhbGwFCGJ1cm5DYWxsCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMIBQFpBmNhbGxlcgkAZQIICQCRAwIIBQFpCHBheW1lbnRzAAEGYW1vdW50BQlsZWZ0VG9QYXkJAQ1nZXRFZ2dBc3NldElkAAUDbmlsCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuBQNuaWwDCQAAAgUGcmVmdW5kBQZyZWZ1bmQEDHJlY29yZEFjdGlvbgkA/AcECQERZ2V0Q291cG9uc0FkZHJlc3MAAgxyZWNvcmRBY3Rpb24JAMwIAgIEUk9QRQUDbmlsBQNuaWwDCQAAAgUMcmVjb3JkQWN0aW9uBQxyZWNvcmRBY3Rpb24DCQECIT0CBQZleGlzdHMCAAkAAgECN1JCUjogUm9wZSB3YXMgYWxyZWFkeSBib3VnaHQgZm9yIHRoaXMgZWdnIGJ5IHRoaXMgdXNlciEJAM4IAgkAzggCCQDMCAIJAQtTdHJpbmdFbnRyeQIJAQhlZ2dJZEtleQIFBWVnZ0lkCQClCAEIBQFpDG9yaWdpbkNhbGxlcgkArAICCQCsAgIJAKQDAQUFcHJpY2UCATsJAKQDAQUIZGlzdGFuY2UFA25pbAUMdmFsaWRQYXltZW50BQZyZWZ1bmQJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4A3SnMsw==", "height": 3310593, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 2ATvSGnJ4rPYXo4h6LiJCw7Vj3Hgsfkrip24KVyhMkrv Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | func staticKey_oracleAddress () = "static_oracleAddress" | |
5 | + | ||
6 | + | ||
7 | + | func staticKey_feeAggregator () = "static_feeAggregator" | |
8 | + | ||
9 | + | ||
10 | + | func staticKey_eggAssetId () = "static_eggAssetId" | |
11 | + | ||
12 | + | ||
13 | + | func staticKey_backendPubKey () = "static_backendPubKey" | |
14 | + | ||
15 | + | ||
16 | + | func staticKey_refContractAddress () = "static_refContractAddress" | |
17 | + | ||
18 | + | ||
19 | + | func staticKey_burnAddress () = "static_burnAddress" | |
20 | + | ||
21 | + | ||
22 | + | func staticKey_couponsAddress () = "static_couponsAddress" | |
23 | + | ||
24 | + | ||
25 | + | func staticKey_itemsAddress () = "static_itemsAddress" | |
26 | + | ||
27 | + | ||
28 | + | func staticKey_extraFee () = "static_extraFee" | |
29 | + | ||
30 | + | ||
31 | + | func eggIdKey (eggId,user) = ((("eggId_" + eggId) + "_") + user) | |
32 | + | ||
33 | + | ||
34 | + | func boosterIdKey (type,user,height) = ((((("booster_" + type) + "_") + user) + "_") + toString(height)) | |
35 | + | ||
36 | + | ||
37 | + | func tryGetStringExternal (address,key) = match getString(address, key) { | |
38 | + | case a: String => | |
39 | + | a | |
40 | + | case _ => | |
41 | + | "" | |
42 | + | } | |
43 | + | ||
44 | + | ||
45 | + | func tryGetString (key) = tryGetStringExternal(this, key) | |
46 | + | ||
47 | + | ||
48 | + | func getOracle () = Address(fromBase58String(tryGetString(staticKey_oracleAddress()))) | |
49 | + | ||
50 | + | ||
51 | + | func getEggAssetId () = fromBase58String(tryGetStringExternal(getOracle(), staticKey_eggAssetId())) | |
52 | + | ||
53 | + | ||
54 | + | func getBackendPubKey () = fromBase58String(getStringValue(getOracle(), staticKey_backendPubKey())) | |
55 | + | ||
56 | + | ||
57 | + | func getFeeAggregator () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_feeAggregator()))) | |
58 | + | ||
59 | + | ||
60 | + | func getRefContractAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_refContractAddress()))) | |
61 | + | ||
62 | + | ||
63 | + | func getBurnAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_burnAddress()))) | |
64 | + | ||
65 | + | ||
66 | + | func getCouponsAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_couponsAddress()))) | |
67 | + | ||
68 | + | ||
69 | + | func getItemsAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_itemsAddress()))) | |
70 | + | ||
71 | + | ||
72 | + | func getBackendProof (eggId,price,distance) = makeString([eggId, toString(price), toString(distance)], ";") | |
73 | + | ||
74 | + | ||
75 | + | func checkAdditionalPayment (payment,amount) = if (isDefined(payment.assetId)) | |
76 | + | then throw("RCAP: Please attach waves") | |
77 | + | else if ((payment.amount != amount)) | |
78 | + | then throw((("RCAP: Please attach exactly " + toString(amount)) + " amount of wavelets")) | |
79 | + | else [ScriptTransfer(getFeeAggregator(), amount, unit)] | |
80 | + | ||
81 | + | ||
82 | + | func asBoolean (value) = match value { | |
83 | + | case boolean: Boolean => | |
84 | + | boolean | |
85 | + | case _ => | |
86 | + | throw("TI: wrong type, expected: Boolean") | |
87 | + | } | |
88 | + | ||
89 | + | ||
90 | + | func asInt (value) = match value { | |
91 | + | case int: Int => | |
92 | + | int | |
93 | + | case _ => | |
94 | + | throw("FAI: wrong type, expected: Int") | |
95 | + | } | |
96 | + | ||
97 | + | ||
98 | + | func asString (value) = match value { | |
99 | + | case string: String => | |
100 | + | string | |
101 | + | case _ => | |
102 | + | throw("wrong type, expected: String") | |
103 | + | } | |
104 | + | ||
105 | + | ||
106 | + | @Callable(i) | |
107 | + | func configureOracle (oracle) = if ((i.caller != this)) | |
108 | + | then throw("RCO: admin only") | |
109 | + | else [StringEntry(staticKey_oracleAddress(), oracle)] | |
110 | + | ||
111 | + | ||
112 | + | ||
113 | + | @Callable(i) | |
114 | + | func buyRope (eggId,price,distance,backendSignature) = throw("Deprecated method! Please use buyRopeInverted") | |
115 | + | ||
116 | + | ||
117 | + | ||
118 | + | @Callable(i) | |
119 | + | func useBooster () = { | |
120 | + | let validPayment = checkAdditionalPayment(i.payments[0], getIntegerValue(getOracle(), staticKey_extraFee())) | |
121 | + | if ((validPayment == validPayment)) | |
122 | + | then if (!(if ((size(i.payments) == 2)) | |
123 | + | then (i.payments[1].amount == 1) | |
124 | + | else false)) | |
125 | + | then throw("Invalid payment") | |
126 | + | else { | |
127 | + | let assetId = value(i.payments[1].assetId) | |
128 | + | let boosterType = asString(invoke(getItemsAddress(), "checkArtefactDetails", [toBase58String(assetId)], nil)) | |
129 | + | if ((boosterType == boosterType)) | |
130 | + | then ([Burn(assetId, 1), StringEntry(boosterIdKey(boosterType, toString(i.caller), height), toBase58String(assetId))] ++ validPayment) | |
131 | + | else throw("Strict value is not equal to itself.") | |
132 | + | } | |
133 | + | else throw("Strict value is not equal to itself.") | |
134 | + | } | |
135 | + | ||
136 | + | ||
137 | + | ||
138 | + | @Callable(i) | |
139 | + | func buyRopeInverted (eggId,price,distance,backendSignature) = { | |
140 | + | let addressString = toString(i.caller) | |
141 | + | let backendProof = getBackendProof(eggId, price, distance) | |
142 | + | let exists = tryGetString(eggIdKey(eggId, toString(i.originCaller))) | |
143 | + | let halfPrice = (price / 2) | |
144 | + | let validPayment = checkAdditionalPayment(i.payments[0], price) | |
145 | + | if ((validPayment == validPayment)) | |
146 | + | then if (!(sigVerify_8Kb(toBytes(backendProof), fromBase58String(backendSignature), getBackendPubKey()))) | |
147 | + | then throw("RBR: Invalid proof from backend") | |
148 | + | else if ((distance > 1200)) | |
149 | + | then throw("RBR: You can only maximum boost 1200 meters distance!") | |
150 | + | else { | |
151 | + | let leftToPay = if ((i.originCaller == i.caller)) | |
152 | + | then { | |
153 | + | let amountPaidByCoupons = asInt(invoke(getCouponsAddress(), "useCoupons", [halfPrice], nil)) | |
154 | + | if ((amountPaidByCoupons == amountPaidByCoupons)) | |
155 | + | then (halfPrice - amountPaidByCoupons) | |
156 | + | else throw("Strict value is not equal to itself.") | |
157 | + | } | |
158 | + | else halfPrice | |
159 | + | let refund = if ((leftToPay != 0)) | |
160 | + | then { | |
161 | + | let firstPayment = value(i.payments[1]) | |
162 | + | if ((firstPayment.assetId != getEggAssetId())) | |
163 | + | then throw(("RBR: You can attach only EGG tokens with the following asset id: " + toBase58String(getEggAssetId()))) | |
164 | + | else if ((leftToPay > firstPayment.amount)) | |
165 | + | then throw(((("RBR: To rope a egg you currently need the following amount of EGGlets: " + toString(leftToPay)) + " ") + toString(i.caller))) | |
166 | + | else { | |
167 | + | let refererRewardForbeach = 0 | |
168 | + | let toBurn = leftToPay | |
169 | + | let burnCall = invoke(getBurnAddress(), "burnAttachedPayments", nil, [AttachedPayment(getEggAssetId(), toBurn)]) | |
170 | + | if ((burnCall == burnCall)) | |
171 | + | then [ScriptTransfer(i.caller, (i.payments[1].amount - leftToPay), getEggAssetId())] | |
172 | + | else throw("Strict value is not equal to itself.") | |
173 | + | } | |
174 | + | } | |
175 | + | else nil | |
176 | + | if ((refund == refund)) | |
177 | + | then { | |
178 | + | let recordAction = invoke(getCouponsAddress(), "recordAction", ["ROPE"], nil) | |
179 | + | if ((recordAction == recordAction)) | |
180 | + | then if ((exists != "")) | |
181 | + | then throw("RBR: Rope was already bought for this egg by this user!") | |
182 | + | else (([StringEntry(eggIdKey(eggId, toString(i.originCaller)), ((toString(price) + ";") + toString(distance)))] ++ validPayment) ++ refund) | |
183 | + | else throw("Strict value is not equal to itself.") | |
184 | + | } | |
185 | + | else throw("Strict value is not equal to itself.") | |
186 | + | } | |
187 | + | else throw("Strict value is not equal to itself.") | |
188 | + | } | |
189 | + | ||
190 | + |
github/deemru/w8io/026f985 16.17 ms ◑