Skip to content

Commit

Permalink
added deploy contract logic command
Browse files Browse the repository at this point in the history
  • Loading branch information
alistair-singh committed Feb 27, 2024
1 parent ac06ee1 commit 053b001
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
2 changes: 1 addition & 1 deletion contracts/src/DeployGatewayLogic.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {ParaID} from "./Types.sol";
import {Script} from "forge-std/Script.sol";
import {stdJson} from "forge-std/StdJson.sol";

contract DeployGateway is Script {
contract DeployGatewayLogic is Script {
using stdJson for string;

function setUp() public {}
Expand Down
25 changes: 21 additions & 4 deletions web/packages/test/scripts/deploy-contracts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ set -eu

source scripts/set-env.sh

deploy_contracts()
{
deploy_command() {
local deploy_script=$1

pushd "$contract_dir"
if [ "$eth_network" != "localhost" ]; then
forge script \
Expand All @@ -13,15 +14,31 @@ deploy_contracts()
--verify \
--etherscan-api-key $etherscan_api_key \
-vvv \
src/DeployScript.sol:DeployScript
$deploy_script
else
forge script \
--rpc-url $eth_endpoint_http \
--broadcast \
-vvv \
src/DeployScript.sol:DeployScript
$deploy_script
fi
popd
}

deploy_gateway_logic()
{
deploy_command src/DeployGatewayLogic.sol:DeployGatewayLogic

pushd "$test_helpers_dir"
pnpm generateContracts "$output_dir/contracts.json"
popd

echo "Exported contract artifacts: $output_dir/contracts.json"
}

deploy_contracts()
{
deploy_command src/DeployScript.sol:DeployScript

pushd "$test_helpers_dir"
pnpm generateContracts "$output_dir/contracts.json"
Expand Down

0 comments on commit 053b001

Please sign in to comment.