tx · 5yNpcWxTAPstoVdiyMwVvrtgUcuVY7k1tys44B7KNxJ

3N8kB3UEjWWvTRBtGpGUErAevaK2q6u2eCM:  -0.01000000 Waves

2023.11.02 19:10 [2825938] smart account 3N8kB3UEjWWvTRBtGpGUErAevaK2q6u2eCM > SELF 0.00000000 Waves

{ "type": 13, "id": "5yNpcWxTAPstoVdiyMwVvrtgUcuVY7k1tys44B7KNxJ", "fee": 1000000, "feeAssetId": null, "timestamp": 1698941427610, "version": 2, "chainId": 84, "sender": "3N8kB3UEjWWvTRBtGpGUErAevaK2q6u2eCM", "senderPublicKey": "6ybktvseycJDGHTjJm3tz9iT2SKaTNtLLCZsJZRemtoM", "proofs": [ "4BwhL43DYrsrCtbXQEAL9CpCsguaXn3B6wM4vFA1Aj3y4F5brSD9sapS59PjXgo4FYNT17uabWHC9Pi8gALmifZn" ], "script": "base64:BgITCAISAwoBAhIAEgMKAQESAwoBAg4AB293bmVyUGsBIFjKQnTzuTU7kMfPWIFrhrNM3EW8gc9F3rO/tY+FuNJcAAtkZW5vbWluYXRvcgCAwtcvAAp0cmFuc2ZlclZrAcQGSYrHhkeDrw+dFMD6Yr/Vrvr2pPyDHCWoMO8w9LxFaQABrVkxqK1PRfgZw0t9bDNsxFEJNHhErc9XHTkkU1OiEYYWiz2VdqW6jQewS86Z3lshxW6Fdf1MU0MDPt1NoikSf2YEIBvI+gscAfqmtvJxZbkVA/Lrr7r+HyVUoZGt1QB46Zv9umeZBwmTWiDHaLPPgOVOWQAVYLMCwpEzEzIdF2C8KzI/CsCeCv3raf56RXmhFAWuJCbMtO6My12PxFQDRv98IWP0FGhY/m6sQ/9r58GInq4bSVYWKlGucbXbayaYF35Fp3o6VaRXVWzJ6FesrH8dS+DxeadscnAN4IQEB4J5YcwZvAX/fjE5JEHNC4WrNfiUe+fe6FAQ4ttHlRgKS+PbN1butH1dDkfQkBKC5Om0WI3D45eaRbN6Taxt7ha5xCUwGVh0LQ+Wf/j9bY+un1Cwur9wx+HmB6P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wAABQdvd25lclBrAwkAAQIFByRtYXRjaDACF0ludm9rZVNjcmlwdFRyYW5zYWN0aW9uBAFkBQckbWF0Y2gwBAckbWF0Y2gxCAUBZAhmdW5jdGlvbgMJAAACAg1zZXRPcGVyYXRvclBrBQckbWF0Y2gxCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAABQdvd25lclBrAwkAAAICCHRyYW5zYWN0BQckbWF0Y2gxBApvcGVyYXRvclBrCQENZ2V0T3BlcmF0b3JQawAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFCm9wZXJhdG9yUGsJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXkHN2k8ZA==", "height": 2825938, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 955pwN2gQ3KaUdziNw2bwgV3tEjTWLRwvT2BbqbeG6Qz Next: none Diff:
OldNewDifferences
180180 else nil
181181 if ((txIndex > poolIndex))
182182 then throw("Invalid transaction index")
183- else if (!(bn256Groth16Verify_5inputs(transferVk, txProof, transferInputs)))
184- then throw("Tx proof is invalid")
185- else if (!(bn256Groth16Verify_3inputs(treeVk, treeProof, treeInputs)))
186- then throw("Tree proof is invalid")
187- else if (nullifierExists)
188- then throw("Double spend")
189- else ((txOps ++ dataOps) ++ feeOps)
183+ else if (nullifierExists)
184+ then throw("Double spend")
185+ else ((txOps ++ dataOps) ++ feeOps)
190186 }
191187 else throw("Strict value is not equal to itself.")
192188 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let ownerPk = base58'6ybktvseycJDGHTjJm3tz9iT2SKaTNtLLCZsJZRemtoM'
55
66 let denominator = 100000000
77
88 let transferVk = base64'SYrHhkeDrw+dFMD6Yr/Vrvr2pPy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GfGnRHaM/Jd0vbiJ723UUAM='
99
1010 let treeVk = base64'qGBPhudr70q2hdpdMHxxPVdk+MJDazUwWbBTl+eJCx/zUEagbSAhrTUc40Jajsexh+ThMSv1ZlKhNgbjvc8GFwfScaiOtcM0fDjNcUeChr2NpgbQV+y4XTvC8sjwVXEareR6FvrGlyEdKcFx+vIagiT77lQ3MK/EfxwlNHsEdAy0sWThEjpDykFPiYWG6T5IJWIGtdhrcPdePYv1GX0wCakWmTMh9NWYby1erGRPnDxWxeFcOBN4DPhkSQKg/DMH1LkY/GlCqIdfdX5Mr+0CMQWnmr8oECA5QgeOJ1ZnSQmO18Jg9rclNx9mhqD3iux0b+o293HkYg4d75ZOBeUqLdx63/eIe/VEuwIkGFBs4sU9WHEsdqpx8QKpByl6ZKgiOcx/wrW0cwTvm34cq5pRVGunz+qu90se2PqAjOjiIRoDvrcCR7qlN0iTvBedZRTlOtbOxAiXOb/nwFrsmf8wFiebpKkjbNkNvTiLGRiea53xusmuNwANOZtfYMT03Kwf1bgRFrkM6TqgEVZq1Vl7wjFhGu3CFrk5popRZ0X8zhJqn5IPLt6g/0ImUPee8frB6VtMYYkmQ7ZCWTwKEPGDIgQAAACMoBtyPY40yogNVj5bF/LbEe5QGKZjwyfMj58AY5ocK00CEsC3Nm1wSKR6xi8NSbjhPZRw0/zChVK9K8ceAO4ijNFpOFuOpTO6aEq0o7spO/E0JTwTStxF0jdD9NCydSTLZi4DdtHHkcph4Sao8AwV4qd50wavb0/hxCXkVWTvErgnIWCgjrfgzQBDfa99z0alUbwyBBd8odwfJU7bERsH/SfhNempxiwEU1uq6TPQ2NxgN3fgXo5i9dHrSaI2ZQd7R9hyJVeMlBaz6uP4gS1XYlt5LkT+TFGT/vidKlcMHQx945x1Iivq728eKgJ4aBI5Ja1nxj7QC7d98xukukQl'
1111
1212 let initialRoot = toBytes(parseBigIntValue("11469701942666298368112882412133877458305516134926649826543144744382391691533"))
1313
1414 func getRootKey (index) = ("R:" + toString(index))
1515
1616
1717 func getNullifierKey (nullifier) = ("N:" + toBase58String(nullifier))
1818
1919
2020 func getDepositKey (address) = ("D:" + toBase58String(address))
2121
2222
2323 let poolIndexKey = "PoolIndex"
2424
2525 let allMessagesHashKey = "AllMessagesHash"
2626
2727 let operatorKey = "OperatorPk"
2828
2929 func takeExt (v,from,n) = take(drop(v, from), n)
3030
3131
3232 func spendDeposit (address,amount) = {
3333 let currentKey = getDepositKey(address.bytes)
3434 let currentAmount = match getInteger(currentKey) {
3535 case a: Int =>
3636 a
3737 case _ =>
3838 0
3939 }
4040 let newAmount = (currentAmount - amount)
4141 if ((0 > amount))
4242 then throw("Can't spend negative amount")
4343 else if ((0 > newAmount))
4444 then throw("Not enough balance")
4545 else [IntegerEntry(currentKey, newAmount)]
4646 }
4747
4848
4949 func getOperatorPk () = match getBinary(operatorKey) {
5050 case a: ByteVector =>
5151 a
5252 case _ =>
5353 ownerPk
5454 }
5555
5656
5757 @Callable(i)
5858 func setOperatorPk (pk) = if ((size(pk) != 32))
5959 then throw("Operator public key must be 32 bytes long")
6060 else [BinaryEntry(operatorKey, pk)]
6161
6262
6363
6464 @Callable(i)
6565 func deposit () = {
6666 let pmt = value(i.payments[0])
6767 if (isDefined(pmt.assetId))
6868 then throw("Only WAVES is allowed at the moment")
6969 else {
7070 let currentKey = getDepositKey(i.caller.bytes)
7171 let currentAmount = match getInteger(this, currentKey) {
7272 case a: Int =>
7373 a
7474 case _ =>
7575 0
7676 }
7777 let newAmount = (currentAmount + pmt.amount)
7878 [IntegerEntry(currentKey, newAmount)]
7979 }
8080 }
8181
8282
8383
8484 @Callable(i)
8585 func withdraw (amount) = {
8686 let currentKey = getDepositKey(i.caller.bytes)
8787 let currentAmount = match getInteger(this, currentKey) {
8888 case a: Int =>
8989 a
9090 case _ =>
9191 0
9292 }
9393 let newAmount = (currentAmount - amount)
9494 if ((0 > amount))
9595 then throw("Can't withdraw negative amount")
9696 else if ((0 > newAmount))
9797 then throw("Not enough balance")
9898 else [IntegerEntry(currentKey, newAmount), ScriptTransfer(i.caller, amount, unit)]
9999 }
100100
101101
102102
103103 @Callable(i)
104104 func transact (tx) = {
105105 let nullifier = take(tx, 32)
106106 let outCommit = takeExt(tx, 32, 32)
107107 let assetId = takeExt(tx, 64, 32)
108108 let delta = takeExt(tx, 96, 32)
109109 let nativeAmount = toInt(take(delta, 8))
110110 let nativeEnergy = toBigInt(takeExt(delta, 8, 14))
111111 let txIndex = toInt((base58'2DyVD' + takeExt(delta, 22, 6)))
112112 let _poolId = takeExt(delta, 28, 3)
113113 let txProof = takeExt(tx, 128, 256)
114114 let treeProof = takeExt(tx, 384, 256)
115115 let rootAfter = takeExt(tx, 640, 32)
116116 let txType = toInt((base58'3gznry4ApWXU7' + takeExt(tx, 672, 2)))
117117 let fullMemo = drop(tx, 674)
118118 let $t059966344 = if ((txType == 0))
119119 then {
120120 let depositDataSize = (32 + 64)
121121 let depositPk = dropRight(takeRight(fullMemo, depositDataSize), 64)
122122 let depositSignature = takeRight(fullMemo, 64)
123123 $Tuple3(dropRight(fullMemo, depositDataSize), depositPk, depositSignature)
124124 }
125125 else $Tuple3(fullMemo, unit, unit)
126126 let memo = $t059966344._1
127127 let depositPk = $t059966344._2
128128 let depositSignature = $t059966344._3
129129 let fee = toInt(take(memo, 8))
130130 let allMessagesHash = valueOrElse(getBinary(allMessagesHashKey), toBytes(toBigInt(0)))
131131 let memoHash = keccak256(memo)
132132 let hashes = (allMessagesHash + memoHash)
133133 let newAllMessagesHash = keccak256(hashes)
134134 let rootBefore = valueOrElse(getBinary(getRootKey(txIndex)), initialRoot)
135135 if ((rootBefore == rootBefore))
136136 then {
137137 let poolIndex = valueOrElse(getInteger(poolIndexKey), 0)
138138 let poolRoot = valueOrElse(getBinary(getRootKey(poolIndex)), initialRoot)
139139 let nullifierExists = match getBinary(getNullifierKey(nullifier)) {
140140 case a: Unit =>
141141 false
142142 case _ =>
143143 true
144144 }
145145 let transferInputs = ((((memoHash + nullifier) + outCommit) + delta) + memoHash)
146146 let treeInputs = ((poolRoot + rootAfter) + outCommit)
147147 let dataOps = [BinaryEntry(getRootKey(txIndex), rootAfter), BinaryEntry(getNullifierKey(nullifier), keccak256((outCommit + delta))), IntegerEntry(poolIndexKey, (poolIndex + 128)), BinaryEntry(allMessagesHashKey, newAllMessagesHash)]
148148 let txOps = match txType {
149149 case _ =>
150150 if ((0 == $match0))
151151 then {
152152 let depositPkValue = value(depositPk)
153153 let depositAddress = addressFromPublicKey(depositPkValue)
154154 if ((0 > nativeAmount))
155155 then throw("Can't deposit negative amount")
156156 else if (!(sigVerify_8Kb((nullifier + depositPkValue), value(depositSignature), depositPkValue)))
157157 then throw("Invalid deposit signature")
158158 else spendDeposit(depositAddress, (nativeAmount * denominator))
159159 }
160160 else if ((1 == $match0))
161161 then if ((nativeAmount != 0))
162162 then throw("Native amount must be zero for transfers")
163163 else nil
164164 else if ((2 == $match0))
165165 then {
166166 let withdrawAmount = (toInt(takeExt(memo, 8, 8)) * denominator)
167167 if ((withdrawAmount > 0))
168168 then throw("Withdraw amount must be positive")
169169 else [ScriptTransfer(i.caller, -(withdrawAmount), unit)]
170170 }
171171 else throw("Unknown tx type")
172172 }
173173 let feeOps = if ((fee > 0))
174174 then {
175175 let totalFee = (fee * denominator)
176176 let operatorPk = getOperatorPk()
177177 let operatorAddress = addressFromPublicKey(operatorPk)
178178 [ScriptTransfer(operatorAddress, fee, unit)]
179179 }
180180 else nil
181181 if ((txIndex > poolIndex))
182182 then throw("Invalid transaction index")
183- else if (!(bn256Groth16Verify_5inputs(transferVk, txProof, transferInputs)))
184- then throw("Tx proof is invalid")
185- else if (!(bn256Groth16Verify_3inputs(treeVk, treeProof, treeInputs)))
186- then throw("Tree proof is invalid")
187- else if (nullifierExists)
188- then throw("Double spend")
189- else ((txOps ++ dataOps) ++ feeOps)
183+ else if (nullifierExists)
184+ then throw("Double spend")
185+ else ((txOps ++ dataOps) ++ feeOps)
190186 }
191187 else throw("Strict value is not equal to itself.")
192188 }
193189
194190
195191 @Verifier(tx)
196192 func verify () = match tx {
197193 case d: SetScriptTransaction =>
198194 sigVerify(tx.bodyBytes, tx.proofs[0], ownerPk)
199195 case d: InvokeScriptTransaction =>
200196 match d.function {
201197 case _ =>
202198 if (("setOperatorPk" == $match1))
203199 then sigVerify(tx.bodyBytes, tx.proofs[0], ownerPk)
204200 else if (("transact" == $match1))
205201 then {
206202 let operatorPk = getOperatorPk()
207203 sigVerify(tx.bodyBytes, tx.proofs[0], operatorPk)
208204 }
209205 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
210206 }
211207 case _ =>
212208 false
213209 }
214210

github/deemru/w8io/169f3d6 
31.26 ms