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(protocol-kit): Predict Safe address improvements #982

Merged
merged 31 commits into from
Sep 26, 2024

Conversation

yagopv
Copy link
Member

@yagopv yagopv commented Sep 20, 2024

What it solves

Resolves #968

How this PR fixes it

  • We are adding a new method to the protocolKit instance
const contractInfo = protocolKit.getContractInfo("0xContractAddress")

it returns the following:

{
  version: "1.3.0"
  type: "eip155"
  contractName: "safeSingletonVersion"
}

We can check the specific safe version and deployment type of a Safe contract Ethereum address

  • We are adding a new optional property to the SafeDeploymentConfig
{
  saltNonce?: string
  safeVersion?: SafeVersion
  deploymentType?: DeploymentType // New "canonical", "eip155" or "zksync"
}

When using this new property with the predictedSafe, the protocolKit initialisation step will use the specified deployment type

const protocolKitGnosis = await Safe.init({
  provider: 'https://rpc.gnosischain.com',
  predictedSafe: {
    safeAccountConfig: {
      owners: ['0xOwnerAddress'],
      threshold: 1
    },
    safeDeploymentConfig: {
      safeVersion: '1.3.0',
      saltNonce: '0x123',
      deploymentType: 'eip155'
    }
  }
})
  • Not related to the concrete issue => We are moving the SafeProvider.init method params to an options object

@coveralls
Copy link

coveralls commented Sep 20, 2024

Pull Request Test Coverage Report for Build 11052216509

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 76.73%

Totals Coverage Status
Change from base Build 11030325314: 0.0%
Covered Lines: 777
Relevant Lines: 948

💛 - Coveralls

@yagopv yagopv requested a review from schmanu September 24, 2024 12:16
@yagopv yagopv linked an issue Sep 24, 2024 that may be closed by this pull request
@yagopv yagopv marked this pull request as ready for review September 24, 2024 14:04
@yagopv yagopv merged commit dc602ed into development Sep 26, 2024
20 checks passed
@yagopv yagopv deleted the feat/predict-safe-address-custom-contracts branch September 26, 2024 14:55
@github-actions github-actions bot locked and limited conversation to collaborators Sep 26, 2024
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.

[protocol-kit] Predict Safe with custom contracts
3 participants