tx · 5F3pKCFMx5YJiFho5YYn7tbZJNyXQLWLeJXdLVpRVf6K
3N2HzcM61QM3LsUrsq4UBvi2btJMHyxvVMD: -0.00200000 Waves
2022.07.14 19:03 [2139605] smart account 3N2HzcM61QM3LsUrsq4UBvi2btJMHyxvVMD > SELF 0.00000000 Waves
{
"type": 13,
"id": "5F3pKCFMx5YJiFho5YYn7tbZJNyXQLWLeJXdLVpRVf6K",
"fee": 200000,
"feeAssetId": null,
"timestamp": 1657814638148,
"version": 2,
"chainId": 84,
"sender": "3N2HzcM61QM3LsUrsq4UBvi2btJMHyxvVMD",
"senderPublicKey": "CU5wMqCBg4bC4Zgs8QGiqjjvmeMkSiKo3Ff6k5axJZwr",
"proofs": [
"vY74cLFPD6kNs7qCpSmmTPztWMc2rXfKkkbyLHLezjiSn515YBLVc5tzkWPU6g2Rrv2eHUUF3mux9HaGAmFeCjQ"
],
"script": "base64:AAIDAAAAAAAAAAkIARIAEgMKAQEAAAABAAAAAAdnZ1Rva2VuAQAAACBrVOjHv/ccQBeJZW/zYCjZI72Il39H9014vm+87tzFkAAAAAIAAAABaQEAAAAHZGVwb3NpdAAAAAAEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50AwkBAAAAAiE9AAAAAggFAAAAA3BtdAAAAAdhc3NldElkBQAAAAdnZ1Rva2VuCQAAAgAAAAECAAAATmdnVG9rZW4gOER5aWR2cTh5a1d4bXY2Q3haWlhRdGRqMWFrdGl3UHY0aWJnR1dUZ3hvNWggdG9rZW5zIG9ubHkgYXQgdGhlIG1vbWVudAQAAAAKY3VycmVudEtleQkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAA1jdXJyZW50QW1vdW50BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAACmN1cnJlbnRLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAQAAAAJbmV3QW1vdW50CQAAZAAAAAIFAAAADWN1cnJlbnRBbW91bnQIBQAAAANwbXQAAAAGYW1vdW50CQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAApjdXJyZW50S2V5BQAAAAluZXdBbW91bnQFAAAAA25pbAAAAAFpAQAAAAh3aXRoZHJhdwAAAAEAAAAGYW1vdW50BAAAAApjdXJyZW50S2V5CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAADWN1cnJlbnRBbW91bnQEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAAKY3VycmVudEtleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABAAAAAluZXdBbW91bnQJAABlAAAAAgUAAAANY3VycmVudEFtb3VudAUAAAAGYW1vdW50AwkAAGYAAAACAAAAAAAAAAAABQAAAAZhbW91bnQJAAACAAAAAQIAAAAeQ2FuJ3Qgd2l0aGRyYXcgbmVnYXRpdmUgYW1vdW50AwkAAGYAAAACAAAAAAAAAAAABQAAAAluZXdBbW91bnQJAAACAAAAAQIAAAASTm90IGVub3VnaCBiYWxhbmNlCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAKY3VycmVudEtleQUAAAAJbmV3QW1vdW50BQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAAZhbW91bnQFAAAABHVuaXQFAAAAA25pbAAAAAAGziiX",
"height": 2139605,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 3Ehj6hcTZyFvDTKHB2Bzh5u5j6K6NErjsBaQ42czgayn
Next: D6MbMuk1EUqS8UQ3Z34NeEFBv5rSJm8YteXRWvNRWAxH
Diff:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
| 4 | + | let ggToken = base58'8Dyidvq8ykWxmv6CxZZXQtdj1aktiwPv4ibgGWTgxo5h' |
---|
| 5 | + | |
---|
| 6 | + | @Callable(i) |
---|
| 7 | + | func deposit () = { |
---|
| 8 | + | let pmt = extract(i.payment) |
---|
| 9 | + | if ((pmt.assetId != ggToken)) |
---|
| 10 | + | then throw("ggToken 8Dyidvq8ykWxmv6CxZZXQtdj1aktiwPv4ibgGWTgxo5h tokens only at the moment") |
---|
| 11 | + | else { |
---|
| 12 | + | let currentKey = toBase58String(i.caller.bytes) |
---|
| 13 | + | let currentAmount = match getInteger(this, currentKey) { |
---|
| 14 | + | case a: Int => |
---|
| 15 | + | a |
---|
| 16 | + | case _ => |
---|
| 17 | + | 0 |
---|
| 18 | + | } |
---|
| 19 | + | let newAmount = (currentAmount + pmt.amount) |
---|
| 20 | + | WriteSet([DataEntry(currentKey, newAmount)]) |
---|
| 21 | + | } |
---|
| 22 | + | } |
---|
| 23 | + | |
---|
4 | 24 | | |
---|
5 | 25 | | |
---|
6 | 26 | | @Callable(i) |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
| 4 | + | let ggToken = base58'8Dyidvq8ykWxmv6CxZZXQtdj1aktiwPv4ibgGWTgxo5h' |
---|
| 5 | + | |
---|
| 6 | + | @Callable(i) |
---|
| 7 | + | func deposit () = { |
---|
| 8 | + | let pmt = extract(i.payment) |
---|
| 9 | + | if ((pmt.assetId != ggToken)) |
---|
| 10 | + | then throw("ggToken 8Dyidvq8ykWxmv6CxZZXQtdj1aktiwPv4ibgGWTgxo5h tokens only at the moment") |
---|
| 11 | + | else { |
---|
| 12 | + | let currentKey = toBase58String(i.caller.bytes) |
---|
| 13 | + | let currentAmount = match getInteger(this, currentKey) { |
---|
| 14 | + | case a: Int => |
---|
| 15 | + | a |
---|
| 16 | + | case _ => |
---|
| 17 | + | 0 |
---|
| 18 | + | } |
---|
| 19 | + | let newAmount = (currentAmount + pmt.amount) |
---|
| 20 | + | WriteSet([DataEntry(currentKey, newAmount)]) |
---|
| 21 | + | } |
---|
| 22 | + | } |
---|
| 23 | + | |
---|
4 | 24 | | |
---|
5 | 25 | | |
---|
6 | 26 | | @Callable(i) |
---|
7 | 27 | | func withdraw (amount) = { |
---|
8 | 28 | | let currentKey = toBase58String(i.caller.bytes) |
---|
9 | 29 | | let currentAmount = match getInteger(this, currentKey) { |
---|
10 | 30 | | case a: Int => |
---|
11 | 31 | | a |
---|
12 | 32 | | case _ => |
---|
13 | 33 | | 0 |
---|
14 | 34 | | } |
---|
15 | 35 | | let newAmount = (currentAmount - amount) |
---|
16 | 36 | | if ((0 > amount)) |
---|
17 | 37 | | then throw("Can't withdraw negative amount") |
---|
18 | 38 | | else if ((0 > newAmount)) |
---|
19 | 39 | | then throw("Not enough balance") |
---|
20 | 40 | | else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)])) |
---|
21 | 41 | | } |
---|
22 | 42 | | |
---|
23 | 43 | | |
---|