From f3cf834c39ed6c58eb05278ce14acad7df0bfd4a Mon Sep 17 00:00:00 2001 From: lza_menace Date: Tue, 27 Dec 2022 16:23:07 -0800 Subject: [PATCH] forge scripting --- .gitignore | 1 + foundry.toml | 1 + mint.sh | 5 +++++ script/Unaboomer.sol | 16 ++++++++++++---- 4 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 mint.sh diff --git a/.gitignore b/.gitignore index 4d6bf97..a65f949 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ out .venv lib cache +broadcast diff --git a/foundry.toml b/foundry.toml index 2ade45a..378475b 100644 --- a/foundry.toml +++ b/foundry.toml @@ -2,3 +2,4 @@ src = 'src' out = 'out' libs = ['lib'] +gas_reports = ['Main'] \ No newline at end of file diff --git a/mint.sh b/mint.sh new file mode 100644 index 0000000..2db1df5 --- /dev/null +++ b/mint.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +export $(cat .env) +forge create Main --rpc-url=$LOCAL_RPC --private-key=$LOCAL_KEY +#cast send --rpc-url=$LOCAL_RPC --private-key=$LOCAL_KEY $LOCAL_CONTRACT "startMinting()" diff --git a/script/Unaboomer.sol b/script/Unaboomer.sol index f5cb393..d744dc8 100644 --- a/script/Unaboomer.sol +++ b/script/Unaboomer.sol @@ -2,11 +2,19 @@ pragma solidity ^0.8.13; import "forge-std/Script.sol"; +import {Main} from "../src/Main.sol"; +import {Unaboomer} from "../src/Unaboomer.sol"; +import {Mailbomb} from "../src/Mailbomb.sol"; -contract ContractScript is Script { - function setUp() public {} - +contract DeployProject is Script { function run() public { - vm.broadcast(); + vm.startBroadcast(); + Main main = new Main(); + Unaboomer boomr = new Unaboomer(); + Mailbomb bomb = new Mailbomb(); + boomr.setMainContract(address(main)); + bomb.setMainContract(address(main)); + main.setUnaboomerContract(address(boomr)); + main.setMailbombContract(address(bomb)); } }