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