tx · G8k4qTBpBxQEEdmNeBz8tMwd5SbMi2dJF9siW1bDqf9c
3Mq5upPvyutNuEDeYttuzZfQHv4Y4uXuvv5: -0.05000000 Waves
2021.08.13 13:34 [1656474] smart account 3Mq5upPvyutNuEDeYttuzZfQHv4Y4uXuvv5 > SELF 0.00000000 Waves
{
"type": 13,
"id": "G8k4qTBpBxQEEdmNeBz8tMwd5SbMi2dJF9siW1bDqf9c",
"fee": 5000000,
"feeAssetId": null,
"timestamp": 1628850894376,
"version": 2,
"chainId": 84,
"sender": "3Mq5upPvyutNuEDeYttuzZfQHv4Y4uXuvv5",
"senderPublicKey": "97jE6RtnPXGL5TBusvVdFPvxKvHs6wgfQhjd2MphH8ot",
"proofs": [
"2kNC7ECJWwvC3F835YZG5QyB2LQ3zXK1A94faSYCdJqRtiafbqc2qJmmmbv9iYBnA8C5drpq5bb4Tn3XgFTHvMF1"
],
"script": "base64:AAIFAAAAAAAAAAQIAhIAAAAAAgAAAAAKc3dvcGZpRGFwcAEAAAAaAVS7fkwF5/jEJRcQSrDfBm+fkq1pHbOmsDQAAAAABnVzZG5JZAEAAAAgbySjyqsw3FIpmOgsYVruWn8jTcItdbvpnapU4NLQB8EAAAABAAAAAWkBAAAAC3J1bkV4Y2hhbmdlAAAAAAQAAAAJJHQwMjQ1MzIwCQAFFAAAAAIICQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAAAAAABmFtb3VudAgJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAAAAAHYXNzZXRJZAQAAAAJcG10QW1vdW50CAUAAAAJJHQwMjQ1MzIwAAAAAl8xBAAAAApwbXRBc3NldElkCAUAAAAJJHQwMjQ1MzIwAAAAAl8yBAAAAAdwYXltZW50CQEAAAAPQXR0YWNoZWRQYXltZW50AAAAAgUAAAAKcG10QXNzZXRJZAUAAAAJcG10QW1vdW50BAAAAAxzdGFydEJhbGFuY2UJAAPwAAAAAgUAAAAEdGhpcwUAAAAGdXNkbklkAwkAAAAAAAACBQAAAAxzdGFydEJhbGFuY2UFAAAADHN0YXJ0QmFsYW5jZQQAAAABcgkAA/wAAAAECQEAAAAHQWRkcmVzcwAAAAEFAAAACnN3b3BmaURhcHACAAAACGV4Y2hhbmdlCQAETAAAAAIAAAAAAAAAAAEFAAAAA25pbAkABEwAAAACBQAAAAdwYXltZW50BQAAAANuaWwDCQAAAAAAAAIFAAAAAXIFAAAAAXIEAAAABGRpZmYJAABlAAAAAgkAA/AAAAACBQAAAAR0aGlzBQAAAAZ1c2RuSWQFAAAADHN0YXJ0QmFsYW5jZQMJAAAAAAAAAgUAAAAEZGlmZgUAAAAEZGlmZgkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAABGRpZmYFAAAABnVzZG5JZAUAAAADbmlsCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXlxPFEk",
"height": 1656474,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 2rES9P5FKjBucvoVxPLLxiwWhJTHX3HFHaWxQqzLUXp5
Next: 7VMzXJ6UAdFaErwHJcRUuArNqPvyuSDJtgmSMrc1qW5i
Diff:
Old | New | | Differences |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let swopfiDapp = base58'3N71TS4RSqLDJgLw2h9cdwUwhfQ7aBoaFb1' |
---|
5 | 5 | | |
---|
| 6 | + | let usdnId = base58'8UrfDVd5GreeUwm7uPk7eYz1eMv376kzR52C6sANPkwS' |
---|
| 7 | + | |
---|
6 | 8 | | @Callable(i) |
---|
7 | 9 | | func runExchange () = { |
---|
8 | | - | let $t0179254 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) |
---|
9 | | - | let pmtAmount = $t0179254._1 |
---|
10 | | - | let pmtAssetId = $t0179254._2 |
---|
| 10 | + | let $t0245320 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) |
---|
| 11 | + | let pmtAmount = $t0245320._1 |
---|
| 12 | + | let pmtAssetId = $t0245320._2 |
---|
11 | 13 | | let payment = AttachedPayment(pmtAssetId, pmtAmount) |
---|
12 | | - | let r = invoke(Address(swopfiDapp), "exchange", [1], [payment]) |
---|
13 | | - | if ((r == r)) |
---|
14 | | - | then nil |
---|
| 14 | + | let startBalance = assetBalance(this, usdnId) |
---|
| 15 | + | if ((startBalance == startBalance)) |
---|
| 16 | + | then { |
---|
| 17 | + | let r = invoke(Address(swopfiDapp), "exchange", [1], [payment]) |
---|
| 18 | + | if ((r == r)) |
---|
| 19 | + | then { |
---|
| 20 | + | let diff = (assetBalance(this, usdnId) - startBalance) |
---|
| 21 | + | if ((diff == diff)) |
---|
| 22 | + | then [ScriptTransfer(i.caller, diff, usdnId)] |
---|
| 23 | + | else throw("Strict value is not equal to itself.") |
---|
| 24 | + | } |
---|
| 25 | + | else throw("Strict value is not equal to itself.") |
---|
| 26 | + | } |
---|
15 | 27 | | else throw("Strict value is not equal to itself.") |
---|
16 | 28 | | } |
---|
17 | 29 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let swopfiDapp = base58'3N71TS4RSqLDJgLw2h9cdwUwhfQ7aBoaFb1' |
---|
5 | 5 | | |
---|
| 6 | + | let usdnId = base58'8UrfDVd5GreeUwm7uPk7eYz1eMv376kzR52C6sANPkwS' |
---|
| 7 | + | |
---|
6 | 8 | | @Callable(i) |
---|
7 | 9 | | func runExchange () = { |
---|
8 | | - | let $t0179254 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) |
---|
9 | | - | let pmtAmount = $t0179254._1 |
---|
10 | | - | let pmtAssetId = $t0179254._2 |
---|
| 10 | + | let $t0245320 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) |
---|
| 11 | + | let pmtAmount = $t0245320._1 |
---|
| 12 | + | let pmtAssetId = $t0245320._2 |
---|
11 | 13 | | let payment = AttachedPayment(pmtAssetId, pmtAmount) |
---|
12 | | - | let r = invoke(Address(swopfiDapp), "exchange", [1], [payment]) |
---|
13 | | - | if ((r == r)) |
---|
14 | | - | then nil |
---|
| 14 | + | let startBalance = assetBalance(this, usdnId) |
---|
| 15 | + | if ((startBalance == startBalance)) |
---|
| 16 | + | then { |
---|
| 17 | + | let r = invoke(Address(swopfiDapp), "exchange", [1], [payment]) |
---|
| 18 | + | if ((r == r)) |
---|
| 19 | + | then { |
---|
| 20 | + | let diff = (assetBalance(this, usdnId) - startBalance) |
---|
| 21 | + | if ((diff == diff)) |
---|
| 22 | + | then [ScriptTransfer(i.caller, diff, usdnId)] |
---|
| 23 | + | else throw("Strict value is not equal to itself.") |
---|
| 24 | + | } |
---|
| 25 | + | else throw("Strict value is not equal to itself.") |
---|
| 26 | + | } |
---|
15 | 27 | | else throw("Strict value is not equal to itself.") |
---|
16 | 28 | | } |
---|
17 | 29 | | |
---|
18 | 30 | | |
---|
19 | 31 | | @Verifier(tx) |
---|
20 | 32 | | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
21 | 33 | | |
---|