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

feat: add BalanceClaimer and contracts update #3

Merged
merged 13 commits into from
Nov 8, 2024

Conversation

0xRaccoon
Copy link
Member

@0xRaccoon 0xRaccoon commented Oct 18, 2024

The purpose is to allow users to claim their balances of eth and ERC20 tokens with a prior snapshot of their balances.

Currently, the assets to be claimed by the users are located in 2 contracts in mainnet:

A snapshot of the users' eth balance of OptimismPortal and snapshot of the users' ERC20 balances of L1StandardBridge will be taken and the Merkle tree, root, and proofs for users will be generated off-chain.

The approach consists of a contract BalanceClaimer that contains the bytes32 merkle root value, all the Merkle verification logic, and claims methods. To achieve this approach, it is be necessary to update L1StandardBridge and the OptimisimPotal contracts and add the following methods:

  • L1StandardBridge: withdrawErc20Balance only called by BalanceClaimer contract after claim verification to send the user token balances.
  • OptimismPortal: withdrawEthBalance only called by BalanceClaimer contract after claim verification to send the user eth balance.

The claim method is permissionless and can be called by any address.

image

Wind Down Deploy and upgrade scripts:

Local test:
yarn upgrade-local:winddown

Prod:
yarn upgrade-prod:winddown

@0xRaccoon 0xRaccoon marked this pull request as draft October 18, 2024 11:41
@0xRaccoon 0xRaccoon marked this pull request as ready for review October 21, 2024 16:59
Copy link
Collaborator

@0xteddybear 0xteddybear left a comment

Choose a reason for hiding this comment

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

Just some comments from trying to get up to speed on the project!


contract WinddownUpgrade is Script {
function run() public {
uint256 _deployerPk = vm.envUint("PRIVATE_KEY_PROXY_ADMIN");
Copy link
Collaborator

Choose a reason for hiding this comment

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

have we considered using keystores like we do in the boilerplate?

Copy link
Member Author

Choose a reason for hiding this comment

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

can you provide the reference?, I can check if we can use it

@@ -8,6 +8,10 @@ PRIVATE_KEY_DEPLOYER=
TENDERLY_PROJECT=
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we check
/packages/contracts-bedrock/README.md ?

Specifically that is mandatory to use foundry version:
foundryup -C da2392e58bb8a7fefeba46b40c4df1afad8ccd22

Copy link
Collaborator

@0xmoebius 0xmoebius left a comment

Choose a reason for hiding this comment

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

LGTM

@0xRaccoon 0xRaccoon merged commit e0d5c85 into feat/wind-down-upgrade Nov 8, 2024
2 of 3 checks passed
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.

4 participants