tx · 71eERG5QVr4UrbPXczR13XjCNQVJrbkLM8Hd2Ke29EE1

3N2HzcM61QM3LsUrsq4UBvi2btJMHyxvVMD:  -0.00100000 Waves

2022.07.16 17:27 [2142419] smart account 3N2HzcM61QM3LsUrsq4UBvi2btJMHyxvVMD > SELF 0.00000000 Waves

{ "type": 13, "id": "71eERG5QVr4UrbPXczR13XjCNQVJrbkLM8Hd2Ke29EE1", "fee": 100000, "feeAssetId": null, "timestamp": 1657981785493, "version": 2, "chainId": 84, "sender": "3N2HzcM61QM3LsUrsq4UBvi2btJMHyxvVMD", "senderPublicKey": "CU5wMqCBg4bC4Zgs8QGiqjjvmeMkSiKo3Ff6k5axJZwr", "proofs": [ "2m1NXWp1LhAtadNjUArm1XXgZDRcTVY3SZxmLVyxU1ffmxo5FLHnkioQwxCvf35Yt7FQhXR9o7schBtVzV2trsgv" ], "script": "base64:AAIFAAAAAAAAAAwIAhIDCgEBEgMKAQEAAAACAAAAAAVnd1VzZAEAAAAg1td3yV5SV/9sTRnPub7Z/8+5gW83ZtDAi9MIvEJ2JY0AAAAABHVzZG4BAAAAIA/yHBKs5MQ8muxGGqslqLDsugcrRsxtiHLwteKSSQG0AAAAAgAAAAFpAQAAAA9zd2FwR0d1c2RUb1VzZG4AAAABAAAABmFtb3VudAQAAAADcG10CQEAAAAFdmFsdWUAAAABCQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAAAwkBAAAAAiE9AAAAAggFAAAAA3BtdAAAAAdhc3NldElkBQAAAAVnd1VzZAkAAAIAAAABAgAAAClPbmx5IGd3VXNkIHRva2VuIGlzIGFsbG93ZWQgZm9yIHN3YXBwaW5nLgQAAAAKY3VycmVudEtleQkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAA1jdXJyZW50QW1vdW50BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAACmN1cnJlbnRLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAABmFtb3VudAUAAAAEdXNkbgUAAAADbmlsAAAAAWkBAAAAD3N3YXBVc2RuVG9HR3VzZAAAAAEAAAAGYW1vdW50BAAAAANwbXQJAQAAAAV2YWx1ZQAAAAEJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAADCQEAAAACIT0AAAACCAUAAAADcG10AAAAB2Fzc2V0SWQFAAAABHVzZG4JAAACAAAAAQIAAAApT25seSBnd1VzZCB0b2tlbiBpcyBhbGxvd2VkIGZvciBzd2FwcGluZy4EAAAACmN1cnJlbnRLZXkJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAANY3VycmVudEFtb3VudAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAApjdXJyZW50S2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAAZhbW91bnQFAAAABWd3VXNkBQAAAANuaWwAAAAAXLGy8g==", "height": 2142419, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: A2CC27i7kagL5XPhpvnUUDwFAEg9gk2kw9Vor2w4cNk8 Next: FEN1bvLwmpJ3LiRupWbMLXSeFsdWA4Cte2x1uXPSGxdp Diff:
OldNewDifferences
2626
2727 @Callable(i)
2828 func swapUsdnToGGusd (amount) = {
29- let currentKey = toBase58String(i.caller.bytes)
30- let currentAmount = match getInteger(this, currentKey) {
31- case a: Int =>
32- a
33- case _ =>
34- 0
35- }
29+ let pmt = value(i.payments[0])
30+ if ((pmt.assetId != usdn))
31+ then throw("Only gwUsd token is allowed for swapping.")
32+ else {
33+ let currentKey = toBase58String(i.caller.bytes)
34+ let currentAmount = match getInteger(this, currentKey) {
35+ case a: Int =>
36+ a
37+ case _ =>
38+ 0
39+ }
3640 [ScriptTransfer(i.caller, amount, gwUsd)]
41+ }
3742 }
3843
3944
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let gwUsd = base58'FTeosv2BmZED7kBcGnqDy9tba1VdkeodQveSAATMQusJ'
55
66 let usdn = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT'
77
88 @Callable(i)
99 func swapGGusdToUsdn (amount) = {
1010 let pmt = value(i.payments[0])
1111 if ((pmt.assetId != gwUsd))
1212 then throw("Only gwUsd token is allowed for swapping.")
1313 else {
1414 let currentKey = toBase58String(i.caller.bytes)
1515 let currentAmount = match getInteger(this, currentKey) {
1616 case a: Int =>
1717 a
1818 case _ =>
1919 0
2020 }
2121 [ScriptTransfer(i.caller, amount, usdn)]
2222 }
2323 }
2424
2525
2626
2727 @Callable(i)
2828 func swapUsdnToGGusd (amount) = {
29- let currentKey = toBase58String(i.caller.bytes)
30- let currentAmount = match getInteger(this, currentKey) {
31- case a: Int =>
32- a
33- case _ =>
34- 0
35- }
29+ let pmt = value(i.payments[0])
30+ if ((pmt.assetId != usdn))
31+ then throw("Only gwUsd token is allowed for swapping.")
32+ else {
33+ let currentKey = toBase58String(i.caller.bytes)
34+ let currentAmount = match getInteger(this, currentKey) {
35+ case a: Int =>
36+ a
37+ case _ =>
38+ 0
39+ }
3640 [ScriptTransfer(i.caller, amount, gwUsd)]
41+ }
3742 }
3843
3944

github/deemru/w8io/fabc49c 
23.39 ms