Skip to content

Commit e8cd17e

Browse files
abhicrisclaude
andcommitted
feat(ci): wire contracts/*.sol into hardhat, bump solc to 0.8.26 cancun
PR #27 unbroke `npx hardhat compile` (got `npm ci` working), but the job still output "Nothing to compile" — hardhat looked at `deploy/contracts/` which doesn't exist; the repo's Solidity sources live in `contracts/` at the repo root. This wires them up properly: - `paths.root = ".."` + `paths.sources = "contracts"` points hardhat at the real source tree. `paths.tests` / `paths.cache` / `paths.artifacts` follow the same root-relative convention so the structure stays clean. - Solidity bumped to `0.8.26` with `evmVersion: "cancun"` because `@openzeppelin/contracts ^5.0.0` (already in `package.json`) uses `mcopy` in `utils/Memory.sol`, which needs the cancun opcode. Verification (locally, from `deploy/`): ``` $ rm -rf cache artifacts && npx hardhat compile Compiled 24 Solidity files successfully (evm target: cancun). ``` The `contracts` CI job on main will now actually type-check the four Solidity files we ship — `MeridianVault.sol`, `MeridianVaultERC4626.sol` (ERC-4626 vault-share token), `OracleAdapter.sol`, `StrategyExecutor.sol` — instead of silently succeeding on an empty source set. Follow-up (separate PR): fix the `_getChainlinkPrice(pairId, ...)` vs `pairId(string)` name-shadowing warning in OracleAdapter.sol. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 7a87fa6 commit e8cd17e

5 files changed

Lines changed: 32 additions & 25 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,10 @@ jobs:
1313

1414
contracts:
1515
runs-on: ubuntu-latest
16-
defaults:
17-
run:
18-
working-directory: deploy
1916
steps:
2017
- uses: actions/checkout@v4
2118
- uses: actions/setup-node@v4
2219
with:
2320
node-version: '20'
2421
- run: npm ci
25-
- run: npx hardhat compile
22+
- run: npm run compile

deploy/hardhat.config.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,18 @@ require("@nomicfoundation/hardhat-toolbox");
22

33
module.exports = {
44
solidity: {
5-
version: "0.8.24",
6-
settings: { optimizer: { enabled: true, runs: 200 } },
5+
version: "0.8.26",
6+
settings: {
7+
optimizer: { enabled: true, runs: 200 },
8+
evmVersion: "cancun",
9+
},
10+
},
11+
paths: {
12+
root: "..",
13+
sources: "contracts",
14+
tests: "tests/contracts",
15+
cache: "deploy/cache",
16+
artifacts: "deploy/artifacts",
717
},
818
networks: {
919
hardhat: {},

deploy/package.json

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

package.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "@kcolbchain/meridian-contracts",
3+
"version": "0.1.0",
4+
"scripts": {
5+
"compile": "hardhat --config deploy/hardhat.config.js compile",
6+
"test": "hardhat --config deploy/hardhat.config.js test",
7+
"deploy:local": "hardhat --config deploy/hardhat.config.js run deploy/deploy.js --network localhost",
8+
"deploy:base-sepolia": "hardhat --config deploy/hardhat.config.js run deploy/deploy.js --network base-sepolia",
9+
"deploy:op-sepolia": "hardhat --config deploy/hardhat.config.js run deploy/deploy.js --network op-sepolia",
10+
"deploy:fuji": "hardhat --config deploy/hardhat.config.js run deploy/deploy.js --network fuji"
11+
},
12+
"dependencies": {
13+
"@openzeppelin/contracts": "^5.0.0"
14+
},
15+
"devDependencies": {
16+
"@nomicfoundation/hardhat-toolbox": "^4.0.0",
17+
"hardhat": "^2.19.0"
18+
}
19+
}

0 commit comments

Comments
 (0)