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

Soloseng/celo-minting-schedule #10995

Merged
merged 68 commits into from
Jun 5, 2024
Merged

Conversation

soloseng
Copy link
Contributor

@soloseng soloseng commented May 14, 2024

Description

Created a contract MintGoldSchedule.sol that calculates the amount of CELO to mint and distribute to the community fund and carbon offsetting fund address. This contract can be deployed on L1, but will only be activated on L2 by calling MintGoldSchedule.setDependencies().

This schedule is based on the existing schedule previously defined by EpochRewards contract. In this new schedule, only the percentage of CELO allocated to community rewards and carbon offsetting fund is minted.

As with the L1 minting schedule, the L2 minting schedule in only defined for the first 15 years after L1 genesis block. Future modification to the MintGoldSchedule contract will be required to define a schedule beyond the first 15 years. Additionally, setting the distribution fraction for any fund is prohibited once the first 15 years have elapsed.

GoldToken.sol was updated to only allow minting by the owner or the MintGoldSchedule contract.

Other changes

  • IGoldToken.sol interface was added to allow MintGoldSchedule to call GoldToken.mint() .
  • A new MockGovernance contract, using pragma 0.8, was added to allow testing of the MintGoldSchedule. Using deployCodeTo("Governance.sol", abi.encode(false), governanceAddress); does not work, as the Governance contract bytecode has a placeholder for the libraries that it is using and Foundry does not provide a way to link the library during the compilation step of the tests.

Tested

  • Added unit tests for this new contract.
  • Updated goldToken test to addd minting tests.

Related issues

@soloseng soloseng marked this pull request as ready for review May 17, 2024 00:30
Copy link

openzeppelin-code bot commented Jun 3, 2024

Soloseng/celo-minting-schedule

Generated at commit: 044c620a98c3646444ed755a1819ee837c570862

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
2
3
0
15
42
62
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

@soloseng soloseng enabled auto-merge (squash) June 5, 2024 16:41
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.

3 participants