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

Fix L2 initialization #116

Merged
merged 2 commits into from
Nov 24, 2021
Merged

Fix L2 initialization #116

merged 2 commits into from
Nov 24, 2021

Conversation

germartinez
Copy link
Member

What it solves

The Master Copy address is obtained from safe-deployments based on the network and contract version.

When the SDK is initialized, to obtain the contract version we need to instantiate the contract and call the VERSION() method. This instance is called temporarySafeContract and uses the SAFE_BASE_VERSION (v1.1.1) just to obtain the contract version and instantiate the contract again with the real one.

When working with L2 contracts (GnosisSafeL2.sol) and Web3 provider (not Ethers), it fails because it tries to get the ABI from safe-deployments for the version v1.1.1, but that version does not have a GnosisSafeL2.sol contract. (It works using the flag isL1SafeContract=true but that forces to use a different Master Copy).

How this PR fixes it

Uses v1.3.0 as the temporary Safe contract to prevent this.

@github-actions
Copy link

CLA Assistant Lite All Contributors have signed the CLA.

Copy link
Member

@iamacook iamacook left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@DiogoSoaress DiogoSoaress left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

@germartinez germartinez merged commit 4989ac6 into main Nov 24, 2021
@germartinez germartinez deleted the fix-l2-init branch November 24, 2021 12:32
@github-actions github-actions bot locked and limited conversation to collaborators Nov 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants