tx · A23sR2sNWSQDrFEB3io77bLk2Tp2sMkJp3119GQDj5go
3NC7GJvfMCykyTMSe9KU2rJmVygk1fzzKpC: -0.01400000 Waves
2020.04.10 13:05 [948102] smart account 3NC7GJvfMCykyTMSe9KU2rJmVygk1fzzKpC > SELF 0.00000000 Waves
{
"type": 13,
"id": "A23sR2sNWSQDrFEB3io77bLk2Tp2sMkJp3119GQDj5go",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1586513145060,
"version": 1,
"sender": "3NC7GJvfMCykyTMSe9KU2rJmVygk1fzzKpC",
"senderPublicKey": "BNrrKkZSXXCbcCtXLT3VMQnSAJt2jt8TLnZWaB5US3Ci",
"proofs": [
"2qGsECRsaVLHYBC8Tvj8iXBDgSYKbopPEPvS8xsQxTpBR4Vsfmb6i94dFKB4H7LBxAF57sQVjCLyVkbaxntTLrLX"
],
"script": "base64:AAIDAAAAAAAAAAoIARIAEgQKAgEIAAAABAAAAAAEdXNkbgEAAAAgImQ/Hr5gRukRahMT3KYz/hZ+B/l36bPyFfyZSSowCjcBAAAACmdldEJhbGFuY2UAAAACAAAAB2FkZHJlc3MAAAAHYXNzZXRJZAQAAAABYgkABBoAAAACBQAAAAR0aGlzCQABLAAAAAIJAAEsAAAAAgUAAAAHYWRkcmVzcwIAAAABXwUAAAAHYXNzZXRJZAQAAAAHJG1hdGNoMAUAAAABYgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAF0BQAAAAckbWF0Y2gwBQAAAAF0AAAAAAAAAAAAAQAAAApnZXRBc3NldElkAAAAAQAAAAdhc3NldElkBAAAAAckbWF0Y2gwBQAAAAdhc3NldElkAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAApCeXRlVmVjdG9yBAAAAAFiBQAAAAckbWF0Y2gwCQACWAAAAAEFAAAAAWICAAAABVdBVkVTAQAAAA5hc3NldElkVG9CeXRlcwAAAAEAAAAHYXNzZXRJZAMJAAAAAAAAAgUAAAAHYXNzZXRJZAIAAAA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3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAGYW1vdW50CQEAAAAOYXNzZXRJZFRvQnl0ZXMAAAABBQAAAAdhc3NldElkBQAAAANuaWwJAAACAAAAAQkAASwAAAACAgAAABBZb3VyIGJhbGFuY2UgaXMgCQABpAAAAAEFAAAAA2JhbAAAAACIdwrz",
"chainId": 84,
"height": 948102,
"spentComplexity": 0
}
View: original | compacted
Prev: 8SALX1ha7bkpGdEABvRuym5YaAmEnCKypqCV94DEYzer
Next: D1pfZeBq4bqTMMABvr8SAsC3RfyNwiakJC9Je2fHgeDf
Diff:
Old | New | | Differences |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let a = base58'3KFXBGGLCjA5Z2DuW4Dq9fDDrHjJJP1ZEkaoajSzuKsC' |
---|
5 | 5 | | |
---|
6 | | - | func b (c) = { |
---|
7 | | - | let d = getInteger(this, c) |
---|
8 | | - | let e = d |
---|
9 | | - | if ($isInstanceOf(e, "Int")) |
---|
| 6 | + | func b (c,d) = { |
---|
| 7 | + | let e = getInteger(this, ((c + "_") + d)) |
---|
| 8 | + | let f = e |
---|
| 9 | + | if ($isInstanceOf(f, "Int")) |
---|
10 | 10 | | then { |
---|
11 | | - | let f = e |
---|
12 | | - | f |
---|
| 11 | + | let g = f |
---|
| 12 | + | g |
---|
13 | 13 | | } |
---|
14 | 14 | | else 0 |
---|
15 | 15 | | } |
---|
16 | 16 | | |
---|
17 | 17 | | |
---|
18 | | - | @Callable(g) |
---|
| 18 | + | func h (d) = { |
---|
| 19 | + | let f = d |
---|
| 20 | + | if ($isInstanceOf(f, "ByteVector")) |
---|
| 21 | + | then { |
---|
| 22 | + | let e = f |
---|
| 23 | + | toBase58String(e) |
---|
| 24 | + | } |
---|
| 25 | + | else "WAVES" |
---|
| 26 | + | } |
---|
| 27 | + | |
---|
| 28 | + | |
---|
| 29 | + | func i (d) = if ((d == "WAVES")) |
---|
| 30 | + | then unit |
---|
| 31 | + | else fromBase58String(d) |
---|
| 32 | + | |
---|
| 33 | + | |
---|
| 34 | + | @Callable(j) |
---|
19 | 35 | | func deposit () = { |
---|
20 | | - | let c = toBase58String(g.caller.bytes) |
---|
21 | | - | let h = b(c) |
---|
22 | | - | let i = extract(g.payment) |
---|
23 | | - | if ((i.assetId == a)) |
---|
24 | | - | then ScriptResult(WriteSet([DataEntry(c, (h + i.amount))]), TransferSet(nil)) |
---|
25 | | - | else throw("Should be USDN") |
---|
| 36 | + | let c = toBase58String(j.caller.bytes) |
---|
| 37 | + | let k = extract(j.payment) |
---|
| 38 | + | let d = h(k.assetId) |
---|
| 39 | + | let l = b(c, d) |
---|
| 40 | + | ScriptResult(WriteSet([DataEntry(((c + "_") + d), (l + k.amount))]), TransferSet(nil)) |
---|
26 | 41 | | } |
---|
27 | 42 | | |
---|
28 | 43 | | |
---|
29 | 44 | | |
---|
30 | | - | @Callable(g) |
---|
31 | | - | func withdraw (j) = { |
---|
32 | | - | let c = toBase58String(g.caller.bytes) |
---|
33 | | - | let h = b(c) |
---|
34 | | - | if ((h >= j)) |
---|
35 | | - | then ScriptResult(WriteSet([DataEntry(c, (h - j))]), TransferSet([ScriptTransfer(g.caller, j, a)])) |
---|
36 | | - | else throw(("Your balance is " + toString(h))) |
---|
| 45 | + | @Callable(j) |
---|
| 46 | + | func withdraw (m,d) = { |
---|
| 47 | + | let c = toBase58String(j.caller.bytes) |
---|
| 48 | + | let l = b(c, d) |
---|
| 49 | + | if ((l >= m)) |
---|
| 50 | + | then ScriptResult(WriteSet([DataEntry(((c + "_") + d), (l - m))]), TransferSet([ScriptTransfer(j.caller, m, i(d))])) |
---|
| 51 | + | else throw(("Your balance is " + toString(l))) |
---|
37 | 52 | | } |
---|
38 | 53 | | |
---|
39 | 54 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let a = base58'3KFXBGGLCjA5Z2DuW4Dq9fDDrHjJJP1ZEkaoajSzuKsC' |
---|
5 | 5 | | |
---|
6 | | - | func b (c) = { |
---|
7 | | - | let d = getInteger(this, c) |
---|
8 | | - | let e = d |
---|
9 | | - | if ($isInstanceOf(e, "Int")) |
---|
| 6 | + | func b (c,d) = { |
---|
| 7 | + | let e = getInteger(this, ((c + "_") + d)) |
---|
| 8 | + | let f = e |
---|
| 9 | + | if ($isInstanceOf(f, "Int")) |
---|
10 | 10 | | then { |
---|
11 | | - | let f = e |
---|
12 | | - | f |
---|
| 11 | + | let g = f |
---|
| 12 | + | g |
---|
13 | 13 | | } |
---|
14 | 14 | | else 0 |
---|
15 | 15 | | } |
---|
16 | 16 | | |
---|
17 | 17 | | |
---|
18 | | - | @Callable(g) |
---|
| 18 | + | func h (d) = { |
---|
| 19 | + | let f = d |
---|
| 20 | + | if ($isInstanceOf(f, "ByteVector")) |
---|
| 21 | + | then { |
---|
| 22 | + | let e = f |
---|
| 23 | + | toBase58String(e) |
---|
| 24 | + | } |
---|
| 25 | + | else "WAVES" |
---|
| 26 | + | } |
---|
| 27 | + | |
---|
| 28 | + | |
---|
| 29 | + | func i (d) = if ((d == "WAVES")) |
---|
| 30 | + | then unit |
---|
| 31 | + | else fromBase58String(d) |
---|
| 32 | + | |
---|
| 33 | + | |
---|
| 34 | + | @Callable(j) |
---|
19 | 35 | | func deposit () = { |
---|
20 | | - | let c = toBase58String(g.caller.bytes) |
---|
21 | | - | let h = b(c) |
---|
22 | | - | let i = extract(g.payment) |
---|
23 | | - | if ((i.assetId == a)) |
---|
24 | | - | then ScriptResult(WriteSet([DataEntry(c, (h + i.amount))]), TransferSet(nil)) |
---|
25 | | - | else throw("Should be USDN") |
---|
| 36 | + | let c = toBase58String(j.caller.bytes) |
---|
| 37 | + | let k = extract(j.payment) |
---|
| 38 | + | let d = h(k.assetId) |
---|
| 39 | + | let l = b(c, d) |
---|
| 40 | + | ScriptResult(WriteSet([DataEntry(((c + "_") + d), (l + k.amount))]), TransferSet(nil)) |
---|
26 | 41 | | } |
---|
27 | 42 | | |
---|
28 | 43 | | |
---|
29 | 44 | | |
---|
30 | | - | @Callable(g) |
---|
31 | | - | func withdraw (j) = { |
---|
32 | | - | let c = toBase58String(g.caller.bytes) |
---|
33 | | - | let h = b(c) |
---|
34 | | - | if ((h >= j)) |
---|
35 | | - | then ScriptResult(WriteSet([DataEntry(c, (h - j))]), TransferSet([ScriptTransfer(g.caller, j, a)])) |
---|
36 | | - | else throw(("Your balance is " + toString(h))) |
---|
| 45 | + | @Callable(j) |
---|
| 46 | + | func withdraw (m,d) = { |
---|
| 47 | + | let c = toBase58String(j.caller.bytes) |
---|
| 48 | + | let l = b(c, d) |
---|
| 49 | + | if ((l >= m)) |
---|
| 50 | + | then ScriptResult(WriteSet([DataEntry(((c + "_") + d), (l - m))]), TransferSet([ScriptTransfer(j.caller, m, i(d))])) |
---|
| 51 | + | else throw(("Your balance is " + toString(l))) |
---|
37 | 52 | | } |
---|
38 | 53 | | |
---|
39 | 54 | | |
---|