tx · ARWVvKX2j5QHhMVU8kusvf27aXdgZ1TUZ2CTM6Rdp2ah
3Myes5WidGyaEZamrigMnHxSp7jofp75MKg: -0.01900000 Waves
2020.10.16 20:59 [1223465] smart account 3Myes5WidGyaEZamrigMnHxSp7jofp75MKg > SELF 0.00000000 Waves
{
"type": 13,
"id": "ARWVvKX2j5QHhMVU8kusvf27aXdgZ1TUZ2CTM6Rdp2ah",
"fee": 1900000,
"feeAssetId": null,
"timestamp": 1602871148602,
"version": 2,
"chainId": 84,
"sender": "3Myes5WidGyaEZamrigMnHxSp7jofp75MKg",
"senderPublicKey": "EHphUnoiuXaNVNoUnDN4jPnVYzBfCN8WmL8KKYE2YGLF",
"proofs": [
"DEhSKASFgnwBa84A2ZMW6UhdJy1aqZztqXBJiPSTyn3zByMBok9ZufLFmdV6jXTcziuHCnZLRP43gbn3o4MNEbM"
],
"script": "base64:AAIDAAAAAAAAAAsIARIAEgMKAQESAAAAAAAAAAADAAAAAWkBAAAAB2RlcG9zaXQAAAAABAAAAA9Db2xsYXRlcmFsVG9rZW4BAAAAIEXAbIcI8kUexOI20CBj9o7wm7aY+dhr4NqLF5bb9v1DBAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAMDCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkCQAAAAAAAAIJAQAAAAdleHRyYWN0AAAAAQgFAAAAA3BtdAAAAAdhc3NldElkBQAAAA9Db2xsYXRlcmFsVG9rZW4HBAAAAApjdXJyZW50S2V5CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAADWN1cnJlbnRBbW91bnQEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAAKY3VycmVudEtleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABAAAAAluZXdBbW91bnQJAAB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AAAAGYW1vdW50BQAAAA9Db2xsYXRlcmFsVG9rZW4FAAAAA25pbAAAAAFpAQAAAAhwYXlZaWVsZAAAAAAEAAAAC0dvdmVyblRva2VuAQAAACC8BnLNTH75zY/85pKTg3cOi9DRRgrZqRPS5vvLPGg8zQQAAAAKY3VycmVudEtleQkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAA1jdXJyZW50QW1vdW50CQAD6wAAAAIFAAAABHRoaXMFAAAAC0dvdmVyblRva2VuBAAAAAluZXdBbW91bnQJAABlAAAAAgUAAAANY3VycmVudEFtb3VudAAAAAAAAAAACgMJAABmAAAAAgAAAAAAAAAAAAUAAAAJbmV3QW1vdW50CQAAAgAAAAECAAAAKU5vdCBlbm91Z2ggR292ZXJUb2tlbiBpbiBDb250cmFjdCBCYWxhbmNlCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAKY3VycmVudEtleQUAAAAJbmV3QW1vdW50BQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyAAAAAAAAAAAKBQAAAAtHb3Zlcm5Ub2tlbgUAAAADbmlsAAAAAKRtZus=",
"height": 1223465,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: AjYPw7LWQc7MY5FFQRgbqPyqm1F8Uce95hCekBCjBovP
Next: none
Diff:
Old | New | | Differences |
---|
33 | 33 | | func withdraw (i) = { |
---|
34 | 34 | | let b = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN' |
---|
35 | 35 | | let d = toBase58String(a.caller.bytes) |
---|
36 | | - | let e = assetBalance(this, b) |
---|
| 36 | + | let e = { |
---|
| 37 | + | let f = getInteger(this, d) |
---|
| 38 | + | if ($isInstanceOf(f, "Int")) |
---|
| 39 | + | then { |
---|
| 40 | + | let g = f |
---|
| 41 | + | g |
---|
| 42 | + | } |
---|
| 43 | + | else 0 |
---|
| 44 | + | } |
---|
37 | 45 | | let h = (e - i) |
---|
38 | 46 | | if ((0 > i)) |
---|
39 | 47 | | then throw("Can't withdraw negative amount") |
---|
40 | 48 | | else if ((0 > h)) |
---|
41 | | - | then throw("Not enough CollateralToken in Balance") |
---|
| 49 | + | then throw("Not enough CollateralToken in Contract Balance") |
---|
42 | 50 | | else ScriptResult(WriteSet([DataEntry(d, h)]), TransferSet([ScriptTransfer(a.caller, i, b)])) |
---|
43 | 51 | | } |
---|
44 | 52 | | |
---|
|
51 | 59 | | let e = assetBalance(this, j) |
---|
52 | 60 | | let h = (e - 10) |
---|
53 | 61 | | if ((0 > h)) |
---|
54 | | - | then throw("Not enough GoverToken in Balance") |
---|
| 62 | + | then throw("Not enough GoverToken in Contract Balance") |
---|
55 | 63 | | else ScriptResult(WriteSet([DataEntry(d, h)]), TransferSet([ScriptTransfer(a.caller, 10, j)])) |
---|
56 | 64 | | } |
---|
57 | 65 | | |
---|
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 = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN' |
---|
9 | 9 | | let c = extract(a.payment) |
---|
10 | 10 | | if (if (isDefined(c.assetId)) |
---|
11 | 11 | | then (extract(c.assetId) == b) |
---|
12 | 12 | | else false) |
---|
13 | 13 | | then { |
---|
14 | 14 | | let d = toBase58String(a.caller.bytes) |
---|
15 | 15 | | let e = { |
---|
16 | 16 | | let f = getInteger(this, d) |
---|
17 | 17 | | if ($isInstanceOf(f, "Int")) |
---|
18 | 18 | | then { |
---|
19 | 19 | | let g = f |
---|
20 | 20 | | g |
---|
21 | 21 | | } |
---|
22 | 22 | | else 0 |
---|
23 | 23 | | } |
---|
24 | 24 | | let h = (e + c.amount) |
---|
25 | 25 | | WriteSet([DataEntry(d, h)]) |
---|
26 | 26 | | } |
---|
27 | 27 | | else throw("Can deposit only MyToken") |
---|
28 | 28 | | } |
---|
29 | 29 | | |
---|
30 | 30 | | |
---|
31 | 31 | | |
---|
32 | 32 | | @Callable(a) |
---|
33 | 33 | | func withdraw (i) = { |
---|
34 | 34 | | let b = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN' |
---|
35 | 35 | | let d = toBase58String(a.caller.bytes) |
---|
36 | | - | let e = assetBalance(this, b) |
---|
| 36 | + | let e = { |
---|
| 37 | + | let f = getInteger(this, d) |
---|
| 38 | + | if ($isInstanceOf(f, "Int")) |
---|
| 39 | + | then { |
---|
| 40 | + | let g = f |
---|
| 41 | + | g |
---|
| 42 | + | } |
---|
| 43 | + | else 0 |
---|
| 44 | + | } |
---|
37 | 45 | | let h = (e - i) |
---|
38 | 46 | | if ((0 > i)) |
---|
39 | 47 | | then throw("Can't withdraw negative amount") |
---|
40 | 48 | | else if ((0 > h)) |
---|
41 | | - | then throw("Not enough CollateralToken in Balance") |
---|
| 49 | + | then throw("Not enough CollateralToken in Contract Balance") |
---|
42 | 50 | | else ScriptResult(WriteSet([DataEntry(d, h)]), TransferSet([ScriptTransfer(a.caller, i, b)])) |
---|
43 | 51 | | } |
---|
44 | 52 | | |
---|
45 | 53 | | |
---|
46 | 54 | | |
---|
47 | 55 | | @Callable(a) |
---|
48 | 56 | | func payYield () = { |
---|
49 | 57 | | let j = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ' |
---|
50 | 58 | | let d = toBase58String(a.caller.bytes) |
---|
51 | 59 | | let e = assetBalance(this, j) |
---|
52 | 60 | | let h = (e - 10) |
---|
53 | 61 | | if ((0 > h)) |
---|
54 | | - | then throw("Not enough GoverToken in Balance") |
---|
| 62 | + | then throw("Not enough GoverToken in Contract Balance") |
---|
55 | 63 | | else ScriptResult(WriteSet([DataEntry(d, h)]), TransferSet([ScriptTransfer(a.caller, 10, j)])) |
---|
56 | 64 | | } |
---|
57 | 65 | | |
---|
58 | 66 | | |
---|