generated from PaulRBerg/foundry-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Create deployment script (#15)
* work on new deployment * first mvp working * get version of contract predeploy * add constructor args resolution * fix error * update package * compile synchronously and fix deployment files * remove temporary file * add worflow draft (#16) * add worflow draft * try to get it runable from non-main branch * use ts node * try fix ts-node error * try fix ts-node error again * install Foundry * use ts deploy script * remove base sepolia deploy to test deploy * set basescan key to env * commit deploys * set commit config * CI deployment of Dropper * format deployment file prior to commit * CI deployment of Dropper --------- Co-authored-by: Arr00 <[email protected]> Co-authored-by: GitHub Actions Bot <> * remove unnecessary node opt --------- Co-authored-by: Brian Le <[email protected]>
- Loading branch information
Showing
6 changed files
with
389 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Deploy | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
network: | ||
type: choice | ||
description: Network | ||
options: | ||
- mainnet | ||
- sepolia | ||
- base | ||
- base-sepolia | ||
contract: | ||
description: Contract to deploy | ||
required: true | ||
|
||
jobs: | ||
deploy-contract: | ||
name: Deploy Contract | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: "16" | ||
|
||
- name: Install packages | ||
run: npm install | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
|
||
- name: Set RPC URL for mainnet | ||
if: ${{ github.event.inputs.network == 'mainnet' }} | ||
run: echo "RPC_URL=${{ secrets.MAINNET_RPC_URL }}" >> $GITHUB_ENV | ||
|
||
- name: Set RPC URL for sepolia | ||
if: ${{ github.event.inputs.network == 'sepolia' }} | ||
run: echo "RPC_URL=${{ secrets.SEPOLIA_RPC_URL }}" >> $GITHUB_ENV | ||
|
||
- name: Set RPC URL for base | ||
if: ${{ github.event.inputs.network == 'base' }} | ||
run: echo "RPC_URL=${{ secrets.BASE_RPC_URL }}" >> $GITHUB_ENV | ||
|
||
- name: Set RPC URL for base-sepolia | ||
if: ${{ github.event.inputs.network == 'base-sepolia' }} | ||
run: echo "RPC_URL=${{ secrets.BASE_SEPOLIA_RPC_URL }}" >> $GITHUB_ENV | ||
|
||
- name: Run Deploy | ||
run: | | ||
npx ts-node script/deploy.ts deploy ${{ github.event.inputs.contract }} --rpc ${{ env.RPC_URL }} --pk ${{ secrets.private_key }} | ||
env: | ||
NETWORK: ${{ github.event.inputs.network }} | ||
CONTRACT: ${{ github.event.inputs.contract }} | ||
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} | ||
RPC_URL: ${{ env.RPC_URL }} | ||
BASESCAN_API_KEY: ${{ secrets.BASESCAN_API_KEY }} | ||
|
||
- name: Prettier Fix | ||
run: npm run prettier:write | ||
|
||
- name: Commit and push changes | ||
run: | | ||
git config --global user.name 'GitHub Actions Bot' | ||
git config --global user.email '<>' | ||
git commit -a -m "CI deployment of ${{ github.event.inputs.contract }}" | ||
git push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"contracts": { | ||
"Dropper": { | ||
"deploys": [ | ||
{ "deployedArgs": "0x", "version": "1.0.0", "address": "0xf7dfc33c76f84a5c852f5366598e67cce91bad53" } | ||
], | ||
"constructorArgs": [] | ||
} | ||
}, | ||
"constants": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
{ | ||
"Dropper": [ | ||
{ | ||
"version": "1.0.0", | ||
"address": "0x2871e49a08acee842c8f225be7bff9cc311b9f43" | ||
"contracts": { | ||
"Dropper": { | ||
"deploys": [ | ||
{ "deployedArgs": "0x", "version": "1.0.0", "address": "0x680168736298451b945F1Dc5D952408C102E7De7" } | ||
], | ||
"constructorArgs": [] | ||
} | ||
] | ||
}, | ||
"constants": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.