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

Fixed bug where domainSeparator was constant bytes32(0) #979

Conversation

davidberiro
Copy link

In the current version, _INITIAL_DOMAIN_SEPARATOR is initialized in the constructor to be constant bytes32(0)

This is because the constructor uses the "gas efficient" domain separator function, but since the INITIAL_CHAIN_ID is set first, the _INITIAL_DOMAIN_SEPARATOR retains its original default value (bytes32(0)).

One potential fix is to simply change the order and set the domain separator before the chain id. The only potential drawback here is if this contract is deployed on ethereum classic (chain id 0), the original bug persists. Because of that edge case I've decided to go with this "bulletproof" fix.

Also note that the address(this) in the domain separator no longer refers to the proxy contract address, but rather the implementation address. This is because _INITIAL_DOMAIN_SEPARATOR is set in the constructor rather than initializer.

0xClandestine and others added 17 commits December 13, 2024 19:27
* feat: add share helpers

* fix: add deposit scaling factor

* fix: rebase
* fix: slashable window boundaries

* test: regression for alm

* test: update withdrawal delay not passed reversion

* test: burning indices

* refactor: switch conditionals

* fix: added unit tests

* test: assert slashable shares in queue

* fix: typos

---------

Co-authored-by: Yash Patil <[email protected]>
refactor small cleanup

chore: `forge fmt`

fix: `getQueuedWithdrawals` + test

fix: add constructor back

test: `totalQueued` > `withdrawal.strategies.length`

test(wip): `completeQueuedWithdrawals`

currently failing

fix: effectBlock

test(wip): @8sunyuan patch

fix: one flaky test

fix: second flaky test
* feat: initial deploy

* feat: slashing patch
* test(wip): todos

* fix: dealloc issue

* fix: remaining

* fix: forktest upgrade issue

* test: add `check_Withdrawal_AsShares_State_AfterSlash`

* refactor: cleanup

* fix: ci

* refactor: review changes
@ypatil12
Copy link
Collaborator

ypatil12 commented Jan 6, 2025

Closing in favor of #990

@ypatil12 ypatil12 closed this Jan 6, 2025
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.

6 participants