diff --git a/packages/contracts/.env.sample b/packages/contracts/.env.sample new file mode 100644 index 0000000..8e2ae98 --- /dev/null +++ b/packages/contracts/.env.sample @@ -0,0 +1,2 @@ +DEPLOYER_PRIVATE_KEY=0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef +DEPLOY_SALT=my_unique_salt_string \ No newline at end of file diff --git a/packages/contracts/script/Deploy_jwtRegistry.s.sol b/packages/contracts/script/Deploy_jwtRegistry.s.sol new file mode 100644 index 0000000..0f6b82f --- /dev/null +++ b/packages/contracts/script/Deploy_jwtRegistry.s.sol @@ -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(); + } +} \ No newline at end of file