Skip to content

Commit

Permalink
Add deploy script and env sample file
Browse files Browse the repository at this point in the history
  • Loading branch information
wshino committed Oct 3, 2024
1 parent 780261f commit 95be6ff
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/contracts/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DEPLOYER_PRIVATE_KEY=0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
DEPLOY_SALT=my_unique_salt_string
23 changes: 23 additions & 0 deletions packages/contracts/script/Deploy_jwtRegistry.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// script/Deploy.s.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;

import "forge-std/Script.sol";
import "../src/utils/JwtRegistry.sol";

contract DeployScript is Script {
function run() external {
uint256 deployerPrivateKey = vm.envUint("DEPLOYER_PRIVATE_KEY");
address deployer = vm.addr(deployerPrivateKey);
bytes32 salt = keccak256(abi.encodePacked(vm.envString("DEPLOY_SALT")));

vm.startBroadcast(deployer);

// Deploy the contract using CREATE2
JwtRegistry jwtRegistry = new JwtRegistry{salt: salt}(deployer);

console.log("Contract deployed to:", address(jwtRegistry));

vm.stopBroadcast();
}
}

0 comments on commit 95be6ff

Please sign in to comment.