tx · DC4ZrYkFz6w1y7sHQbL9NiE3ePrFfe7dvSdfdsWjRCXz 3MrcyedG2j6tbHVVuz9NX35W3pH3msoyFx9: -0.01000000 Waves 2019.07.05 23:24 [572686] smart account 3MrcyedG2j6tbHVVuz9NX35W3pH3msoyFx9 > SELF 0.00000000 Waves
{ "type": 13, "id": "DC4ZrYkFz6w1y7sHQbL9NiE3ePrFfe7dvSdfdsWjRCXz", "fee": 1000000, "feeAssetId": null, "timestamp": 1562358260025, "version": 1, "sender": "3MrcyedG2j6tbHVVuz9NX35W3pH3msoyFx9", "senderPublicKey": "8UV4eabrtAA9gekYHs82KZh3LqNaaFzJMDfzea2oSAv4", "proofs": [ "5mcebpT6Zk7bqSrFN5BBeAp5kKDB1yV3AbGohotdPipLtcaJ8cmshLREsz7JWtUwSbV4JSL7RVx5VALgKn5a7rsP" ], "script": "base64:AAIDAAAAAAAAAAAAAAABAAAAAAF1AQAAABoBVNHjVc5bKe92es96JRDP/yfcbI+eDemLtQAAAAIAAAABaQEAAAAHZGVwb3NpdAAAAAAEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50AwkBAAAAAiE9AAAAAggFAAAAA3BtdAAAAAdhc3NldElkBQAAAAF1CQAAAgAAAAECAAAACGFzYXNhc2FzBAAAAARjS2V5CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAAA2NBbQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAARjS2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAEAAAAA25BbQkAAGQAAAACBQAAAANjQW0IBQAAAANwbXQAAAAGYW1vdW50CQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAARjS2V5BQAAAANuQW0FAAAAA25pbAAAAAFpAQAAAAh3aXRoZHJhdwAAAAEAAAAGYW1vdW50BAAAAARjS2V5CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAAA2NBbQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAARjS2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAEAAAAA25BbQkAAGUAAAACBQAAAANjQW0FAAAABmFtb3VudAMJAABmAAAAAgAAAAAAAAAAAAUAAAAGYW1vdW50CQAAAgAAAAECAAAAHWNhbid0IHdpdGhkcmF3IG5lZ2F0aXZlIGFtb3V0AwkAAGYAAAACAAAAAAAAAAAABQAAAANuQW0JAAACAAAAAQIAAAAQbm90IG5vdWdoIGJhbGFjZQkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAABGNLZXkFAAAAA25BbQUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAGYW1vdW50BQAAAAF1BQAAAANuaWwAAAAAXCCFNw==", "chainId": 84, "height": 572686, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let u = base58'3N93sLYBAH7kxZ8KKBspQtTZvUw1byVwqrk' | |
5 | + | ||
6 | + | @Callable(i) | |
7 | + | func deposit () = { | |
8 | + | let pmt = extract(i.payment) | |
9 | + | if ((pmt.assetId != u)) | |
10 | + | then throw("asasasas") | |
11 | + | else { | |
12 | + | let cKey = toBase58String(i.caller.bytes) | |
13 | + | let cAm = match getInteger(this, cKey) { | |
14 | + | case a: Int => | |
15 | + | a | |
16 | + | case _ => | |
17 | + | 0 | |
18 | + | } | |
19 | + | let nAm = (cAm + pmt.amount) | |
20 | + | WriteSet([DataEntry(cKey, nAm)]) | |
21 | + | } | |
22 | + | } | |
23 | + | ||
24 | + | ||
25 | + | ||
26 | + | @Callable(i) | |
27 | + | func withdraw (amount) = { | |
28 | + | let cKey = toBase58String(i.caller.bytes) | |
29 | + | let cAm = match getInteger(this, cKey) { | |
30 | + | case a: Int => | |
31 | + | a | |
32 | + | case _ => | |
33 | + | 0 | |
34 | + | } | |
35 | + | let nAm = (cAm - amount) | |
36 | + | if ((0 > amount)) | |
37 | + | then throw("can't withdraw negative amout") | |
38 | + | else if ((0 > nAm)) | |
39 | + | then throw("not nough balace") | |
40 | + | else ScriptResult(WriteSet([DataEntry(cKey, nAm)]), TransferSet([ScriptTransfer(i.caller, amount, u)])) | |
41 | + | } | |
42 | + | ||
43 | + |
github/deemru/w8io/169f3d6 17.77 ms ◑