tx · 7x5MjnTDCKtjCXDbgbrZbrJkHFGnwLQgnKyCEPrvkrDs 3N1ck7kc9gv3MMsAfLUBxGbPbDjQp9KorsK: -0.10000000 Waves 2022.06.04 02:20 [2080820] smart account 3N1ck7kc9gv3MMsAfLUBxGbPbDjQp9KorsK > SELF 0.00000000 Waves
{ "type": 13, "id": "7x5MjnTDCKtjCXDbgbrZbrJkHFGnwLQgnKyCEPrvkrDs", "fee": 10000000, "feeAssetId": null, "timestamp": 1654298508438, "version": 2, "chainId": 84, "sender": "3N1ck7kc9gv3MMsAfLUBxGbPbDjQp9KorsK", "senderPublicKey": "HiJ3uFkbVp87z5kzFCdZQ6uous6Se4iEJ9ja789dTwpS", "proofs": [ "5kCfPnw3tXRwS27J4oSyZoA1RSVK2a2WCEd4ApNgJYAy9VoVcuRBfLGvZ1ob9mQKTTUzqxex8MojtGSEtoHLUsTq" ], "script": "base64:AAIFAAAAAAAAABkIAhIECgIICBIDCgEIEgMKAQgSBQoDCAECAAAADAAAAAAMbG9ja2luZ1N0b3JlAgAAAAZzdGFrZXIAAAAABWFkbWluAgAAAAVhZG1pbgEAAAAEZ2V0SQAAAAEAAAADa2V5CQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQEAAAAEZ2V0UwAAAAEAAAADa2V5CQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQEAAAAFZ2V0SVYAAAABAAAAA2tleQkBAAAABXZhbHVlAAAAAQkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkBAAAABWdldFNWAAAAAQAAAANrZXkJAQAAAAV2YWx1ZQAAAAEJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AQAAAAh3cml0ZUludAAAAAIAAAADa2V5AAAABXZhbHVlAwkAAGYAAAACAAAAAAAAAAAABQAAAAV2YWx1ZQkAAAIAAAABCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAABd3cml0aW5nIG5lZ2F0aXZlIHZhbHVlIAkAAaQAAAABBQAAAAV2YWx1ZQIAA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Mgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAABaQEAAAAQdHJhbnNmZXJJbnRlcmVzdAAAAAMAAAAEdXNlcgAAAAZhbW91bnQAAAAHYXNzZXRJRAQAAAAGY2hlY2tzCQEAAAAQbG9ja2luZ1N0b3JlT25seQAAAAEFAAAAAWkDCQAAAAAAAAIFAAAABmNoZWNrcwUAAAAGY2hlY2tzCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAEFAAAABHVzZXIFAAAABmFtb3VudAUAAAAHYXNzZXRJRAUAAAADbmlsCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAAAqm1dM", "height": 2080820, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EamnWKRvkfWrhRiMQHrj2KcXrWr2Q2979N1Sk8Wusqcx Next: HzZ7JjVr1aFKZ98MsQgwDGfz9D5NX1NnND6pA2QqeWH3 Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let lockingStore = "staker" | |
5 | 5 | ||
6 | 6 | let admin = "admin" | |
7 | 7 | ||
8 | 8 | func getI (key) = getInteger(this, key) | |
9 | 9 | ||
10 | 10 | ||
11 | 11 | func getS (key) = getString(this, key) | |
12 | 12 | ||
13 | 13 | ||
14 | 14 | func getIV (key) = value(getInteger(this, key)) | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | func getSV (key) = value(getString(this, key)) | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func writeInt (key,value) = if ((0 > value)) | |
21 | 21 | then throw(((("writing negative value " + toString(value)) + " for key ") + key)) | |
22 | 22 | else IntegerEntry(key, value) | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func writeStr (key,value) = if ((" " == value)) | |
26 | 26 | then throw(("writing an empty string " + value)) | |
27 | 27 | else StringEntry(key, value) | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func writeConstString (key,value) = if (!(isDefined(getS(key)))) | |
31 | 31 | then writeStr(key, value) | |
32 | 32 | else throw(("already initialized: " + key)) | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func writeConstInteger (key,value) = if (!(isDefined(getS(key)))) | |
36 | 36 | then writeInt(key, value) | |
37 | 37 | else throw(("already initialized: " + key)) | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func lockingStoreOnly (i) = if ((toString(i.caller) != valueOrElse(getString(this, lockingStore), "no store address"))) | |
41 | 41 | then throw("only the staker contract can call this function") | |
42 | 42 | else true | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func adminOnly (i) = if ((toString(i.caller) != valueOrElse(getString(this, admin), "no admin defined"))) | |
46 | 46 | then throw("only an admin can call this function") | |
47 | 47 | else true | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | @Callable(i) | |
51 | 51 | func init (pLockingStore,pAdmin) = [writeConstString(lockingStore, pLockingStore), writeConstString(admin, pAdmin)] | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | ||
55 | 55 | @Callable(i) | |
56 | 56 | func removeLockingStore (address) = { | |
57 | 57 | let checks = adminOnly(i) | |
58 | 58 | if ((checks == checks)) | |
59 | 59 | then [DeleteEntry(lockingStore)] | |
60 | 60 | else throw("Strict value is not equal to itself.") | |
61 | 61 | } | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | ||
65 | 65 | @Callable(i) | |
66 | 66 | func updateLockingStore (address) = { | |
67 | 67 | let checks = adminOnly(i) | |
68 | 68 | if ((checks == checks)) | |
69 | 69 | then [DeleteEntry(lockingStore), writeConstString(lockingStore, address)] | |
70 | 70 | else throw("Strict value is not equal to itself.") | |
71 | 71 | } | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | ||
75 | 75 | @Callable(i) | |
76 | 76 | func transferInterest (user,amount,assetID) = { | |
77 | 77 | let checks = lockingStoreOnly(i) | |
78 | 78 | if ((checks == checks)) | |
79 | 79 | then [ScriptTransfer(addressFromStringValue(user), amount, assetID)] | |
80 | 80 | else throw("Strict value is not equal to itself.") | |
81 | 81 | } | |
82 | 82 | ||
83 | 83 |
github/deemru/w8io/169f3d6 25.41 ms ◑