Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a CLI tool to deploy the contracts using Foundry #86

Merged
merged 9 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 34 additions & 3 deletions .github/workflows/contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ on:

jobs:
test-foundry:
strategy:
fail-fast: true

name: Foundry tests
runs-on: ubuntu-latest
steps:
Expand All @@ -48,6 +45,40 @@ jobs:
forge test -vvv
id: test

deploy:
name: Deploy contracts to Liquity v2 Testnet
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install pnpm
uses: pnpm/action-setup@v3.0.0
with:
version: 8

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'pnpm'
cache-dependency-path: 'contracts/pnpm-lock.yaml'

- name: Install dependencies
run: pnpm install

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Run deployment tool
run: ./deploy liquity-testnet --verify
env:
DEPLOYER: ${{ secrets.DEPLOYER }}

console-logs:
name: Check we didn’t forget to remove console imports
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions contracts/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ out/
# Ignores development broadcast logs
!/broadcast
/broadcast/*/31337/
/broadcast/*/1337/
/broadcast/**/dry-run/

# Docs
Expand Down
8 changes: 8 additions & 0 deletions contracts/deploy
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env -S npx tsx

require("./utils/deploy-cli").main().catch(({ message }) => {
console.error("");
console.error(` Error: ${message}`);
console.error("");
process.exit(1);
});
4 changes: 3 additions & 1 deletion contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
"hardhat-gas-reporter": "^1.0.8",
"solidity-coverage": "^0.8.8",
"ts-node": ">=8.0.0",
"tsx": "^4.7.1",
"typechain": "^8.1.0",
"typescript": ">=4.5.0"
"typescript": ">=4.5.0",
"zx": "^7.2.3"
}
}
Loading
Loading