tx · FRQoNFT4ZazKBrfqNZEoa8zF8UVVrAPZ2C6JMwa1oGif 3N4vPEuMkXveuFYFohFsZaPMdbbiP24T1F7: -0.01400000 Waves 2023.09.06 18:08 [2743675] smart account 3N4vPEuMkXveuFYFohFsZaPMdbbiP24T1F7 > SELF 0.00000000 Waves
{ "type": 13, "id": "FRQoNFT4ZazKBrfqNZEoa8zF8UVVrAPZ2C6JMwa1oGif", "fee": 1400000, "feeAssetId": null, "timestamp": 1694012873824, "version": 2, "chainId": 84, "sender": "3N4vPEuMkXveuFYFohFsZaPMdbbiP24T1F7", "senderPublicKey": "2paZxKSEp48rdM6xb5j15ZN3hHbBLxSQmsuG1HnK5sPp", "proofs": [ "sF8PgyYJbxjy7nQ6egjgGV3U29c4jb2z7TPw2wf6k4cGtzjm61enoLJR9dz1BV9CKaodmbjsnNCaqzBZHoVWFjC" ], "script": "base64:AAIFAAAAAAAAACAIAhIHCgUIAQgYARIDCgEBEgQKAgEBEgMKAQQSAwoBAQAAAA4AAAAAEGN1cnJlbnRMb2NrSWRLZXkCAAAADWN1cnJlbnRMb2NrSWQAAAAAEGFkbWluQ29udHJhY3RLZXkCAAAADWFkbWluQ29udHJhY3QAAAAAE3RyZWFzdXJ5Q29udHJhY3RLZXkCAAAAEHRyZWFzdXJ5Q29udHJhY3QAAAAADGlzRnJlZXplZEtleQIAAAAJaXNGcmVlemVkAAAAABBpc0NvbnN0cnVjdGVkS2V5AgAAAA1pc0NvbnN0cnVjdGVkAAAAAAx2ZXJpZmllcnNLZXkCAAAACXZlcmlmaWVycwAAAAAQdmVyaWZpZXJzRGF0YUtleQIAAAANdmVyaWZpZXJzRGF0YQAAAAARdW5sb2NrRmVlQmFzaXNLZXkCAAAADnVubG9ja0ZlZUJhc2lzAAAAAANTRVACAAAAAl9fAAAAAAZNVUxUMTAAAAAAAlQL5AABAAAACWFzUGF5bWVudAAAAAEAAAABdgQAAAAHJG1hdGNoMAUAAAABdgMJAAABAAAAAgUAAAAHJG1hdGNo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GQAAAACBQAAABR2YWxpZGF0ZWRQcm9vZnNDb3VudAUAAAAKaXNWZXJpZmllZAkAAGQAAAACBQAAABJjdXJyZW50UHJvb2ZzSW5kZXgAAAAAAAAAAAEEAAAADnZhbGlkYXRpb25EYXRhCgAAAAACJGwFAAAACXZlcmlmaWVycwoAAAAAAiRzCQABkAAAAAEFAAAAAiRsCgAAAAAFJGFjYzAJAAUUAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAoBAAAABSRmMF8xAAAAAgAAAAIkYQAAAAIkaQMJAABnAAAAAgUAAAACJGkFAAAAAiRzBQAAAAIkYQkBAAAAA3N1bQAAAAIFAAAAAiRhCQABkQAAAAIFAAAAAiRsBQAAAAIkaQoBAAAABSRmMF8yAAAAAgAAAAIkYQAAAAIkaQMJAABnAAAAAgUAAAACJGkFAAAAAiRzBQAAAAIkYQkAAAIAAAABAgAAABNMaXN0IHNpemUgZXhjZWVkcyA4CQEAAAAFJGYwXzIAAAACCQEAAAAFJGYwXzEAAAACCQEAAAAFJGYwXzEAAAACCQEAAAAFJGYwXzEAAAACCQEAAAAFJGYwXzEAAAACCQEAAAAFJGYwXzEAAAACCQEAAAAFJGYwXzEAAAACCQEAAAAFJGYwXzEAAAACCQEAAAAFJGYwXzEAAAACBQAAAAUkYWNjMAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAgAAAAAAAAAAAwAAAAAAAAAABAAAAAAAAAAABQAAAAAAAAAABgAAAAAAAAAABwAAAAAAAAAACAkAAGcAAAACCAUAAAAOdmFsaWRhdGlvbkRhdGEAAAACXzEFAAAAEXZlcmlmaWVyc1JlcXVpcmVkCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleZdnd84=", "height": 2743675, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5UZpAdzRdnE8NNLnMoucXr3ArD9P112wskTZLCiyabpk Next: 9b5exMFNRUtihgs25cPNsewaJ4BqYGftWnieqVL427qU Diff:
Old | New | Differences | |
---|---|---|---|
124 | 124 | else fromBase58String(storedAssetId) | |
125 | 125 | let amountToTreasury = treasuryAmount(amount) | |
126 | 126 | let amountToUser = (amount - amountToTreasury) | |
127 | + | let treasuryContract = getStringValue(treasuryContractKey) | |
127 | 128 | let transactionResult = [StringEntry(key, newData), ScriptTransfer(i.caller, amountToUser, assetIdToTransfer)] | |
128 | 129 | if ((amountToTreasury > 0)) | |
129 | - | then ScriptTransfer( | |
130 | + | then ScriptTransfer(Address(fromBase58String(treasuryContract)), amountToTreasury, assetIdToTransfer) :: transactionResult | |
130 | 131 | else transactionResult | |
131 | 132 | } | |
132 | 133 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let currentLockIdKey = "currentLockId" | |
5 | 5 | ||
6 | 6 | let adminContractKey = "adminContract" | |
7 | 7 | ||
8 | 8 | let treasuryContractKey = "treasuryContract" | |
9 | 9 | ||
10 | 10 | let isFreezedKey = "isFreezed" | |
11 | 11 | ||
12 | 12 | let isConstructedKey = "isConstructed" | |
13 | 13 | ||
14 | 14 | let verifiersKey = "verifiers" | |
15 | 15 | ||
16 | 16 | let verifiersDataKey = "verifiersData" | |
17 | 17 | ||
18 | 18 | let unlockFeeBasisKey = "unlockFeeBasis" | |
19 | 19 | ||
20 | 20 | let SEP = "__" | |
21 | 21 | ||
22 | 22 | let MULT10 = 10000000000 | |
23 | 23 | ||
24 | 24 | func asPayment (v) = match v { | |
25 | 25 | case p: AttachedPayment => | |
26 | 26 | p | |
27 | 27 | case _ => | |
28 | 28 | throw("fail to cast into AttachedPayment") | |
29 | 29 | } | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func asByteVector (v) = match v { | |
33 | 33 | case p: ByteVector => | |
34 | 34 | p | |
35 | 35 | case _ => | |
36 | 36 | throw("fail to cast into ByteVector") | |
37 | 37 | } | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func maxTakeableAmount (lockHeight,vestingPeriod,amount,takedAmount) = { | |
41 | 41 | let blocksPassed = (height - lockHeight) | |
42 | 42 | if ((blocksPassed >= vestingPeriod)) | |
43 | 43 | then (amount - takedAmount) | |
44 | 44 | else { | |
45 | 45 | let perBlockUnlock = fraction(amount, MULT10, vestingPeriod, HALFUP) | |
46 | 46 | let availableUnlock = fraction(perBlockUnlock, blocksPassed, MULT10) | |
47 | 47 | (availableUnlock - takedAmount) | |
48 | 48 | } | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func treasuryAmount (amount) = { | |
53 | 53 | let feeBasis = getIntegerValue(unlockFeeBasisKey) | |
54 | 54 | if ((feeBasis == 0)) | |
55 | 55 | then 0 | |
56 | 56 | else fraction(fraction(amount, MULT10, 1000, HALFUP), feeBasis, MULT10, HALFUP) | |
57 | 57 | } | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | @Callable(i) | |
61 | 61 | func constructor (adminAdress,unlockFeeBasis,treasuryContract,verifiers,requiredVerifiers) = if (isDefined(getBoolean(isConstructedKey))) | |
62 | 62 | then throw("Constructor can be called just once") | |
63 | 63 | else { | |
64 | 64 | let verifiersCount = size(verifiers) | |
65 | 65 | if ((verifiersCount > 8)) | |
66 | 66 | then throw("Max verifiers number is 8") | |
67 | 67 | else { | |
68 | 68 | let verifiersPubKeys = makeString(verifiers, SEP) | |
69 | 69 | [StringEntry(adminContractKey, adminAdress), IntegerEntry(currentLockIdKey, 0), BooleanEntry(isFreezedKey, false), BooleanEntry(isConstructedKey, true), IntegerEntry(unlockFeeBasisKey, unlockFeeBasis), StringEntry(treasuryContractKey, treasuryContract), StringEntry(verifiersKey, verifiersPubKeys), StringEntry(verifiersDataKey, ((toString(verifiersCount) + SEP) + toString(requiredVerifiers)))] | |
70 | 70 | } | |
71 | 71 | } | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | ||
75 | 75 | @Callable(i) | |
76 | 76 | func lock (period) = if (getBooleanValue(isFreezedKey)) | |
77 | 77 | then throw("Contract operations is suspended") | |
78 | 78 | else { | |
79 | 79 | let payment = asPayment(i.payments[0]) | |
80 | 80 | if ((0 >= payment.amount)) | |
81 | 81 | then throw("Amount must be positive") | |
82 | 82 | else if ((1440 > period)) | |
83 | 83 | then throw("24 hours is minimum vesting period") | |
84 | 84 | else { | |
85 | 85 | let currentLockId = getIntegerValue(currentLockIdKey) | |
86 | 86 | let callerAddressString = toBase58String(i.caller.bytes) | |
87 | 87 | let paymentAssetIdString = if (!(isDefined(payment.assetId))) | |
88 | 88 | then "WAVES" | |
89 | 89 | else toBase58String(asByteVector(payment.assetId)) | |
90 | 90 | let key = ((callerAddressString + SEP) + toString(currentLockId)) | |
91 | 91 | let data = ((((((((toString(height) + SEP) + toString(payment.amount)) + SEP) + "0") + SEP) + toString(period)) + SEP) + paymentAssetIdString) | |
92 | 92 | [StringEntry(key, data), IntegerEntry(currentLockIdKey, (currentLockId + 1))] | |
93 | 93 | } | |
94 | 94 | } | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | ||
98 | 98 | @Callable(i) | |
99 | 99 | func withdraw (amount,lockId) = if (getBooleanValue(isFreezedKey)) | |
100 | 100 | then throw("Contract operations is suspended") | |
101 | 101 | else if (if ((0 >= amount)) | |
102 | 102 | then true | |
103 | 103 | else (0 > lockId)) | |
104 | 104 | then throw("Amount must be positive or wrong lock id") | |
105 | 105 | else { | |
106 | 106 | let callerAddressString = toBase58String(i.caller.bytes) | |
107 | 107 | let key = ((callerAddressString + SEP) + toString(lockId)) | |
108 | 108 | let dataArray = split(getStringValue(key), SEP) | |
109 | 109 | if ((size(dataArray) != 5)) | |
110 | 110 | then throw("Internal error") | |
111 | 111 | else { | |
112 | 112 | let storedHeight = dataArray[0] | |
113 | 113 | let storedAmount = dataArray[1] | |
114 | 114 | let storedTakedAmount = dataArray[2] | |
115 | 115 | let storedVestingPeriod = dataArray[3] | |
116 | 116 | let storedAssetId = dataArray[4] | |
117 | 117 | let availableAmount = maxTakeableAmount(parseIntValue(storedHeight), parseIntValue(storedVestingPeriod), parseIntValue(storedAmount), parseIntValue(storedTakedAmount)) | |
118 | 118 | if ((amount > availableAmount)) | |
119 | 119 | then throw(("Requested amount is two big, max available amount is: " + toString(availableAmount))) | |
120 | 120 | else { | |
121 | 121 | let newData = ((((((((storedHeight + SEP) + storedAmount) + SEP) + toString((parseIntValue(storedTakedAmount) + amount))) + SEP) + storedVestingPeriod) + SEP) + storedAssetId) | |
122 | 122 | let assetIdToTransfer = if ((storedAssetId == "WAVES")) | |
123 | 123 | then unit | |
124 | 124 | else fromBase58String(storedAssetId) | |
125 | 125 | let amountToTreasury = treasuryAmount(amount) | |
126 | 126 | let amountToUser = (amount - amountToTreasury) | |
127 | + | let treasuryContract = getStringValue(treasuryContractKey) | |
127 | 128 | let transactionResult = [StringEntry(key, newData), ScriptTransfer(i.caller, amountToUser, assetIdToTransfer)] | |
128 | 129 | if ((amountToTreasury > 0)) | |
129 | - | then ScriptTransfer( | |
130 | + | then ScriptTransfer(Address(fromBase58String(treasuryContract)), amountToTreasury, assetIdToTransfer) :: transactionResult | |
130 | 131 | else transactionResult | |
131 | 132 | } | |
132 | 133 | } | |
133 | 134 | } | |
134 | 135 | ||
135 | 136 | ||
136 | 137 | ||
137 | 138 | @Callable(i) | |
138 | 139 | func freezeContract (isUnfreeze) = { | |
139 | 140 | let adminAddress = getStringValue(adminContractKey) | |
140 | 141 | if ((adminAddress != toBase58String(i.caller.bytes))) | |
141 | 142 | then throw("Only admin contract can call this function") | |
142 | 143 | else [BooleanEntry(isFreezedKey, !(isUnfreeze))] | |
143 | 144 | } | |
144 | 145 | ||
145 | 146 | ||
146 | 147 | ||
147 | 148 | @Callable(i) | |
148 | 149 | func changeFeeBasis (newFeeBasis) = { | |
149 | 150 | let adminAddress = getStringValue(adminContractKey) | |
150 | 151 | if ((adminAddress != toBase58String(i.caller.bytes))) | |
151 | 152 | then throw("Only admin contract can call this function") | |
152 | 153 | else if ((0 > newFeeBasis)) | |
153 | 154 | then throw("Fee basis can't be negative") | |
154 | 155 | else if ((newFeeBasis > 1000)) | |
155 | 156 | then throw("Fee basis can't be bigger than 10 percent") | |
156 | 157 | else [IntegerEntry(unlockFeeBasisKey, newFeeBasis)] | |
157 | 158 | } | |
158 | 159 | ||
159 | 160 | ||
160 | 161 | @Verifier(tx) | |
161 | 162 | func verify () = match tx { | |
162 | 163 | case _: MassTransferTransaction|TransferTransaction|SetScriptTransaction => | |
163 | 164 | let verifiers = split(getStringValue(verifiersKey), SEP) | |
164 | 165 | let verifiersData = split(getStringValue(verifiersDataKey), SEP) | |
165 | 166 | let verifiersCount = parseIntValue(verifiersData[0]) | |
166 | 167 | let verifiersRequired = parseIntValue(verifiersData[1]) | |
167 | 168 | func sum (accum,next) = { | |
168 | 169 | let validatedProofsCount = accum._1 | |
169 | 170 | let currentProofsIndex = accum._2 | |
170 | 171 | let isVerified = if (sigVerify(tx.bodyBytes, tx.proofs[currentProofsIndex], fromBase58String(next))) | |
171 | 172 | then 1 | |
172 | 173 | else 0 | |
173 | 174 | $Tuple2((validatedProofsCount + isVerified), (currentProofsIndex + 1)) | |
174 | 175 | } | |
175 | 176 | ||
176 | 177 | let validationData = { | |
177 | 178 | let $l = verifiers | |
178 | 179 | let $s = size($l) | |
179 | 180 | let $acc0 = $Tuple2(0, 0) | |
180 | 181 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
181 | 182 | then $a | |
182 | 183 | else sum($a, $l[$i]) | |
183 | 184 | ||
184 | 185 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
185 | 186 | then $a | |
186 | 187 | else throw("List size exceeds 8") | |
187 | 188 | ||
188 | 189 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8) | |
189 | 190 | } | |
190 | 191 | (validationData._1 >= verifiersRequired) | |
191 | 192 | case _ => | |
192 | 193 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
193 | 194 | } | |
194 | 195 |
github/deemru/w8io/026f985 33.85 ms ◑