tx · GLyrLF6RKj1TKqJUMZAn4v3p1vV3takXxsrptFNyiTKH

3MsfPLcgQY8V3SpQss9hw5ydZ3SdoooQ9xy:  -0.00700000 Waves

2022.09.29 20:18 [2250687] smart account 3MsfPLcgQY8V3SpQss9hw5ydZ3SdoooQ9xy > SELF 0.00000000 Waves

{ "type": 13, "id": "GLyrLF6RKj1TKqJUMZAn4v3p1vV3takXxsrptFNyiTKH", "fee": 700000, "feeAssetId": null, "timestamp": 1664471920536, "version": 2, "chainId": 84, "sender": "3MsfPLcgQY8V3SpQss9hw5ydZ3SdoooQ9xy", "senderPublicKey": "4mZ3UeajXYuJVqUiK9DfeKYAVuR279UJFfMQi4WBbBnf", "proofs": [ "2Uzr1pkhwQ429WX2Khc19eznvD1P3Na5VvG3kZuqbxsGzMT2q9WmK9eGi12EJ85h74RHALiuSXsNenggHVwm1DNT" ], "script": "base64:AAIFAAAAAAAAAAwIAhIICgYICAgICAEAAAAGAAAAAAVydWxlcgIAAAAsQmd4cENtNHd4Ylc4U0tMUEtabmY0S1UyRDZaVTI5b3Y4TWdacmthU0FxcFkAAAAACGJvYm1hX2lkAgAAACw1eHlyVW9KdVhKY1l4YzhSZnJvV2o0UWVMYXc2eGhCZkFkU3JlU3RZQ1JNbgAAAAAIYnVnZ3NfaWQCAAAALEg1VVV1UEo3V0JYempnNloxYWhCVXhqN1ZXb1ZGRmZHM0JNenlBQW5SV3Q2AQAAAA5nZXRBc3NldFN0cmluZwAAAAEAAAAHYXNzZXRJZAQAAAAHJG1hdGNoMAUAAAAHYXNzZXRJZAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAKQnl0ZVZlY3RvcgQAAAABYgUAAAAHJG1hdGNoMAkAAlgAAAABBQAAAAFiAgAAAAVXQVZFUwEAAAANZ2V0QXNzZXRCeXRlcwAAAAEAAAAHYXNzZXRJZAMJAAAAAAAAAgUAAAAHYXNzZXRJZAIAAAAFV0FWRVMFAAAABHVuaXQJAAJZAAAAAQUAAAAHYXNzZX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AAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXnL35lc", "height": 2250687, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 966iURjdFwRzoAnk3AdtLMob75U4ZycvuGRFvKLtMrtH Next: yoFPvLMMopFFiAQ5DvX1yShyQckP82qGHgCoMfSXvC8 Diff:
OldNewDifferences
4343 if ((entry1 == entry1))
4444 then {
4545 let nb = myBalance(getAssetBytes(a))
46- let entry2 = if ((p1t == "p"))
47- then invoke(Address(toBytes(p2)), "swap", [assetIn, 0], [AttachedPayment(getAssetBytes(a), nb)])
48- else invoke(Address(toBytes(p2)), "exchange", [0], [AttachedPayment(getAssetBytes(a), nb)])
49- if ((entry2 == entry2))
46+ if ((nb == nb))
5047 then {
51- let nb2 = myBalance(assetIn)
52- if ((nb2 > amountIn))
53- then [ScriptTransfer(i.caller, nb2, assetIn)]
54- else throw(("Ooops, " + toString(nb2)))
48+ let entry2 = if ((p1t == "p"))
49+ then invoke(Address(toBytes(p2)), "swap", [assetIn, 0], [AttachedPayment(getAssetBytes(a), nb)])
50+ else invoke(Address(toBytes(p2)), "exchange", [0], [AttachedPayment(getAssetBytes(a), nb)])
51+ if ((entry2 == entry2))
52+ then {
53+ let nb2 = myBalance(assetIn)
54+ if ((nb2 == nb2))
55+ then if ((nb2 > amountIn))
56+ then [ScriptTransfer(i.caller, nb2, assetIn)]
57+ else throw(("Ooops, " + toString(nb2)))
58+ else throw("Strict value is not equal to itself.")
59+ }
60+ else throw("Strict value is not equal to itself.")
5561 }
5662 else throw("Strict value is not equal to itself.")
5763 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let ruler = "BgxpCm4wxbW8SKLPKZnf4KU2D6ZU29ov8MgZrkaSAqpY"
55
66 let bobma_id = "5xyrUoJuXJcYxc8RfroWj4QeLaw6xhBfAdSreStYCRMn"
77
88 let buggs_id = "H5UUuPJ7WBXzjg6Z1ahBUxj7VWoVFFfG3BMzyAAnRWt6"
99
1010 func getAssetString (assetId) = match assetId {
1111 case b: ByteVector =>
1212 toBase58String(b)
1313 case _ =>
1414 "WAVES"
1515 }
1616
1717
1818 func getAssetBytes (assetId) = if ((assetId == "WAVES"))
1919 then unit
2020 else fromBase58String(assetId)
2121
2222
2323 func myBalance (assetId) = match assetId {
2424 case b: ByteVector =>
2525 assetBalance(this, b)
2626 case _ =>
2727 wavesBalance(this).available
2828 }
2929
3030
3131 @Callable(i)
3232 func trade (a,p1,p1t,p2,p2t,min) = {
3333 let callerPbk = toBase58String(i.callerPublicKey)
3434 if ((callerPbk != ruler))
3535 then throw("No-no-no")
3636 else {
3737 let pmt = i.payments[0]
3838 let assetIn = value(pmt.assetId)
3939 let amountIn = value(pmt.amount)
4040 let entry1 = if ((p1t == "p"))
4141 then invoke(Address(fromBase58String(p1)), "swap", [a, 0], [AttachedPayment(assetIn, amountIn)])
4242 else invoke(Address(fromBase58String(p1)), "exchange", [0], [AttachedPayment(assetIn, amountIn)])
4343 if ((entry1 == entry1))
4444 then {
4545 let nb = myBalance(getAssetBytes(a))
46- let entry2 = if ((p1t == "p"))
47- then invoke(Address(toBytes(p2)), "swap", [assetIn, 0], [AttachedPayment(getAssetBytes(a), nb)])
48- else invoke(Address(toBytes(p2)), "exchange", [0], [AttachedPayment(getAssetBytes(a), nb)])
49- if ((entry2 == entry2))
46+ if ((nb == nb))
5047 then {
51- let nb2 = myBalance(assetIn)
52- if ((nb2 > amountIn))
53- then [ScriptTransfer(i.caller, nb2, assetIn)]
54- else throw(("Ooops, " + toString(nb2)))
48+ let entry2 = if ((p1t == "p"))
49+ then invoke(Address(toBytes(p2)), "swap", [assetIn, 0], [AttachedPayment(getAssetBytes(a), nb)])
50+ else invoke(Address(toBytes(p2)), "exchange", [0], [AttachedPayment(getAssetBytes(a), nb)])
51+ if ((entry2 == entry2))
52+ then {
53+ let nb2 = myBalance(assetIn)
54+ if ((nb2 == nb2))
55+ then if ((nb2 > amountIn))
56+ then [ScriptTransfer(i.caller, nb2, assetIn)]
57+ else throw(("Ooops, " + toString(nb2)))
58+ else throw("Strict value is not equal to itself.")
59+ }
60+ else throw("Strict value is not equal to itself.")
5561 }
5662 else throw("Strict value is not equal to itself.")
5763 }
5864 else throw("Strict value is not equal to itself.")
5965 }
6066 }
6167
6268
6369 @Verifier(tx)
6470 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
6571

github/deemru/w8io/169f3d6 
28.82 ms