tx · 7cmNATEo5iXEkBbHWHPKzPEewQ9DmwYUjt5dc3qm7xY5 3N7sgwhSS8xPkYAJBvrjhAu5NNM8nSVBK6d: -0.01000000 Waves 2023.10.02 10:11 [2780698] smart account 3N7sgwhSS8xPkYAJBvrjhAu5NNM8nSVBK6d > SELF 0.00000000 Waves
{ "type": 13, "id": "7cmNATEo5iXEkBbHWHPKzPEewQ9DmwYUjt5dc3qm7xY5", "fee": 1000000, "feeAssetId": null, "timestamp": 1696230687284, "version": 2, "chainId": 84, "sender": "3N7sgwhSS8xPkYAJBvrjhAu5NNM8nSVBK6d", "senderPublicKey": "2xepYpePcdoBmD6T455w9bKmTxgot7zSjzpg4wbQ7HLQ", "proofs": [ "2taWhjDx3DRGJgkY3fbAB8N8Rk1WdPB9bPEPeVbRKPiHn6sYmSeFpeQ23WR8xn6ZkzE6fHj19o1aQJfT4U6uWjVe" ], "script": "base64:BgIdCAISBAoCCAgSBAoCCAESBQoDAgEIEgQKAgIBEgAIAANTRVACAl9fABFrZXlGYWN0b3J5QWRkcmVzcwkAuQkCCQDMCAICAiVzCQDMCAICB2ZhY3RvcnkFA25pbAUDU0VQAA5mYWN0b3J5QWRkcmVzcwkBEUBleHRyTmF0aXZlKDEwNjIpAQkBEUBleHRyTmF0aXZlKDEwNTMpAgUEdGhpcwURa2V5RmFjdG9yeUFkZHJlc3MADmtleUltcGxBZGRyZXNzCQC5CQIJAMwIAgICJXMJAMwIAgIEaW1wbAUDbmlsBQNTRVAAC2ltcGxBZGRyZXNzCQERQGV4dHJOYXRpdmUoMTA2MikBCQERQGV4dHJOYXRpdmUoMTA1MykCBQ5mYWN0b3J5QWRkcmVzcwUOa2V5SW1wbEFkZHJlc3MBD2Fzc2V0SWRUb1N0cmluZwEHYXNzZXRJZAQHJG1hdGNoMAUHYXNzZXRJZAMJAAECBQckbWF0Y2gwAgpCeXRlVmVjdG9yBAFiBQckbWF0Y2gwCQDYBAEFAWICBVdBVkVTAQttdXN0QWRkcmVzcwIBaQ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W50BAxwcmljZUFzc2V0SWQJAQ9hc3NldElkVG9TdHJpbmcBCAkAkQMCCAUBaQhwYXltZW50cwABB2Fzc2V0SWQEEHByaWNlQXNzZXRBbW91bnQICQCRAwIIBQFpCHBheW1lbnRzAAEGYW1vdW50BAZyZXN1bHQJAP0HBAULaW1wbEFkZHJlc3MCA3B1dAkAzAgCBQ1hbW91bnRBc3NldElkCQDMCAIFEWFtb3VudEFzc2V0QW1vdW50CQDMCAIFDHByaWNlQXNzZXRJZAkAzAgCBRBwcmljZUFzc2V0QW1vdW50BQNuaWwFA25pbAMJAAACBQZyZXN1bHQFBnJlc3VsdAkAlAoCBQNuaWwFA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgDdm6JB", "height": 2780698, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AvgFWFUhwU4sjFr24mgjeUunQ4NwQfVQxDNyohjnzamR Next: 6H8j5An5EUCS74dyyvMFnvdyLeuWUEv6LrXMQQX1CMAS Diff:
Old | New | Differences | |
---|---|---|---|
19 | 19 | } | |
20 | 20 | ||
21 | 21 | ||
22 | + | func mustAddress (i,address) = if ((i.caller == address)) | |
23 | + | then true | |
24 | + | else throw() | |
25 | + | ||
26 | + | ||
27 | + | func mustImpl (i) = mustAddress(i, implAddress) | |
28 | + | ||
29 | + | ||
30 | + | @Callable(i) | |
31 | + | func stringEntry (key,val) = if (mustImpl(i)) | |
32 | + | then $Tuple2([StringEntry(key, val)], key) | |
33 | + | else $Tuple2(nil, unit) | |
34 | + | ||
35 | + | ||
36 | + | ||
37 | + | @Callable(i) | |
38 | + | func integerEntry (key,val) = if (mustImpl(i)) | |
39 | + | then $Tuple2([IntegerEntry(key, val)], key) | |
40 | + | else $Tuple2(nil, unit) | |
41 | + | ||
42 | + | ||
43 | + | ||
44 | + | @Callable(i) | |
45 | + | func transferAsset (recipientBytes,amount,assetIdString) = { | |
46 | + | let assetId = if ((assetIdString == "WAVES")) | |
47 | + | then unit | |
48 | + | else fromBase58String(assetIdString) | |
49 | + | if (mustImpl(i)) | |
50 | + | then $Tuple2([ScriptTransfer(Address(recipientBytes), amount, assetId)], amount) | |
51 | + | else $Tuple2(nil, unit) | |
52 | + | } | |
53 | + | ||
54 | + | ||
55 | + | ||
56 | + | @Callable(i) | |
57 | + | func transferWaves (recipientBytes,amount) = if (mustImpl(i)) | |
58 | + | then $Tuple2([ScriptTransfer(Address(recipientBytes), amount, unit)], amount) | |
59 | + | else $Tuple2(nil, unit) | |
60 | + | ||
61 | + | ||
62 | + | ||
22 | 63 | @Callable(i) | |
23 | 64 | func put () = { | |
24 | 65 | let amountAssetId = assetIdToString(i.payments[0].assetId) | |
27 | 68 | let priceAssetAmount = i.payments[1].amount | |
28 | 69 | let result = reentrantInvoke(implAddress, "put", [amountAssetId, amountAssetAmount, priceAssetId, priceAssetAmount], nil) | |
29 | 70 | if ((result == result)) | |
30 | - | then { | |
31 | - | let res = match result { | |
32 | - | case t: List[Any] => | |
33 | - | t | |
34 | - | case _ => | |
35 | - | throw("ERR") | |
36 | - | } | |
37 | - | $Tuple2(nil, res) | |
38 | - | } | |
71 | + | then $Tuple2(nil, nil) | |
39 | 72 | else throw("Strict value is not equal to itself.") | |
40 | 73 | } | |
41 | 74 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | let keyFactoryAddress = makeString(["%s", "factory"], SEP) | |
7 | 7 | ||
8 | 8 | let factoryAddress = addressFromStringValue(getStringValue(this, keyFactoryAddress)) | |
9 | 9 | ||
10 | 10 | let keyImplAddress = makeString(["%s", "impl"], SEP) | |
11 | 11 | ||
12 | 12 | let implAddress = addressFromStringValue(getStringValue(factoryAddress, keyImplAddress)) | |
13 | 13 | ||
14 | 14 | func assetIdToString (assetId) = match assetId { | |
15 | 15 | case b: ByteVector => | |
16 | 16 | toBase58String(b) | |
17 | 17 | case _ => | |
18 | 18 | "WAVES" | |
19 | 19 | } | |
20 | 20 | ||
21 | 21 | ||
22 | + | func mustAddress (i,address) = if ((i.caller == address)) | |
23 | + | then true | |
24 | + | else throw() | |
25 | + | ||
26 | + | ||
27 | + | func mustImpl (i) = mustAddress(i, implAddress) | |
28 | + | ||
29 | + | ||
30 | + | @Callable(i) | |
31 | + | func stringEntry (key,val) = if (mustImpl(i)) | |
32 | + | then $Tuple2([StringEntry(key, val)], key) | |
33 | + | else $Tuple2(nil, unit) | |
34 | + | ||
35 | + | ||
36 | + | ||
37 | + | @Callable(i) | |
38 | + | func integerEntry (key,val) = if (mustImpl(i)) | |
39 | + | then $Tuple2([IntegerEntry(key, val)], key) | |
40 | + | else $Tuple2(nil, unit) | |
41 | + | ||
42 | + | ||
43 | + | ||
44 | + | @Callable(i) | |
45 | + | func transferAsset (recipientBytes,amount,assetIdString) = { | |
46 | + | let assetId = if ((assetIdString == "WAVES")) | |
47 | + | then unit | |
48 | + | else fromBase58String(assetIdString) | |
49 | + | if (mustImpl(i)) | |
50 | + | then $Tuple2([ScriptTransfer(Address(recipientBytes), amount, assetId)], amount) | |
51 | + | else $Tuple2(nil, unit) | |
52 | + | } | |
53 | + | ||
54 | + | ||
55 | + | ||
56 | + | @Callable(i) | |
57 | + | func transferWaves (recipientBytes,amount) = if (mustImpl(i)) | |
58 | + | then $Tuple2([ScriptTransfer(Address(recipientBytes), amount, unit)], amount) | |
59 | + | else $Tuple2(nil, unit) | |
60 | + | ||
61 | + | ||
62 | + | ||
22 | 63 | @Callable(i) | |
23 | 64 | func put () = { | |
24 | 65 | let amountAssetId = assetIdToString(i.payments[0].assetId) | |
25 | 66 | let amountAssetAmount = i.payments[0].amount | |
26 | 67 | let priceAssetId = assetIdToString(i.payments[1].assetId) | |
27 | 68 | let priceAssetAmount = i.payments[1].amount | |
28 | 69 | let result = reentrantInvoke(implAddress, "put", [amountAssetId, amountAssetAmount, priceAssetId, priceAssetAmount], nil) | |
29 | 70 | if ((result == result)) | |
30 | - | then { | |
31 | - | let res = match result { | |
32 | - | case t: List[Any] => | |
33 | - | t | |
34 | - | case _ => | |
35 | - | throw("ERR") | |
36 | - | } | |
37 | - | $Tuple2(nil, res) | |
38 | - | } | |
71 | + | then $Tuple2(nil, nil) | |
39 | 72 | else throw("Strict value is not equal to itself.") | |
40 | 73 | } | |
41 | 74 | ||
42 | 75 |
github/deemru/w8io/169f3d6 26.08 ms ◑