tx · 5UZpAdzRdnE8NNLnMoucXr3ArD9P112wskTZLCiyabpk

3N4vPEuMkXveuFYFohFsZaPMdbbiP24T1F7:  -0.01000000 Waves

2023.09.06 17:28 [2743632] smart account 3N4vPEuMkXveuFYFohFsZaPMdbbiP24T1F7 > SELF 0.00000000 Waves

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

github/deemru/w8io/169f3d6 
25.54 ms