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:
OldNewDifferences
44
55
66 @Callable(i)
7-func deposit () = {
7+func buyTokenWithWaves () = {
88 let swapToken = base58'8WTnTr8QxFYKhMo7tkjLigfw2zAFFQYzjpoNdSFruTL3'
99 let pmt = extract(i.payment)
1010 if (isDefined(pmt.assetId))
1616 }
1717
1818
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:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(i)
7-func deposit () = {
7+func buyTokenWithWaves () = {
88 let swapToken = base58'8WTnTr8QxFYKhMo7tkjLigfw2zAFFQYzjpoNdSFruTL3'
99 let pmt = extract(i.payment)
1010 if (isDefined(pmt.assetId))
1111 then throw("can hodl waves only at the moment")
1212 else {
1313 let amount = pmt.amount
1414 TransferSet([ScriptTransfer(i.caller, amount, swapToken)])
1515 }
1616 }
1717
1818
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+

github/deemru/w8io/169f3d6 
38.33 ms