Skip to content

Commit

Permalink
deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
sanbir committed Sep 11, 2024
1 parent 08f7bb5 commit 076159b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ forge-cache/
!/broadcast
/broadcast/*/31337/
/broadcast/**/dry-run/
/broadcast

# Docs
docs/
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"author": "P2P Validator <[email protected]>",
"license": "MIT",
"scripts": {
"01-test-send-user-operation": "ts-node 01-test-send-user-operation.ts"
"01-test-send-user-operation": "ts-node 01-test-send-user-operation.ts",
"deploy": "forge script script/Deploy.s.sol:Deploy --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast --chain holesky --json --verify --etherscan-api-key $ETHERSCAN_API_KEY -vvvvv"
},
"dependencies": {
"@types/node": "22.5.4",
Expand All @@ -15,4 +16,4 @@
"typescript": "5.6.2",
"viem": "2.21.4"
}
}
}
24 changes: 24 additions & 0 deletions script/Deploy.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// SPDX-FileCopyrightText: 2024 P2P Validator <[email protected]>
// SPDX-License-Identifier: MIT

pragma solidity 0.8.17;

import {Script} from "forge-std/Script.sol";
import "../src/proofSubmitterFactory/ProofSubmitterFactory.sol";
import "../src/proofSubmitter/ProofSubmitter.sol";

contract Deploy is Script {
function run()
external
returns (ProofSubmitterFactory factory, ProofSubmitter proofSubmitter)
{
uint256 deployerKey = vm.envUint("PRIVATE_KEY");

vm.startBroadcast(deployerKey);
factory = new ProofSubmitterFactory();
proofSubmitter = factory.createProofSubmitter{value: 0.01 ether}();
vm.stopBroadcast();

return (factory, proofSubmitter);
}
}

0 comments on commit 076159b

Please sign in to comment.