Skip to content

Commit

Permalink
feat:justfile contract deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
sambacha authored May 30, 2022
1 parent 6e1e05c commit be69838
Showing 1 changed file with 30 additions and 6 deletions.
36 changes: 30 additions & 6 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#!/usr/bin/env just --justfile
# @title Foundry Justfile
# @version: 0.2.1
# @license ISC
#
# TODO:
# document justfile using https://github.com/tests-always-included/tomdoc.sh
# @version: 0.3.0
# @license Apache-2.0 OR MIT
# @see {@link https://github.com/sambacha/foundry-scripts}

bt := '0'
export RUST_BACKTRACE := bt
Expand Down Expand Up @@ -49,7 +47,31 @@ set export
size:
forge build --sizes --force

# Build Output
# [DEPLOY]: Environemtn Config
DEPLOYED_ADDRESS := "0xd8da6bf26964af9d7eed9e03e53415d37aa96045"
CONTRACT_NAME := ''
ETHERSCAN_API_KEY := ''

# [DEPLOY]: Deploy contract
deploy-contract:
forge create $(contract) \
--constructor-args $(constructorArgs) \
--rpc-url $(url) \
--private-key $(privateKey)


# [DEPLOY]: Verify contract
verify-contract:
forge verify-contract \
--chain-id $(chainId) \
--constructor-args `cast abi-encode "$(constructorSig)" $(constructorArgs)` \
--compiler-version $(compilerVersion) \
--num-of-optimizations 200 \
{{ DEPLOYED_ADDRESS }} \
{{ CONTRACT_NAME }} \
{{ ETHERSCAN_API_KEY }}

# [BUILD]: Timer
build: && _timer
cd {{ invocation_directory() }}; forge build --sizes --names --force

Expand All @@ -72,6 +94,8 @@ test-mainnet *commands="": && _timer
test-debug *commands="": && _timer
cd {{ invocation_directory() }}; forge test --rpc-url {{ MAINNET_RPC }} --match-path "*.t.sol" {{ commands }}

gas-cov:
forge test --gas-report

# [GAS] default gas snapshot script
gas-snapshot: gas-snapshot-local
Expand Down

0 comments on commit be69838

Please sign in to comment.