Giter Site home page Giter Site logo

Comments (6)

pcaversaccio avatar pcaversaccio commented on June 30, 2024

@dinesh11515 thanks for the request. Can you please fund the deployer address 0x554282Cf65b42fc8fddc6041eb24ce5E8A0632Ad with enough funds on the chains you need and I will deploy it accordingly.

from create2deployer.

dinesh11515 avatar dinesh11515 commented on June 30, 2024

Need ZkSync,Mantle,FVM, Scroll testnets
I have sent the testnet tokens to that address
@pcaversaccio

from create2deployer.

pcaversaccio avatar pcaversaccio commented on June 30, 2024

Thanks - I will look into those. Actually I don't know yet how to deploy on zksync since they don't follow the usual RLP scheme used by EVMs: https://era.zksync.io/docs/dev/building-on-zksync/contracts/contract-deployment.html#differences-in-create-behaviour

For the ease of supporting account abstraction, for each account, we split the nonce into two parts: the deployment nonce and the transaction nonce. The deployment nonce is the number of contracts the account has deployed with CREATE opcode, while the transaction nonce is used for replay attack protection for the transactions.

This means that while for smart contracts the nonce on zkSync behaves the same way as on Ethereum, for EOAs calculating the address of the deployed contract is not as straightforward. On Ethereum, it can be safely calculated as hash(RLP[address, nonce]), while on zkSync it is recommended to wait until the contract is deployed and catch the ContractDeployed event emitted by ContractDeployer with the address of the newly deployed contract. All of this is done in the background by the SDK.

I simulated the deployment using the zksync hardhat tools and the deployment from my EOA would lead to an incorrect Create2Deployer address. I asked in their discord for help but I can be that it's not possible to deploy it right now.

from create2deployer.

pcaversaccio avatar pcaversaccio commented on June 30, 2024

1eb0b35 added Mantle and Filecoin. What Scroll testnet did you send the tokens? I couldn't figure it out.

from create2deployer.

pcaversaccio avatar pcaversaccio commented on June 30, 2024

Ok after a zksync deep-dive, I must inform you that I won't be able to deploy my Create2Deployer there on the address 0x13b0D85CcB8bf860b6b79AF3029fCA081AE9beF2. Let me elaborate the reason why it won't work:

If you deploy a contract, the zksync system contracts invoke the function create under the hood. This function in turn calls a function createAccount which calls the function getNewAddressCreate. This function looks like the following:

    /// @notice Calculates the address of a deployed contract via create
    /// @param _sender The account that deploys the contract.
    /// @param _senderNonce The deploy nonce of the sender's account.
    function getNewAddressCreate(
        address _sender,
        uint256 _senderNonce
    ) public pure override returns (address newAddress) {
        // No collision is possible with the Ethereum's CREATE, since
        // the prefix begins with 0x63....
        bytes32 hash = keccak256(
            bytes.concat(CREATE_PREFIX, bytes32(uint256(uint160(_sender))), bytes32(_senderNonce))
        );

        newAddress = address(uint160(uint256(hash)));
    }

The issue here is now the CREATE_PREFIX with value 0x63bae3a9951d38e8a3fbb7b70909afc1200610fc5bc55ade242f815974674f23. This will lead to a different derived address than you would expect on any "normal" EVM chain.

The only remaining thing I can do for you is to deploy to the Scroll network if you tell me which test network you sent the tokens to.

from create2deployer.

pcaversaccio avatar pcaversaccio commented on June 30, 2024

Completed via 3ccdac4. For zkSync you will need to find another solution.

from create2deployer.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.