-
Notifications
You must be signed in to change notification settings - Fork 371
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
[DO NOT MERGE] Epoch manager WIP #11189
Conversation
no working test. Co-authored-by: Martín Volpe <[email protected]>
…o into feat/epoch-manager
* unit test with mocks * ++ integration tests * clean up * -- logging * removed duplicate interface * using `MockCeloToken` to get test to pass. Fails when it hits a precompile in `EpochRewards.sol` * removed endEpochTimestamp * moved IEpochManager to 0.5 folder * added L2 conditions for EpochRewards functions using precompiles Still missing tests * renamed EpochManagerInitializer due to name conflict * ++ more unit test * setup anvil migration fix name conflict * compiles * ++ require fund in unreleased treasury * Updated regex * ++ registry 0.8 for testing only * clean up * ++ unit test * initial integration test using L1 devchain * ++ comment * -- forge based integration test * ++ to const * happy linter * update contract name * ++ PR feedback * ++ checks * updated carbon address * proxy stableToken mint call via Validators contract * -- duplicate imports * removed registry08. replaced with vm call * PR feedback * -- coment * passing unit tests * clean up * ++ mintStable test * -- TODO; compiles test when filtering * PR feedback * updated migration script to add more validators * passing integration test * removed test for zero amount * yarn build fix * clean up comments && TODO * revert change as out of scope
* dynamically fetch epochManagerEnabler && carbonOffsettingPartner ++ to registry * PR feedback * removed onlyL1 modifier in setter functions * updated unit test to reflect changes * fixing tests * fix test * fixed migration data * fixed migration script error * removed unused modifier * removed duplicate or unused code
*/ | ||
function release(address to, uint256 amount) external onlyEpochManager { | ||
require(address(this).balance >= amount, "Insufficient balance."); | ||
require(getCeloToken().transfer(to, amount), "CELO transfer failed."); |
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.
any reason why we prefer doing an ERC20 transfer, instead of a native transfer. My rule of thumb is that Token Duality is only for cases where you NEED a ERC20, for the rest of use cases we should just use native transfer. They are much cheaper gas wide
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's nice to have the event log and the checks the transfer function has, as rule of thumb I always use the ERC20 transfer 🤔
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.
yo do have an event here. The Release
event.
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.
I meant in general, I find it nice to always leave a trace with Celo transfers
* truffle build fix * build fix * PR comments * prettify * rename of registerValidator overload * bug fix * extensing epochManager e2e test * yarn lint
Reset pending payment to 0 when sending
* ++ basic test * -- celoToken balance check * cleanup comments * use celoToken instead of native token for `initializeSystem` balance check * ++ more test * removed additional epochs
* updated `CeloUnrealeasedTreasure` to `CeloUnreleasedTreasury` * update `CeloUnreleasedTreasury` initial balance to use defined constant
* Update score manager behavior * scoremanager events * Remove magic number --------- Co-authored-by: Martín Volpe <[email protected]>
…monorepo into feat/l2-epoch-system
Placeholder PR to have the CI