diff --git a/bun.lockb b/bun.lockb index 892a0ea..caa0d94 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index e65a72a..8677ef4 100644 --- a/package.json +++ b/package.json @@ -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" }, diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol new file mode 100644 index 0000000..38ce12e --- /dev/null +++ b/script/Deploy.s.sol @@ -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)"); + } + } +} \ No newline at end of file diff --git a/src/PODv2.sol b/src/PODv2.sol index 05873aa..09dabe1 100644 --- a/src/PODv2.sol +++ b/src/PODv2.sol @@ -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"; diff --git a/test/PODv2.t.sol b/test/PODv2.t.sol index 88f3aa2..6ca05ca 100644 --- a/test/PODv2.t.sol +++ b/test/PODv2.t.sol @@ -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";