-
Notifications
You must be signed in to change notification settings - Fork 11
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
Governance factory #284
Governance factory #284
Conversation
Co-authored-by: Bayological <[email protected]>
After a few iterations, we landed on a simple Airgrab scheme: - With a list of <address>,<token amount> we generate a merkle tree and record the root in the contract - A user does KYC, gets the merkle proof from our backend and submits the claim - The contract verifies the merkle proof and KYC and locks the tokens on behalf of the user for a predetermined cliff and slope. - The airgrab has an endTimestamp after witch any leftover tokens in the contract can be transferred to the treasury. More details on specifics around the KYC can be extracted from the comments in the code which contain links to documentation. There is a single open question around how we encode the expected credential from fractal. The expected credential is basically the set of restrictions we want to enforce and it's a string that looks like `"level:plus;residency_not:ca,us"`. I currently provided that statically in the code and it's probably not the final version that we want. But to parameterize in a naive way would incur a big gas because we can only store it in storage, and not as an immutable parameter because only immutable base types are allowed as of now in solidity. If we want to parameterize it the approach I would take would be to store a keccak of it as an immutable bytes32 parameter, and provide the full string as a parameter to the claim function and when verifying the credential we would first verify that the keccak matches and then use it in the construction of the full credential. I'm not sure if it's worth it or if it's fine to just come up with the value and keep it static in line as is right now. N/A Yes - Fixes #282 N/A N/A --------- Co-authored-by: baroooo <[email protected]>
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.
Left a few small comments but overall looks good. Would be nice to have a 2nd pass once the locking branch is merged to look at the clean diff
contracts/governance/Factory.sol
Outdated
// Airgrab configuration | ||
uint32 public constant AIRGRAB_LOCK_SLOPE = 104; // Slope duration for the airgrabed tokens in weeks | ||
uint32 public constant AIRGRAB_LOCK_CLIFF = 0; // Cliff duration for the airgrabed tokens | ||
uint256 public constant AIRGRAB_DURATION = 365 days; // Duration for the airgrab |
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.
A lot of these comments are redundant given the variable names. Maybe only leave the ones that you think are not as clear or could provide additional context to the reader?
For example L56 seems like useful context:
uint256 public constant GOVERNOR_VOTING_DELAY = 1; // Voting start the next block
on another note, is the airgrab supposed to last one year?
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.
yes, after one year remaining funds will be drained
contracts/governance/Factory.sol
Outdated
// Governor configuration | ||
uint256 public constant GOVERNOR_VOTING_DELAY = 1; // Voting start the next block | ||
uint256 public constant GOVERNOR_VOTING_PERIOD = 120_960; // Voting period for the governor (7 days in blocks CELO) | ||
uint256 public constant GOVERNOR_PROPOSAL_THRESHOLD = 1_000e18; // Proposal threshold for the governor |
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.
How can I verify that this value is correct?
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.
it is tentatively decided and noted here:
https://www.notion.so/Mento-Token-and-Governance-ae6acced7b4d465db90f92f1408ee23c?pvs=4#ac6b141b682b4c1b9986c2d50dcca811
Description
A factory contract that deploys and configures all token and governance related contracts.
It will be initiated by Celo governance.
Treasury and vesting contracts won't be created in this PR. Those changes will be added later.
Other changes
Airgrab's init function is updated to resolve triple circular dependence between token, locking and airgrab
Governor config is parameterized to keep all config in the Factory
Added TODO comments as reminders
The branch is based on locking-contracts branch so locking related changes can be ignored in this review (contracts/governance/locking, test/Locking, test/mocks, test/utils)
Tested
Tested with unit tests
The issue #275 aims to add integration tests that will test the main flows
Related issues