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+pZTRYABtbI5go6O3BawJgjgnJaTVUAAAADAAAAAWkBAAAAD3N3YXBHR3VzZFRvVXNkbgAAAAEAAAAGYW1vdW50BAAAAANwbXQJAQAAAAV2YWx1ZQAAAAEJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAADCQEAAAACIT0AAAACCAUAAAADcG10AAAAB2Fzc2V0SWQFAAAABWd3VXNkCQAAAgAAAAECAAAAKU9ubHkgZ3dVc2QgdG9rZW4gaXMgYWxsb3dlZCBmb3Igc3dhcHBpbmcuBAAAAApjdXJyZW50S2V5CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAADWN1cnJlbnRB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bG93ZWQgZm9yIHN0YWtpbmcuBAAAAANyZXMJAAP8AAAABAkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQIAAAAjM05Dcm9LeHBDV0NZaWp3amlWQmc2aGMyVDdEYWFqckh1QnICAAAAA3B1dAUAAAADbmlsCQAETAAAAAIJAQAAAA9BdHRhY2hlZFBheW1lbnQAAAACAQAAACAP8hwSrOTEPJrsRhqrJaiw7LoHK0bMbYhy8LXikkkBtAAAAAAAAJiWgAUAAAADbmlsAwkAAAAAAAACBQAAAANyZXMFAAAAA3JlcwQAAAAHJG1hdGNoMAUAAAADcmVzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAXIFAAAAByRtYXRjaDAJAAUUAAAAAgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAAEa2V5MQUAAAABcgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAAEa2V5MggJAAPvAAAAAQkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQIAAAAjM05Dcm9LeHBDV0NZaWp3amlWQmc2aGMyVDdEYWFqckh1QnIAAAAHcmVndWxhcgUAAAADbmlsBQAAAAR1bml0CQAAAgAAAAECAAAAF0luY29ycmVjdCBpbnZva2UgcmVzdWx0CQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAADJSnS5",
"height": 2143883,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 71eERG5QVr4UrbPXczR13XjCNQVJrbkLM8Hd2Ke29EE1
Next: 6WEM4fJuGM4VhVN5KnQ9LuvqmEEUNHwkbMJfghbAGJA7
Diff:
Old | New | | Differences |
---|
4 | 4 | | let gwUsd = base58'FTeosv2BmZED7kBcGnqDy9tba1VdkeodQveSAATMQusJ' |
---|
5 | 5 | | |
---|
6 | 6 | | let usdn = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT' |
---|
| 7 | + | |
---|
| 8 | + | let usdnDapp = base58'3NCroKxpCWCYijwjiVBg6hc2T7DaajrHuBr' |
---|
7 | 9 | | |
---|
8 | 10 | | @Callable(i) |
---|
9 | 11 | | func swapGGusdToUsdn (amount) = { |
---|
|
28 | 30 | | func swapUsdnToGGusd (amount) = { |
---|
29 | 31 | | let pmt = value(i.payments[0]) |
---|
30 | 32 | | if ((pmt.assetId != usdn)) |
---|
31 | | - | then throw("Only gwUsd token is allowed for swapping.") |
---|
| 33 | + | then throw("Only usdn token is allowed for swapping.") |
---|
32 | 34 | | else { |
---|
33 | 35 | | let currentKey = toBase58String(i.caller.bytes) |
---|
34 | 36 | | let currentAmount = match getInteger(this, currentKey) { |
---|
|
42 | 44 | | } |
---|
43 | 45 | | |
---|
44 | 46 | | |
---|
| 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:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let gwUsd = base58'FTeosv2BmZED7kBcGnqDy9tba1VdkeodQveSAATMQusJ' |
---|
5 | 5 | | |
---|
6 | 6 | | let usdn = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT' |
---|
| 7 | + | |
---|
| 8 | + | let usdnDapp = base58'3NCroKxpCWCYijwjiVBg6hc2T7DaajrHuBr' |
---|
7 | 9 | | |
---|
8 | 10 | | @Callable(i) |
---|
9 | 11 | | func swapGGusdToUsdn (amount) = { |
---|
10 | 12 | | let pmt = value(i.payments[0]) |
---|
11 | 13 | | if ((pmt.assetId != gwUsd)) |
---|
12 | 14 | | then throw("Only gwUsd token is allowed for swapping.") |
---|
13 | 15 | | else { |
---|
14 | 16 | | let currentKey = toBase58String(i.caller.bytes) |
---|
15 | 17 | | let currentAmount = match getInteger(this, currentKey) { |
---|
16 | 18 | | case a: Int => |
---|
17 | 19 | | a |
---|
18 | 20 | | case _ => |
---|
19 | 21 | | 0 |
---|
20 | 22 | | } |
---|
21 | 23 | | [ScriptTransfer(i.caller, amount, usdn)] |
---|
22 | 24 | | } |
---|
23 | 25 | | } |
---|
24 | 26 | | |
---|
25 | 27 | | |
---|
26 | 28 | | |
---|
27 | 29 | | @Callable(i) |
---|
28 | 30 | | func swapUsdnToGGusd (amount) = { |
---|
29 | 31 | | let pmt = value(i.payments[0]) |
---|
30 | 32 | | if ((pmt.assetId != usdn)) |
---|
31 | | - | then throw("Only gwUsd token is allowed for swapping.") |
---|
| 33 | + | then throw("Only usdn token is allowed for swapping.") |
---|
32 | 34 | | else { |
---|
33 | 35 | | let currentKey = toBase58String(i.caller.bytes) |
---|
34 | 36 | | let currentAmount = match getInteger(this, currentKey) { |
---|
35 | 37 | | case a: Int => |
---|
36 | 38 | | a |
---|
37 | 39 | | case _ => |
---|
38 | 40 | | 0 |
---|
39 | 41 | | } |
---|
40 | 42 | | [ScriptTransfer(i.caller, amount, gwUsd)] |
---|
41 | 43 | | } |
---|
42 | 44 | | } |
---|
43 | 45 | | |
---|
44 | 46 | | |
---|
| 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 | + | |
---|