tx · Ayb9pKfxTvDWNPNkn58SfFd2bbHqSTPHM2WBLwGnm4MQ 3NBqs2vfpyT5cMdUJ97mEJ1Ycp2y8GbAZDA: -0.01300000 Waves 2023.01.19 12:35 [2411635] smart account 3NBqs2vfpyT5cMdUJ97mEJ1Ycp2y8GbAZDA > SELF 0.00000000 Waves
{ "type": 13, "id": "Ayb9pKfxTvDWNPNkn58SfFd2bbHqSTPHM2WBLwGnm4MQ", "fee": 1300000, "feeAssetId": null, "timestamp": 1674120948934, "version": 1, "sender": "3NBqs2vfpyT5cMdUJ97mEJ1Ycp2y8GbAZDA", "senderPublicKey": "H19CeJVbUnfsK8EYs8K6fHxwBH7pLyxw8WCDFu7D4rGQ", "proofs": [ "2au37BqbhSm9MU2ChQuBSLkjXGBktyZuprBgvy4SZAxzYwDc9HG4tN7XqWkfkVxFGScJF15ACjsgTx5RgzXV7kHp" ], "script": "base64:AAIFAAAAAAAABccIAhIJCgcIAQEBAQEIEgMKAQgSAwoBARIAEgMKAQgSACIDU0VQIg9nZXRTdHJpbmdPckZhaWwiB2FkZHJlc3MiA2tleSIRa2V5RmFjdG9yeUFkZHJlc3MiGWtleVZvdGluZ1ZlcmlmaWVkQ29udHJhY3QiImtleVZvdGluZ0VtaXNzaW9uQ2FuZGlkYXRlQ29udHJhY3QiFnZvdGluZ1ZlcmlmaWVkQ29udHJhY3QiH3ZvdGluZ0VtaXNzaW9uQ2FuZGlkYXRlQ29udHJhY3QiGElkeEZhY3RvcnlDZmdTdGFraW5nRGFwcCIZSWR4RmFjdG9yeUNmZ0Jvb3N0aW5nRGFwcCIUSWR4RmFjdG9yeUNmZ0lkb0RhcHAiFUlkeEZhY3RvcnlDZmdUZWFtRGFwcCIZSWR4RmFjdG9yeUNmZ0VtaXNzaW9uRGFwcCIVSWR4RmFjdG9yeUNmZ1Jlc3REYXBwIhlJZHhGYWN0b3J5Q2ZnU2xpcHBhZ2VEYXBwIhpJZHhGYWN0b3J5Q2ZnR3d4UmV3YXJkRGFw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AAAAAVQAAAAAAwkAAAEAAAACBQAAAAFVAgAAAApCeXRlVmVjdG9yBAAAAAJhYQUAAAABVQUAAAACYWEDCQAAAQAAAAIFAAAAAVUCAAAABFVuaXQIBQAAAAJhegAAAA9zZW5kZXJQdWJsaWNLZXkJAAACAAAAAQIAAAALTWF0Y2ggZXJyb3IJAAH0AAAAAwgFAAAAAmF6AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACYXoAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAAJhQhK4wBM=", "chainId": 84, "height": 2411635, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GEwEFzibKCDXtAtV7KGiifN6KR3ARsg55brdcDWRsw29 Next: AB1FNxsKPjePuX88Pr6Bxbm5Nk27vKgsPujTT5XFYvGP Diff:
Old | New | Differences | |
---|---|---|---|
13 | 13 | ||
14 | 14 | let keyVotingEmissionCandidateContract = "%s%s__config__votingEmissionCandidateContract" | |
15 | 15 | ||
16 | - | let keyUserPoolsContract = "%s%s__config__userPoolsContract" | |
17 | - | ||
18 | 16 | let votingVerifiedContract = addressFromStringValue(getStringOrFail(this, keyVotingVerifiedContract)) | |
19 | 17 | ||
20 | 18 | let votingEmissionCandidateContract = addressFromStringValue(getStringOrFail(this, keyVotingEmissionCandidateContract)) | |
21 | - | ||
22 | - | let userPoolsContract = addressFromStringValue(getStringOrFail(this, keyUserPoolsContract)) | |
23 | 19 | ||
24 | 20 | let IdxFactoryCfgStakingDapp = 1 | |
25 | 21 | ||
196 | 192 | let wxAssetId = fromBase58String(split(getStringOrFail(this, keyConfig()), SEP)[1]) | |
197 | 193 | if ((assetId != wxAssetId)) | |
198 | 194 | then throw("invalid wxAssetId is passed") | |
199 | - | else if (!(containsElement([boostingContract, votingVerifiedContract, votingEmissionCandidateContract | |
195 | + | else if (!(containsElement([boostingContract, votingVerifiedContract, votingEmissionCandidateContract], i.caller))) | |
200 | 196 | then throw("permissions denied") | |
201 | 197 | else [Burn(assetId, pmtAmount), StringEntry(("%s%s%s__history__burn__" + toBase58String(i.transactionId)), makeString(["%d%d%d", toString(height), toString(lastBlock.timestamp), toString(pmtAmount)], SEP))] | |
202 | 198 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), (("mandatory this." + key) + " is not defined")) | |
7 | 7 | ||
8 | 8 | ||
9 | 9 | func keyFactoryAddress () = "%s%s__config__factoryAddress" | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | let keyVotingVerifiedContract = "%s%s__config__votingVerifiedContract" | |
13 | 13 | ||
14 | 14 | let keyVotingEmissionCandidateContract = "%s%s__config__votingEmissionCandidateContract" | |
15 | 15 | ||
16 | - | let keyUserPoolsContract = "%s%s__config__userPoolsContract" | |
17 | - | ||
18 | 16 | let votingVerifiedContract = addressFromStringValue(getStringOrFail(this, keyVotingVerifiedContract)) | |
19 | 17 | ||
20 | 18 | let votingEmissionCandidateContract = addressFromStringValue(getStringOrFail(this, keyVotingEmissionCandidateContract)) | |
21 | - | ||
22 | - | let userPoolsContract = addressFromStringValue(getStringOrFail(this, keyUserPoolsContract)) | |
23 | 19 | ||
24 | 20 | let IdxFactoryCfgStakingDapp = 1 | |
25 | 21 | ||
26 | 22 | let IdxFactoryCfgBoostingDapp = 2 | |
27 | 23 | ||
28 | 24 | let IdxFactoryCfgIdoDapp = 3 | |
29 | 25 | ||
30 | 26 | let IdxFactoryCfgTeamDapp = 4 | |
31 | 27 | ||
32 | 28 | let IdxFactoryCfgEmissionDapp = 5 | |
33 | 29 | ||
34 | 30 | let IdxFactoryCfgRestDapp = 6 | |
35 | 31 | ||
36 | 32 | let IdxFactoryCfgSlippageDapp = 7 | |
37 | 33 | ||
38 | 34 | let IdxFactoryCfgGwxRewardDapp = 10 | |
39 | 35 | ||
40 | 36 | func keyFactoryCfg () = "%s__factoryConfig" | |
41 | 37 | ||
42 | 38 | ||
43 | 39 | func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
44 | 40 | ||
45 | 41 | ||
46 | 42 | func keyFactoryLpList () = "%s__lpTokensList" | |
47 | 43 | ||
48 | 44 | ||
49 | 45 | func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
50 | 46 | ||
51 | 47 | ||
52 | 48 | func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP) | |
53 | 49 | ||
54 | 50 | ||
55 | 51 | func readFactoryAddressOrFail () = addressFromStringValue(getStringOrFail(this, keyFactoryAddress())) | |
56 | 52 | ||
57 | 53 | ||
58 | 54 | func readLpList () = split(valueOrElse(getString(readFactoryAddressOrFail(), keyFactoryLpList()), ""), SEP) | |
59 | 55 | ||
60 | 56 | ||
61 | 57 | func readFactoryCfgOrFail (factory) = split(getStringOrFail(factory, keyFactoryCfg()), SEP) | |
62 | 58 | ||
63 | 59 | ||
64 | 60 | func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp]) | |
65 | 61 | ||
66 | 62 | ||
67 | 63 | func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp]) | |
68 | 64 | ||
69 | 65 | ||
70 | 66 | func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp]) | |
71 | 67 | ||
72 | 68 | ||
73 | 69 | func getGwxRewardAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgGwxRewardDapp]) | |
74 | 70 | ||
75 | 71 | ||
76 | 72 | func keyConfig () = "%s__config" | |
77 | 73 | ||
78 | 74 | ||
79 | 75 | func keyRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current" | |
80 | 76 | ||
81 | 77 | ||
82 | 78 | func keyRatePerBlockMaxStartFrom (timestamp,block) = makeString(["%s%s%d%d__ratePerBlockMax__start", toString(timestamp), toString(block)], SEP) | |
83 | 79 | ||
84 | 80 | ||
85 | 81 | func keyRatePerBlockCurrent () = "%s%s__ratePerBlock__current" | |
86 | 82 | ||
87 | 83 | ||
88 | 84 | func keyRatePerBlockStartFrom (timestamp,block) = makeString(["%s%s%d%d__ratePerBlock__start", toString(timestamp), toString(block)], SEP) | |
89 | 85 | ||
90 | 86 | ||
91 | 87 | func keyEmissionStartBlock () = "%s%s__emission__startBlock" | |
92 | 88 | ||
93 | 89 | ||
94 | 90 | func keyEmissionDurationInBlocks () = "%s%s__emission__duration" | |
95 | 91 | ||
96 | 92 | ||
97 | 93 | func keyEmissionEndBlock () = "%s%s__emission__endBlock" | |
98 | 94 | ||
99 | 95 | ||
100 | 96 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
101 | 97 | ||
102 | 98 | ||
103 | 99 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
104 | 100 | ||
105 | 101 | ||
106 | 102 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
107 | 103 | case s: String => | |
108 | 104 | fromBase58String(s) | |
109 | 105 | case _: Unit => | |
110 | 106 | unit | |
111 | 107 | case _ => | |
112 | 108 | throw("Match error") | |
113 | 109 | } | |
114 | 110 | ||
115 | 111 | ||
116 | 112 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
117 | 113 | case s: String => | |
118 | 114 | fromBase58String(s) | |
119 | 115 | case _: Unit => | |
120 | 116 | unit | |
121 | 117 | case _ => | |
122 | 118 | throw("Match error") | |
123 | 119 | } | |
124 | 120 | ||
125 | 121 | ||
126 | 122 | func mustManager (i) = { | |
127 | 123 | let pd = throw("Permission denied") | |
128 | 124 | match managerPublicKeyOrUnit() { | |
129 | 125 | case pk: ByteVector => | |
130 | 126 | if ((i.callerPublicKey == pk)) | |
131 | 127 | then true | |
132 | 128 | else pd | |
133 | 129 | case _: Unit => | |
134 | 130 | if ((i.caller == this)) | |
135 | 131 | then true | |
136 | 132 | else pd | |
137 | 133 | case _ => | |
138 | 134 | throw("Match error") | |
139 | 135 | } | |
140 | 136 | } | |
141 | 137 | ||
142 | 138 | ||
143 | 139 | @Callable(i) | |
144 | 140 | func constructor (factoryAddress,ratePerBlockMax,ratePerBlock,emissionStartBlock,emissionDuration,emissionStartTimestamp,wxAssetIdStr) = { | |
145 | 141 | let checkCaller = mustManager(i) | |
146 | 142 | if ((checkCaller == checkCaller)) | |
147 | 143 | then [IntegerEntry(keyRatePerBlockMaxStartFrom(emissionStartTimestamp, emissionStartBlock), ratePerBlockMax), IntegerEntry(keyRatePerBlockMaxCurrent(), ratePerBlockMax), IntegerEntry(keyRatePerBlockStartFrom(emissionStartTimestamp, emissionStartBlock), ratePerBlock), IntegerEntry(keyRatePerBlockCurrent(), ratePerBlock), IntegerEntry(keyEmissionStartBlock(), emissionStartBlock), IntegerEntry(keyEmissionDurationInBlocks(), emissionDuration), IntegerEntry(keyEmissionEndBlock(), (emissionStartBlock + emissionDuration)), StringEntry(keyFactoryAddress(), factoryAddress), StringEntry(keyConfig(), ("%s__" + wxAssetIdStr))] | |
148 | 144 | else throw("Strict value is not equal to itself.") | |
149 | 145 | } | |
150 | 146 | ||
151 | 147 | ||
152 | 148 | ||
153 | 149 | @Callable(i) | |
154 | 150 | func constructorV2 (votingVerifiedContractPrm) = { | |
155 | 151 | let checkCaller = mustManager(i) | |
156 | 152 | if ((checkCaller == checkCaller)) | |
157 | 153 | then $Tuple2([StringEntry(keyVotingVerifiedContract, votingVerifiedContractPrm)], unit) | |
158 | 154 | else throw("Strict value is not equal to itself.") | |
159 | 155 | } | |
160 | 156 | ||
161 | 157 | ||
162 | 158 | ||
163 | 159 | @Callable(i) | |
164 | 160 | func emit (amount) = if ((0 >= amount)) | |
165 | 161 | then $Tuple2(nil, nil) | |
166 | 162 | else { | |
167 | 163 | let factoryContract = readFactoryAddressOrFail() | |
168 | 164 | let factoryCfg = readFactoryCfgOrFail(factoryContract) | |
169 | 165 | let stakingContract = getStakingAddressOrFail(factoryCfg) | |
170 | 166 | let gwxRewardsContract = getGwxRewardAddressOrFail(factoryCfg) | |
171 | 167 | let caller = i.caller | |
172 | 168 | if (if ((caller != stakingContract)) | |
173 | 169 | then (caller != gwxRewardsContract) | |
174 | 170 | else false) | |
175 | 171 | then throw("permissions denied") | |
176 | 172 | else { | |
177 | 173 | let wxAssetIdStr = split(getStringOrFail(this, keyConfig()), SEP)[1] | |
178 | 174 | let wxAssetId = fromBase58String(wxAssetIdStr) | |
179 | 175 | $Tuple2([ScriptTransfer(caller, amount, wxAssetId)], [wxAssetId]) | |
180 | 176 | } | |
181 | 177 | } | |
182 | 178 | ||
183 | 179 | ||
184 | 180 | ||
185 | 181 | @Callable(i) | |
186 | 182 | func burn () = { | |
187 | 183 | let factoryContract = readFactoryAddressOrFail() | |
188 | 184 | let factoryCfg = readFactoryCfgOrFail(factoryContract) | |
189 | 185 | let boostingContract = getBoostingAddressOrFail(factoryCfg) | |
190 | 186 | if ((size(i.payments) != 1)) | |
191 | 187 | then throw("exact one payment is allowed") | |
192 | 188 | else { | |
193 | 189 | let pmt = i.payments[0] | |
194 | 190 | let assetId = value(pmt.assetId) | |
195 | 191 | let pmtAmount = pmt.amount | |
196 | 192 | let wxAssetId = fromBase58String(split(getStringOrFail(this, keyConfig()), SEP)[1]) | |
197 | 193 | if ((assetId != wxAssetId)) | |
198 | 194 | then throw("invalid wxAssetId is passed") | |
199 | - | else if (!(containsElement([boostingContract, votingVerifiedContract, votingEmissionCandidateContract | |
195 | + | else if (!(containsElement([boostingContract, votingVerifiedContract, votingEmissionCandidateContract], i.caller))) | |
200 | 196 | then throw("permissions denied") | |
201 | 197 | else [Burn(assetId, pmtAmount), StringEntry(("%s%s%s__history__burn__" + toBase58String(i.transactionId)), makeString(["%d%d%d", toString(height), toString(lastBlock.timestamp), toString(pmtAmount)], SEP))] | |
202 | 198 | } | |
203 | 199 | } | |
204 | 200 | ||
205 | 201 | ||
206 | 202 | ||
207 | 203 | @Callable(i) | |
208 | 204 | func setManager (pendingManagerPublicKey) = { | |
209 | 205 | let checkCaller = mustManager(i) | |
210 | 206 | if ((checkCaller == checkCaller)) | |
211 | 207 | then { | |
212 | 208 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
213 | 209 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
214 | 210 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
215 | 211 | else throw("Strict value is not equal to itself.") | |
216 | 212 | } | |
217 | 213 | else throw("Strict value is not equal to itself.") | |
218 | 214 | } | |
219 | 215 | ||
220 | 216 | ||
221 | 217 | ||
222 | 218 | @Callable(i) | |
223 | 219 | func confirmManager () = { | |
224 | 220 | let pm = pendingManagerPublicKeyOrUnit() | |
225 | 221 | let hasPM = if (isDefined(pm)) | |
226 | 222 | then true | |
227 | 223 | else throw("No pending manager") | |
228 | 224 | if ((hasPM == hasPM)) | |
229 | 225 | then { | |
230 | 226 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
231 | 227 | then true | |
232 | 228 | else throw("You are not pending manager") | |
233 | 229 | if ((checkPM == checkPM)) | |
234 | 230 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
235 | 231 | else throw("Strict value is not equal to itself.") | |
236 | 232 | } | |
237 | 233 | else throw("Strict value is not equal to itself.") | |
238 | 234 | } | |
239 | 235 | ||
240 | 236 | ||
241 | 237 | @Verifier(tx) | |
242 | 238 | func verify () = { | |
243 | 239 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
244 | 240 | case pk: ByteVector => | |
245 | 241 | pk | |
246 | 242 | case _: Unit => | |
247 | 243 | tx.senderPublicKey | |
248 | 244 | case _ => | |
249 | 245 | throw("Match error") | |
250 | 246 | } | |
251 | 247 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
252 | 248 | } | |
253 | 249 |
github/deemru/w8io/026f985 49.75 ms ◑