tx · JBAbTbkWmXcsbqYwr3kAc7b7CNeeRojUcsEGzmd7B8we 3MxXA443AARoS3rQ9RNdPeBur74yBTCTyxJ: -0.03200000 Waves 2022.08.03 12:28 [2168124] smart account 3MxXA443AARoS3rQ9RNdPeBur74yBTCTyxJ > SELF 0.00000000 Waves
{ "type": 13, "id": "JBAbTbkWmXcsbqYwr3kAc7b7CNeeRojUcsEGzmd7B8we", "fee": 3200000, "feeAssetId": null, "timestamp": 1659518951150, "version": 2, "chainId": 84, "sender": "3MxXA443AARoS3rQ9RNdPeBur74yBTCTyxJ", "senderPublicKey": "Dhf95pPhxwKtWsqgf6tyeDW2xpQA7TvM8nTwbwgqKjkd", "proofs": [ "4rwsqjm7MyTDCZhkJQCrd4CkxJ1zJLJVayrHuQoe5GjyX8Z2ZhDChvU3Lr4j4GkANJjHYfkEgXNRQFBieSmoQKhu" ], "script": "base64:AAIFAAAAAAAAACwIAhIDCgEIEgMKAQgSAwoBCBIECgIICBIDCgEIEgQKAggIEgMKAQgSAwoBCAAAABEAAAAAE2tfaW5zdXJhbmNlX2FkZHJlc3MCAAAAE2tfaW5zdXJhbmNlX2FkZHJlc3MAAAAAD2tfYWRtaW5fYWRkcmVzcwIAAAAPa19hZG1pbl9hZGRyZXNzAAAAABJrX2FkbWluX3B1YmxpY19rZXkCAAAAEmtfYWRtaW5fcHVibGljX2tleQAAAAANa19xdW90ZV9hc3NldAIAAAANa19xdW90ZV9hc3NldAAAAAAPa19xdW90ZV9zdGFraW5nAgAAAA9rX3F1b3RlX3N0YWtpbmcAAAAAEWtfc3Rha2luZ19hZGRyZXNzAgAAABFrX3N0YWtpbmdfYWRkcmVzcwAAAAAFa19hbW0CAAAABWtfYW1tAAAAAAprX2FtbV9kYXRhAgAAAAprX2FtbV9kYXRhAAAAABJrX2dvdmVybmFuY2VfYXNzZXQCAAAAC2tfZ292X2Fzc2V0AAAAAA9rX21pbmVyX2FkZHJlc3MCAAAAD2tfbWluZXJfYWRkcmVzcwEAAAAOd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GVLZXkAAAACBQAAAAprX2FtbV9kYXRhBQAAAAtfYW1tQWRkcmVzcwUAAAAFX2RhdGEFAAAAA25pbAAAAAFpAQAAAAlyZW1vdmVBbW0AAAABAAAAC19hbW1BZGRyZXNzCQEAAAALdmFsdWVPckVsc2UAAAACCQEAAAAHaXNBZG1pbgAAAAEFAAAAAWkJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkBAAAADnRvQ29tcG9zaXRlS2V5AAAAAgUAAAAFa19hbW0FAAAAC19hbW1BZGRyZXNzBQAAAANuaWwAAAABaQEAAAASc2V0R292ZXJuYW5jZUFzc2V0AAAAAQAAAAhfYXNzZXRJZAkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkBAAAAB2lzQWRtaW4AAAABBQAAAAFpBAAAAAphc3NldEJ5dGVzCQACWQAAAAEFAAAACF9hc3NldElkBAAAAAckbWF0Y2gwCQAD7AAAAAEFAAAACmFzc2V0Qnl0ZXMDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABUFzc2V0BAAAAAVhc3NldAUAAAAHJG1hdGNoMAMJAQAAAAIhPQAAAAIIBQAAAAVhc3NldAAAAAhkZWNpbWFscwAAAAAAAAAACAkAAAIAAAABAgAAACNJbnZhbGlkIGFzc2V0IGRlY2ltYWxzLCBzaG91bGQgYmUgOAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACBQAAABJrX2dvdmVybmFuY2VfYXNzZXQFAAAACF9hc3NldElkBQAAAANuaWwJAAACAAAAAQIAAAAQQ2FuJ3QgZmluZCBhc3NldAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACQACWQAAAAEJAQAAAA5hZG1pblB1YmxpY0tleQAAAADitUTk", "height": 2168124, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: njpqfpBZQY9XaKEAi5dgsYib1g98CJfDFVjgd6X97ZZ Next: 6GpdSm4MjnP3ZZpHi4qfvhJL1wsY45JggTu8BNBYS4W1 Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let k_insurance_address = "k_insurance_address" | |
5 | 5 | ||
6 | 6 | let k_admin_address = "k_admin_address" | |
7 | 7 | ||
8 | 8 | let k_admin_public_key = "k_admin_public_key" | |
9 | 9 | ||
10 | 10 | let k_quote_asset = "k_quote_asset" | |
11 | 11 | ||
12 | 12 | let k_quote_staking = "k_quote_staking" | |
13 | 13 | ||
14 | 14 | let k_staking_address = "k_staking_address" | |
15 | 15 | ||
16 | 16 | let k_amm = "k_amm" | |
17 | 17 | ||
18 | 18 | let k_amm_data = "k_amm_data" | |
19 | 19 | ||
20 | 20 | let k_governance_asset = "k_gov_asset" | |
21 | 21 | ||
22 | 22 | let k_miner_address = "k_miner_address" | |
23 | 23 | ||
24 | 24 | func toCompositeKey (_key,_address) = ((_key + "_") + _address) | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func getAddressIfValid (address) = toString(valueOrErrorMessage(addressFromString(address), (("Can't parse \"" + address) + "\" as address"))) | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func adminPublicKey () = getStringValue(this, k_admin_public_key) | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func isNoAdmin () = (getString(this, k_admin_address) == unit) | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func admin () = addressFromStringValue(valueOrErrorMessage(getString(this, k_admin_address), "Admin not defined")) | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func isNoAdminOrAdmin (i) = if (if (isNoAdmin()) | |
40 | 40 | then true | |
41 | 41 | else (i.caller == admin())) | |
42 | 42 | then unit | |
43 | 43 | else throw("Only the Admin itself can invoke this function") | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func isAdmin (i) = if ((i.caller == admin())) | |
47 | 47 | then unit | |
48 | 48 | else throw("Only the Admin itself can invoke this function") | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | @Callable(i) | |
52 | 52 | func setAdmin (_adminPublicKey) = valueOrElse(isNoAdminOrAdmin(i), { | |
53 | 53 | let bytes = fromBase58String(_adminPublicKey) | |
54 | 54 | let address = addressFromPublicKey(bytes) | |
55 | 55 | [StringEntry(k_admin_address, toString(address)), StringEntry(k_admin_public_key, _adminPublicKey)] | |
56 | 56 | }) | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | ||
60 | 60 | @Callable(i) | |
61 | 61 | func setInsuranceFund (_insuranceFund) = valueOrElse(isAdmin(i), { | |
62 | 62 | let address = getAddressIfValid(_insuranceFund) | |
63 | 63 | [StringEntry(k_insurance_address, address)] | |
64 | 64 | }) | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | ||
68 | 68 | @Callable(i) | |
69 | 69 | func setLiquidityMiner (_liquidityMiner) = valueOrElse(isAdmin(i), { | |
70 | 70 | let address = getAddressIfValid(_liquidityMiner) | |
71 | 71 | [StringEntry(k_miner_address, address)] | |
72 | 72 | }) | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | ||
76 | 76 | @Callable(i) | |
77 | 77 | func setQuoteAsset (_assetId,_stakingAddress) = valueOrElse(isAdmin(i), { | |
78 | 78 | let stakingAddress = getAddressIfValid(_stakingAddress) | |
79 | 79 | [StringEntry(k_quote_asset, _assetId), StringEntry(k_quote_staking, _stakingAddress)] | |
80 | 80 | }) | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | ||
84 | 84 | @Callable(i) | |
85 | 85 | func setStakingAddress (_stakingAddress) = valueOrElse(isAdmin(i), { | |
86 | 86 | let stakingAddress = getAddressIfValid(_stakingAddress) | |
87 | 87 | [StringEntry(k_staking_address, _stakingAddress)] | |
88 | 88 | }) | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | ||
92 | 92 | @Callable(i) | |
93 | 93 | func addAmm (_ammAddress,_data) = valueOrElse(isAdmin(i), { | |
94 | 94 | let ammAddress = getAddressIfValid(_ammAddress) | |
95 | 95 | [BooleanEntry(toCompositeKey(k_amm, _ammAddress), true), StringEntry(toCompositeKey(k_amm_data, _ammAddress), _data)] | |
96 | 96 | }) | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | ||
100 | 100 | @Callable(i) | |
101 | 101 | func removeAmm (_ammAddress) = valueOrElse(isAdmin(i), [DeleteEntry(toCompositeKey(k_amm, _ammAddress))]) | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | ||
105 | 105 | @Callable(i) | |
106 | 106 | func setGovernanceAsset (_assetId) = valueOrElse(isAdmin(i), { | |
107 | 107 | let assetBytes = fromBase58String(_assetId) | |
108 | 108 | match assetInfo(assetBytes) { | |
109 | 109 | case asset: Asset => | |
110 | 110 | if ((asset.decimals != 8)) | |
111 | 111 | then throw("Invalid asset decimals, should be 8") | |
112 | 112 | else [StringEntry(k_governance_asset, _assetId)] | |
113 | 113 | case _ => | |
114 | 114 | throw("Can't find asset") | |
115 | 115 | } | |
116 | 116 | }) | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | @Verifier(tx) | |
120 | 120 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(adminPublicKey())) | |
121 | 121 |
github/deemru/w8io/169f3d6 28.82 ms ◑