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

Deterministic Deployments Can't Work With Library Due To Gas Limit #45

Closed
xBalbinus opened this issue Aug 8, 2024 · 6 comments
Closed
Assignees
Labels
from slack Painpoint request flagged from Slack

Comments

@xBalbinus
Copy link
Collaborator

Description:
https://github.com/Arachnid/deterministic-deployment-proxy is one of the most popular EVM deployment tools for deploying smart contracts to a canonical address across all chains in a permissionless way. Unfortunately it has a hard-coded gasLimit (on the README) and FVM’s gasLimit is an order of magnitude higher. Drips.network and other EVM teams currently cannot use this popular proxy to deploy their contracts to their canonical addresses on FVM due to differences in our gasLimit.
• Current https://filfox.info/en/stats/gasFVM gasLimit>s from Filfox vs 100000 required by the deterministic-deployment-proxy
• Here’s the explanation of how the deterministic deployer deployment transaction works: ZeframLou/create3-factory#4 (comment)
• The Arachnid deterministic deployer is used to CREATE2 the CREATE3Factory, which is used to create a DripsDeployer which then deploys all the Drips contracts using CREATE3

Source:
https://filecoinproject.slack.com/archives/C0745JU645A/p1723119353808849?thread_ts=1723119353.808849&cid=C0745JU645A

@xBalbinus xBalbinus added the from slack Painpoint request flagged from Slack label Aug 8, 2024
@github-project-automation github-project-automation bot moved this to 🌑 Unstarted / Needs Triage in Filecoin DX Painpoints Tracker Aug 8, 2024
@xBalbinus xBalbinus changed the title <New Issue From Slack> Deterministic Deployments Can't Work With Library Due To Gas Limit Aug 8, 2024
@longfeiWan9 longfeiWan9 moved this from 🌑 Unstarted / Needs Triage to 🖊 Planning in Filecoin DX Painpoints Tracker Aug 12, 2024
@longfeiWan9
Copy link
Member

@xBalbinus Can you please review this pain-point and add potential solution for it?

@xBalbinus
Copy link
Collaborator Author

A current solution right now is to use Safe's singleton factory for deterministic deployments, see

import { getSingletonFactoryInfo } from "@safe-global/safe-singleton-factory";

const deterministicDeployment = (network: string): DeterministicDeploymentInfo => {
    const info = getSingletonFactoryInfo(parseInt(network));
    if (!info) {
        throw new Error(`
        Safe factory not found for network ${network}. You can request a new deployment at https://github.com/safe-global/safe-singleton-factory.
        For more information, see https://github.com/safe-global/safe-contracts#replay-protection-eip-155
      `);
    }
    return {
        factory: info.address,
        deployer: info.signerAddress,
        funding: BigNumber.from(info.gasLimit).mul(BigNumber.from(info.gasPrice)).toString(),
        signedTx: info.transaction,
    };
};

And include deterministicDeployment in your hardhat config.

In the future, we should probably look to fork the Arachnid library, or even create a deployment factory contract example for people to fork off of.

@trruckerfling
Copy link
Collaborator

https://github.com/Arachnid/deterministic-deployment-proxy adding this that @longfeiWan9 shared. So does that mean that we will need to provide a custom deployment repo for both foundry and hardhat or just one?

@trruckerfling trruckerfling moved this from 🖊 Planning to 🚧 In progress in Filecoin DX Painpoints Tracker Aug 22, 2024
@longfeiWan9 longfeiWan9 self-assigned this Aug 26, 2024
@trruckerfling
Copy link
Collaborator

Resolved with docs guide filecoin-project/filecoin-docs#2309

@trruckerfling
Copy link
Collaborator

@xBalbinus you solved this issue with adding of deterministic deployment. close this issue? #82 is assigned to me to finish up

@xBalbinus
Copy link
Collaborator Author

xBalbinus commented Dec 16, 2024 via email

@trruckerfling trruckerfling moved this from 🚧 In progress to 👀 In review in Filecoin DX Painpoints Tracker Dec 16, 2024
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Filecoin DX Painpoints Tracker Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
from slack Painpoint request flagged from Slack
Projects
Status: Done
Development

No branches or pull requests

3 participants