Skip to content

Commit

Permalink
Merge pull request #299 from gin/gin/pin-version-openzeppelin-contrac…
Browse files Browse the repository at this point in the history
…ts-upgradeable

Advanced Foundry, Upgradeable Smart Contracts: Pin version in openzeppelin-contracts-upgradeable and initialize proxy in demo code
  • Loading branch information
Equious authored Jan 7, 2025
2 parents e943ec1 + 52070ce commit 4010692
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ contract BoxV2 {
In order to implement the UUPS functionality, we're going to leverage an OpenZeppelin library. This one is actually different from the OpenZeppelin/Contracts we're used to and is tailored specifically for upgradeability. Let's install this library.

```bash
forge install OpenZeppelin/openzeppelin-contracts-upgradeable --no-commit
forge install OpenZeppelin/openzeppelin-contracts-upgradeable@v4.9.6 --no-commit
```

Once installed we can add our remappings to our `foundry.toml`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ contract DeployBox is Script {
vm.startBroadcast();
BoxV1 box = new BoxV1(); // Implementation
ERC1967Proxy proxy = new ERC1967Proxy(address(box), "");
BoxV1(address(proxy)).initialize();
vm.stopBroadcast();
return address(proxy);
}
Expand Down

0 comments on commit 4010692

Please sign in to comment.