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: deploy contracts using EIP1193 provider #211

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

NicoSerranoP
Copy link

The EIP1193 provider was not sending the right deploy contract data to the kernelClient.eth_sendTransaction. This change does the following:

  1. When using the EIP1193 provider
  2. If the SendTransactionParameters do not contain the field to then
  3. Take the tx.data (contract deployment data sent by the factory) and put it as input for the encodedSafeCreateCall function that generates code for the safe smart account to deploy a contract
  4. Set the tx.data to the new deploy encoded data and to to the safeCreateCallAddress. It is similar to this step:
  5. Else do the normal flow

I am having some problems because factory.deploy( ... ) computes the contract address from the sender and the nonce. This does not work in this case because the contract is being deployed by another contract. I submitted an issue to ethers.js with my current patch.

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.

1 participant