tx · FrVvPTCtnqpJUSNCojefZuno4FbUdRoMNqhbj6Y1iX9j

3N58U7hA1kzMTCUqHiJGdcPdjxAKspMgGNp:  -0.01000000 Waves

2021.07.16 16:30 [1616223] smart account 3N58U7hA1kzMTCUqHiJGdcPdjxAKspMgGNp > SELF 0.00000000 Waves

{ "type": 13, "id": "FrVvPTCtnqpJUSNCojefZuno4FbUdRoMNqhbj6Y1iX9j", "fee": 1000000, "feeAssetId": null, "timestamp": 1626442259653, "version": 2, "chainId": 84, "sender": "3N58U7hA1kzMTCUqHiJGdcPdjxAKspMgGNp", "senderPublicKey": "85gydchvWB9gMPFCKM6kfLPWFSATbtGog2Y6rUjhtQKT", "proofs": [ "3rmpM64M4bLa8NG9VirCAuRFZF62RUYumx1xfbT9545NSgrWW2DBZQTK5HYQHFHWxH9tzeghBHYtqygBRVSV3pAx" ], "script": "base64:AAIDAAAAAAAAAAkIARIAEgMKAQEAAAAAAAAAAgAAAAFpAQAAAAdkZXBvc2l0AAAAAAQAAAAJc3dhcFRva2VuAQAAABoBVKbhhw1lumsjC/7Bb+h6XQQxRSS4GArgRQQAAAADcG10CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFpAAAAB3BheW1lbnQDCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkCQAAAgAAAAECAAAAIWNhbiBob2RsIHdhdmVzIG9ubHkgYXQgdGhlIG1vbWVudAQAAAAKY3VycmVudEtleQkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAA1jdXJyZW50QW1vdW50BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAACmN1cnJlbnRLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAQAAAAJbmV3QW1vdW50CQAAZAAAAAIFAAAADWN1cnJlbnRBbW91bnQIBQAAAANwbXQAAAAGYW1vdW50CQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAJbmV3QW1vdW50BQAAAAlzd2FwVG9rZW4FAAAAA25pbAAAAAFpAQAAAAh3aXRoZHJhdwAAAAEAAAAGYW1vdW50BAAAAAlzd2FwVG9rZW4BAAAAGgFUpuGHDWW6ayML/sFv6HpdBDFFJLgYCuBFBAAAAApjdXJyZW50S2V5CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAADWN1cnJlbnRBbW91bnQEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAAKY3VycmVudEtleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABAAAAAluZXdBbW91bnQJAABlAAAAAgUAAAANY3VycmVudEFtb3VudAUAAAAGYW1vdW50AwkAAGYAAAACAAAAAAAAAAAABQAAAAZhbW91bnQJAAACAAAAAQIAAAAeQ2FuJ3Qgd2l0aGRyYXcgbmVnYXRpdmUgYW1vdW50AwkAAGYAAAACAAAAAAAAAAAABQAAAAluZXdBbW91bnQJAAACAAAAAQIAAAASTm90IGVub3VnaCBiYWxhbmNlCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAKY3VycmVudEtleQUAAAAJbmV3QW1vdW50BQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAAZhbW91bnQFAAAACXN3YXBUb2tlbgUAAAADbmlsAAAAAGsQhtk=", "height": 1616223, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CA6LK4LYrSMQzVjJLnBu8tGtmTJ9dWJJNYTVfRGE1WAM Next: 8bwq8FdCd7WLjzR7LavyAy8jvmsyZLq8jRBvQi9HGH9F Diff:
OldNewDifferences
55
66 @Callable(i)
77 func deposit () = {
8+ let swapToken = base58'3N58U7hA1kzMTCUqHiJGdcPdjxAKspMgGNp'
89 let pmt = extract(i.payment)
910 if (isDefined(pmt.assetId))
1011 then throw("can hodl waves only at the moment")
1718 0
1819 }
1920 let newAmount = (currentAmount + pmt.amount)
20- WriteSet([DataEntry(currentKey, newAmount)])
21+ TransferSet([ScriptTransfer(i.caller, newAmount, swapToken)])
2122 }
2223 }
2324
2526
2627 @Callable(i)
2728 func withdraw (amount) = {
29+ let swapToken = base58'3N58U7hA1kzMTCUqHiJGdcPdjxAKspMgGNp'
2830 let currentKey = toBase58String(i.caller.bytes)
2931 let currentAmount = match getInteger(this, currentKey) {
3032 case a: Int =>
3739 then throw("Can't withdraw negative amount")
3840 else if ((0 > newAmount))
3941 then throw("Not enough balance")
40- else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)]))
42+ else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, swapToken)]))
4143 }
4244
4345
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(i)
77 func deposit () = {
8+ let swapToken = base58'3N58U7hA1kzMTCUqHiJGdcPdjxAKspMgGNp'
89 let pmt = extract(i.payment)
910 if (isDefined(pmt.assetId))
1011 then throw("can hodl waves only at the moment")
1112 else {
1213 let currentKey = toBase58String(i.caller.bytes)
1314 let currentAmount = match getInteger(this, currentKey) {
1415 case a: Int =>
1516 a
1617 case _ =>
1718 0
1819 }
1920 let newAmount = (currentAmount + pmt.amount)
20- WriteSet([DataEntry(currentKey, newAmount)])
21+ TransferSet([ScriptTransfer(i.caller, newAmount, swapToken)])
2122 }
2223 }
2324
2425
2526
2627 @Callable(i)
2728 func withdraw (amount) = {
29+ let swapToken = base58'3N58U7hA1kzMTCUqHiJGdcPdjxAKspMgGNp'
2830 let currentKey = toBase58String(i.caller.bytes)
2931 let currentAmount = match getInteger(this, currentKey) {
3032 case a: Int =>
3133 a
3234 case _ =>
3335 0
3436 }
3537 let newAmount = (currentAmount - amount)
3638 if ((0 > amount))
3739 then throw("Can't withdraw negative amount")
3840 else if ((0 > newAmount))
3941 then throw("Not enough balance")
40- else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)]))
42+ else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, swapToken)]))
4143 }
4244
4345

github/deemru/w8io/873ac7e 
36.09 ms