Skip to content
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

Open
wants to merge 90 commits into
base: aip1
Choose a base branch
from

Conversation

kupermind
Copy link
Collaborator

  • Introducing tokenomics changes to reflect on new top-ups approach.

kupermind and others added 30 commits July 4, 2024 13:34
refactor and test: addressing C4R issue 26
chore: update tokenomics implementation address
chore: testing bridge interactions
refactor: addressing C4R issues 56 and 27
refactor and test: addressing C4R issue 38
refactor and test: addressing C4R issue 61
refactor and test: addressing C4R issues 32 and 5
refactor: addressing C4R issues 45 and 4
refactor and test: addressing issue 20
refactor and test: addressing C4R issue 22
contracts/Tokenomics.sol Outdated Show resolved Hide resolved
contracts/Tokenomics.sol Outdated Show resolved Hide resolved
contracts/Tokenomics.sol Outdated Show resolved Hide resolved
vPower = 0;
} else {
// Increase the total top-up voting power in this epoch
mapDonationPoints[epochCounter].totalDonationPower += uint96(vPower);
Copy link
Collaborator Author

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;
Copy link
Collaborator Author

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);
Copy link
Collaborator Author

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.

if (mapDonationPoints[eCounter].totalDonationPower > accountTopUps) {
mapDonationPoints[eCounter].moreDonationPower = true;
}
mapDonationPoints[eCounter].totalDonationPower = uint96(accountTopUps);
Copy link
Collaborator Author

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.

// Accumulate to the final top-up for the last epoch
topUp += totalIncentives / sumUnitIncentives;
if (mapDonationPoints[lastEpoch].moreDonationPower) {
Copy link
Collaborator Author

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.

@@ -267,13 +267,18 @@ contract Dispenser {
event TreasuryUpdated(address indexed treasury);
Copy link
Contributor

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?

Copy link
Collaborator Author

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.

@kupermind kupermind mentioned this pull request Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants