Skip to content

Commit 9e640f4

Browse files
committed
better abi exporter todo using forge inspect
1 parent 4808f41 commit 9e640f4

File tree

13 files changed

+41
-43
lines changed

13 files changed

+41
-43
lines changed

.vscode/settings.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
// solidity
23
"solidity.packageDefaultDependenciesContractsDirectory": "src",
34
"solidity.packageDefaultDependenciesDirectory": "lib",
45
"editor.formatOnSave": true,
@@ -7,5 +8,8 @@
78
},
89
"solidity.formatter": "forge",
910
"solidity.compileUsingRemoteVersion": "v0.8.26",
10-
"solidity.defaultCompiler": "localFile"
11+
"solidity.defaultCompiler": "localFile",
12+
"material-icon-theme.files.associations": {
13+
".gas-snapshot": "bench-ts"
14+
}
1115
}

README.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ forge script ./script/Deploy.s.sol:Deploy<CONTRACT_NAME> \
116116
--broadcast
117117
```
118118

119-
You can see deployed contract addresses under the `deployment/<chainid>.json`
119+
You can see deployed contract addresses under the [`deployments/<chainid>.json`](./deployments/)
120120

121121
You can verify the contract during deployment by adding the verification arguments as well:
122122

@@ -150,18 +150,32 @@ Note that the `--verifier-url` value should be the target explorer's homepage UR
150150
>
151151
> The `--verifier` can accept any of the following: `etherscan`, `blockscout`, `sourcify`, `oklink`. We are using Blockscout most of the time.
152152
153-
### Generate ABIs
153+
After deployment, we need to take care of two things:
154154

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:
155+
- **ABIs**: to interact with the contracts
156+
- **Artifacts**: required if we need to upgrade in future
157+
158+
We have a post-deployment script that outputs these files under the [`deployments/abis`](./deployments/abis/) folder:
156159

157160
```sh
158-
./export-abis.sh
161+
# requires NodeJS
162+
./post-deploy.sh
159163
```
160164

161165
### Upgrade Contract
162166

163167
Upgrading an existing contract is done as per the instructions in [openzeppelin-foundry-upgrades](https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades) repository.
164-
The `--sender <ADDRESS>` field is required when deploying a contract,
168+
169+
To upgrade, you must
170+
171+
> [!NOTE]
172+
>
173+
> The `--sender <ADDRESS>` field is mandatory when deploying a contract, it can be obtained with:
174+
>
175+
> ```sh
176+
> # will prompt for password
177+
> cast wallet address --account <WALLET_NAME>
178+
> ```
165179
166180
## Testing & Diagnostics
167181
@@ -225,7 +239,7 @@ forge fmt ./src/**/*.sol ./script/**/*.sol
225239
If you have solhint installed, you can lint all contracts with:
226240

227241
```sh
228-
solhint 'contracts/**/*.sol'
242+
solhint 'src/**/*.sol'
229243
```
230244

231245
## Documentation

abis/parseAbi.cjs

Lines changed: 0 additions & 24 deletions
This file was deleted.
File renamed without changes.

deployments/abis/LLMOracleCoordinator.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

abis/LLMOracleRegistry.json renamed to deployments/abis/LLMOracleRegistry.abi.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,4 +585,4 @@
585585
}
586586
]
587587
}
588-
]
588+
]

deployments/abis/LLMOracleRegistry.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

export-abis.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)