SocketDotTech / socket-DL

GNU General Public License v3.0
54 stars 42 forks source link

Kinto integration #363

Closed fedealconada closed 4 months ago

fedealconada commented 5 months ago

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

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 commented 5 months ago

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.