tx · DyQoCAqnMESaNmeJd2Wjou12tAXoUPHBWYAQizwGgVb8 3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq: -0.01000000 Waves 2023.06.23 02:03 [2634485] smart account 3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq > SELF 0.00000000 Waves
{ "type": 13, "id": "DyQoCAqnMESaNmeJd2Wjou12tAXoUPHBWYAQizwGgVb8", "fee": 1000000, "feeAssetId": null, "timestamp": 1687475027708, "version": 2, "chainId": 84, "sender": "3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq", "senderPublicKey": "ERewvWFUFQfR1eCnipNAv9n7SdQhof2ESP6PGVjTueLd", "proofs": [ "5ipDHTXBR1TKjomStoLpnzAWdNuMBPHf6rATXg3cRtaGZFWFo7CsSbpMoDJiwurVjTjwuaDeNEpAdVvko1TNoKKh" ], "script": "base64:BgIaCAISAwoBARIDCgEBEgQKAggBEgASBAoCCAEDAANhcnIJAMwIAgABCQDMCAIAAgkAzAgCAAMJAMwIAgAECQDMCAIABQUDbmlsAARhcnIyCQDMCAIAAQkAzAgCAAIFA25pbAEDc3VtAgFhAWIJAPwHBAkBEUBleHRyTmF0aXZlKDEwNjIpAQIjM04zRG5WZmZuVXladHoyTVJiazVVN2dpTjExMldlbXBNTmQCBmJvcnJvdwkAzAgCAiwyNUZFcUVqUmtxSzZ5Q2tpVDdMejZTQVl6N2dVRkN0eGZDQ2huclZGRDVBVAkAzAgCAMCEPQUDbmlsBQNuaWwFAWkBBmJvcnJvdwELYXNzZXRBbW91bnQEB2FkZHJlc3MJAKUIAQgFAWkGY2FsbGVyBANyZXMJAPwHBAkBEUBleHRyTmF0aXZlKDEwNjIpAQIjM04zRG5WZmZuVXladHoyTVJiazVVN2dpTjExMldlbXBNTmQCBmJvcnJvdwkAzAgCAiwyNUZFcUVqUmtxSzZ5Q2tpVDdMejZTQVl6N2dVRkN0eGZDQ2huclZGRDVBVAkAzAgCBQthc3NldEFtb3VudAUDbmlsBQNua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GV4dHJOYXRpdmUoMTA2MikBAiMzTjNEblZmZm5VeVp0ejJNUmJrNVU3Z2lOMTEyV2VtcE1OZAIGc3VwcGx5BQNuaWwJAMwIAgkBD0F0dGFjaGVkUGF5bWVudAIFBHVuaXQAwIQ9BQNuaWwDCQAAAgUDcmVzBQNyZXMJAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgUHYWRkcmVzcwIMc3VwcGx5X3dhdmVzAMCEPQUDbmlsCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAWkBCHdpdGhkcmF3Agphc3NldElkU3RyC2Fzc2V0QW1vdW50BAdhZGRyZXNzCQClCAEIBQFpBmNhbGxlcgQDcmVzCQD8BwQJARFAZXh0ck5hdGl2ZSgxMDYyKQECIzNOM0RuVmZmblV5WnR6Mk1SYms1VTdnaU4xMTJXZW1wTU5kAgh3aXRoZHJhdwkAzAgCBQphc3NldElkU3RyCQDMCAIFC2Fzc2V0QW1vdW50BQNuaWwFA25pbAMJAAACBQNyZXMFA3JlcwkAzAgCCQEMSW50ZWdlckVudHJ5AgkArAICCQCsAgIFB2FkZHJlc3MCCl93aXRoZHJld18FCmFzc2V0SWRTdHIFC2Fzc2V0QW1vdW50BQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V55KWo7A==", "height": 2634485, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3k8ws5ubAroCNfTEXEvY7T1agLqKifk8bfMYk1BbpsNG Next: BbZ4sMUkDc5VqJGjQCHaPBKTx5DwYt9MpDJnQpZVT2kQ Diff:
Old | New | Differences | |
---|---|---|---|
26 | 26 | func repeatFunc (accum,next) = { | |
27 | 27 | let re = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", assetAmount], nil) | |
28 | 28 | if ((re == re)) | |
29 | - | then [(accum + next)] | |
29 | + | then { | |
30 | + | let result = (accum + next) | |
31 | + | if ((result == result)) | |
32 | + | then [result] | |
33 | + | else throw("Strict value is not equal to itself.") | |
34 | + | } | |
30 | 35 | else throw("Strict value is not equal to itself.") | |
31 | 36 | } | |
32 | 37 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let arr = [1, 2, 3, 4, 5] | |
5 | 5 | ||
6 | 6 | let arr2 = [1, 2] | |
7 | 7 | ||
8 | 8 | func sum (a,b) = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", 1000000], nil) | |
9 | 9 | ||
10 | 10 | ||
11 | 11 | @Callable(i) | |
12 | 12 | func borrow (assetAmount) = { | |
13 | 13 | let address = toString(i.caller) | |
14 | 14 | let res = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", assetAmount], nil) | |
15 | 15 | if ((res == res)) | |
16 | 16 | then [ScriptTransfer(i.caller, assetAmount, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT'), IntegerEntry(((address + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), assetAmount)] | |
17 | 17 | else throw("Strict value is not equal to itself.") | |
18 | 18 | } | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | ||
22 | 22 | @Callable(i) | |
23 | 23 | func borrow2 (assetAmount) = { | |
24 | 24 | let address = toString(i.caller) | |
25 | 25 | let array = [assetAmount, assetAmount] | |
26 | 26 | func repeatFunc (accum,next) = { | |
27 | 27 | let re = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", assetAmount], nil) | |
28 | 28 | if ((re == re)) | |
29 | - | then [(accum + next)] | |
29 | + | then { | |
30 | + | let result = (accum + next) | |
31 | + | if ((result == result)) | |
32 | + | then [result] | |
33 | + | else throw("Strict value is not equal to itself.") | |
34 | + | } | |
30 | 35 | else throw("Strict value is not equal to itself.") | |
31 | 36 | } | |
32 | 37 | ||
33 | 38 | let res = { | |
34 | 39 | let $l = array | |
35 | 40 | let $s = size($l) | |
36 | 41 | let $acc0 = 0 | |
37 | 42 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
38 | 43 | then $a | |
39 | 44 | else repeatFunc($a, $l[$i]) | |
40 | 45 | ||
41 | 46 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
42 | 47 | then $a | |
43 | 48 | else throw("List size exceeds 2") | |
44 | 49 | ||
45 | 50 | $f0_2($f0_1($f0_1($acc0, 0), 1), 2) | |
46 | 51 | } | |
47 | 52 | if ((res == res)) | |
48 | 53 | then [IntegerEntry(((address + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), assetAmount), IntegerEntry("Total Amount", res)] | |
49 | 54 | else throw("Strict value is not equal to itself.") | |
50 | 55 | } | |
51 | 56 | ||
52 | 57 | ||
53 | 58 | ||
54 | 59 | @Callable(i) | |
55 | 60 | func borrow5 (assetIdStr,assetAmount) = { | |
56 | 61 | let address = toString(i.caller) | |
57 | 62 | let res = { | |
58 | 63 | let $l = arr | |
59 | 64 | let $s = size($l) | |
60 | 65 | let $acc0 = 0 | |
61 | 66 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
62 | 67 | then $a | |
63 | 68 | else sum($a, $l[$i]) | |
64 | 69 | ||
65 | 70 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
66 | 71 | then $a | |
67 | 72 | else throw("List size exceeds 5") | |
68 | 73 | ||
69 | 74 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
70 | 75 | } | |
71 | 76 | if ((res == res)) | |
72 | 77 | then [IntegerEntry(((address + "_borrowed_") + assetIdStr), assetAmount)] | |
73 | 78 | else throw("Strict value is not equal to itself.") | |
74 | 79 | } | |
75 | 80 | ||
76 | 81 | ||
77 | 82 | ||
78 | 83 | @Callable(i) | |
79 | 84 | func deposit () = { | |
80 | 85 | let address = toString(i.caller) | |
81 | 86 | let res = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, 1000000)]) | |
82 | 87 | if ((res == res)) | |
83 | 88 | then [IntegerEntry((address + "supply_waves"), 1000000)] | |
84 | 89 | else throw("Strict value is not equal to itself.") | |
85 | 90 | } | |
86 | 91 | ||
87 | 92 | ||
88 | 93 | ||
89 | 94 | @Callable(i) | |
90 | 95 | func withdraw (assetIdStr,assetAmount) = { | |
91 | 96 | let address = toString(i.caller) | |
92 | 97 | let res = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "withdraw", [assetIdStr, assetAmount], nil) | |
93 | 98 | if ((res == res)) | |
94 | 99 | then [IntegerEntry(((address + "_withdrew_") + assetIdStr), assetAmount)] | |
95 | 100 | else throw("Strict value is not equal to itself.") | |
96 | 101 | } | |
97 | 102 | ||
98 | 103 | ||
99 | 104 | @Verifier(tx) | |
100 | 105 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
101 | 106 |
github/deemru/w8io/026f985 40.70 ms ◑