tx · 9XUuyYF5LpKDCzUDPsGCW9JabjFVmFhBa3GQXjJJGFfE 3MshLEZwkjz17HtsouWjFBXrXkPBVBHD7gm: -0.00200000 Waves 2022.07.07 13:21 [2129143] smart account 3MshLEZwkjz17HtsouWjFBXrXkPBVBHD7gm > SELF 0.00000000 Waves
{ "type": 13, "id": "9XUuyYF5LpKDCzUDPsGCW9JabjFVmFhBa3GQXjJJGFfE", "fee": 200000, "feeAssetId": null, "timestamp": 1657189313221, "version": 2, "chainId": 84, "sender": "3MshLEZwkjz17HtsouWjFBXrXkPBVBHD7gm", "senderPublicKey": "CAYySFNuYSLU5jGWNBottZuyHbvGh2JxucGYSXF3aEi8", "proofs": [ "3Qs5SJ4Y8CimzorUYAt8buEqpkHbRhpGktQeMPnadorjBhFjSGqCb7fYMwyt6yDzZgKeoX89acGTPp57Lqm4w2HW" ], "script": "base64:AAIFAAAAAAAAABAIAhIDCgEIEgMKAQgSABIAAAAABAEAAAAMZ2V0T3duZXJBZGRyAAAAAAQAAAAFb3duZXIJAAQdAAAAAgUAAAAEdGhpcwIAAAAFb3duZXIDCQEAAAABIQAAAAEJAQAAAAlpc0RlZmluZWQAAAABBQAAAAVvd25lcgkAAAIAAAABAgAAAAppbml0IGZpcnN0CQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABCQEAAAAFdmFsdWUAAAABBQAAAAVvd25lcgEAAAAKY2hlY2tPd25lcgAAAAEAAAAGY2FsbGVyCQAAAAAAAAIFAAAABmNhbGxlcgkBAAAADGdldE93bmVyQWRkcgAAAAABAAAAE2NoYW5nZU93bmVySW50ZXJuYWwAAAACAAAABmNhbGxlcgAAAARhZGRyAwkBAAAACmNoZWNrT3duZXIAAAABBQAAAAZjYWxsZXIJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgIAAAAFb3duZXIJAAQlAAAAAQUAAAAEYWRkcgUAAAADbmlsCQAAAgAAAAECAAAACk9ubHkgb3duZXIBAAAADGluaXRJbnRlcm5hbAAAAAIAAAAGY2FsbGVyAAAABGFkZHIEAAAABW93bmVyCQAEHQAAAAIFAAAABHRoaXMCAAAABW93bmVyAwMJAAAAAAAAAgUAAAAGY2FsbGVyBQAAAAR0aGlzCQEAAAABIQAAAAEJAQAAAAlpc0RlZmluZWQAAAABBQAAAAVvd25lcgcJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgIAAAAFb3duZXIFAAAABGFkZHIFAAAAA25pbAkAAAIAAAABAgAAAApPbmx5IGFkbWluAAAABAAAAAFpAQAAAAlpbml0T3duZXIAAAABAAAABGFkZHIJAQAAAAxpbml0SW50ZXJuYWwAAAACCAUAAAABaQAAAAZjYWxsZXIFAAAABGFkZHIAAAABaQEAAAALY2hhbmdlT3duZXIAAAABAAAABGFkZHIJAQAAABNjaGFuZ2VPd25lckludGVybmFsAAAAAggFAAAAAWkAAAAGY2FsbGVyCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABBQAAAARhZGRyAAAAAWkBAAAACGNhbGxGdW5jAAAAAAMJAQAAAApjaGVja093bmVyAAAAAQgFAAAAAWkAAAAGY2FsbGVyCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQAEJQAAAAEIBQAAAAFpAAAABmNhbGxlcgUAAAAGaGVpZ2h0BQAAAANuaWwJAAACAAAAAQIAAAAKT25seSBPd25lcgAAAAFpAQAAAAlzaG93T3duZXIAAAAACQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAAATEJAAQlAAAAAQkBAAAADGdldE93bmVyQWRkcgAAAAAFAAAAA25pbAAAAAAJCgWg", "height": 2129143, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3SwY9rYs3WMJLF9jSV7YfHNr5V8SAeebg7DzJCSkHey4 Next: 9J2hPenVVshpSzUZ7Mu7edo5hzSPBmViYPZb5K5WRVxV Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func getOwnerAddr () = { | |
5 | 5 | let owner = getString(this, "owner") | |
6 | 6 | if (!(isDefined(owner))) | |
7 | 7 | then throw("init first") | |
8 | 8 | else addressFromStringValue(value(owner)) | |
9 | 9 | } | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | func checkOwner (caller) = (caller == getOwnerAddr()) | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | func changeOwnerInternal (caller,addr) = if (checkOwner(caller)) | |
16 | 16 | then [StringEntry("owner", toString(addr))] | |
17 | 17 | else throw("Only owner") | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func initInternal (caller,addr) = { | |
21 | 21 | let owner = getString(this, "owner") | |
22 | 22 | if (if ((caller == this)) | |
23 | 23 | then !(isDefined(owner)) | |
24 | 24 | else false) | |
25 | 25 | then [StringEntry("owner", addr)] | |
26 | 26 | else throw("Only admin") | |
27 | 27 | } | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | @Callable(i) | |
31 | 31 | func initOwner (addr) = initInternal(i.caller, addr) | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | ||
35 | 35 | @Callable(i) | |
36 | 36 | func changeOwner (addr) = changeOwnerInternal(i.caller, addressFromStringValue(addr)) | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | ||
40 | 40 | @Callable(i) | |
41 | 41 | func callFunc () = if (checkOwner(i.caller)) | |
42 | 42 | then [IntegerEntry(toString(i.caller), height)] | |
43 | 43 | else throw("Only Owner") | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | ||
47 | 47 | @Callable(i) | |
48 | 48 | func showOwner () = [StringEntry("1", toString(getOwnerAddr()))] | |
49 | 49 | ||
50 | 50 |
github/deemru/w8io/026f985 54.09 ms ◑