OpenZeppelin Clones CREATE2 keeps failing #154
-
EnvironmentTestnet Provide a brief description of the functionality you're trying to implement.We have a factory contract that deploys ERC-1167 Minimal Proxy contracts using the OpenZeppelin's Clones library which also uses CREATE2 for deployment of these proxies. What is the specific issue or error you're encountering?I keep getting the error Can you share the error messages or logs you're receiving, if any?
Tried using the exploere and failed. Sample Txn with same calldata: https://goerli.explorer.zksync.io/tx/0xf0f2d853430b6bc87222e68b805e2ae8898f0b0f3125d7f7ff8e0ca250cae07d#overview Have you made any recent changes to the contract before encountering this issue?No Are there any external libraries or contracts that your contract interacts with?OpenZeppelin's Clones library v4.8.0 Can you provide the relevant portions of your contract code where the issue is occurring?The relevant code from the Clones library is this: function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) {
/// @solidity memory-safe-assembly
assembly {
// Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes
// of the `implementation` address with the bytecode before the address.
mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))
// Packs the remaining 17 bytes of `implementation` with the bytecode after the address.
mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))
instance := create2(0, 0x09, 0x37, salt)
}
require(instance != address(0), "ERC1167: create2 failed");
} Have you tried to isolate the problem, and if so, what were the results?Not yet What steps have you already taken to try to resolve the issue?I went through the docs regarding the CREATE, CREATE2 differences. But I am still unsure if its not possible to use the type of code used in OpenZeppelin's Clones library Repo Link (Optional)private monorepo Additional DetailsNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Duplicate of #91 |
Beta Was this translation helpful? Give feedback.
Duplicate of #91