tx · 6id63iDe5KAG9tNySyTiNHvQYFDZs7aooWaD1C8rxmsL
3MxeNALaUgGSkVy7eXsg95v3e1Wh3vteUAk: -0.01000000 Waves
2020.10.14 20:18 [1220514] smart account 3MxeNALaUgGSkVy7eXsg95v3e1Wh3vteUAk > SELF 0.00000000 Waves
{
"type": 13,
"id": "6id63iDe5KAG9tNySyTiNHvQYFDZs7aooWaD1C8rxmsL",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1602695911299,
"version": 2,
"chainId": 84,
"sender": "3MxeNALaUgGSkVy7eXsg95v3e1Wh3vteUAk",
"senderPublicKey": "BaL6pbP4xCN2Jsv2oXzbTwuyBSMZmWWfYzQENwxzn6Uz",
"proofs": [
"2C4VuvpxyLF8NgjcVQV38TvLCKnhM4U2FeFk7WpyBNPqBgPYr8D2kBakySRtpCvYcQ7ekHxP7cVpxte1YDbyj7Y"
],
"script": "base64:AAIDAAAAAAAAAAQIARIAAAAAAQEAAAAKZ2V0QmFsYW5jZQAAAAEAAAAHYWRkcmVzcwQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAAdhZGRyZXNzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAAAAABAAAAAWkBAAAAB2RlcG9zaXQAAAAABAAAAAdNeVRva2VuAQAAACBnlI60/6aGpTs6AWB3Z3fme76uLBJhXVO7m0SCsEN5ZgQAAAAGY2FsbGVyCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAADmN1cnJlbnRCYWxhbmNlCQEAAAAKZ2V0QmFsYW5jZQAAAAEFAAAABmNhbGxlcgQAAAAHcGF5bWVudAQAAAAHJG1hdGNoMAgFAAAAAWkAAAAHcGF5bWVudAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPQXR0YWNoZWRQYXltZW50BAAAAAFwBQAAAAckbWF0Y2gwBQAAAAFwCQAAAgAAAAECAAAAKFlvdSBoYXZlIHRvIHByb3ZpZGUgYSBwYXltZW50IHRvIGRlcG9zaXQDCQEAAAACIT0AAAACCAUAAAAHcGF5bWVudAAAAAdhc3NldElkBQAAAAdNeVRva2VuCQAAAgAAAAECAAAAE0Nhbm5vdCBwYXkgaW4gV0FWRVMEAAAACm5ld0JhbGFuY2UJAABkAAAAAgUAAAAOY3VycmVudEJhbGFuY2UIBQAAAAdwYXltZW50AAAABmFtb3VudAkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAGY2FsbGVyBQAAAApuZXdCYWxhbmNlBQAAAANuaWwAAAAAOanjPw==",
"height": 1220514,
"applicationStatus": "succeeded",
"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 | + | func getBalance (address) = match getInteger(this, address) { |
---|
| 5 | + | case a: Int => |
---|
| 6 | + | a |
---|
| 7 | + | case _ => |
---|
| 8 | + | 0 |
---|
| 9 | + | } |
---|
| 10 | + | |
---|
| 11 | + | |
---|
| 12 | + | @Callable(i) |
---|
| 13 | + | func deposit () = { |
---|
| 14 | + | let MyToken = base58'7yLNv2JPqTfmv8FUe7yFoDnkayE76pHgfH9r9n7cVDU9' |
---|
| 15 | + | let caller = toBase58String(i.caller.bytes) |
---|
| 16 | + | let currentBalance = getBalance(caller) |
---|
| 17 | + | let payment = match i.payment { |
---|
| 18 | + | case p: AttachedPayment => |
---|
| 19 | + | p |
---|
| 20 | + | case _ => |
---|
| 21 | + | throw("You have to provide a payment to deposit") |
---|
| 22 | + | } |
---|
| 23 | + | if ((payment.assetId != MyToken)) |
---|
| 24 | + | then throw("Cannot pay in WAVES") |
---|
| 25 | + | else { |
---|
| 26 | + | let newBalance = (currentBalance + payment.amount) |
---|
| 27 | + | WriteSet([DataEntry(caller, newBalance)]) |
---|
| 28 | + | } |
---|
| 29 | + | } |
---|
| 30 | + | |
---|
| 31 | + | |
---|