forge scripting

master
lza_menace 2 years ago
parent 1c21b158c4
commit f3cf834c39

1
.gitignore vendored

@ -3,3 +3,4 @@ out
.venv .venv
lib lib
cache cache
broadcast

@ -2,3 +2,4 @@
src = 'src' src = 'src'
out = 'out' out = 'out'
libs = ['lib'] libs = ['lib']
gas_reports = ['Main']

@ -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()"

@ -2,11 +2,19 @@
pragma solidity ^0.8.13; pragma solidity ^0.8.13;
import "forge-std/Script.sol"; 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 { contract DeployProject is Script {
function setUp() public {}
function run() public { 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));
} }
} }

Loading…
Cancel
Save