tx · 7b1kQaG9ih4onF1uWtrjViPHjN5YpzGc3UWqHnq8aykj 3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9: -0.01400000 Waves 2021.07.15 13:12 [1614599] smart account 3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9 > SELF 0.00000000 Waves
{ "type": 13, "id": "7b1kQaG9ih4onF1uWtrjViPHjN5YpzGc3UWqHnq8aykj", "fee": 1400000, "feeAssetId": null, "timestamp": 1626343897335, "version": 2, "chainId": 84, "sender": "3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9", "senderPublicKey": "D1X9WatF6ARMCmm3jC4Ex5Wd5VQ3LY8i1xbHNqeHqeAa", "proofs": [ "5w8p3WJGjVzfPvPqupJCDAaNZFwHvYSXeEcfKnzEAnycmGKUbrzRp8o9iWFyQKFdZQhRHLBWyvGJPMxwf8sBydh4", "49WDXPHoSS7k7ERaQGq5rWCy3eHEqwqibQRtgkjf6EEdCZG5Zk75V8NGSPY8S5UkZ28Ag4HTGprvuApfyo6NUzNT", "5Fj4aJkM4GRTrvxP8s3vUzirKc9jf6bvHCkRJ68ZHqJLpXyepvXDjQ2UWEtk5RzGocWmjTT9veJjmZvnsDgMuDPa" ], "script": "base64:AAIFAAAAAAAAABYIAhIECgIIARIAEgQKAggIEgQKAggIAAAAGAAAAAAQa2V5UG9vbHNMaXN0TmFtZQIAAAAFcG9vbHMAAAAAEWtleVByZWZpeFBvb2xOYW1lAgAAAAVwb29sXwAAAAASa2V5UHJlZml4UG9vbEluZGV4AgAAAAZpbmRleF8AAAAAEWtleUluaXRQb29sSGVpZ2h0AgAAABBpbml0X3Bvb2xfaGlnaHRfAAAAABJrZXlDb25maXJtZWRBc3NldHMCAAAAEGNvbmZpcm1lZF9hc3NldHMAAAAAEGtleUFzc2V0UHJpb3JpdHkCAAAAD2Fzc2V0X3ByaW9yaXR5XwAAAAAHa2V5UGFpcgIAAAAFcGFpcl8AAAAAC2tleUFzc2V0SWRBAgAAAApBX2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JhbnNhY3Rpb24GAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABdNYXNzVHJhbnNmZXJUcmFuc2FjdGlvbgYDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAD0J1cm5UcmFuc2FjdGlvbgYJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAASUmVpc3N1ZVRyYW5zYWN0aW9uBQAAAA1zaWduZWRCeUFkbWluCQAAAgAAAAECAAAAC01hdGNoIGVycm9yy578iQ==", "height": 1614599, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2S2HvreMeWvdiAWVska6q8ECs5FLmXJPx1XVvZmmsR9n Next: 5Un9uaR2tfE8oBks2BGndJfSeBnJ4rsheoM3eqcTFCdG Diff:
Old | New | Differences | |
---|---|---|---|
25 | 25 | ||
26 | 26 | let keyAdminPubKey3 = "admin_pub_3" | |
27 | 27 | ||
28 | - | let | |
28 | + | let keyAdminStartStop = "admin_start_stop" | |
29 | 29 | ||
30 | - | func getAdminPub (keyAdminPub) = match getString(oracleAdminPool, keyAdminPub) { | |
31 | - | case string: String => | |
32 | - | fromBase58String(string) | |
33 | - | case nothing => | |
34 | - | throw("Admin public key is empty") | |
35 | - | } | |
30 | + | let keyAdminStaking = "admin_staking" | |
36 | 31 | ||
32 | + | let adminPubKey1 = base58'GFmKZ2naZFRoCvNbwKAQVGmLb1uBeWGDgFabdGBuZiuy' | |
37 | 33 | ||
38 | - | let | |
34 | + | let adminPubKey2 = base58'GmJXRyhRA79g8yUGgKBAVdnFfQFDMjQG98b1MmLDh5kk' | |
39 | 35 | ||
40 | - | let | |
36 | + | let adminPubKey3 = base58'CFhbV6h41hVjbGHudGtS3fYUv7QAKRxFQzKNtx4B5PqP' | |
41 | 37 | ||
42 | - | let adminPubKey3 = getAdminPub(keyAdminPubKey3) | |
38 | + | let adminStartStop = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
39 | + | ||
40 | + | let adminStaking = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
43 | 41 | ||
44 | 42 | let adminInvoke = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
45 | 43 | ||
76 | 74 | func setPriority (assetId,priority) = valueOrElse(isSelfCall(i), if ((0 > priority)) | |
77 | 75 | then throw("Priority must be positive") | |
78 | 76 | else [IntegerEntry((keyAssetPriority + assetId), priority)]) | |
77 | + | ||
78 | + | ||
79 | + | ||
80 | + | @Callable(i) | |
81 | + | func setAdmin () = valueOrElse(isSelfCall(i), [StringEntry(keyAdminPubKey1, toBase58String(adminPubKey1)), StringEntry(keyAdminPubKey2, toBase58String(adminPubKey2)), StringEntry(keyAdminPubKey3, toBase58String(adminPubKey3)), StringEntry(keyAdminStaking, toBase58String(adminStaking)), StringEntry(keyAdminStartStop, toBase58String(adminStartStop))]) | |
79 | 82 | ||
80 | 83 | ||
81 | 84 | ||
126 | 129 | let isSelfInvokeRenamePool = if ((inv.dApp == this)) | |
127 | 130 | then containsElement(["renamePool"], inv.function) | |
128 | 131 | else false | |
132 | + | let isSelfInvokeSetAdmin = if ((inv.dApp == this)) | |
133 | + | then containsElement(["setAdmin"], inv.function) | |
134 | + | else false | |
129 | 135 | let isSelfInvokeAddPool = if ((inv.dApp == this)) | |
130 | 136 | then containsElement(["addPool"], inv.function) | |
131 | 137 | else false |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let keyPoolsListName = "pools" | |
5 | 5 | ||
6 | 6 | let keyPrefixPoolName = "pool_" | |
7 | 7 | ||
8 | 8 | let keyPrefixPoolIndex = "index_" | |
9 | 9 | ||
10 | 10 | let keyInitPoolHeight = "init_pool_hight_" | |
11 | 11 | ||
12 | 12 | let keyConfirmedAssets = "confirmed_assets" | |
13 | 13 | ||
14 | 14 | let keyAssetPriority = "asset_priority_" | |
15 | 15 | ||
16 | 16 | let keyPair = "pair_" | |
17 | 17 | ||
18 | 18 | let keyAssetIdA = "A_asset_id" | |
19 | 19 | ||
20 | 20 | let keyAssetIdB = "B_asset_id" | |
21 | 21 | ||
22 | 22 | let keyAdminPubKey1 = "admin_pub_1" | |
23 | 23 | ||
24 | 24 | let keyAdminPubKey2 = "admin_pub_2" | |
25 | 25 | ||
26 | 26 | let keyAdminPubKey3 = "admin_pub_3" | |
27 | 27 | ||
28 | - | let | |
28 | + | let keyAdminStartStop = "admin_start_stop" | |
29 | 29 | ||
30 | - | func getAdminPub (keyAdminPub) = match getString(oracleAdminPool, keyAdminPub) { | |
31 | - | case string: String => | |
32 | - | fromBase58String(string) | |
33 | - | case nothing => | |
34 | - | throw("Admin public key is empty") | |
35 | - | } | |
30 | + | let keyAdminStaking = "admin_staking" | |
36 | 31 | ||
32 | + | let adminPubKey1 = base58'GFmKZ2naZFRoCvNbwKAQVGmLb1uBeWGDgFabdGBuZiuy' | |
37 | 33 | ||
38 | - | let | |
34 | + | let adminPubKey2 = base58'GmJXRyhRA79g8yUGgKBAVdnFfQFDMjQG98b1MmLDh5kk' | |
39 | 35 | ||
40 | - | let | |
36 | + | let adminPubKey3 = base58'CFhbV6h41hVjbGHudGtS3fYUv7QAKRxFQzKNtx4B5PqP' | |
41 | 37 | ||
42 | - | let adminPubKey3 = getAdminPub(keyAdminPubKey3) | |
38 | + | let adminStartStop = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
39 | + | ||
40 | + | let adminStaking = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
43 | 41 | ||
44 | 42 | let adminInvoke = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
45 | 43 | ||
46 | 44 | let pools = match getString(this, keyPoolsListName) { | |
47 | 45 | case string: String => | |
48 | 46 | split(string, ",") | |
49 | 47 | case nothing => | |
50 | 48 | nil | |
51 | 49 | } | |
52 | 50 | ||
53 | 51 | func isSelfCall (i) = if ((i.caller == this)) | |
54 | 52 | then unit | |
55 | 53 | else throw("Only the Oracle itself can invoke this function") | |
56 | 54 | ||
57 | 55 | ||
58 | 56 | func getPoolNameIfValid (poolName) = { | |
59 | 57 | let underscoreIndex = valueOrElse(indexOf(poolName, "_"), -1) | |
60 | 58 | let underscoreLastIndex = valueOrElse(lastIndexOf(poolName, "_"), -1) | |
61 | 59 | let hasSingleUnderscore = if (if ((underscoreIndex == underscoreLastIndex)) | |
62 | 60 | then (underscoreIndex > 0) | |
63 | 61 | else false) | |
64 | 62 | then (underscoreIndex != (size(poolName) - 1)) | |
65 | 63 | else false | |
66 | 64 | if (hasSingleUnderscore) | |
67 | 65 | then poolName | |
68 | 66 | else throw("Pool name must consist of two asset names separated by an underscore character") | |
69 | 67 | } | |
70 | 68 | ||
71 | 69 | ||
72 | 70 | func getAddressIfValid (address) = toString(valueOrErrorMessage(addressFromString(address), (("Can't parse \"" + address) + "\" as address"))) | |
73 | 71 | ||
74 | 72 | ||
75 | 73 | @Callable(i) | |
76 | 74 | func setPriority (assetId,priority) = valueOrElse(isSelfCall(i), if ((0 > priority)) | |
77 | 75 | then throw("Priority must be positive") | |
78 | 76 | else [IntegerEntry((keyAssetPriority + assetId), priority)]) | |
77 | + | ||
78 | + | ||
79 | + | ||
80 | + | @Callable(i) | |
81 | + | func setAdmin () = valueOrElse(isSelfCall(i), [StringEntry(keyAdminPubKey1, toBase58String(adminPubKey1)), StringEntry(keyAdminPubKey2, toBase58String(adminPubKey2)), StringEntry(keyAdminPubKey3, toBase58String(adminPubKey3)), StringEntry(keyAdminStaking, toBase58String(adminStaking)), StringEntry(keyAdminStartStop, toBase58String(adminStartStop))]) | |
79 | 82 | ||
80 | 83 | ||
81 | 84 | ||
82 | 85 | @Callable(i) | |
83 | 86 | func addPool (poolAddress,poolName) = valueOrElse(isSelfCall(i), { | |
84 | 87 | let validatedAddress = getAddressIfValid(poolAddress) | |
85 | 88 | let keyName = (keyPrefixPoolName + validatedAddress) | |
86 | 89 | let keyIndex = (keyPrefixPoolIndex + validatedAddress) | |
87 | 90 | let assetIdA = valueOrErrorMessage(getString(value(addressFromString(poolAddress)), keyAssetIdA), "Asset id A is incorrect") | |
88 | 91 | let assetIdB = valueOrErrorMessage(getString(value(addressFromString(poolAddress)), keyAssetIdB), "Asset id B is incorrect") | |
89 | 92 | let possiblyAlreadyAddedPool = getString(this, keyName) | |
90 | 93 | if (isDefined(possiblyAlreadyAddedPool)) | |
91 | 94 | then throw((((("Pool with address \"" + validatedAddress) + "\" is already defined with name \"") + value(possiblyAlreadyAddedPool)) + "\"")) | |
92 | 95 | else [IntegerEntry(keyIndex, size(pools)), IntegerEntry((keyInitPoolHeight + poolAddress), height), StringEntry(keyName, getPoolNameIfValid(poolName)), StringEntry((((keyPair + assetIdA) + "_") + assetIdB), poolAddress), StringEntry(keyPoolsListName, makeString((pools :+ validatedAddress), ","))] | |
93 | 96 | }) | |
94 | 97 | ||
95 | 98 | ||
96 | 99 | ||
97 | 100 | @Callable(i) | |
98 | 101 | func renamePool (poolAddress,newPoolName) = valueOrElse(isSelfCall(i), { | |
99 | 102 | let validatedAddress = getAddressIfValid(poolAddress) | |
100 | 103 | let keyName = (keyPrefixPoolName + validatedAddress) | |
101 | 104 | let possiblyAlreadyAddedPool = getString(this, keyName) | |
102 | 105 | if (isDefined(possiblyAlreadyAddedPool)) | |
103 | 106 | then [StringEntry(keyName, getPoolNameIfValid(newPoolName))] | |
104 | 107 | else throw((("Pool with address \"" + validatedAddress) + "\" has not yet been added")) | |
105 | 108 | }) | |
106 | 109 | ||
107 | 110 | ||
108 | 111 | @Verifier(tx) | |
109 | 112 | func verify () = { | |
110 | 113 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
111 | 114 | then 1 | |
112 | 115 | else 0 | |
113 | 116 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
114 | 117 | then 1 | |
115 | 118 | else 0 | |
116 | 119 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
117 | 120 | then 1 | |
118 | 121 | else 0 | |
119 | 122 | let signedByAdmin = (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
120 | 123 | let adminInvokeSigned = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminInvoke)) | |
121 | 124 | then 1 | |
122 | 125 | else 0 | |
123 | 126 | let signedByAdminToCallAddPoolOrSetPriority = ((((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) + adminInvokeSigned) >= 1) | |
124 | 127 | match tx { | |
125 | 128 | case inv: InvokeScriptTransaction => | |
126 | 129 | let isSelfInvokeRenamePool = if ((inv.dApp == this)) | |
127 | 130 | then containsElement(["renamePool"], inv.function) | |
128 | 131 | else false | |
132 | + | let isSelfInvokeSetAdmin = if ((inv.dApp == this)) | |
133 | + | then containsElement(["setAdmin"], inv.function) | |
134 | + | else false | |
129 | 135 | let isSelfInvokeAddPool = if ((inv.dApp == this)) | |
130 | 136 | then containsElement(["addPool"], inv.function) | |
131 | 137 | else false | |
132 | 138 | let isSelfInvokeSetPriority = if ((inv.dApp == this)) | |
133 | 139 | then containsElement(["setPriority"], inv.function) | |
134 | 140 | else false | |
135 | 141 | if (if (if (if (signedByAdmin) | |
136 | 142 | then (size(inv.payments) == 0) | |
137 | 143 | else false) | |
138 | 144 | then isSelfInvokeRenamePool | |
139 | 145 | else false) | |
140 | 146 | then true | |
141 | 147 | else if (if (signedByAdminToCallAddPoolOrSetPriority) | |
142 | 148 | then (size(inv.payments) == 0) | |
143 | 149 | else false) | |
144 | 150 | then isSelfInvokeAddPool | |
145 | 151 | else false) | |
146 | 152 | then true | |
147 | 153 | else if (if (signedByAdminToCallAddPoolOrSetPriority) | |
148 | 154 | then (size(inv.payments) == 0) | |
149 | 155 | else false) | |
150 | 156 | then isSelfInvokeSetPriority | |
151 | 157 | else false | |
152 | 158 | case _: Order|DataTransaction|SponsorFeeTransaction|SetScriptTransaction|CreateAliasTransaction|LeaseCancelTransaction|LeaseTransaction|IssueTransaction|UpdateAssetInfoTransaction|InvokeScriptTransaction|SetAssetScriptTransaction|TransferTransaction|ExchangeTransaction|MassTransferTransaction|BurnTransaction|ReissueTransaction => | |
153 | 159 | signedByAdmin | |
154 | 160 | case _ => | |
155 | 161 | throw("Match error") | |
156 | 162 | } | |
157 | 163 | } | |
158 | 164 |
github/deemru/w8io/169f3d6 52.42 ms ◑