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