tx · CUarzkQMVUx7fWm3M8aTre5ZYkVWNXNqkNK8vD2ZPBQ8
3N58U7hA1kzMTCUqHiJGdcPdjxAKspMgGNp: -0.01000000 Waves
2021.07.16 19:19 [1616393] smart account 3N58U7hA1kzMTCUqHiJGdcPdjxAKspMgGNp > SELF 0.00000000 Waves
{
"type": 13,
"id": "CUarzkQMVUx7fWm3M8aTre5ZYkVWNXNqkNK8vD2ZPBQ8",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1626452345446,
"version": 2,
"chainId": 84,
"sender": "3N58U7hA1kzMTCUqHiJGdcPdjxAKspMgGNp",
"senderPublicKey": "85gydchvWB9gMPFCKM6kfLPWFSATbtGog2Y6rUjhtQKT",
"proofs": [
"4JNY48MhbqUTmPJrf1UavsiEZSGu5TDG5WWX56FMT1hWRbjYz4RAKKiQRpEMuvToDfwT2qfL6ekeXJDB8ow3tsfH"
],
"script": "base64:AAIDAAAAAAAAAAYIARIAEgAAAAAAAAAAAgAAAAFpAQAAABFidXlUb2tlbldpdGhXYXZlcwAAAAAEAAAADHRpbWVzdGFtcEJ1eQkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAAlzd2FwVG9rZW4BAAAAIG+N78DFRdzZ4h9vUG03pp+dsAKm3dAiY5/XOR+UGGwoBAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAQAAAAGYW1vdW50CAUAAAADcG10AAAABmFtb3VudAMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAhY2FuIGhvZGwgd2F2ZXMgb25seSBhdCB0aGUgbW9tZW50CQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAMdGltZXN0YW1wQnV5BQAAAAZhbW91bnQFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAABmFtb3VudAUAAAAEdW5pdAUAAAADbmlsAAAAAWkBAAAAEXNlbGxUb2tlbkZvcldhdmVzAAAAAAQAAAAJc3dhcFRva2VuAQAAACBvje/AxUXc2eIfb1BtN6afnbACpt3QImOf1zkflBhsKAQAAAADcG10CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFpAAAAB3BheW1lbnQDCQEAAAACIT0AAAACCAUAAAADcG10AAAAB2Fzc2V0SWQFAAAACXN3YXBUb2tlbgkAAAIAAAABAgAAABljYW4gaG9kbCBTd2FwIFRva2VuIG9ubHkuBAAAAAZhbW91bnQIBQAAAANwbXQAAAAGYW1vdW50CQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAGYW1vdW50BQAAAAR1bml0BQAAAANuaWwAAAAAyVQHfA==",
"height": 1616393,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: D5NVaF36NCs9vv7115Wtr8RyDDJ8tG5gGVyvCDQ8Z41n
Next: none
Diff:
Old | New | | Differences |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(i) |
---|
7 | 7 | | func buyTokenWithWaves () = { |
---|
| 8 | + | let timestampBuy = toBase58String(i.caller.bytes) |
---|
8 | 9 | | let swapToken = base58'8WTnTr8QxFYKhMo7tkjLigfw2zAFFQYzjpoNdSFruTL3' |
---|
9 | 10 | | let pmt = extract(i.payment) |
---|
| 11 | + | let amount = pmt.amount |
---|
10 | 12 | | if (isDefined(pmt.assetId)) |
---|
11 | 13 | | then throw("can hodl waves only at the moment") |
---|
12 | | - | else { |
---|
13 | | - | let amount = pmt.amount |
---|
14 | | - | TransferSet([ScriptTransfer(i.caller, amount, swapToken)]) |
---|
15 | | - | } |
---|
| 14 | + | else ScriptResult(WriteSet([DataEntry(timestampBuy, amount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)])) |
---|
16 | 15 | | } |
---|
17 | 16 | | |
---|
18 | 17 | | |
---|
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 | 7 | | func buyTokenWithWaves () = { |
---|
| 8 | + | let timestampBuy = toBase58String(i.caller.bytes) |
---|
8 | 9 | | let swapToken = base58'8WTnTr8QxFYKhMo7tkjLigfw2zAFFQYzjpoNdSFruTL3' |
---|
9 | 10 | | let pmt = extract(i.payment) |
---|
| 11 | + | let amount = pmt.amount |
---|
10 | 12 | | if (isDefined(pmt.assetId)) |
---|
11 | 13 | | then throw("can hodl waves only at the moment") |
---|
12 | | - | else { |
---|
13 | | - | let amount = pmt.amount |
---|
14 | | - | TransferSet([ScriptTransfer(i.caller, amount, swapToken)]) |
---|
15 | | - | } |
---|
| 14 | + | else ScriptResult(WriteSet([DataEntry(timestampBuy, amount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)])) |
---|
16 | 15 | | } |
---|
17 | 16 | | |
---|
18 | 17 | | |
---|
19 | 18 | | |
---|
20 | 19 | | @Callable(i) |
---|
21 | 20 | | func sellTokenForWaves () = { |
---|
22 | 21 | | let swapToken = base58'8WTnTr8QxFYKhMo7tkjLigfw2zAFFQYzjpoNdSFruTL3' |
---|
23 | 22 | | let pmt = extract(i.payment) |
---|
24 | 23 | | if ((pmt.assetId != swapToken)) |
---|
25 | 24 | | then throw("can hodl Swap Token only.") |
---|
26 | 25 | | else { |
---|
27 | 26 | | let amount = pmt.amount |
---|
28 | 27 | | TransferSet([ScriptTransfer(i.caller, amount, unit)]) |
---|
29 | 28 | | } |
---|
30 | 29 | | } |
---|
31 | 30 | | |
---|
32 | 31 | | |
---|