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