You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+38-21Lines changed: 38 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,19 +45,14 @@ forge install
45
45
Compile the contracts with:
46
46
47
47
```sh
48
-
forge clean && forge build
48
+
forge build
49
49
```
50
50
51
-
### Upgradability
52
-
53
-
We are using [openzeppelin-foundry-upgrades](https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades) library. To make sure upgrades are **safe**, you must do one of the following (as per their [docs](https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades?tab=readme-ov-file#before-running)) before you run `forge script` or `forge test`:
54
-
55
-
-`forge clean` beforehand, e.g. `forge clean && forge test`
56
-
- include `--force` option when running, e.g. `forge test --force`
57
-
58
51
> [!NOTE]
59
52
>
60
-
> Note that for some users this may fail (see [issue](https://github.com/firstbatchxyz/dria-oracle-contracts/issues/16)) due to a missing NPM package called `@openzeppelin/upgrades-core`. To fix it, do:
53
+
> We are using [openzeppelin-foundry-upgrades](https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades) library, which [requires](https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades?tab=readme-ov-file#before-running) clean-up per compilation to ensure upgrades are done safely. We use `force = true` option in `foundry.toml` for this, which may increase build times.
54
+
>
55
+
> Note that for some users this may fail (see [issue](https://github.com/firstbatchxyz/dria-oracle-contracts/issues/16)) due to a missing NPM package called `@openzeppelin/upgrades-core`. To fix it, you can install the package manually:
@@ -155,57 +150,79 @@ Note that the `--verifier-url` value should be the target explorer's homepage UR
155
150
>
156
151
> The `--verifier` can accept any of the following: `etherscan`, `blockscout`, `sourcify`, `oklink`. We are using Blockscout most of the time.
157
152
153
+
### Generate ABIs
154
+
155
+
To interact with the contracts, you need the contract ABIs. We store the ABIs under the [`abis`](./abis/) folder, and these can be generated using the following script:
156
+
157
+
```sh
158
+
./export-abis.sh
159
+
```
160
+
158
161
## Testing & Diagnostics
159
162
160
163
Run tests on local network:
161
164
162
165
```sh
163
-
forge clean && forge test
166
+
forge test
164
167
165
168
# or -vvv to show reverts in detail
166
-
forge clean && forge test -vvv
169
+
forge test -vvv
167
170
```
168
171
169
172
or fork an existing chain and run the tests on it:
170
173
171
174
```sh
172
-
forge clean && forge test --rpc-url <RPC_URL>
175
+
forge test --rpc-url <RPC_URL>
173
176
```
174
177
175
178
### Code Coverage
176
179
177
180
We have a script that generates the coverage information as an HTML page. This script requires [`lcov`](https://linux.die.net/man/1/lcov) and [`genhtml`](https://linux.die.net/man/1/genhtml) command line tools. To run, do:
178
181
179
182
```sh
180
-
forge clean &&./coverage.sh
183
+
./coverage.sh
181
184
```
182
185
183
186
Alternatively, you can see a summarized text-only output as well:
0 commit comments