diff --git a/justfile b/justfile index c8cff8e..6b9da93 100755 --- a/justfile +++ b/justfile @@ -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 @@ -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 @@ -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