Skip to content

Commit c73099d

Browse files
authored
Update Foundry Upgrades docs (#1022)
1 parent 44d0d4b commit c73099d

File tree

4 files changed

+27
-5
lines changed

4 files changed

+27
-5
lines changed

docs/modules/ROOT/pages/foundry/api/pages/api-foundry-upgrades.adoc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,24 @@ struct DefenderOptions {
7474
string upgradeApprovalProcessId;
7575
string licenseType;
7676
bool skipLicenseType;
77+
struct TxOverrides txOverrides;
78+
}
79+
```
80+
81+
[[TxOverrides]]
82+
=== `++TxOverrides++` link:https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades/blob/main/src/Options.sol[{github-icon},role=heading-link]
83+
84+
[.hljs-theme-light.nopadding]
85+
```solidity
86+
import { TxOverrides } from "openzeppelin-foundry-upgrades/Options.sol";
87+
```
88+
89+
```solidity
90+
struct TxOverrides {
91+
uint256 gasLimit;
92+
uint256 gasPrice;
93+
uint256 maxFeePerGas;
94+
uint256 maxPriorityFeePerGas;
7795
}
7896
```
7997

docs/modules/ROOT/pages/foundry/pages/foundry-defender.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ pragma solidity ^0.8.20;
149149
import {Script} from "forge-std/Script.sol";
150150
import {console} from "forge-std/console.sol";
151151
152+
import {MyContract} from "../src/MyContract.sol";
153+
152154
import {Defender} from "openzeppelin-foundry-upgrades/Defender.sol";
153155
154156
contract DefenderScript is Script {

docs/modules/ROOT/pages/foundry/pages/foundry-upgrades.adoc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,20 @@ extra_output = ["storageLayout"]
6565

6666
If you do not want to run upgrade safety checks, you can skip the above steps and use the `unsafeSkipAllChecks` option when calling the library's functions. Note that this is a dangerous option meant to be used as a last resort.
6767

68-
=== Output directory configuration
68+
=== Optional: Custom output directory
6969

70-
If your `foundry.toml` uses a non-default output directory, set the `FOUNDRY_OUT` environment variable to match your output directory. For example, if `foundry.toml` has:
70+
By default, this library assumes your Foundry output directory is set to "out".
71+
72+
If you want to use a custom output directory, set it in your `foundry.toml` and provide read permissions for the directory. For example (replace `my-output-dir` with the directory that you want to use):
7173

7274
[source,json]
7375
----
7476
[profile.default]
7577
out = "my-output-dir"
78+
fs_permissions = [{ access = "read", path = "my-output-dir" }]
7679
----
7780

78-
Then set the following in the `.env` file of your project:
79-
81+
Then in a `.env` at your project root, set the `FOUNDRY_OUT` environment variable to match the custom output directory, for example:
8082
[source]
8183
----
8284
FOUNDRY_OUT=my-output-dir

0 commit comments

Comments
 (0)