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