Skip to content

Commit

Permalink
Create deploy script and change license
Browse files Browse the repository at this point in the history
  • Loading branch information
geovgy committed Sep 20, 2024
1 parent 20dc6c4 commit 5dd06c8
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 2 deletions.
Binary file modified bun.lockb
Binary file not shown.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
"name": "pod-v2",
"module": "index.ts",
"type": "module",
"scripts": {
"deploy": "forge script script/Deploy.s.sol:Deploy --rpc-url $RPC_URL --broadcast",
"verify": "forge verify-contract --chain-id 84532 --etherscan-api-key $ETHERSCAN_API_KEY --watch --constructor-args $(cast abi-encode 'constructor(address)' $OWNER_ADDRESS) $POD_ADDRESS src/PODv2.sol:PODv2"
},
"devDependencies": {
"@types/bun": "latest"
},
Expand Down
25 changes: 25 additions & 0 deletions script/Deploy.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import {Script, console2} from "forge-std/Script.sol";
import {PODv2} from "../src/PODv2.sol";

contract Deploy is Script {
address constant EXPECTED_POD = 0xB00B5D137709a301283E225e536E85882Cfadd55;
address constant ownerSafe = vm.envAddress("OWNER_ADDRESS");

function run() public {
console2.log("Deploying on chain ID", block.chainid);

if (EXPECTED_POD.code.length == 0) {
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
vm.startBroadcast(deployerPrivateKey);
PODv2 pod = new PODv2(ownerSafe);
assert(address(pod) == EXPECTED_POD);
vm.stopBroadcast();
console2.log("PODv2:", address(pod), "(deployed)");
} else {
console2.log("PODv2:", EXPECTED_POD, "(exists)");
}
}
}
2 changes: 1 addition & 1 deletion src/PODv2.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: UNLICENSED
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import {ERC1155} from "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
Expand Down
2 changes: 1 addition & 1 deletion test/PODv2.t.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: UNLICENSED
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import {Test, console} from "forge-std/Test.sol";
Expand Down

0 comments on commit 5dd06c8

Please sign in to comment.