tx · FEN1bvLwmpJ3LiRupWbMLXSeFsdWA4Cte2x1uXPSGxdp

3N2HzcM61QM3LsUrsq4UBvi2btJMHyxvVMD:  -0.00200000 Waves

2022.07.17 17:32 [2143883] smart account 3N2HzcM61QM3LsUrsq4UBvi2btJMHyxvVMD > SELF 0.00000000 Waves

{ "type": 13, "id": "FEN1bvLwmpJ3LiRupWbMLXSeFsdWA4Cte2x1uXPSGxdp", "fee": 200000, "feeAssetId": null, "timestamp": 1658068440678, "version": 2, "chainId": 84, "sender": "3N2HzcM61QM3LsUrsq4UBvi2btJMHyxvVMD", "senderPublicKey": "CU5wMqCBg4bC4Zgs8QGiqjjvmeMkSiKo3Ff6k5axJZwr", "proofs": [ "32yCdmU8iAQAdfLhTxZRcL4LhZ67ZxdUzsxgBpB9VzxSGMxS6JsVFxWuV21UfF67Mgg32d8PeiyF2GYwGE73hxiZ" ], "script": "base64:AAIFAAAAAAAAABIIAhIDCgEBEgMKAQESBAoCCAgAAAADAAAAAAVnd1VzZAEAAAAg1td3yV5SV/9sTRnPub7Z/8+5gW83ZtDAi9MIvEJ2JY0AAAAABHVzZG4BAAAAIA/yHBKs5MQ8muxGGqslqLDsugcrRsxtiHLwteKSSQG0AAAAAAh1c2RuRGFwcAEAAAAaAVT7q+pZTRYABtbI5go6O3BawJgjgnJaTVUAAAADAAAAAWkBAAAAD3N3YXBHR3VzZFRvVXNkbgAAAAEAAAAGYW1vdW50BAAAAANwbXQJAQAAAAV2YWx1ZQAAAAEJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAADCQEAAAACIT0AAAACCAUAAAADcG10AAAAB2Fzc2V0SWQFAAAABWd3VXNkCQAAAgAAAAECAAAAKU9ubHkgZ3dVc2QgdG9rZW4gaXMgYWxsb3dlZCBmb3Igc3dhcHBpbmcuBAAAAApjdXJyZW50S2V5CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAADWN1cnJlbnRBbW91bnQEAA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m9yIHN0YWtpbmcuBAAAAANyZXMJAAP8AAAABAkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQIAAAAjM05Dcm9LeHBDV0NZaWp3amlWQmc2aGMyVDdEYWFqckh1QnICAAAAA3B1dAUAAAADbmlsCQAETAAAAAIJAQAAAA9BdHRhY2hlZFBheW1lbnQAAAACAQAAACAP8hwSrOTEPJrsRhqrJaiw7LoHK0bMbYhy8LXikkkBtAAAAAAAAJiWgAUAAAADbmlsAwkAAAAAAAACBQAAAANyZXMFAAAAA3JlcwQAAAAHJG1hdGNoMAUAAAADcmVzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAXIFAAAAByRtYXRjaDAJAAUUAAAAAgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAAEa2V5MQUAAAABcgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAAEa2V5MggJAAPvAAAAAQkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQIAAAAjM05Dcm9LeHBDV0NZaWp3amlWQmc2aGMyVDdEYWFqckh1QnIAAAAHcmVndWxhcgUAAAADbmlsBQAAAAR1bml0CQAAAgAAAAECAAAAF0luY29ycmVjdCBpbnZva2UgcmVzdWx0CQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAADJSnS5", "height": 2143883, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 71eERG5QVr4UrbPXczR13XjCNQVJrbkLM8Hd2Ke29EE1 Next: 6WEM4fJuGM4VhVN5KnQ9LuvqmEEUNHwkbMJfghbAGJA7 Diff:
OldNewDifferences
44 let gwUsd = base58'FTeosv2BmZED7kBcGnqDy9tba1VdkeodQveSAATMQusJ'
55
66 let usdn = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT'
7+
8+let usdnDapp = base58'3NCroKxpCWCYijwjiVBg6hc2T7DaajrHuBr'
79
810 @Callable(i)
911 func swapGGusdToUsdn (amount) = {
2830 func swapUsdnToGGusd (amount) = {
2931 let pmt = value(i.payments[0])
3032 if ((pmt.assetId != usdn))
31- then throw("Only gwUsd token is allowed for swapping.")
33+ then throw("Only usdn token is allowed for swapping.")
3234 else {
3335 let currentKey = toBase58String(i.caller.bytes)
3436 let currentAmount = match getInteger(this, currentKey) {
4244 }
4345
4446
47+
48+@Callable(i)
49+func putUsdnLp (key1,key2) = {
50+ let pmt = value(i.payments[0])
51+ if ((pmt.assetId != usdn))
52+ then throw("Only usdn token is allowed for staking.")
53+ else {
54+ let res = invoke(addressFromStringValue("3NCroKxpCWCYijwjiVBg6hc2T7DaajrHuBr"), "put", nil, [AttachedPayment(base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT', 10000000)])
55+ if ((res == res))
56+ then match res {
57+ case r: Int =>
58+ $Tuple2([IntegerEntry(key1, r), IntegerEntry(key2, wavesBalance(addressFromStringValue("3NCroKxpCWCYijwjiVBg6hc2T7DaajrHuBr")).regular)], unit)
59+ case _ =>
60+ throw("Incorrect invoke result")
61+ }
62+ else throw("Strict value is not equal to itself.")
63+ }
64+ }
65+
66+
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'
7+
8+let usdnDapp = base58'3NCroKxpCWCYijwjiVBg6hc2T7DaajrHuBr'
79
810 @Callable(i)
911 func swapGGusdToUsdn (amount) = {
1012 let pmt = value(i.payments[0])
1113 if ((pmt.assetId != gwUsd))
1214 then throw("Only gwUsd token is allowed for swapping.")
1315 else {
1416 let currentKey = toBase58String(i.caller.bytes)
1517 let currentAmount = match getInteger(this, currentKey) {
1618 case a: Int =>
1719 a
1820 case _ =>
1921 0
2022 }
2123 [ScriptTransfer(i.caller, amount, usdn)]
2224 }
2325 }
2426
2527
2628
2729 @Callable(i)
2830 func swapUsdnToGGusd (amount) = {
2931 let pmt = value(i.payments[0])
3032 if ((pmt.assetId != usdn))
31- then throw("Only gwUsd token is allowed for swapping.")
33+ then throw("Only usdn token is allowed for swapping.")
3234 else {
3335 let currentKey = toBase58String(i.caller.bytes)
3436 let currentAmount = match getInteger(this, currentKey) {
3537 case a: Int =>
3638 a
3739 case _ =>
3840 0
3941 }
4042 [ScriptTransfer(i.caller, amount, gwUsd)]
4143 }
4244 }
4345
4446
47+
48+@Callable(i)
49+func putUsdnLp (key1,key2) = {
50+ let pmt = value(i.payments[0])
51+ if ((pmt.assetId != usdn))
52+ then throw("Only usdn token is allowed for staking.")
53+ else {
54+ let res = invoke(addressFromStringValue("3NCroKxpCWCYijwjiVBg6hc2T7DaajrHuBr"), "put", nil, [AttachedPayment(base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT', 10000000)])
55+ if ((res == res))
56+ then match res {
57+ case r: Int =>
58+ $Tuple2([IntegerEntry(key1, r), IntegerEntry(key2, wavesBalance(addressFromStringValue("3NCroKxpCWCYijwjiVBg6hc2T7DaajrHuBr")).regular)], unit)
59+ case _ =>
60+ throw("Incorrect invoke result")
61+ }
62+ else throw("Strict value is not equal to itself.")
63+ }
64+ }
65+
66+

github/deemru/w8io/fabc49c 
25.88 ms