remix-project icon indicating copy to clipboard operation
remix-project copied to clipboard

Compile UUPS proxy for older EVM target versions

Open ericglau opened this issue 1 year ago • 3 comments

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.

ericglau avatar Oct 12 '23 17:10 ericglau

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/)

bunsenstraat avatar Oct 31 '23 05:10 bunsenstraat

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

vinaykharayat avatar Feb 12 '24 05:02 vinaykharayat

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 ?

RpGmAx avatar Feb 19 '24 13:02 RpGmAx