OpenZeppelin / openzeppelin-foundry-upgrades

Foundry library for deploying and managing upgradeable contracts
MIT License
145 stars 22 forks source link

Failed to run upgrade safety validation #59

Open therealharpaljadeja opened 1 week ago

therealharpaljadeja commented 1 week ago

I am using openzeppelin-foundry-upgrades, openzeppelin contracts v5 and using the following code snippet in my setUp() function in foundry test.

 proxy = Upgrades.deployTransparentProxy(
      'Token.sol',
      tokenOwner,
      abi.encodeCall(Token.initialize, tokenOwner)
 );

foundry.toml

[profile.default]
src = "src"
out = "out"
libs = ["lib"]
ffi = true
ast = true
build_info = true
extra_output = ["storageLayout"]

OS: macOS Sonoma

I get the following error when running forge test. Compilation works, tests fail.

image
ericglau commented 6 days ago

This looks like an installation issue with the npm package @openzeppelin/upgrades-core or its dependency solidity-ast.

You can try manually installing that package for your project by running the following command from your project root:

npm install @openzeppelin/upgrades-core@latest