Hello team,
i tried to deploy the contract and i am using create2 but the result is different in ethereum and same in bsc and matic.
here is my code
address internal CONTRACTWALLET=0x32DEDD5C2AdF4F6180f28a6A216066A4139935b5;
function getBytecode( uint256 _foo) public view returns (bytes memory) {
bytes memory bytecode = type(Vault).creationCode;
return abi.encodePacked(bytecode, abi.encode(CONTRACTWALLET, _foo));
}
function getAddress(uint256 _salt) public view returns (address) {
bytes32 hash = keccak256(
abi.encodePacked(bytes1(0xff), address(this), _salt, keccak256(getBytecode(_salt)))
);
return address(uint160(uint(hash)));
}
generate address is completly giving different address in ethereum chain and different address in matic and bsc chain
Jun 19, 2023, 11:30 AM
the contract address is same
and the acconut from which i try is the same
and to my advantage the nonce values is same in all chains
same contract code
the contract code snippet is shared, and the same code is used all the time
this
Jun 19, 2023, 12:45 PM