tx · 5VR7ZhXcRsRLRxHatt56ecGC6w28hfxz3YRdzTanExY9 3NAfrN5xp6G6o34pzEhDwKDjz37NUaEpi8E: -0.00100000 Waves 2024.11.11 14:47 [3366743] smart account 3NAfrN5xp6G6o34pzEhDwKDjz37NUaEpi8E > SELF 0.00000000 Waves
{ "type": 13, "id": "5VR7ZhXcRsRLRxHatt56ecGC6w28hfxz3YRdzTanExY9", "fee": 100000, "feeAssetId": null, "timestamp": 1731325669012, "version": 1, "sender": "3NAfrN5xp6G6o34pzEhDwKDjz37NUaEpi8E", "senderPublicKey": "4Hyg7NjV4cswejcnGeMvk6x68P2RLt9Y1ontHkWtTcEQ", "proofs": [ "17pYkYjr34K44633YgdnUx5KqsmedvqcpDxPkgumeEA3z9ViFSPn7dWr191Gd6PHB6SUzJ6H9XNA5wbNzu9sGps" ], "script": "base64:BgIECAISAAIAD3RhcmdldFB1YmxpY0tleQEg+e9728ltknUsQCBBwCxMBwhHVc4j3fqo8/Rn+6BSvzgADXRhcmdldEFkZHJlc3MBGgFUmcdFrQw1qSNbFgeZ6tW41ICzXwdjp0IVAQFpARRleGVjdXRlU2V0U2NyaXB0TnVsbAAEAnR4CQDMCAIJAQxJbnRlZ2VyRW50cnkCAgR0eXBlAA0JAMwIAgkBDEludGVnZXJFbnRyeQICB3ZlcnNpb24AAQkAzAgCCQEMSW50ZWdlckVudHJ5AgIHY2hhaW5JZABUCQDMCAIJAQxJbnRlZ2VyRW50cnkCAgNmZWUAoI0GCQDMCAIJAQxJbnRlZ2VyRW50cnkCAgl0aW1lc3RhbXAIBQlsYXN0QmxvY2sJdGltZXN0YW1wCQDMCAIJAQtCaW5hcnlFbnRyeQICD3NlbmRlclB1YmxpY0tleQUPdGFyZ2V0UHVibGljS2V5CQDMCAIJAQtCaW5hcnlFbnRyeQICBnNjcmlwdAEACQDMCAIJAQtCaW5hcnlFbnRyeQICB2FkZHJlc3MFDXRhcmdldEFkZHJlc3MFA25pbAkAlAoCBQJ0eAUEdW5pdAECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXkaZuDI", "chainId": 84, "height": 3366743, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EcCMTiN7TcpxeDAkjWKcFS4AAitmxk21RyfiVMnHnoka Next: 3rAEijjdx1iREfz8Yr6fTQAVm8bvMmsGNvqpZFBekA4E Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let | |
4 | + | let targetPublicKey = base58'HpeKQu8xawfaxbbTSPNMNqVvWM9xhebUcemDK5REzG2j' | |
5 | 5 | ||
6 | - | let allowedCaller1 = base58'HpeKQu8xawfaxbbTSPNMNqVvWM9xhebUcemDK5REzG2j' | |
7 | - | ||
8 | - | let allowedCaller2 = base58'BEVjN4AXKQ2Yw7KS1wiL5DMGg5V9cDniNH7dK2v5d7Ek' | |
9 | - | ||
10 | - | func isCallerAllowed (callerPublicKey) = if ((callerPublicKey == allowedCaller1)) | |
11 | - | then true | |
12 | - | else (callerPublicKey == allowedCaller2) | |
13 | - | ||
6 | + | let targetAddress = base58'3N3wBswhGGLLvVmd6KAA7hH8tZsu2iSY5Yx' | |
14 | 7 | ||
15 | 8 | @Callable(i) | |
16 | - | func executeSetScriptNull () = if (!(isCallerAllowed(i.callerPublicKey))) | |
17 | - | then throw("Unauthorized: caller not in allowed list") | |
18 | - | else { | |
19 | - | let txType = toBytes(13) | |
20 | - | let version = toBytes(1) | |
21 | - | let chainId = toBytes(84) | |
22 | - | let fee = toBytes(100000) | |
23 | - | let timestamp = toBytes(lastBlock.timestamp) | |
24 | - | let txData = (((((txType + version) + chainId) + targetAccount) + fee) + timestamp) | |
25 | - | $Tuple2([BinaryEntry("setScriptTxData", txData), BinaryEntry("callerPublicKey", i.callerPublicKey)], "SetScript transaction data prepared") | |
26 | - | } | |
9 | + | func executeSetScriptNull () = { | |
10 | + | let tx = [IntegerEntry("type", 13), IntegerEntry("version", 1), IntegerEntry("chainId", 84), IntegerEntry("fee", 100000), IntegerEntry("timestamp", lastBlock.timestamp), BinaryEntry("senderPublicKey", targetPublicKey), BinaryEntry("script", base58''), BinaryEntry("address", targetAddress)] | |
11 | + | $Tuple2(tx, unit) | |
12 | + | } | |
27 | 13 | ||
28 | 14 | ||
29 | 15 | @Verifier(tx) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let | |
4 | + | let targetPublicKey = base58'HpeKQu8xawfaxbbTSPNMNqVvWM9xhebUcemDK5REzG2j' | |
5 | 5 | ||
6 | - | let allowedCaller1 = base58'HpeKQu8xawfaxbbTSPNMNqVvWM9xhebUcemDK5REzG2j' | |
7 | - | ||
8 | - | let allowedCaller2 = base58'BEVjN4AXKQ2Yw7KS1wiL5DMGg5V9cDniNH7dK2v5d7Ek' | |
9 | - | ||
10 | - | func isCallerAllowed (callerPublicKey) = if ((callerPublicKey == allowedCaller1)) | |
11 | - | then true | |
12 | - | else (callerPublicKey == allowedCaller2) | |
13 | - | ||
6 | + | let targetAddress = base58'3N3wBswhGGLLvVmd6KAA7hH8tZsu2iSY5Yx' | |
14 | 7 | ||
15 | 8 | @Callable(i) | |
16 | - | func executeSetScriptNull () = if (!(isCallerAllowed(i.callerPublicKey))) | |
17 | - | then throw("Unauthorized: caller not in allowed list") | |
18 | - | else { | |
19 | - | let txType = toBytes(13) | |
20 | - | let version = toBytes(1) | |
21 | - | let chainId = toBytes(84) | |
22 | - | let fee = toBytes(100000) | |
23 | - | let timestamp = toBytes(lastBlock.timestamp) | |
24 | - | let txData = (((((txType + version) + chainId) + targetAccount) + fee) + timestamp) | |
25 | - | $Tuple2([BinaryEntry("setScriptTxData", txData), BinaryEntry("callerPublicKey", i.callerPublicKey)], "SetScript transaction data prepared") | |
26 | - | } | |
9 | + | func executeSetScriptNull () = { | |
10 | + | let tx = [IntegerEntry("type", 13), IntegerEntry("version", 1), IntegerEntry("chainId", 84), IntegerEntry("fee", 100000), IntegerEntry("timestamp", lastBlock.timestamp), BinaryEntry("senderPublicKey", targetPublicKey), BinaryEntry("script", base58''), BinaryEntry("address", targetAddress)] | |
11 | + | $Tuple2(tx, unit) | |
12 | + | } | |
27 | 13 | ||
28 | 14 | ||
29 | 15 | @Verifier(tx) | |
30 | 16 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
31 | 17 |
github/deemru/w8io/169f3d6 30.11 ms ◑