tx · CSmsEmACzyHN2SjaN9isY3zN5kj7MCy6CKxSb9pgL4DB 3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq: -0.01000000 Waves 2023.06.26 00:57 [2638736] smart account 3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq > SELF 0.00000000 Waves
{ "type": 13, "id": "CSmsEmACzyHN2SjaN9isY3zN5kj7MCy6CKxSb9pgL4DB", "fee": 1000000, "feeAssetId": null, "timestamp": 1687730245417, "version": 2, "chainId": 84, "sender": "3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq", "senderPublicKey": "ERewvWFUFQfR1eCnipNAv9n7SdQhof2ESP6PGVjTueLd", "proofs": [ "WTs9w1P1KGR7jBgD63GFQQhZMHz1SCyWbWDTHAur68Cwhs87YX5drYrby2QeTXThHFQiMVgVNr6thffvarFQdRq" ], "script": "base64:BgIkCAISAwoBARIDCgEBEgMKAQESBAoCCAESABIECgIIARIDCgEIBAADYXJyCQDMCAIAAQkAzAgCAAIJAMwIAgADCQDMCAIABAkAzAgCAAUFA25pbAAEYXJyMgkAzAgCAAEJAMwIAgACBQNuaWwBA3N1bQIBYQFiCQD8BwQJARFAZXh0ck5hdGl2ZSgxMDYyKQECIzNOM0RuVmZmblV5WnR6Mk1SYms1VTdnaU4xMTJXZW1wTU5kAgZib3Jyb3cJAMwIAgIsMjVGRXFFalJrcUs2eUNraVQ3THo2U0FZejdnVUZDdHhmQ0NobnJWRkQ1QVQJAMwIAgDAhD0FA25pbAUDbmlsAQpnZXRCYWxhbmNlAgphc3NldElkU3RyB2FkZHJlc3MDCQAAAgUKYXNzZXRJZFN0cgIFV0FWRVMICQDvBwEFB2FkZHJlc3MJYXZhaWxhYmxlCQDwBwIFB2FkZHJlc3MJANkEAQUKYXNzZXRJZFN0cgcBaQEGbG9uZzJ4AQthc3NldEFtb3VudAQHYWRkcmVzcwkApQgBCAUBaQZjYWxsZXIEDWN1cnJlbnRBbW91bnQJAQpnZXRCYWxhbmNlAgIF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NlbGYuAWkBDGNoZWNrQmFsYW5jZQEKYXNzZXRJZFN0cgQHYWRkcmVzcwgFAWkGY2FsbGVyAwkAAAIFCmFzc2V0SWRTdHICBVdBVkVTCQDMCAIJAQxJbnRlZ2VyRW50cnkCAg1XYXZlcyBCYWxhbmNlCAkA7wcBBQdhZGRyZXNzCWF2YWlsYWJsZQUDbmlsCQDMCAIJAQxJbnRlZ2VyRW50cnkCAg1Bc3NldCBCYWxhbmNlCQDwBwIFB2FkZHJlc3MJANkEAQUKYXNzZXRJZFN0cgUDbmlsAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tlec4PHvs=", "height": 2638736, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EM8cQgaUsiwzaESLEDguLhVghpRXsJYgK7dnf2xF8LSi Next: 8Tk3kEk3bUcx9qck43bkFG6Nu35f8aY8iQx9VmNLky45 Diff:
Old | New | Differences | |
---|---|---|---|
6 | 6 | let arr2 = [1, 2] | |
7 | 7 | ||
8 | 8 | func sum (a,b) = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", 1000000], nil) | |
9 | + | ||
10 | + | ||
11 | + | func getBalance (assetIdStr,address) = if ((assetIdStr == "WAVES")) | |
12 | + | then wavesBalance(address).available | |
13 | + | else assetBalance(address, fromBase58String(assetIdStr)) | |
14 | + | ||
15 | + | ||
16 | + | @Callable(i) | |
17 | + | func long2x (assetAmount) = { | |
18 | + | let address = toString(i.caller) | |
19 | + | let currentAmount = getBalance("WAVES", i.caller) | |
20 | + | if ((currentAmount > assetAmount)) | |
21 | + | then { | |
22 | + | let supplyResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, assetAmount)]) | |
23 | + | if ((supplyResult == supplyResult)) | |
24 | + | then { | |
25 | + | func repeatFunc (accum,next) = { | |
26 | + | let result = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", assetAmount], nil) | |
27 | + | if ((result == result)) | |
28 | + | then (accum + next) | |
29 | + | else throw("Strict value is not equal to itself.") | |
30 | + | } | |
31 | + | ||
32 | + | let array = [assetAmount, assetAmount] | |
33 | + | let res = { | |
34 | + | let $l = array | |
35 | + | let $s = size($l) | |
36 | + | let $acc0 = 0 | |
37 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
38 | + | then $a | |
39 | + | else repeatFunc($a, $l[$i]) | |
40 | + | ||
41 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
42 | + | then $a | |
43 | + | else throw("List size exceeds 2") | |
44 | + | ||
45 | + | $f0_2($f0_1($f0_1($acc0, 0), 1), 2) | |
46 | + | } | |
47 | + | [IntegerEntry(((address + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), assetAmount), ScriptTransfer(i.caller, res, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')] | |
48 | + | } | |
49 | + | else throw("Strict value is not equal to itself.") | |
50 | + | } | |
51 | + | else throw("Error!") | |
52 | + | } | |
53 | + | ||
9 | 54 | ||
10 | 55 | ||
11 | 56 | @Callable(i) |
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 | + | ||
10 | + | ||
11 | + | func getBalance (assetIdStr,address) = if ((assetIdStr == "WAVES")) | |
12 | + | then wavesBalance(address).available | |
13 | + | else assetBalance(address, fromBase58String(assetIdStr)) | |
14 | + | ||
15 | + | ||
16 | + | @Callable(i) | |
17 | + | func long2x (assetAmount) = { | |
18 | + | let address = toString(i.caller) | |
19 | + | let currentAmount = getBalance("WAVES", i.caller) | |
20 | + | if ((currentAmount > assetAmount)) | |
21 | + | then { | |
22 | + | let supplyResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, assetAmount)]) | |
23 | + | if ((supplyResult == supplyResult)) | |
24 | + | then { | |
25 | + | func repeatFunc (accum,next) = { | |
26 | + | let result = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", assetAmount], nil) | |
27 | + | if ((result == result)) | |
28 | + | then (accum + next) | |
29 | + | else throw("Strict value is not equal to itself.") | |
30 | + | } | |
31 | + | ||
32 | + | let array = [assetAmount, assetAmount] | |
33 | + | let res = { | |
34 | + | let $l = array | |
35 | + | let $s = size($l) | |
36 | + | let $acc0 = 0 | |
37 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
38 | + | then $a | |
39 | + | else repeatFunc($a, $l[$i]) | |
40 | + | ||
41 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
42 | + | then $a | |
43 | + | else throw("List size exceeds 2") | |
44 | + | ||
45 | + | $f0_2($f0_1($f0_1($acc0, 0), 1), 2) | |
46 | + | } | |
47 | + | [IntegerEntry(((address + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), assetAmount), ScriptTransfer(i.caller, res, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')] | |
48 | + | } | |
49 | + | else throw("Strict value is not equal to itself.") | |
50 | + | } | |
51 | + | else throw("Error!") | |
52 | + | } | |
53 | + | ||
9 | 54 | ||
10 | 55 | ||
11 | 56 | @Callable(i) | |
12 | 57 | func borrow (assetAmount) = { | |
13 | 58 | let address = toString(i.caller) | |
14 | 59 | let res = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", assetAmount], nil) | |
15 | 60 | if ((res == res)) | |
16 | 61 | then [ScriptTransfer(i.caller, assetAmount, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT'), IntegerEntry(((address + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), assetAmount)] | |
17 | 62 | else throw("Strict value is not equal to itself.") | |
18 | 63 | } | |
19 | 64 | ||
20 | 65 | ||
21 | 66 | ||
22 | 67 | @Callable(i) | |
23 | 68 | func borrow2 (assetAmount) = { | |
24 | 69 | let address = toString(i.caller) | |
25 | 70 | func repeatFunc (accum,next) = { | |
26 | 71 | let result = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", assetAmount], nil) | |
27 | 72 | if ((result == result)) | |
28 | 73 | then (accum + next) | |
29 | 74 | else throw("Strict value is not equal to itself.") | |
30 | 75 | } | |
31 | 76 | ||
32 | 77 | let array = [assetAmount, assetAmount] | |
33 | 78 | let res = { | |
34 | 79 | let $l = array | |
35 | 80 | let $s = size($l) | |
36 | 81 | let $acc0 = 0 | |
37 | 82 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
38 | 83 | then $a | |
39 | 84 | else repeatFunc($a, $l[$i]) | |
40 | 85 | ||
41 | 86 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
42 | 87 | then $a | |
43 | 88 | else throw("List size exceeds 2") | |
44 | 89 | ||
45 | 90 | $f0_2($f0_1($f0_1($acc0, 0), 1), 2) | |
46 | 91 | } | |
47 | 92 | [IntegerEntry(((address + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), assetAmount), ScriptTransfer(i.caller, res, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')] | |
48 | 93 | } | |
49 | 94 | ||
50 | 95 | ||
51 | 96 | ||
52 | 97 | @Callable(i) | |
53 | 98 | func borrow5 (assetIdStr,assetAmount) = { | |
54 | 99 | let address = toString(i.caller) | |
55 | 100 | let res = { | |
56 | 101 | let $l = arr | |
57 | 102 | let $s = size($l) | |
58 | 103 | let $acc0 = 0 | |
59 | 104 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
60 | 105 | then $a | |
61 | 106 | else sum($a, $l[$i]) | |
62 | 107 | ||
63 | 108 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
64 | 109 | then $a | |
65 | 110 | else throw("List size exceeds 5") | |
66 | 111 | ||
67 | 112 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
68 | 113 | } | |
69 | 114 | if ((res == res)) | |
70 | 115 | then [IntegerEntry(((address + "_borrowed_") + assetIdStr), assetAmount)] | |
71 | 116 | else throw("Strict value is not equal to itself.") | |
72 | 117 | } | |
73 | 118 | ||
74 | 119 | ||
75 | 120 | ||
76 | 121 | @Callable(i) | |
77 | 122 | func deposit () = { | |
78 | 123 | let address = toString(i.caller) | |
79 | 124 | let res = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, 1000000)]) | |
80 | 125 | if ((res == res)) | |
81 | 126 | then [IntegerEntry((address + "supply_waves"), 1000000)] | |
82 | 127 | else throw("Strict value is not equal to itself.") | |
83 | 128 | } | |
84 | 129 | ||
85 | 130 | ||
86 | 131 | ||
87 | 132 | @Callable(i) | |
88 | 133 | func withdraw (assetIdStr,assetAmount) = { | |
89 | 134 | let address = toString(i.caller) | |
90 | 135 | let res = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "withdraw", [assetIdStr, assetAmount], nil) | |
91 | 136 | if ((res == res)) | |
92 | 137 | then [IntegerEntry(((address + "_withdrew_") + assetIdStr), assetAmount)] | |
93 | 138 | else throw("Strict value is not equal to itself.") | |
94 | 139 | } | |
95 | 140 | ||
96 | 141 | ||
97 | 142 | ||
98 | 143 | @Callable(i) | |
99 | 144 | func checkBalance (assetIdStr) = { | |
100 | 145 | let address = i.caller | |
101 | 146 | if ((assetIdStr == "WAVES")) | |
102 | 147 | then [IntegerEntry("Waves Balance", wavesBalance(address).available)] | |
103 | 148 | else [IntegerEntry("Asset Balance", assetBalance(address, fromBase58String(assetIdStr)))] | |
104 | 149 | } | |
105 | 150 | ||
106 | 151 | ||
107 | 152 | @Verifier(tx) | |
108 | 153 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
109 | 154 |
github/deemru/w8io/169f3d6 28.75 ms ◑