tx · 2LGqgBzdBPdaEPYXnUq5JEExyVHPNeSELsZfUcfw2jKH 3N93XuDT7GvzMZdp8WGTbqYxiGY9JQmiWAG: -0.00300000 Waves 2023.09.01 02:32 [2735524] smart account 3N93XuDT7GvzMZdp8WGTbqYxiGY9JQmiWAG > SELF 0.00000000 Waves
{ "type": 13, "id": "2LGqgBzdBPdaEPYXnUq5JEExyVHPNeSELsZfUcfw2jKH", "fee": 300000, "feeAssetId": null, "timestamp": 1693524801319, "version": 2, "chainId": 84, "sender": "3N93XuDT7GvzMZdp8WGTbqYxiGY9JQmiWAG", "senderPublicKey": "3MV6QZNSjqH7Ctc3BGRQJJyZ3DJgCJ6Tqn7LXRgneZ5B", "proofs": [ "2MdK61quJPj7hJEPwJtCBJhfGQKLYaPDAQGXkoCaGkrWHvX2zc4cWBymcSH7KnCqJ1x2Xi1UAZKnpEZ5Hj6kptte" ], "script": "base64:BgISCAISBAoCCAESABIGCgQIAQgICQAKbGltaXRSYXRpbwCgjQYAA2ZlZQBkAAZzY2FsZTUAoI0GAAxmZWVDb2xsZWN0b3ICIzNOMkZ1em9NMXg4aEpxU0RVVmlYdXZhdE5wOWlwN0dyS29CAQpnZXRBc3NldElkAQNhc3QEByRtYXRjaDAFA2FzdAMJAAECBQckbWF0Y2gwAgpCeXRlVmVjdG9yBAFwBQckbWF0Y2gwBQNhc3QFBHVuaXQBDmdldEFzc2V0U3RyaW5nAQdhc3NldElkBAckbWF0Y2gwBQdhc3NldElkAwkAAQIFByRtYXRjaDACCkJ5dGVWZWN0b3IEAWIFByRtYXRjaDAJANgEAQUBYgIFV0FWRVMBDWdldEFzc2V0Qnl0ZXMBB2Fzc2V0SWQDCQAAAgUHYXNzZXRJZAIFV0FWRVMFBHVuaXQJANkEAQUHYXNzZXRJZAEKZ2V0QmFsYW5jZQEHYXNzZXRJZAQHJG1hdGNoMAUHYXNzZXRJZAMJAAECBQckbWF0Y2gwAgpCeXRlVmVjdG9yBAFiBQckbWF0Y2gwCQDwBwI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BQdhc3NldElkBQZhbW91bnQFA25pbAMJAAACBQhjYWxsYmFjawUIY2FsbGJhY2sECWZlZUFtb3VudAkAawMFBmFtb3VudAUDZmVlBQZzY2FsZTUEDWFtb3VudFRvUmVwYXkJAGQCBQZhbW91bnQFCWZlZUFtb3VudAQKbmV3QmFsYW5jZQkBCmdldEJhbGFuY2UBCQENZ2V0QXNzZXRCeXRlcwEFB2Fzc2V0SWQDCQAAAgUKbmV3QmFsYW5jZQUKbmV3QmFsYW5jZQMJAGcCBQpuZXdCYWxhbmNlBQ5jdXJyZW50QmFsYW5jZQkAAgEJAKwCAgkArAICCQCsAgICEGN1cnJlbnRCYWxhbmNlOiAJAKQDAQUOY3VycmVudEJhbGFuY2UCDiwgbmV3QmFsYW5jZTogCQCkAwEFCm5ld0JhbGFuY2UJAAIBCQCsAgIJAKwCAgkArAICAihSZWplY3RlZCBkdWUgdG8gbG93IHJlcGF5IGFtb3VudC4gTmVlZDogCQCkAwEFDWFtb3VudFRvUmVwYXkCDCwgcHJvdmlkZWQ6IAkApAMBCQBlAgUKbmV3QmFsYW5jZQUOY3VycmVudEJhbGFuY2UJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AN6warg==", "height": 2735524, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7g8g5Kyyr8gX82DkmyE1UM6ehMCZufG2L4ErHeVjcjSi Next: G9A3gkA3wMSCCBEdF7Jf8qAvUZLXxetvdAcQfrr9gTw Diff:
Old | New | Differences | |
---|---|---|---|
109 | 109 | let F = m(l(j)) | |
110 | 110 | if ((F == F)) | |
111 | 111 | then if ((F >= s)) | |
112 | - | then | |
112 | + | then throw(((("currentBalance: " + toString(s)) + ", newBalance: ") + toString(F))) | |
113 | 113 | else throw(((("Rejected due to low repay amount. Need: " + toString(E)) + ", provided: ") + toString((F - s)))) | |
114 | 114 | else throw("Strict value is not equal to itself.") | |
115 | 115 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = 100000 | |
5 | 5 | ||
6 | 6 | let b = 100 | |
7 | 7 | ||
8 | 8 | let c = 100000 | |
9 | 9 | ||
10 | 10 | let d = "3N2FuzoM1x8hJqSDUViXuvatNp9ip7GrKoB" | |
11 | 11 | ||
12 | 12 | func e (f) = { | |
13 | 13 | let g = f | |
14 | 14 | if ($isInstanceOf(g, "ByteVector")) | |
15 | 15 | then { | |
16 | 16 | let h = g | |
17 | 17 | f | |
18 | 18 | } | |
19 | 19 | else unit | |
20 | 20 | } | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | func i (j) = { | |
24 | 24 | let g = j | |
25 | 25 | if ($isInstanceOf(g, "ByteVector")) | |
26 | 26 | then { | |
27 | 27 | let k = g | |
28 | 28 | toBase58String(k) | |
29 | 29 | } | |
30 | 30 | else "WAVES" | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func l (j) = if ((j == "WAVES")) | |
35 | 35 | then unit | |
36 | 36 | else fromBase58String(j) | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func m (j) = { | |
40 | 40 | let g = j | |
41 | 41 | if ($isInstanceOf(g, "ByteVector")) | |
42 | 42 | then { | |
43 | 43 | let k = g | |
44 | 44 | assetBalance(this, k) | |
45 | 45 | } | |
46 | 46 | else wavesBalance(this).available | |
47 | 47 | } | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | func n (o,p) = { | |
51 | 51 | let g = getInteger(p, o) | |
52 | 52 | if ($isInstanceOf(g, "Int")) | |
53 | 53 | then { | |
54 | 54 | let k = g | |
55 | 55 | k | |
56 | 56 | } | |
57 | 57 | else 0 | |
58 | 58 | } | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | @Callable(q) | |
62 | 62 | func borrow (j,r) = { | |
63 | 63 | let s = m(l(j)) | |
64 | 64 | if ((s == s)) | |
65 | 65 | then { | |
66 | 66 | let t = fraction(s, a, c) | |
67 | 67 | if ((t >= r)) | |
68 | 68 | then [IntegerEntry(((("borrowed_" + toString(q.originCaller)) + "_") + j), r), ScriptTransfer(q.originCaller, r, l(j))] | |
69 | 69 | else throw(((("Requested amount " + toString(r)) + " is bigger than limit: ") + toString(t))) | |
70 | 70 | } | |
71 | 71 | else throw("Strict value is not equal to itself.") | |
72 | 72 | } | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | ||
76 | 76 | @Callable(q) | |
77 | 77 | func repay () = { | |
78 | 78 | let r = value(q.payments[0].amount) | |
79 | 79 | let j = q.payments[0].assetId | |
80 | 80 | let u = n(((("borrowed_" + toString(q.originCaller)) + "_") + i(j)), this) | |
81 | 81 | if ((u > 0)) | |
82 | 82 | then { | |
83 | 83 | let v = min([r, u]) | |
84 | 84 | let w = (r - v) | |
85 | 85 | let x = if ((w > 0)) | |
86 | 86 | then ScriptTransfer(q.originCaller, w, j) | |
87 | 87 | else unit | |
88 | 88 | [IntegerEntry(((("borrowed_" + toString(q.originCaller)) + "_") + i(j)), (u - v))] | |
89 | 89 | } | |
90 | 90 | else throw("You shouldn't repay") | |
91 | 91 | } | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | ||
95 | 95 | @Callable(q) | |
96 | 96 | func flash (j,r,y,z) = { | |
97 | 97 | let A = Address(fromBase58String(y)) | |
98 | 98 | let s = m(l(j)) | |
99 | 99 | if ((s == s)) | |
100 | 100 | then { | |
101 | 101 | let B = invoke(this, "borrow", [j, r], nil) | |
102 | 102 | if ((B == B)) | |
103 | 103 | then { | |
104 | 104 | let C = invoke(Address(fromBase58String(y)), z, nil, [AttachedPayment(l(j), r)]) | |
105 | 105 | if ((C == C)) | |
106 | 106 | then { | |
107 | 107 | let D = fraction(r, b, c) | |
108 | 108 | let E = (r + D) | |
109 | 109 | let F = m(l(j)) | |
110 | 110 | if ((F == F)) | |
111 | 111 | then if ((F >= s)) | |
112 | - | then | |
112 | + | then throw(((("currentBalance: " + toString(s)) + ", newBalance: ") + toString(F))) | |
113 | 113 | else throw(((("Rejected due to low repay amount. Need: " + toString(E)) + ", provided: ") + toString((F - s)))) | |
114 | 114 | else throw("Strict value is not equal to itself.") | |
115 | 115 | } | |
116 | 116 | else throw("Strict value is not equal to itself.") | |
117 | 117 | } | |
118 | 118 | else throw("Strict value is not equal to itself.") | |
119 | 119 | } | |
120 | 120 | else throw("Strict value is not equal to itself.") | |
121 | 121 | } | |
122 | 122 | ||
123 | 123 |
github/deemru/w8io/026f985 31.12 ms ◑