tx · E5KdkibjJL43e5yndhL8a1D1H5DxjMtiwr9rYtthRyMF
3N58U7hA1kzMTCUqHiJGdcPdjxAKspMgGNp: -0.01000000 Waves
2021.07.16 17:37 [1616291] smart account 3N58U7hA1kzMTCUqHiJGdcPdjxAKspMgGNp > SELF 0.00000000 Waves
{
"type": 13,
"id": "E5KdkibjJL43e5yndhL8a1D1H5DxjMtiwr9rYtthRyMF",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1626446342995,
"version": 2,
"chainId": 84,
"sender": "3N58U7hA1kzMTCUqHiJGdcPdjxAKspMgGNp",
"senderPublicKey": "85gydchvWB9gMPFCKM6kfLPWFSATbtGog2Y6rUjhtQKT",
"proofs": [
"5fDtPWPzmzvQRqSwVVhiJnDRqYUAScHekVZcxhCtvmfhmrjMa5Wak6Qbhm3gNf57UdQzkYqebUCNS8VH8KZC6vf8"
],
"script": "base64:AAIDAAAAAAAAAAYIARIAEgAAAAAAAAAAAgAAAAFpAQAAABFidXlUb2tlbldpdGhXYXZlcwAAAAAEAAAACXN3YXBUb2tlbgEAAAAgb43vwMVF3NniH29QbTemn52wAqbd0CJjn9c5H5QYbCgEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50AwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAkAAAIAAAABAgAAACFjYW4gaG9kbCB3YXZlcyBvbmx5IGF0IHRoZSBtb21lbnQEAAAABmFtb3VudAgFAAAAA3BtdAAAAAZhbW91bnQJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAAZhbW91bnQFAAAACXN3YXBUb2tlbgUAAAADbmlsAAAAAWkBAAAAEXNlbGxUb2tlbkZvcldhdmVzAAAAAAQAAAAJc3dhcFRva2VuAQAAACBvje/AxUXc2eIfb1BtN6afnbACpt3QImOf1zkflBhsKAQAAAADcG10CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFpAAAAB3BheW1lbnQDCQAAAAAAAAIIBQAAAANwbXQAAAAHYXNzZXRJZAUAAAAJc3dhcFRva2VuCQAAAgAAAAECAAAAGWNhbiBob2RsIFN3YXAgVG9rZW4gb25seS4EAAAABmFtb3VudAgFAAAAA3BtdAAAAAZhbW91bnQJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAAZhbW91bnQFAAAACXN3YXBUb2tlbgUAAAADbmlsAAAAAP5YQU0=",
"height": 1616291,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 4kgLm4Z8B3qDrdytaQSYq1e7KtpmWFaGGguBaUjxAWfJ
Next: 2mYwm2HrdcSBAERgcTJRVpkJQy9iDa58sRsPUtyhuMyU
Diff:
Old | New | | Differences |
---|
4 | 4 | | |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(i) |
---|
7 | | - | func deposit () = { |
---|
| 7 | + | func buyTokenWithWaves () = { |
---|
8 | 8 | | let swapToken = base58'8WTnTr8QxFYKhMo7tkjLigfw2zAFFQYzjpoNdSFruTL3' |
---|
9 | 9 | | let pmt = extract(i.payment) |
---|
10 | 10 | | if (isDefined(pmt.assetId)) |
---|
|
16 | 16 | | } |
---|
17 | 17 | | |
---|
18 | 18 | | |
---|
| 19 | + | |
---|
| 20 | + | @Callable(i) |
---|
| 21 | + | func sellTokenForWaves () = { |
---|
| 22 | + | let swapToken = base58'8WTnTr8QxFYKhMo7tkjLigfw2zAFFQYzjpoNdSFruTL3' |
---|
| 23 | + | let pmt = extract(i.payment) |
---|
| 24 | + | if ((pmt.assetId == swapToken)) |
---|
| 25 | + | then throw("can hodl Swap Token only.") |
---|
| 26 | + | else { |
---|
| 27 | + | let amount = pmt.amount |
---|
| 28 | + | TransferSet([ScriptTransfer(i.caller, amount, swapToken)]) |
---|
| 29 | + | } |
---|
| 30 | + | } |
---|
| 31 | + | |
---|
| 32 | + | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(i) |
---|
7 | | - | func deposit () = { |
---|
| 7 | + | func buyTokenWithWaves () = { |
---|
8 | 8 | | let swapToken = base58'8WTnTr8QxFYKhMo7tkjLigfw2zAFFQYzjpoNdSFruTL3' |
---|
9 | 9 | | let pmt = extract(i.payment) |
---|
10 | 10 | | if (isDefined(pmt.assetId)) |
---|
11 | 11 | | then throw("can hodl waves only at the moment") |
---|
12 | 12 | | else { |
---|
13 | 13 | | let amount = pmt.amount |
---|
14 | 14 | | TransferSet([ScriptTransfer(i.caller, amount, swapToken)]) |
---|
15 | 15 | | } |
---|
16 | 16 | | } |
---|
17 | 17 | | |
---|
18 | 18 | | |
---|
| 19 | + | |
---|
| 20 | + | @Callable(i) |
---|
| 21 | + | func sellTokenForWaves () = { |
---|
| 22 | + | let swapToken = base58'8WTnTr8QxFYKhMo7tkjLigfw2zAFFQYzjpoNdSFruTL3' |
---|
| 23 | + | let pmt = extract(i.payment) |
---|
| 24 | + | if ((pmt.assetId == swapToken)) |
---|
| 25 | + | then throw("can hodl Swap Token only.") |
---|
| 26 | + | else { |
---|
| 27 | + | let amount = pmt.amount |
---|
| 28 | + | TransferSet([ScriptTransfer(i.caller, amount, swapToken)]) |
---|
| 29 | + | } |
---|
| 30 | + | } |
---|
| 31 | + | |
---|
| 32 | + | |
---|