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

Incorrect deployment addresses listed for zkSync Sepolia (chainid 300) #686

Open
spengrah opened this issue Jul 5, 2024 · 17 comments
Open

Comments

@spengrah
Copy link

spengrah commented Jul 5, 2024

I'm trying to deploy a contract to zkSync Era Sepolia (chainid 300) that interacts with several safe contracts, and I'm not finding those contracts to be deployed even though they have deployments listed on their respective v1.3.0 lists.

In fact, the addresses listed as deployed to chainid 300 in each of the below cases is the "canonical" address rather than the expected "zksync" address (which is listed for zkSync Era Mainnet, chainid 324).

@spengrah
Copy link
Author

spengrah commented Jul 5, 2024

cc @alexkeating

@mmv08
Copy link
Member

mmv08 commented Jul 5, 2024

Chain id 300 originally belonged to Optimism on gnosis chain: #85

Looks like it was deprecated and the chain id got taken over by zksync: https://github.com/ethereum-lists/chains/commits/master/_data/chains/eip155-300.json

If you could deploy the contracts to zksync sepolia and create a PR, that would be great

@alexkeating
Copy link

@mmv08 To deploy to zksync sepolia we need to first deploy the safe singleton factory and the bot seems to error on the chains rpc url. safe-global/safe-singleton-factory#575

@remedcu
Copy link
Member

remedcu commented Jul 15, 2024

Looks like the gasLimit is resulting in null value: https://github.com/safe-global/safe-singleton-factory/actions/runs/9941306550/job/27460023828

So, the response here is generating a null value.

@alexkeating
Copy link

Ah thanks, iit looks like the github deploy does not support zksync based networks.

@remedcu
Copy link
Member

remedcu commented Jul 15, 2024

This is the response in short for the script:

bash-3.2$ FACTORY_BYTECODE="${FACTORY_BYTECODE:-0x604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf3}"
bash-3.2$ FACTORY_DEPLOYER_ADDRESS="${FACTORY_DEPLOYER_ADDRESS:-0xE1CB04A0fA36DdD16a06ea828007E35e1a3cBC37}"
bash-3.2$ json_request='[
>     {
>         "jsonrpc": "2.0",
>         "method": "eth_gasPrice",
>         "params": [],
>         "id": 1
>     },
>     {
>         "jsonrpc": "2.0",
>         "method": "eth_estimateGas",
>         "params": [
>             {
>                 "from": "'$FACTORY_DEPLOYER_ADDRESS'",
>                 "data": "'$FACTORY_BYTECODE'"
>             }
>         ],
>         "id": 2
>     }
> ]'
bash-3.2$ rpc_url=https://sepolia.era.zksync.dev
bash-3.2$ response=$(curl -s "$rpc_url" --location --header 'Content-Type: application/json' --data "$json_request")
bash-3.2$ echo $response
[{"jsonrpc":"2.0","result":"0x17d7840","id":1},{"jsonrpc":"2.0","error":{"code":3,"message":"Failed to serialize transaction: toAddressIsNull"},"id":2}]

@alexkeating
Copy link

alexkeating commented Jul 15, 2024

@remedcu yes, and it would make sense for this to fail because the bytecode on a zkSync era network would be incompatible with the bytecode on an evm network. What would be the best way to move this forward?

@mmv08
Copy link
Member

mmv08 commented Jul 15, 2024

Looks like the gasLimit is resulting in null value: https://github.com/safe-global/safe-singleton-factory/actions/runs/9941306550/job/27460023828

So, the response here is generating a null value.

Alexander is right here, the CI script doesn't support ZKSync networks. It's fine to proceed still, the actual deployment script will work.

@alexkeating
Copy link

Thanks @mmv08! I was able to deploy the safe-singleton-factory, but I did need to modify the submit script. I have a different sender address than other deployments which is creating a different address for the safe-singleton contract compared to the other zksync network deployments. How can I get the safe-singleton deployed with the correct address? My understanding is we need the safe-singleton deployed before we can deploy the rest of the safe contracts.

@remedcu
Copy link
Member

remedcu commented Jul 16, 2024

You can use this repo to create an issue so the Safe team can create a safe-singleton contract for you.

@alexkeating
Copy link

alexkeating commented Jul 16, 2024

@remedcu Thanks! I did here. There also seems to be a similar request from back in March here.

@alexkeating
Copy link

@remedcu @mmv08 I am having trouble deploying to zksync sepolia. I am using this branch locally and get the following error Error: deterministic zk deployments are not supported at this time. Any ideas how I can get past this? I only changed the rpc and network in the hardhat config.

@mmv08
Copy link
Member

mmv08 commented Jul 19, 2024

@remedcu @mmv08 I am having trouble deploying to zksync sepolia. I am using this branch locally and get the following error Error: deterministic zk deployments are not supported at this time. Any ideas how I can get past this? I only changed the rpc and network in the hardhat config.

I can reproduce it, but honestly, I have no idea why it doesn't work, but it seems to be in line with the zksync pattern i observe - things are just not working. I relayed this to the Protofire team, which worked on the integration back then.

@nick8319
Copy link
Contributor

Hi guys, I just was able to deploy and verify safe contracts to zkSync Sepolia using the mentioned branch :
deploying "SimulateTxAccessor" (tx: 0xa6e274ca8d719c6d906a68bfdff971041f7d76db8b9200a3f1ef24cd48d3b540)...: deployed at 0x4191E2e12E8BC5002424CE0c51f9947b02675a44 with 356418 gas deploying "GnosisSafeProxyFactory" (tx: 0x51f5b1cc6fc5b735d842d8ceb534448409aeb6d61d0287862719d94ff15f11ed)...: deployed at 0xDAec33641865E4651fB43181C6DB6f7232Ee91c2 with 13365501 gas deploying "DefaultCallbackHandler" (tx: 0x68d980be3a68105c33ce09b138ac9bc89de67613ad8ecb6000de344ae048f401)...: deployed at 0x08798512808f838a06BCe7c26905f05e94dF6f50 with 3169906 gas deploying "CompatibilityFallbackHandler" (tx: 0xc9e39a476a4c1a4151463629ebac6f8d8ea3f6fb8bb353e6ed11292ea084aeaf)...: deployed at 0x2f870a80647BbC554F3a0EBD093f11B4d2a7492A with 15112508 gas deploying "CreateCall" (tx: 0xc4265f379ff435364529561cca1db7174fe4960ce6995111817af066d9c1c26a)...: deployed at 0xcB8e5E438c5c2b45FbE17B02Ca9aF91509a8ad56 with 3690842 gas deploying "MultiSend" (tx: 0x7df2e847a2b74cf14b97f9673248f4572d7b78880af0f45c8230024bfd24e22b)...: deployed at 0x0dFcccB95225ffB03c6FBB2559B530C2B7C8A912 with 3464038 gas deploying "MultiSendCallOnly" (tx: 0x615578b1c84bf10171f5390fde95b8579252b57b720f71869e3d0931e534d196)...: deployed at 0xf220D3b4DFb23C4ade8C88E526C1353AbAcbC38F with 2309635 gas deploying "SignMessageLib" (tx: 0xe0b0139fe8ddce9fb86957136e0bbb45f8549dabadb32cbbdc2fd96bc4795b4e)...: deployed at 0x357147caf9C0cCa67DfA0CF5369318d8193c8407 with 5461844 gas deploying "GnosisSafeL2" (tx: 0x52e87056bca03617e9ee72c23044690976a99eefc4bb961e9c348de6d2b16650)...: deployed at 0x1727c2c531cf966f902E5927b98490fDFb3b2b70 with 44128994 gas deploying "GnosisSafe" (tx: 0x01450ba0d79b19506b39f578d8437b589a37a021485bd492c8ae8b98fede9789)...: deployed at 0xB00ce5CCcdEf57e539ddcEd01DF43a13855d9910 with 41945796 gas ✨ Done in 46.41s.

@mmv08
Copy link
Member

mmv08 commented Jul 19, 2024

Hi guys, I just was able to deploy and verify safe contracts to zkSync Sepolia using the mentioned branch : deploying "SimulateTxAccessor" (tx: 0xa6e274ca8d719c6d906a68bfdff971041f7d76db8b9200a3f1ef24cd48d3b540)...: deployed at 0x4191E2e12E8BC5002424CE0c51f9947b02675a44 with 356418 gas deploying "GnosisSafeProxyFactory" (tx: 0x51f5b1cc6fc5b735d842d8ceb534448409aeb6d61d0287862719d94ff15f11ed)...: deployed at 0xDAec33641865E4651fB43181C6DB6f7232Ee91c2 with 13365501 gas deploying "DefaultCallbackHandler" (tx: 0x68d980be3a68105c33ce09b138ac9bc89de67613ad8ecb6000de344ae048f401)...: deployed at 0x08798512808f838a06BCe7c26905f05e94dF6f50 with 3169906 gas deploying "CompatibilityFallbackHandler" (tx: 0xc9e39a476a4c1a4151463629ebac6f8d8ea3f6fb8bb353e6ed11292ea084aeaf)...: deployed at 0x2f870a80647BbC554F3a0EBD093f11B4d2a7492A with 15112508 gas deploying "CreateCall" (tx: 0xc4265f379ff435364529561cca1db7174fe4960ce6995111817af066d9c1c26a)...: deployed at 0xcB8e5E438c5c2b45FbE17B02Ca9aF91509a8ad56 with 3690842 gas deploying "MultiSend" (tx: 0x7df2e847a2b74cf14b97f9673248f4572d7b78880af0f45c8230024bfd24e22b)...: deployed at 0x0dFcccB95225ffB03c6FBB2559B530C2B7C8A912 with 3464038 gas deploying "MultiSendCallOnly" (tx: 0x615578b1c84bf10171f5390fde95b8579252b57b720f71869e3d0931e534d196)...: deployed at 0xf220D3b4DFb23C4ade8C88E526C1353AbAcbC38F with 2309635 gas deploying "SignMessageLib" (tx: 0xe0b0139fe8ddce9fb86957136e0bbb45f8549dabadb32cbbdc2fd96bc4795b4e)...: deployed at 0x357147caf9C0cCa67DfA0CF5369318d8193c8407 with 5461844 gas deploying "GnosisSafeL2" (tx: 0x52e87056bca03617e9ee72c23044690976a99eefc4bb961e9c348de6d2b16650)...: deployed at 0x1727c2c531cf966f902E5927b98490fDFb3b2b70 with 44128994 gas deploying "GnosisSafe" (tx: 0x01450ba0d79b19506b39f578d8437b589a37a021485bd492c8ae8b98fede9789)...: deployed at 0xB00ce5CCcdEf57e539ddcEd01DF43a13855d9910 with 41945796 gas ✨ Done in 46.41s.

did you have this branch locally, or was it freshly checked out? Perhaps your local dependencies are different? What os did you use?

@nick8319
Copy link
Contributor

I have it locally, but it is in sync with the remote branch (apart from zkSyncSepolia network in hardhat, and I put a safe-singleton-factory json into artifacts in node_modules).
I am using MacOS, node version is 20.10.0
image

@alexkeating
Copy link

Thank you @nick8319! FWIW I am using Fedora as my OS, and I also copied the safe singleton into my node modules.

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 a pull request may close this issue.

5 participants