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

refactor: addressing interim internal audit findings #182

Merged
merged 80 commits into from
Aug 3, 2024

Conversation

kupermind
Copy link
Collaborator

  • Addressing interim internal audit findings;
  • Adjusting tests.

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
@kupermind kupermind requested review from DavidMinarsch and 77ph July 29, 2024 16:59
@@ -225,6 +227,17 @@ contract Depository is ERC721, IErrorsTokenomics {
}
}

/// @dev Sets minimum OLAS leftover amount for the product to keep the supply.
/// @param _minOLASLeftoverAmount Updated minimum OLAS leftover amount.
function setMinOLASLeftoverAmount(uint256 _minOLASLeftoverAmount) external {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe need to add a variable in the constructor as well.

uint256 totalDonationPower = mapDonationPoints[epochNum].totalDonationPower;
totalIncentives *= totalTopUpsOLAS * mapEpochTokenomics[epochNum].unitPoints[unitType].topUpUnitFraction;
totalIncentives = mapUnitIncentives[unitType][unitId].topUp + (totalIncentives / (totalDonationPower * 100));
// topUp = (pendingRelativeTopUp * totalUnitTopUps * topUpUnitFraction) / sumTopUpUnitFractions, if totalDonationPower > totalUnitTopUps
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adjusted calculations according to the doc, tests prove their correctness.

}
mapDonationPoints[eCounter].totalDonationPower = uint96(accountTopUps);

// Record total unit top-ups and fractions in a settled epoch
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

totalUnitTopUps and the sum of fractions need to be recorded. The total veOLAS donation power is recorded throughout the epoch in the tracking function.

@DavidMinarsch DavidMinarsch merged commit 927a3b8 into v1.3.0-internal-audit Aug 3, 2024
2 checks passed
@DavidMinarsch DavidMinarsch deleted the aip1_3 branch August 3, 2024 02:00
@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