Closed fedealconada closed 4 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.
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 adeployContract
function suitable for deploying any contract and also compatible with ownable contracts which expose thetransferOwnership()
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 includedKintoDeployer.sol
which is a convenience contract that simply exposes adeploy
function which performsCREATE2
deployments and nominates an address for ownership.Requirements before running the deployment scripts
SOCKET_SIGNER_KEY
env var with the signer's private keySOCKET_OWNER_ADDRESS
env var with your Kinto Wallet (note that this is not the address of theSOCKET_SIGNER_KEY
but your Kinto WalletHow to run
1). On
config.ts
, on thechains
array, comment all the chains except forKinto
2). Resolve TODOs 3). Runbash 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)