tx · 3t1Bv3SgAPk3KKwVReh9VoPV5JMae6xuSUrCYFr4NDX2

3MqRnEd83AoPWjTCHP2PVpFpWg6KbBPCJyo:  -0.01400000 Waves

2019.09.08 12:18 [666907] smart account 3MqRnEd83AoPWjTCHP2PVpFpWg6KbBPCJyo > SELF 0.00000000 Waves

{ "type": 13, "id": "3t1Bv3SgAPk3KKwVReh9VoPV5JMae6xuSUrCYFr4NDX2", "fee": 1400000, "feeAssetId": null, "timestamp": 1567934265076, "version": 1, "sender": "3MqRnEd83AoPWjTCHP2PVpFpWg6KbBPCJyo", "senderPublicKey": "C1VF5w6S6GzcSydWsAbL2czedDrjFAPUeyZ5HknvisxJ", "proofs": [ "u1PzpRQtNXSdeG9SBnKt3Wu1BXDH7LARCXWnqMUUmmKuGVF7KAEuTd8CsVnBNfE2srea9dNNFtwjxTJd7x2dYGo" ], "script": "base64:AAIDAAAAAAAAAAAAAAAAAAAAAgAAAAFpAQAAAAdkZXBvc2l0AAAAAAQAAAADcG10CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFpAAAAB3BheW1lbnQDCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkCQAAAgAAAAECAAAAIWNhbiBob2RsIHdhdmVzIG9ubHkgYXQgdGhlIG1vbWVudAQAAAAKY3VycmVudEtleQkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAA1jdXJyZW50QW1vdW50BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAACmN1cnJlbnRLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAQAAAAFbXlhZHIJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQIAAAAjM05BY29lV2RVVFduOGNzWEpQRzQ3djFGanRqY2ZxeGI1dHUEAAAADGNvcnJlY3RQcmljZQQA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ZhbW91bnQFAAAABHVuaXQFAAAAA25pbAAAAABTXu68", "chainId": 84, "height": 666907, "spentComplexity": 0 } View: original | compacted Prev: GVovjFkysZtDKgmhB13UePQL5LQ3nxn7xzr96EV29BFD Next: 2yQnbe3fbfAQbtphApncNjqY7cJWy9efZEQ5CULosYa4 Diff:
OldNewDifferences
2020 else 0
2121 }
2222 let g = addressFromStringValue("3NAcoeWdUTWn8csXJPG47v1Fjtjcfqxb5tu")
23- let h = getInteger(g, "waves_btc_8")
23+ let h = {
24+ let e = getInteger(g, "waves_btc_8")
25+ if ($isInstanceOf(e, "Int"))
26+ then {
27+ let f = e
28+ f
29+ }
30+ else 0
31+ }
2432 let i = (d + b.amount)
2533 WriteSet([DataEntry(c, i)])
2634 }
35+ }
36+
37+
38+
39+@Callable(a)
40+func withdraw (j) = {
41+ let c = toBase58String(a.caller.bytes)
42+ let d = {
43+ let e = getInteger(this, c)
44+ if ($isInstanceOf(e, "Int"))
45+ then {
46+ let f = e
47+ f
48+ }
49+ else 0
50+ }
51+ let i = (d - j)
52+ if ((0 > j))
53+ then throw("Can't withdraw negative amount")
54+ else if ((0 > i))
55+ then throw("Not enough balance")
56+ else ScriptResult(WriteSet([DataEntry(c, i)]), TransferSet([ScriptTransfer(a.caller, j, unit)]))
2757 }
2858
2959
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(a)
77 func deposit () = {
88 let b = extract(a.payment)
99 if (isDefined(b.assetId))
1010 then throw("can hodl waves only at the moment")
1111 else {
1212 let c = toBase58String(a.caller.bytes)
1313 let d = {
1414 let e = getInteger(this, c)
1515 if ($isInstanceOf(e, "Int"))
1616 then {
1717 let f = e
1818 f
1919 }
2020 else 0
2121 }
2222 let g = addressFromStringValue("3NAcoeWdUTWn8csXJPG47v1Fjtjcfqxb5tu")
23- let h = getInteger(g, "waves_btc_8")
23+ let h = {
24+ let e = getInteger(g, "waves_btc_8")
25+ if ($isInstanceOf(e, "Int"))
26+ then {
27+ let f = e
28+ f
29+ }
30+ else 0
31+ }
2432 let i = (d + b.amount)
2533 WriteSet([DataEntry(c, i)])
2634 }
35+ }
36+
37+
38+
39+@Callable(a)
40+func withdraw (j) = {
41+ let c = toBase58String(a.caller.bytes)
42+ let d = {
43+ let e = getInteger(this, c)
44+ if ($isInstanceOf(e, "Int"))
45+ then {
46+ let f = e
47+ f
48+ }
49+ else 0
50+ }
51+ let i = (d - j)
52+ if ((0 > j))
53+ then throw("Can't withdraw negative amount")
54+ else if ((0 > i))
55+ then throw("Not enough balance")
56+ else ScriptResult(WriteSet([DataEntry(c, i)]), TransferSet([ScriptTransfer(a.caller, j, unit)]))
2757 }
2858
2959

github/deemru/w8io/169f3d6 
32.24 ms