Skip to content

Commit

Permalink
Merge pull request #113 from liquity/fix-deployment
Browse files Browse the repository at this point in the history
Re-enable automated contract deployment
  • Loading branch information
danielattilasimon committed Apr 12, 2024
2 parents 7f3e73f + 6a299b1 commit b2706f7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/testnet-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ on:
push:
branches: [main]
paths:
- ".github/workflows/deploy-testnet.yml"
- ".github/workflows/testnet-deployment.yml"
- "contracts/**"
- "frontend/**"
pull_request:
paths:
- ".github/workflows/deploy-testnet.yml"
- ".github/workflows/testnet-deployment.yml"
- "contracts/**"

env:
Expand All @@ -27,7 +27,6 @@ concurrency:
jobs:
deploy-contracts:
name: Deploy contracts
if: false # Disable contracts deployment for now
runs-on: ubuntu-latest
steps:
- name: Git checkout
Expand All @@ -49,6 +48,7 @@ jobs:

- name: Install dependencies
run: pnpm install
working-directory: ./contracts

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
Expand Down
6 changes: 5 additions & 1 deletion contracts/utils/deploy-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,13 @@ Deploying Liquity contracts with the following settings:
`broadcast/DeployLiquity2.s.sol/${options.chainId}/run-latest.json`,
);

// XXX hotfix: we were leaking Github secrets in "deployer"
// TODO: check if "deployer" is a private key, and calculate its address and use it instead?
const { deployer, ...safeOptions } = options;

// write env file
await fs.writeJson("deployment-context-latest.json", {
options,
options: safeOptions,
deployedContracts: Object.fromEntries(deployedContracts),
});

Expand Down
3 changes: 2 additions & 1 deletion contracts/utils/deployment-artifacts-to-app-env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ const ZAddress = z.string().regex(/^0x[0-9a-fA-F]{40}$/);
const ZDeploymentContext = z.object({
options: z.object({
chainId: z.number(),
deployer: z.string(), // can be an address or a private key
// XXX hotfix: we were leaking Github secrets in "deployer"
// deployer: z.string(), // can be an address or a private key
help: z.boolean(),
openDemoTroves: z.boolean(),
rpcUrl: z.string(),
Expand Down

0 comments on commit b2706f7

Please sign in to comment.