-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introducing tokenomics changes to reflect on new top-ups approach #179
base: aip1
Are you sure you want to change the base?
Conversation
kupermind
commented
Jul 25, 2024
- Introducing tokenomics changes to reflect on new top-ups approach.
refactor and test: addressing C4R issue 26
chore: update tokenomics implementation address
…incentives for removed nominee epoch
chore: testing bridge interactions
V1.2.2 internal audit
refactor: addressing C4R issues 56 and 27
refactor and test: addressing C4R issue 38
refactor and test: addressing C4R issue 61
refactor: addressing C4R issue 67
refactor and test: addressing C4R issues 32 and 5
refactor: addressing C4R issues 45 and 4
refactor: addressing C4R issue 29
refactor and test: addressing issue 20
refactor and test: addressing C4R issue 22
doc: catch up on changes
doc: updating changelog
vPower = 0; | ||
} else { | ||
// Increase the total top-up voting power in this epoch | ||
mapDonationPoints[epochCounter].totalDonationPower += uint96(vPower); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
veOLAS is added to the totalDonationPower
(per epoch) once for each donator who has not donated yet.
// Increase the total top-up voting power in this epoch | ||
mapDonationPoints[epochCounter].totalDonationPower += uint96(vPower); | ||
// Otherwise, split them to the corresponding number of services | ||
vPower /= numServices; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
veOLAS is equally distributed across the number of services being donated to.
uint96 amount = uint96(amounts[i] / numServiceUnits); | ||
uint96 vPowerUnit; | ||
if (vPower > 0) { | ||
vPowerUnit = uint96(vPower / numServiceUnits); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
veOLAS power is then further distributed between service units. Note that the fraction for component / agent normalizer will be applied later in the finalization of top-ups.
contracts/Tokenomics.sol
Outdated
if (mapDonationPoints[eCounter].totalDonationPower > accountTopUps) { | ||
mapDonationPoints[eCounter].moreDonationPower = true; | ||
} | ||
mapDonationPoints[eCounter].totalDonationPower = uint96(accountTopUps); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bug, here it must be the totalUnitTopUps
value, which is finalized at the checkpoint.
contracts/Tokenomics.sol
Outdated
// Accumulate to the final top-up for the last epoch | ||
topUp += totalIncentives / sumUnitIncentives; | ||
if (mapDonationPoints[lastEpoch].moreDonationPower) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This corresponds to the same top-ups calculations as in the write function above.
doc: re-audit
refactor: addressing interim internal audit findings
doc: internal audit ref AIP-1/Bonding
@@ -267,13 +267,18 @@ contract Dispenser { | |||
event TreasuryUpdated(address indexed treasury); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, are these changes not already on main?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, wanted to just merge in order to get rid of git leaks errors, but forgot where the branch was initiated and that it is pretty far in the sequence of commits.
doc: check-erc-721 in audit