Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest Foundry Forge breaks OZ Upgrades #51

Closed
Magicking opened this issue May 8, 2024 · 1 comment
Closed

Latest Foundry Forge breaks OZ Upgrades #51

Magicking opened this issue May 8, 2024 · 1 comment

Comments

@Magicking
Copy link

Magicking commented May 8, 2024

Using

%> forge --version
forge 0.2.0 (c486fca34 2024-05-06T14:17:57.000000000Z)

it spits out these errors

Ran 1 test for test/deployment/Upgrades.t.sol:DeploymentTest
[FAIL. Reason: setup failed: revert: Failed to run upgrade safety validation: /home/XXX/.npm/_npx/fb3494f8bab08a4d/node_modules/@openzeppelin/upgrades-core/dist/validate/run.js:152
        const content = solcInput.sources[source].content;
                                                  ^

TypeError: Cannot read properties of undefined (reading 'content')
    at checkNamespaceSolidityVersion (/home/XXX/.npm/_npx/fb3494f8bab08a4d/node_modules/@openzeppelin/upgrades-core/dist/validate/run.js:152:51)
    at validate (/home/XXX/.npm/_npx/fb3494f8bab08a4d/node_modules/@openzeppelin/upgrades-core/dist/validate/run.js:89:9)
    at runValidations (/home/XXX/.npm/_npx/fb3494f8bab08a4d/node_modules/@openzeppelin/upgrades-core/dist/cli/validate/validations.js:23:41)
    at validateBuildInfoContracts (/home/XXX/.npm/_npx/fb3494f8bab08a4d/node_modules/@openzeppelin/upgrades-core/dist/cli/validate/validations.js:14:29)
    at validateUpgradeSafety (/home/XXX/.npm/_npx/fb3494f8bab08a4d/node_modules/@openzeppelin/upgrades-core/dist/cli/validate/validate-upgrade-safety.js:23:74)
    at async main (/home/XXX/.npm/_npx/fb3494f8bab08a4d/node_modules/@openzeppelin/upgrades-core/dist/cli/validate.js:30:24)
    at async run (/home/XXX/.npm/_npx/fb3494f8bab08a4d/node_modules/@openzeppelin/upgrades-core/dist/cli/cli.js:6:5)

Node.js v21.7.3
] setUp() (gas: 0)
Suite result: FAILED. 0 passed; 1 failed; 0 skipped; finished in 4.56s (0.00ns CPU time)

while this version

%> forge --version
forge 0.2.0 (72bc4f4e6 2024-05-08T13:15:15.000000000Z)

works perfectly fine.

Regarding the content of Upgrades.t.sol, it's a test that imports a deployment Script and performs the Upgrades check to verify that the proxy upgrades are working.

Other information

%> git submodule
 bb4ceea94d6f10eeb5b41dc2391c6c8bf8e734ef lib/forge-std (v1.8.1)
 dbb6104ce834628e473d2173bbc9d47f81a9eec3 lib/openzeppelin-contracts (v5.0.0-12-gdbb6104c)
 723f8cab09cdae1aca9ec9cc1cfa040c2d4b06c1 lib/openzeppelin-contracts-upgradeable (v5.0.2)
 359589365aeba6cf41d39bae69867446b194e582 lib/openzeppelin-foundry-upgrades (v0.2.1)
@ericglau
Copy link
Member

ericglau commented May 9, 2024

This was reported and fixed through foundry-rs/foundry#7878.

Can you run foundryup again? I tested that it works with the latest version forge 0.2.0 (a4d79ac 2024-05-09T00:18:10.247407000Z).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants