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

Kinto integration #363

Closed
wants to merge 37 commits into from
Closed

Kinto integration #363

wants to merge 37 commits into from

Conversation

fedealconada
Copy link

@fedealconada fedealconada commented Apr 22, 2024

Context

Kinto only allows transactions from account abstraction-powered wallets. Externally owned accounts (EOA) are disabled for greater security and to provide a uniform, delightful user experience.

Since EOAs are disabled at chain level, all deployments need to be done using some sort of factory contract. Kinto has the KintoWalletFactory convenience contract which exposes a deployContract function suitable for deploying any contract and also compatible with ownable contracts which expose the transferOwnership() function. Contracts implementing custom "ownable" functionalities would require implementing a custom factory to transfer ownership to a different address.

Description

This PR modifies Socket's deployment scripts to work with Kinto's requirements; Every time there's a deployment or a call that modifies the chain state, we replace it with a handleOps() call to Kinto's EntryPoint.

Since Socket uses a custom 2-step Ownable contract we have included KintoDeployer.sol which is a convenience contract that simply exposes a deploy function which performs CREATE2 deployments and nominates an address for ownership.

Requirements before running the deployment scripts

  • Complete KYC or KYB
  • Set SOCKET_SIGNER_KEY env var with the signer's private key
  • Ask Kinto team to create a Kinto wallet for you (*)
  • Set SOCKET_OWNER_ADDRESS env var with your Kinto Wallet (note that this is not the address of the SOCKET_SIGNER_KEY but your Kinto Wallet
  • Make sure your Kinto Wallet has enough funds

How to run

1). On config.ts, on the chains array, comment all the chains except for Kinto
2). Resolve TODOs
3). Run bash deploy.sh

(*) in oder for the Kinto team to create a Kinto wallet for you, run `npx ts-node ./scripts/deploy/utils/kinto/sign.ts and share the signature with them (so the contract can verify that the request is indeed coming from your signer address)

@arthcp
Copy link
Contributor

arthcp commented Apr 23, 2024

Thanks for the PR, since this has a lot of kinto specific logic I dont think we should merge the code into main. I think it is best to maintain a fork under your org and take up deployment + ownership on kinto.
Once deployed we can do some smoke tests to check all is deployed properly.

@fedealconada fedealconada force-pushed the master branch 2 times, most recently from 7bcdb7e to ad647be Compare May 20, 2024 15:44
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.

None yet

2 participants