Skip to content

Commit

Permalink
Add deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
icyfry committed Mar 27, 2024
1 parent 907a4e4 commit b3d60a2
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 17 deletions.
19 changes: 14 additions & 5 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,22 @@ tasks:
- forge build --out "../dapp/abi"
- forge test --gas-report

contracts-deploy-script:
dir: contracts/script
cmds:
- forge script --rpc-url http://127.0.0.1:8545
--private-key {{.PRIVATE_KEY_LOCAL}}
--broadcast
DeployZombieOwnership

contracts-deploy:
dir: contracts
cmds:
- forge create --rpc-url "http://127.0.0.1:8545"
--private-key "{{.PRIVATE_KEY_LOCAL}}"
src/zombieownership.sol:ZombieOwnership

- forge create --rpc-url http://127.0.0.1:8545
--private-key {{.PRIVATE_KEY_LOCAL}}
ZombieOwnership
# -- interactive
# src/zombieownership.sol:ZombieOwnership
frontend-build:
dir: dapp
cmds:
Expand All @@ -32,4 +41,4 @@ tasks:
dir: dapp
deps: [frontend-build]
cmds:
- pnpm run dev --open
- pnpm run dev --open
1 change: 1 addition & 0 deletions contracts/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
cache/
out/
bin/
broadcast/

# Ignores development broadcast logs
!/broadcast
Expand Down
12 changes: 0 additions & 12 deletions contracts/script/Counter.s.sol

This file was deleted.

18 changes: 18 additions & 0 deletions contracts/script/DeployZombieOwnership.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.20;

import {Script, console} from "forge-std/Script.sol";
import {ZombieOwnership} from "../src/zombieownership.sol";

contract DeployZombieOwnership is Script {
function setUp() public {}

function run() public {
vm.startBroadcast();

ZombieOwnership zombieownership = new ZombieOwnership();
console.log("ZombieOwnership deployed at address: ", address(zombieownership));

vm.stopBroadcast();
}
}

0 comments on commit b3d60a2

Please sign in to comment.