tx · 3df1uov6jKwcgW9c8qBGWTzjjnu31QhygjgsyyuKkTob

3Myes5WidGyaEZamrigMnHxSp7jofp75MKg:  -1.00000000 Waves

2020.10.16 19:50 [1223401] smart account 3Myes5WidGyaEZamrigMnHxSp7jofp75MKg > SELF 0.00000000 Waves

{ "type": 13, "id": "3df1uov6jKwcgW9c8qBGWTzjjnu31QhygjgsyyuKkTob", "fee": 100000000, "feeAssetId": null, "timestamp": 1602867012234, "version": 2, "chainId": 84, "sender": "3Myes5WidGyaEZamrigMnHxSp7jofp75MKg", "senderPublicKey": "EHphUnoiuXaNVNoUnDN4jPnVYzBfCN8WmL8KKYE2YGLF", "proofs": [ "4FrXTNwqjfK61rDJbqaNkCpKezgEsPYGQeHzxrc4E1DfdCu4HdfhfovRNudLPDi56hJSvxhQtNkfuYRQWKRg9qhE" ], "script": "base64:AAIDAAAAAAAAAAsIARIAEgMKAQESAAAAAAAAAAADAAAAAWkBAAAAB2RlcG9zaXQAAAAABAAAAA9Db2xsYXRlcmFsVG9rZW4BAAAAIEXAbIcI8kUexOI20CBj9o7wm7aY+dhr4NqLF5bb9v1DBAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAMDCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkCQAAAAAAAAIJAQAAAAdleHRyYWN0AAAAAQgFAAAAA3BtdAAAAAdhc3NldElkBQAAAA9Db2xsYXRlcmFsVG9rZW4HBAAAAApjdXJyZW50S2V5CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAADWN1cnJlbnRBbW91bnQEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAAKY3VycmVudEtleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABAAAAAluZXdBbW91bnQJAABkAAAAAgUAAAANY3VycmV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/85pKTg3cOi9DRRgrZqRPS5vvLPGg8zQQAAAAKY3VycmVudEtleQkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAA1jdXJyZW50QW1vdW50CQAD6wAAAAIFAAAABHRoaXMFAAAAC0dvdmVyblRva2VuBAAAAAluZXdBbW91bnQJAABlAAAAAgUAAAANY3VycmVudEFtb3VudAAAAAAAAAAACgMJAABmAAAAAgAAAAAAAAAAAAUAAAAJbmV3QW1vdW50CQAAAgAAAAECAAAAIE5vdCBlbm91Z2ggR292ZXJUb2tlbiBpbiBCYWxhbmNlCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAKY3VycmVudEtleQUAAAAJbmV3QW1vdW50BQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyAAAAAAAAAAAKBQAAAAtHb3Zlcm5Ub2tlbgUAAAADbmlsAAAAAHNTHNY=", "height": 1223401, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Ebb9yS2gdVCoyMnW4Dz3BLX1dLKDettp8FiS96LAsdEE Next: AjYPw7LWQc7MY5FFQRgbqPyqm1F8Uce95hCekBCjBovP Diff:
OldNewDifferences
3030 func withdraw (amount) = {
3131 let CollateralToken = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN'
3232 let currentKey = toBase58String(i.caller.bytes)
33- let currentAmount = match getInteger(this, currentKey) {
34- case a: Int =>
35- a
36- case _ =>
37- 0
38- }
33+ let currentAmount = assetBalance(this, CollateralToken)
3934 let newAmount = (currentAmount - amount)
4035 if ((0 > amount))
4136 then throw("Can't withdraw negative amount")
4237 else if ((0 > newAmount))
43- then throw("Not enough balance")
38+ then throw("Not enough CollateralToken in Balance")
4439 else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, CollateralToken)]))
4540 }
4641
5045 func payYield () = {
5146 let GovernToken = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ'
5247 let currentKey = toBase58String(i.caller.bytes)
53- let currentAmount = match getInteger(this, currentKey) {
54- case a: Int =>
55- a
56- case _ =>
57- 0
58- }
48+ let currentAmount = assetBalance(this, GovernToken)
5949 let newAmount = (currentAmount - 10)
6050 if ((0 > newAmount))
61- then throw("Not enough Governance balance in the Contract")
51+ then throw("Not enough GoverToken in Balance")
6252 else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, 10, GovernToken)]))
6353 }
6454
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(i)
77 func deposit () = {
88 let CollateralToken = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN'
99 let pmt = extract(i.payment)
1010 if (if (isDefined(pmt.assetId))
1111 then (extract(pmt.assetId) == CollateralToken)
1212 else false)
1313 then {
1414 let currentKey = toBase58String(i.caller.bytes)
1515 let currentAmount = match getInteger(this, currentKey) {
1616 case a: Int =>
1717 a
1818 case _ =>
1919 0
2020 }
2121 let newAmount = (currentAmount + pmt.amount)
2222 WriteSet([DataEntry(currentKey, newAmount)])
2323 }
2424 else throw("Can deposit only MyToken")
2525 }
2626
2727
2828
2929 @Callable(i)
3030 func withdraw (amount) = {
3131 let CollateralToken = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN'
3232 let currentKey = toBase58String(i.caller.bytes)
33- let currentAmount = match getInteger(this, currentKey) {
34- case a: Int =>
35- a
36- case _ =>
37- 0
38- }
33+ let currentAmount = assetBalance(this, CollateralToken)
3934 let newAmount = (currentAmount - amount)
4035 if ((0 > amount))
4136 then throw("Can't withdraw negative amount")
4237 else if ((0 > newAmount))
43- then throw("Not enough balance")
38+ then throw("Not enough CollateralToken in Balance")
4439 else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, CollateralToken)]))
4540 }
4641
4742
4843
4944 @Callable(i)
5045 func payYield () = {
5146 let GovernToken = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ'
5247 let currentKey = toBase58String(i.caller.bytes)
53- let currentAmount = match getInteger(this, currentKey) {
54- case a: Int =>
55- a
56- case _ =>
57- 0
58- }
48+ let currentAmount = assetBalance(this, GovernToken)
5949 let newAmount = (currentAmount - 10)
6050 if ((0 > newAmount))
61- then throw("Not enough Governance balance in the Contract")
51+ then throw("Not enough GoverToken in Balance")
6252 else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, 10, GovernToken)]))
6353 }
6454
6555

github/deemru/w8io/026f985 
41.53 ms