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:BgISCAISBAoCCAESABIGCgQIAQgICQAKbGltaXRSYXRpbwCgjQYAA2ZlZQBkAAZzY2FsZTUAoI0GAAxmZWVDb2xsZWN0b3ICIzNOMkZ1em9NMXg4aEpxU0RVVmlYdXZhdE5wOWlwN0dyS29CAQpnZXRBc3NldElkAQNhc3QEByRtYXRjaDAFA2FzdAMJAAECBQckbWF0Y2gwAgpCeXRlVmVjdG9yBAFwBQckbWF0Y2gwBQNhc3QFBHVuaXQBDmdldEFzc2V0U3RyaW5nAQdhc3NldElkBAckbWF0Y2gwBQdhc3NldElkAwkAAQIFByRtYXRjaDACCkJ5dGVWZWN0b3IEAWIFByRtYXRjaDAJANgEAQUBYgIFV0FWRVMBDWdldEFzc2V0Qnl0ZXMBB2Fzc2V0SWQDCQAAAgUHYXNzZXRJZAIFV0FWRVMFBHVuaXQJANkEAQUHYXNzZXRJZAEKZ2V0QmFsYW5jZQEHYXNzZXRJZAQHJG1hdGNoMAUHYXNzZXRJZAMJAAECBQckbWF0Y2gwAgpCeXRlVmVjdG9yBAFiBQckbWF0Y2gwCQDwBw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BBQdhc3NldElkBQZhbW91bnQFA25pbAMJAAACBQhjYWxsYmFjawUIY2FsbGJhY2sECWZlZUFtb3VudAkAawMFBmFtb3VudAUDZmVlBQZzY2FsZTUEDWFtb3VudFRvUmVwYXkJAGQCBQZhbW91bnQFCWZlZUFtb3VudAQKbmV3QmFsYW5jZQkBCmdldEJhbGFuY2UBCQENZ2V0QXNzZXRCeXRlcwEFB2Fzc2V0SWQDCQAAAgUKbmV3QmFsYW5jZQUKbmV3QmFsYW5jZQMJAGcCBQpuZXdCYWxhbmNlBQ5jdXJyZW50QmFsYW5jZQkAAgEJAKwCAgkArAICCQCsAgICEGN1cnJlbnRCYWxhbmNlOiAJAKQDAQUOY3VycmVudEJhbGFuY2UCDiwgbmV3QmFsYW5jZTogCQCkAwEFCm5ld0JhbGFuY2UJAAIBCQCsAgIJAKwCAgkArAICAihSZWplY3RlZCBkdWUgdG8gbG93IHJlcGF5IGFtb3VudC4gTmVlZDogCQCkAwEFDWFtb3VudFRvUmVwYXkCDCwgcHJvdmlkZWQ6IAkApAMBCQBlAgUKbmV3QmFsYW5jZQUOY3VycmVudEJhbGFuY2UJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AN6warg==", "height": 2735524, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7g8g5Kyyr8gX82DkmyE1UM6ehMCZufG2L4ErHeVjcjSi Next: G9A3gkA3wMSCCBEdF7Jf8qAvUZLXxetvdAcQfrr9gTw Diff:
OldNewDifferences
109109 let F = m(l(j))
110110 if ((F == F))
111111 then if ((F >= s))
112- then [ScriptTransfer(Address(fromBase58String(d)), D, l(j))]
112+ then throw(((("currentBalance: " + toString(s)) + ", newBalance: ") + toString(F)))
113113 else throw(((("Rejected due to low repay amount. Need: " + toString(E)) + ", provided: ") + toString((F - s))))
114114 else throw("Strict value is not equal to itself.")
115115 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = 100000
55
66 let b = 100
77
88 let c = 100000
99
1010 let d = "3N2FuzoM1x8hJqSDUViXuvatNp9ip7GrKoB"
1111
1212 func e (f) = {
1313 let g = f
1414 if ($isInstanceOf(g, "ByteVector"))
1515 then {
1616 let h = g
1717 f
1818 }
1919 else unit
2020 }
2121
2222
2323 func i (j) = {
2424 let g = j
2525 if ($isInstanceOf(g, "ByteVector"))
2626 then {
2727 let k = g
2828 toBase58String(k)
2929 }
3030 else "WAVES"
3131 }
3232
3333
3434 func l (j) = if ((j == "WAVES"))
3535 then unit
3636 else fromBase58String(j)
3737
3838
3939 func m (j) = {
4040 let g = j
4141 if ($isInstanceOf(g, "ByteVector"))
4242 then {
4343 let k = g
4444 assetBalance(this, k)
4545 }
4646 else wavesBalance(this).available
4747 }
4848
4949
5050 func n (o,p) = {
5151 let g = getInteger(p, o)
5252 if ($isInstanceOf(g, "Int"))
5353 then {
5454 let k = g
5555 k
5656 }
5757 else 0
5858 }
5959
6060
6161 @Callable(q)
6262 func borrow (j,r) = {
6363 let s = m(l(j))
6464 if ((s == s))
6565 then {
6666 let t = fraction(s, a, c)
6767 if ((t >= r))
6868 then [IntegerEntry(((("borrowed_" + toString(q.originCaller)) + "_") + j), r), ScriptTransfer(q.originCaller, r, l(j))]
6969 else throw(((("Requested amount " + toString(r)) + " is bigger than limit: ") + toString(t)))
7070 }
7171 else throw("Strict value is not equal to itself.")
7272 }
7373
7474
7575
7676 @Callable(q)
7777 func repay () = {
7878 let r = value(q.payments[0].amount)
7979 let j = q.payments[0].assetId
8080 let u = n(((("borrowed_" + toString(q.originCaller)) + "_") + i(j)), this)
8181 if ((u > 0))
8282 then {
8383 let v = min([r, u])
8484 let w = (r - v)
8585 let x = if ((w > 0))
8686 then ScriptTransfer(q.originCaller, w, j)
8787 else unit
8888 [IntegerEntry(((("borrowed_" + toString(q.originCaller)) + "_") + i(j)), (u - v))]
8989 }
9090 else throw("You shouldn't repay")
9191 }
9292
9393
9494
9595 @Callable(q)
9696 func flash (j,r,y,z) = {
9797 let A = Address(fromBase58String(y))
9898 let s = m(l(j))
9999 if ((s == s))
100100 then {
101101 let B = invoke(this, "borrow", [j, r], nil)
102102 if ((B == B))
103103 then {
104104 let C = invoke(Address(fromBase58String(y)), z, nil, [AttachedPayment(l(j), r)])
105105 if ((C == C))
106106 then {
107107 let D = fraction(r, b, c)
108108 let E = (r + D)
109109 let F = m(l(j))
110110 if ((F == F))
111111 then if ((F >= s))
112- then [ScriptTransfer(Address(fromBase58String(d)), D, l(j))]
112+ then throw(((("currentBalance: " + toString(s)) + ", newBalance: ") + toString(F)))
113113 else throw(((("Rejected due to low repay amount. Need: " + toString(E)) + ", provided: ") + toString((F - s))))
114114 else throw("Strict value is not equal to itself.")
115115 }
116116 else throw("Strict value is not equal to itself.")
117117 }
118118 else throw("Strict value is not equal to itself.")
119119 }
120120 else throw("Strict value is not equal to itself.")
121121 }
122122
123123

github/deemru/w8io/026f985 
31.12 ms