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:
OldNewDifferences
55
66 @Callable(i)
77 func buyTokenWithWaves () = {
8+ let timestampBuy = toBase58String(i.caller.bytes)
89 let swapToken = base58'8WTnTr8QxFYKhMo7tkjLigfw2zAFFQYzjpoNdSFruTL3'
910 let pmt = extract(i.payment)
11+ let amount = pmt.amount
1012 if (isDefined(pmt.assetId))
1113 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)]))
1615 }
1716
1817
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(i)
77 func buyTokenWithWaves () = {
8+ let timestampBuy = toBase58String(i.caller.bytes)
89 let swapToken = base58'8WTnTr8QxFYKhMo7tkjLigfw2zAFFQYzjpoNdSFruTL3'
910 let pmt = extract(i.payment)
11+ let amount = pmt.amount
1012 if (isDefined(pmt.assetId))
1113 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)]))
1615 }
1716
1817
1918
2019 @Callable(i)
2120 func sellTokenForWaves () = {
2221 let swapToken = base58'8WTnTr8QxFYKhMo7tkjLigfw2zAFFQYzjpoNdSFruTL3'
2322 let pmt = extract(i.payment)
2423 if ((pmt.assetId != swapToken))
2524 then throw("can hodl Swap Token only.")
2625 else {
2726 let amount = pmt.amount
2827 TransferSet([ScriptTransfer(i.caller, amount, unit)])
2928 }
3029 }
3130
3231

github/deemru/w8io/026f985 
39.32 ms