foundry-upgrades
foundry-upgrades copied to clipboard
Member "upgradeTo" not found
I am trying to add those upgradeable Solidity helper files from src folder into my repo.
But after adding them, Foundry could not compile!??
Error (9582): Member "upgradeTo" not found or not visible after argument-dependent lookup in contract TransparentUpgradeableProxy.
--> src/utils/UpgradeProxy.sol:33:17:
|
33 | uups.upgradeTo(newImplementation);
| ^^^^^^^^^^^^^^
Is there some other dependencies I need ?
In the README file it says forge install
... What would Foundry install? What are those dependencies? I cannot find them in foundry.toml
Only in .gitmodules, I found
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/brockelmore/forge-std
[submodule "lib/ds-test"]
path = lib/ds-test
url = https://github.com/dapphub/ds-test
Are those the dependencies?
I know forge-std will be auto installed. And I know how to install OpenZeppelin:
forge install Openzeppelin/openzeppelin-contracts
After some investigation, it seems OpenZeppelin may have been the problem... UpgradeProxy inherits from DeployProxy, which declares uups as a new TransparentUpgradeableProxy(..) TransparentUpgradeableProxy inherits from ERC1967Proxy, which inherits from Proxy, ERC1967Upgrade. ERC1967Upgrade inherits from IERC1967. But current OpenZeppelin IERC1967 has no function defined!?? So it seems this repo code needs to be updated to work with current OpenZeppelin 4.9.2 version. Okay? Also why does this repo install an older OpenZeppelin v4.5.0 ? Where does it set OZ's version?