Skip to content

[General] OZ Factory/Clone pattern is not working on zkSyncEra #561

Answered by bxpana
andrebrener asked this question in Deployments
Discussion options

You must be logged in to vote

We don't currently support ERC1167 since we have a different bytecode format. You could Accept the address in the constructor and fallback to this address always instead

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())
          …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@andrebrener
Comment options

@bxpana
Comment options

Answer selected by bxpana
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