10000 Contracts connector by voltrevo · Pull Request #586 · getwax/bls-wallet · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Nov 5, 2023. It is now read-only.

Contracts connector #586

Merged
merged 1 commit into from
May 2, 2023
Merged

Contracts connector #586

merged 1 commit into from
May 2, 2023

Conversation

voltrevo
Copy link
Collaborator
@voltrevo voltrevo commented Apr 24, 2023

Dependent PR

This PR depends on #585.

After that's merged, toggle the target branch back and forth or push an empty commit to fix the diff. (Preview of this PR's changes.)

(If you want, you can also just review+merge this one directly. Github will automerge the previous PRs.)

What is this PR doing?

Adds a new utility ContractsConnector to bls-wallet-clients.

Now that we use SafeSingletonFactory, there's no need to deal with configured addresses - instead you just connect to the contracts predetermined address (or throw an error if it's no there). The only problem is that you need the init data to figure out the address, and that init data can be another predetermined address. Our contracts are a small network of singletons that are initialized in a tree. ContractsConnector is just making this easy by dealing with the init data for you.

How can these changes be manually tested?

yarn hardhat test

Does this PR resolve or contribute to any issues?

Contributes to #406.

Checklist

  • I have manually tested these changes
  • Post a link to the PR in the group chat

Guidelines

  • If your PR is not ready, mark it as a draft
  • The resolve conversation button is for reviewers, not authors
    • (But add a 'done' comment or similar)

@github-actions github-actions bot added clients contracts Smart contract related labels Apr 24, 2023
@voltrevo voltrevo mentioned this pull request Apr 24, 2023
2 tasks
@blakecduncan blakecduncan changed the base branch from contract-updates to main May 2, 2023 11:03
@blakecduncan blakecduncan changed the base branch from main to contract-updates May 2, 2023 11:03
Copy link
Contributor
@blakecduncan blakecduncan left a comment

Choose a reason for hiding this comment

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

LGTM - Gonna merge in so I can keep reviewing the next PRs

Only thing I noticed is, it doesn't look like ContractsConnector is used anywhere in the code. Would yarn hardhat test actually test anything in this file?

Edit: nvm I see you use it in the next PR

@blakecduncan blakecduncan merged commit daa51bc into contract-updates May 2, 2023
@blakecduncan blakecduncan deleted the contracts-connector branch May 2, 2023 11:26
static async create(signerOrProvider: SignerOrProvider) {
let provider: ethers.providers.Provider;

if ("getNetwork" in signerOrProvider) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason to not use ethers.providers.Provider.isProvider() here?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
clients contracts Smart contract related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0