tx · 525AKwtCWfWFMyPPL2ecfnmjF6FXAYzXXHGDh1u7DJGB 3N3kKNoJohjVQYNLTrYTGTesr3nq3PZNh37: -0.01000000 Waves 2024.03.18 17:58 [3023600] smart account 3N3kKNoJohjVQYNLTrYTGTesr3nq3PZNh37 > SELF 0.00000000 Waves
{ "type": 13, "id": "525AKwtCWfWFMyPPL2ecfnmjF6FXAYzXXHGDh1u7DJGB", "fee": 1000000, "feeAssetId": null, "timestamp": 1710773919755, "version": 2, "chainId": 84, "sender": "3N3kKNoJohjVQYNLTrYTGTesr3nq3PZNh37", "senderPublicKey": "vmMXxwQAMUAoisvL193ptPiTtaWQqL5YNu2zs1ouTbY", "proofs": [ "2QFAFCFzYhsy8jJA7UnLbHUiyy5JvuJBGKsTibcVJDCeLpx5VKmo5SAvSaWgGAQxSSQzjMuiJ8YkoM5hjasM84yP" ], "script": "base64:BwIfCAISAwoBCBIECgICGBIECgICGBIECgICGBIECgICGCgACXNlcGFyYXRvcgICX18AB2NoYWluSWQJAMkBAgkAygECCAUEdGhpcwVieXRlcwABAAEACGNoYWluSWRXAQFXABBjb250cmFjdEZpbGVuYW1lAhdmdXR1cmVzX2NhbGN1bGF0b3IucmlkZQEHd3JhcEVycgEBcwkArAICCQCsAgIFEGNvbnRyYWN0RmlsZW5hbWUCAjogBQFzAQh0aHJvd0VycgEBcwkAAgEJAQd3cmFwRXJyAQUBcwAPa0ZhY3RvcnlBZGRyZXNzAhIlc19fZmFjdG9yeUFkZHJlc3MAFGZhY3RvcnlBZGRyZXNzT3B0aW9uBAckbWF0Y2gwCQCdCAIFBHRoaXMFD2tGYWN0b3J5QWRkcmVzcwMJAAECBQckbWF0Y2gwAgZTdHJpbmcEAXMFByRtYXRjaDAJAKYIAQUBcwMJAAECBQckbWF0Y2gwAgRVbml0BQR1bml0CQACAQILTWF0Y2ggZXJyb3IADmZhY3RvcnlBZGRyZXNzCQETdmFsdWVPckVycm9yTWVzc2FnZQIFFGZhY3RvcnlBZGRyZXNzT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QZhbW91bnQJAMwIAgUHYXNzZXRJZAUDbmlsBQNuaWwFA25pbAkAlAoCBQNuaWwFC2ludm9jYXRpb25zCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAP8wRLc=", "height": 3023600, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 5zzWw2qQYEvxnqh3evKVySAUAWQj1kBBHrN9RfJ2k13b Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 7 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let separator = "__" | |
5 | + | ||
6 | + | let chainId = take(drop(this.bytes, 1), 1) | |
7 | + | ||
8 | + | let chainIdW = base58'2W' | |
9 | + | ||
10 | + | let contractFilename = "futures_calculator.ride" | |
11 | + | ||
12 | + | func wrapErr (s) = ((contractFilename + ": ") + s) | |
13 | + | ||
14 | + | ||
15 | + | func throwErr (s) = throw(wrapErr(s)) | |
16 | + | ||
17 | + | ||
18 | + | let kFactoryAddress = "%s__factoryAddress" | |
19 | + | ||
20 | + | let factoryAddressOption = match getString(this, kFactoryAddress) { | |
21 | + | case s: String => | |
22 | + | addressFromString(s) | |
23 | + | case _: Unit => | |
24 | + | unit | |
25 | + | case _ => | |
26 | + | throw("Match error") | |
27 | + | } | |
28 | + | ||
29 | + | let factoryAddress = valueOrErrorMessage(factoryAddressOption, wrapErr("invalid factory address")) | |
30 | + | ||
31 | + | func mustAddress (i,address) = if ((i.caller == address)) | |
32 | + | then true | |
33 | + | else throwErr("permission denied") | |
34 | + | ||
35 | + | ||
36 | + | func mustThis (i) = mustAddress(i, this) | |
37 | + | ||
38 | + | ||
39 | + | func mustFactory (i) = mustAddress(i, factoryAddress) | |
40 | + | ||
41 | + | ||
42 | + | let wavesString = "WAVES" | |
43 | + | ||
44 | + | let queueItemSize = 32 | |
45 | + | ||
46 | + | func parseAssetId (input) = if ((input == wavesString)) | |
47 | + | then unit | |
48 | + | else fromBase58String(input) | |
49 | + | ||
50 | + | ||
51 | + | func assetIdToString (input) = if ((input == unit)) | |
52 | + | then wavesString | |
53 | + | else toBase58String(value(input)) | |
54 | + | ||
55 | + | ||
56 | + | let kAccountScript = "%s__accountScript" | |
57 | + | ||
58 | + | func accountScript () = valueOrErrorMessage(getBinary(factoryAddress, kAccountScript), wrapErr("account script is not set")) | |
59 | + | ||
60 | + | ||
61 | + | let kRewardAmount = "%s__rewardAmount" | |
62 | + | ||
63 | + | func rewardAmount () = valueOrErrorMessage(getInteger(factoryAddress, kRewardAmount), wrapErr("reward amount is not set")) | |
64 | + | ||
65 | + | ||
66 | + | let kAccountsLimit = "%s__accountsLimit" | |
67 | + | ||
68 | + | let accountsLimitDefault = 20 | |
69 | + | ||
70 | + | func accountsLimit () = valueOrElse(getInteger(factoryAddress, kAccountsLimit), accountsLimitDefault) | |
71 | + | ||
72 | + | ||
73 | + | let REQUEST_STATUS_EMPTY = 0 | |
74 | + | ||
75 | + | let REQUEST_STATUS_READY = 1 | |
76 | + | ||
77 | + | func kRequestStatus (requestId) = makeString(["%s%s", toBase58String(requestId), "status"], separator) | |
78 | + | ||
79 | + | ||
80 | + | func kAccountCreatorPublicKey (accountAddress) = makeString(["%s%s", toString(accountAddress), "creatorPublicKey"], separator) | |
81 | + | ||
82 | + | ||
83 | + | func kRequestOwnerPublicKey (requestId) = makeString(["%s%s", toBase58String(requestId), "ownerPublicKey"], separator) | |
84 | + | ||
85 | + | ||
86 | + | func kRequestAmountAssetId (requestId) = makeString(["%s%s", toBase58String(requestId), "amountAssetId"], separator) | |
87 | + | ||
88 | + | ||
89 | + | func kRequestPriceAssetId (requestId) = makeString(["%s%s", toBase58String(requestId), "priceAssetId"], separator) | |
90 | + | ||
91 | + | ||
92 | + | func kRequestIdToAccountPublicKey (requestId) = makeString(["%s%s", toBase58String(requestId), "requestIdToAccountPublicKey"], separator) | |
93 | + | ||
94 | + | ||
95 | + | func kAccountAddressToRequestId (accountAddress) = makeString(["%s%s", toString(accountAddress), "accountAddressToRequestId"], separator) | |
96 | + | ||
97 | + | ||
98 | + | func kRequestsQueue () = makeString(["%s", "requestsQueue"], separator) | |
99 | + | ||
100 | + | ||
101 | + | func requestsQueue () = valueOrElse(getBinary(factoryAddress, kRequestsQueue()), base58'') | |
102 | + | ||
103 | + | ||
104 | + | func kAccountsQueue () = makeString(["%s", "accountsQueue"], separator) | |
105 | + | ||
106 | + | ||
107 | + | func accountsQueue () = valueOrElse(getBinary(factoryAddress, kAccountsQueue()), base58'') | |
108 | + | ||
109 | + | ||
110 | + | func kRequestsByOwner (ownerAddress) = makeString(["%s%s", "accounts", toString(ownerAddress)], separator) | |
111 | + | ||
112 | + | ||
113 | + | func requestsByOwner (ownerAddress) = valueOrElse(getBinary(factoryAddress, kRequestsByOwner(ownerAddress)), base58'') | |
114 | + | ||
115 | + | ||
116 | + | func kPairAllowed (amountAssetId,priceAssetId) = makeString(["%s%s%s", assetIdToString(amountAssetId), assetIdToString(priceAssetId), "pairAllowed"], separator) | |
117 | + | ||
118 | + | ||
119 | + | func pairAllowed (amountAssetId,priceAssetId) = valueOrElse(getBoolean(factoryAddress, kPairAllowed(amountAssetId, priceAssetId)), false) | |
120 | + | ||
121 | + | ||
122 | + | @Callable(i) | |
123 | + | func init (factoryAddressStr) = { | |
124 | + | let checkCaller = mustThis(i) | |
125 | + | if ((checkCaller == checkCaller)) | |
126 | + | then $Tuple2([StringEntry(kFactoryAddress, factoryAddressStr)], unit) | |
127 | + | else throw("Strict value is not equal to itself.") | |
128 | + | } | |
129 | + | ||
130 | + | ||
131 | + | ||
132 | + | @Callable(i) | |
133 | + | func requestAccount (callerPublicKey,args) = { | |
134 | + | let checkCaller = mustFactory(i) | |
135 | + | if ((checkCaller == checkCaller)) | |
136 | + | then { | |
137 | + | let amountAssetIdStr = args[0] | |
138 | + | let priceAssetIdStr = args[1] | |
139 | + | let userAddress = addressFromPublicKey(callerPublicKey) | |
140 | + | let requestId = sha256(((userAddress.bytes + fromBase58String(amountAssetIdStr)) + fromBase58String(priceAssetIdStr))) | |
141 | + | let amountAssetId = parseAssetId(amountAssetIdStr) | |
142 | + | let priceAssetId = parseAssetId(priceAssetIdStr) | |
143 | + | let userRequestsNumber = (size(kRequestsByOwner(userAddress)) / queueItemSize) | |
144 | + | let checks = [if ((size(i.payments) == 1)) | |
145 | + | then true | |
146 | + | else throwErr("1 payment is required"), if ((i.payments[0].assetId == unit)) | |
147 | + | then true | |
148 | + | else throwErr("invalid asset"), if ((i.payments[0].amount == rewardAmount())) | |
149 | + | then true | |
150 | + | else throwErr("invalid amount"), if (pairAllowed(amountAssetId, priceAssetId)) | |
151 | + | then true | |
152 | + | else throwErr("pair is not allowed"), if ((getInteger(factoryAddress, kRequestStatus(requestId)) == unit)) | |
153 | + | then true | |
154 | + | else throwErr("account is already exists"), if ((accountsLimit() > userRequestsNumber)) | |
155 | + | then true | |
156 | + | else throwErr(("accounts limit is " + toString(accountsLimit())))] | |
157 | + | if ((checks == checks)) | |
158 | + | then { | |
159 | + | let $t050206376 = if ((size(accountsQueue()) == 0)) | |
160 | + | then $Tuple2([ScriptTransfer(factoryAddress, rewardAmount(), unit)], [invoke(factoryAddress, "integerEntry", [kRequestStatus(requestId), REQUEST_STATUS_EMPTY], nil), invoke(factoryAddress, "binaryEntry", [kRequestsQueue(), (requestsQueue() + requestId)], nil)]) | |
161 | + | else { | |
162 | + | let accountPublicKey = take(accountsQueue(), queueItemSize) | |
163 | + | let accountAddress = addressFromPublicKey(accountPublicKey) | |
164 | + | let creatorAddress = addressFromPublicKey(valueOrErrorMessage(getBinary(factoryAddress, kAccountCreatorPublicKey(accountAddress)), wrapErr("invalid creator public key"))) | |
165 | + | $Tuple2([ScriptTransfer(creatorAddress, rewardAmount(), unit)], [invoke(factoryAddress, "binaryEntry", [kAccountsQueue(), drop(accountsQueue(), queueItemSize)], nil), invoke(factoryAddress, "integerEntry", [kRequestStatus(requestId), REQUEST_STATUS_READY], nil), invoke(factoryAddress, "binaryEntry", [kRequestIdToAccountPublicKey(requestId), accountPublicKey], nil), invoke(factoryAddress, "stringEntry", [kAccountAddressToRequestId(accountAddress), toBase58String(requestId)], nil)]) | |
166 | + | } | |
167 | + | let actions = $t050206376._1 | |
168 | + | let factoryActions = $t050206376._2 | |
169 | + | $Tuple2(actions, (factoryActions ++ [invoke(factoryAddress, "binaryEntry", [kRequestOwnerPublicKey(requestId), callerPublicKey], nil), invoke(factoryAddress, "binaryEntry", [kRequestsByOwner(userAddress), (requestsByOwner(userAddress) + requestId)], nil), invoke(factoryAddress, "stringEntry", [kRequestAmountAssetId(requestId), amountAssetIdStr], nil), invoke(factoryAddress, "stringEntry", [kRequestPriceAssetId(requestId), priceAssetIdStr], nil)])) | |
170 | + | } | |
171 | + | else throw("Strict value is not equal to itself.") | |
172 | + | } | |
173 | + | else throw("Strict value is not equal to itself.") | |
174 | + | } | |
175 | + | ||
176 | + | ||
177 | + | ||
178 | + | @Callable(i) | |
179 | + | func addAccount (callerPublicKey,args) = { | |
180 | + | let checkCaller = mustFactory(i) | |
181 | + | if ((checkCaller == checkCaller)) | |
182 | + | then { | |
183 | + | let creatorPublicKey = fromBase58String(args[0]) | |
184 | + | let accountPublicKey = callerPublicKey | |
185 | + | let accountAddress = addressFromPublicKey(callerPublicKey) | |
186 | + | let creatorAddress = addressFromPublicKey(creatorPublicKey) | |
187 | + | let checks = [if ((getBinary(factoryAddress, kAccountCreatorPublicKey(accountAddress)) == unit)) | |
188 | + | then true | |
189 | + | else throwErr("account is already exists"), if ( match scriptHash(accountAddress) { | |
190 | + | case b: ByteVector => | |
191 | + | (b == blake2b256_32Kb(accountScript())) | |
192 | + | case _ => | |
193 | + | false | |
194 | + | }) | |
195 | + | then true | |
196 | + | else throwErr("invalid script")] | |
197 | + | if ((checks == checks)) | |
198 | + | then { | |
199 | + | let $t075778579 = if ((size(requestsQueue()) == 0)) | |
200 | + | then $Tuple2(nil, [invoke(factoryAddress, "binaryEntry", [kAccountsQueue(), (accountsQueue() + accountPublicKey)], nil)]) | |
201 | + | else { | |
202 | + | let requestId = take(requestsQueue(), queueItemSize) | |
203 | + | $Tuple2(nil, [invoke(factoryAddress, "integerEntry", [kRequestStatus(requestId), REQUEST_STATUS_READY], nil), invoke(factoryAddress, "binaryEntry", [kRequestIdToAccountPublicKey(requestId), accountPublicKey], nil), invoke(factoryAddress, "binaryEntry", [kRequestsQueue(), drop(requestsQueue(), queueItemSize)], nil), invoke(factoryAddress, "stringEntry", [kAccountAddressToRequestId(accountAddress), toBase58String(requestId)], nil), invoke(factoryAddress, "transferWaves", [creatorAddress.bytes, rewardAmount()], nil)]) | |
204 | + | } | |
205 | + | let actions = $t075778579._1 | |
206 | + | let factoryActions = $t075778579._2 | |
207 | + | $Tuple2(actions, (factoryActions ++ [invoke(factoryAddress, "binaryEntry", [kAccountCreatorPublicKey(accountAddress), creatorPublicKey], nil)])) | |
208 | + | } | |
209 | + | else throw("Strict value is not equal to itself.") | |
210 | + | } | |
211 | + | else throw("Strict value is not equal to itself.") | |
212 | + | } | |
213 | + | ||
214 | + | ||
215 | + | ||
216 | + | @Callable(i) | |
217 | + | func deposit (callerPublicKey,args) = { | |
218 | + | let checkCaller = mustFactory(i) | |
219 | + | if ((checkCaller == checkCaller)) | |
220 | + | then { | |
221 | + | let accountAddress = valueOrErrorMessage(addressFromString(args[0]), wrapErr("invalid account address")) | |
222 | + | let payment = i.payments[0] | |
223 | + | let actions = [ScriptTransfer(accountAddress, payment.amount, payment.assetId)] | |
224 | + | let factoryActions = nil | |
225 | + | $Tuple2(actions, factoryActions) | |
226 | + | } | |
227 | + | else throw("Strict value is not equal to itself.") | |
228 | + | } | |
229 | + | ||
230 | + | ||
231 | + | ||
232 | + | @Callable(i) | |
233 | + | func withdraw (callerPublicKey,args) = { | |
234 | + | let checkCaller = mustFactory(i) | |
235 | + | if ((checkCaller == checkCaller)) | |
236 | + | then { | |
237 | + | let userAddress = addressFromPublicKey(callerPublicKey) | |
238 | + | let accountAddress = valueOrErrorMessage(addressFromString(args[0]), wrapErr("invalid account address")) | |
239 | + | let amount = valueOrErrorMessage(parseInt(args[1]), wrapErr("invalid amount")) | |
240 | + | let assetId = parseAssetId(args[2]) | |
241 | + | let invocations = [invoke(accountAddress, "transferAsset", [userAddress.bytes, amount, assetId], nil)] | |
242 | + | $Tuple2(nil, invocations) | |
243 | + | } | |
244 | + | else throw("Strict value is not equal to itself.") | |
245 | + | } | |
246 | + | ||
247 | + |
github/deemru/w8io/169f3d6 22.51 ms ◑