From 7bdb777f6a4f4e0018fed0b74155c9a5d31b6433 Mon Sep 17 00:00:00 2001 From: Eric Lau Date: Thu, 5 Dec 2024 16:13:25 -0500 Subject: [PATCH] Update Foundry docs (#1105) --- .../pages/foundry/pages/foundry-upgrades.adoc | 28 +++++++++++++++++++ submodules/openzeppelin-foundry-upgrades | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/docs/modules/ROOT/pages/foundry/pages/foundry-upgrades.adoc b/docs/modules/ROOT/pages/foundry/pages/foundry-upgrades.adoc index 57290467e..70c68f5d2 100644 --- a/docs/modules/ROOT/pages/foundry/pages/foundry-upgrades.adoc +++ b/docs/modules/ROOT/pages/foundry/pages/foundry-upgrades.adoc @@ -49,6 +49,34 @@ Set the following in `remappings.txt`: NOTE: Use `LegacyUpgrades.sol` instead of `Upgrades.sol` to upgrade existing deployments that were created with OpenZeppelin Contracts v4. +=== Optional: Alternative installation methods + +==== NPM + +Follow the steps above, but instead of running `forge install OpenZeppelin/openzeppelin-foundry-upgrades`, use this command instead: +[source,console] +---- +npm install @openzeppelin/foundry-upgrades +---- + +Then add the following additional lines to `remappings.txt`, in addition to the ones described above: +[source,console] +---- +openzeppelin-foundry-upgrades/=node_modules/@openzeppelin/foundry-upgrades/src/ +solidity-stringutils/=node_modules/@openzeppelin/foundry-upgrades/lib/solidity-stringutils/ +---- + +==== Soldeer + +Follow the steps above, but instead of running `forge install OpenZeppelin/openzeppelin-foundry-upgrades`, use one of the install commands described in https://soldeer.xyz/project/openzeppelin-foundry-upgrades + +Then add the following additional lines to `remappings.txt`, in addition to the ones described above (replace `0.3.6` with the version of the plugin that you installed): +[source,console] +---- +openzeppelin-foundry-upgrades/=dependencies/openzeppelin-foundry-upgrades-0.3.6/src/ +solidity-stringutils/=dependencies/openzeppelin-foundry-upgrades-0.3.6/lib/solidity-stringutils/ +---- + == Foundry Requirements This library requires https://github.com/foundry-rs/forge-std[forge-std] version 1.8.0 or higher. diff --git a/submodules/openzeppelin-foundry-upgrades b/submodules/openzeppelin-foundry-upgrades index 16e0ae21e..6461ba385 160000 --- a/submodules/openzeppelin-foundry-upgrades +++ b/submodules/openzeppelin-foundry-upgrades @@ -1 +1 @@ -Subproject commit 16e0ae21e0e39049f619f2396fa28c57fad07368 +Subproject commit 6461ba3851dea1fa4381a0fb1477c669279cdd44