remix-project
remix-project copied to clipboard
Compile UUPS proxy for older EVM target versions
Remix currently deploys UUPS proxy bytecode which was compiled from OpenZeppelin Contract 5.0 and uses Solidity ^0.8.20
However, the bytecode https://github.com/ethereum/remix-project/blob/ba2113659b614628025ec20a2a1af5f7c7b7c621/libs/remix-core-plugin/src/lib/constants/uups.ts#L5
appears to be targeting shanghai
and has PUSH0 opcodes which are not compatible with older EVM versions.
When a user tries to deploy this UUPS proxy to an older EVM environment, they would get an invalid opcode error. For example, this was encountered by a user.
Note that OpenZeppelin Contracts 5.0 does not strictly require shanghai, and can be compiled with older target versions when more compatibility is required.
Remix can precompile the UUPS proxy using an older target (e.g. paris
) instead.
This has been addressed in a PR for the coming release. https://github.com/ethereum/remix-project/pull/4143 It can best tested here: https://remix-alpha.ethereum.org/)
This has been addressed in a PR for the coming release. #4143 It can best tested here: https://remix-alpha.ethereum.org/)
I guess the issue is still there
Hi,
Yes, issue is still there, the ERC1967 proxy contract still use "Shangai" EVM version (with PUSH0 opcode).
@bunsenstraat if you can take a look ?