forge scripting

master
lza_menace 2 years ago
parent 1c21b158c4
commit f3cf834c39

1
.gitignore vendored

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

@ -2,3 +2,4 @@
src = 'src'
out = 'out'
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;
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));
}
}

Loading…
Cancel
Save