getwax / bls-wallet

Core components to use layer 2 smart contract wallets with the BLS signature scheme
MIT License
178 stars 47 forks source link

Contracts connector #586

Closed voltrevo closed 1 year ago

voltrevo commented 1 year ago

Dependent PR

This PR depends on https://github.com/web3well/bls-wallet/pull/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

Guidelines