tx · 2NitVT9qm7RAo3o3U4TUBkZR5MLVUDFZeR5jgg6jnBtx
3N5KWDSz3ynimUoZyu8d7sHQuGhdjPbnj1T: -0.01000000 Waves
2023.09.28 14:06 [2775187] smart account 3N5KWDSz3ynimUoZyu8d7sHQuGhdjPbnj1T > SELF 0.00000000 Waves
{
"type": 13,
"id": "2NitVT9qm7RAo3o3U4TUBkZR5MLVUDFZeR5jgg6jnBtx",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1695899245831,
"version": 2,
"chainId": 84,
"sender": "3N5KWDSz3ynimUoZyu8d7sHQuGhdjPbnj1T",
"senderPublicKey": "DFdS6bGBeh573tRUkRP8LBGiGBfYyrDHm6ABQBfrXyPK",
"proofs": [
"5q8iDPdpmrSuD4Xe2M4TiCVLXZiqRLfhEoRRjJ8gS5iPV7Yk1g36aMhAyzSZ5UPFeZ99VthoUp3HWVSCJbaPDEft"
],
"script": "base64:BgIHCAISAwoBAQEACm1lZGFsQnl0ZXMBIAMKVYdqF5H9gyg/ZcMrzWCgomAWOkqqluAe9d4DSoDcAQFpAQh3aXRoZHJhdwEGYW1vdW50BAZzZW5kZXIJANgEAQgIBQFpBmNhbGxlcgVieXRlcwQNY3VycmVudEFtb3VudAkA8AcCCQEHQWRkcmVzcwEBGgFUqPfbANR0JRp7Ml9c8A9BY7L6KfJFHu9qBQptZWRhbEJ5dGVzBAluZXdBbW91bnQJAGUCBQ1jdXJyZW50QW1vdW50BQZhbW91bnQDCQBmAgAABQZhbW91bnQJAAIBAh9DYW5ub3Qgd2l0aGRyYXcgbmVnYXRpdmUgYW1vdW50AwkAZgIAAAUJbmV3QW1vdW50CQDMCAIJAAIBAhJub3QgZW5vdWdoIGJhbGFuY2UFA25pbAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIFBmFtb3VudAUKbWVkYWxCeXRlcwUDbmlsAOhgGD4=",
"height": 2775187,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 3FwFbAMW61b25cbLZWHEzTwZvHtcqLMiFSx5x8gsn3hS
Next: none
Diff:
Old | New | | Differences |
---|
4 | 4 | | let medalBytes = base58'CsN2rorkXvYvF1buXVxZH8qzxfdsiVgZAiJYRanz24s' |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(i) |
---|
7 | | - | func withdraw (amount,assetId) = { |
---|
| 7 | + | func withdraw (amount) = { |
---|
8 | 8 | | let sender = toBase58String(i.caller.bytes) |
---|
9 | 9 | | let currentAmount = assetBalance(Address(base58'3N5KWDSz3ynimUoZyu8d7sHQuGhdjPbnj1T'), medalBytes) |
---|
10 | 10 | | let newAmount = (currentAmount - amount) |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 6 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let medalBytes = base58'CsN2rorkXvYvF1buXVxZH8qzxfdsiVgZAiJYRanz24s' |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(i) |
---|
7 | | - | func withdraw (amount,assetId) = { |
---|
| 7 | + | func withdraw (amount) = { |
---|
8 | 8 | | let sender = toBase58String(i.caller.bytes) |
---|
9 | 9 | | let currentAmount = assetBalance(Address(base58'3N5KWDSz3ynimUoZyu8d7sHQuGhdjPbnj1T'), medalBytes) |
---|
10 | 10 | | let newAmount = (currentAmount - amount) |
---|
11 | 11 | | if ((0 > amount)) |
---|
12 | 12 | | then throw("Cannot withdraw negative amount") |
---|
13 | 13 | | else if ((0 > newAmount)) |
---|
14 | 14 | | then [throw("not enough balance")] |
---|
15 | 15 | | else [ScriptTransfer(i.caller, amount, medalBytes)] |
---|
16 | 16 | | } |
---|
17 | 17 | | |
---|
18 | 18 | | |
---|