Skip to content

[Deployment] ERC1167 create failed error when cloning a contract #605

Closed Answered by jennyg0
ArshaanB asked this question in Deployments
Discussion options

You must be logged in to vote

hey @ArshaanB, erc1167 isn't supported on zksync due to the different bytecode format. Instead, can you try a proxy, something like this:

pragma solidity ^0.8.20;

contract Proxy {
address immutable implementation;

constructor(address _implementation) {
    implementation = _implementation;
}

fallback() external payable {
    address impl = implementation;
    assembly {
        // The pointer to the free memory slot
        let ptr := mload(0x40)
        // Copy function signature and arguments from calldata at zero position into memory at pointer position
        calldatacopy(ptr, 0, calldatasize())
        // Delegatecall method of the implementation contract returns 0 on error
     …

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@ArshaanB
Comment options

@jennyg0
Comment options

@ArshaanB
Comment options

@jennyg0
Comment options

Answer selected by ArshaanB
@ArshaanB
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployment Questions for deployment
3 participants