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:AAIDAAAAAAAAAAAAAAAAAAAAAgAAAAFpAQAAAAdkZXBvc2l0AAAAAAQAAAADcG10CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFpAAAAB3BheW1lbnQDCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkCQAAAgAAAAECAAAAIWNhbiBob2RsIHdhdmVzIG9ubHkgYXQgdGhlIG1vbWVudAQAAAAKY3VycmVudEtleQkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAA1jdXJyZW50QW1vdW50BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAACmN1cnJlbnRLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAQAAAAFbXlhZHIJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQIAAAAjM05BY29lV2RVVFduOGNzWEpQRzQ3djFGanRqY2ZxeGI1dHUEAAAADGNvcnJlY3R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VyBQAAAAZhbW91bnQFAAAABHVuaXQFAAAAA25pbAAAAABTXu68",
"chainId": 84,
"height": 666907,
"spentComplexity": 0
}
View: original | compacted
Prev: GVovjFkysZtDKgmhB13UePQL5LQ3nxn7xzr96EV29BFD
Next: 2yQnbe3fbfAQbtphApncNjqY7cJWy9efZEQ5CULosYa4
Diff:
Old | New | | Differences |
---|
20 | 20 | | else 0 |
---|
21 | 21 | | } |
---|
22 | 22 | | 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 | + | } |
---|
24 | 32 | | let i = (d + b.amount) |
---|
25 | 33 | | WriteSet([DataEntry(c, i)]) |
---|
26 | 34 | | } |
---|
| 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)])) |
---|
27 | 57 | | } |
---|
28 | 58 | | |
---|
29 | 59 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(a) |
---|
7 | 7 | | func deposit () = { |
---|
8 | 8 | | let b = extract(a.payment) |
---|
9 | 9 | | if (isDefined(b.assetId)) |
---|
10 | 10 | | then throw("can hodl waves only at the moment") |
---|
11 | 11 | | else { |
---|
12 | 12 | | let c = toBase58String(a.caller.bytes) |
---|
13 | 13 | | let d = { |
---|
14 | 14 | | let e = getInteger(this, c) |
---|
15 | 15 | | if ($isInstanceOf(e, "Int")) |
---|
16 | 16 | | then { |
---|
17 | 17 | | let f = e |
---|
18 | 18 | | f |
---|
19 | 19 | | } |
---|
20 | 20 | | else 0 |
---|
21 | 21 | | } |
---|
22 | 22 | | 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 | + | } |
---|
24 | 32 | | let i = (d + b.amount) |
---|
25 | 33 | | WriteSet([DataEntry(c, i)]) |
---|
26 | 34 | | } |
---|
| 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)])) |
---|
27 | 57 | | } |
---|
28 | 58 | | |
---|
29 | 59 | | |
---|