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