mirror of
https://github.com/vacp2p/staking-reward-streamer.git
synced 2026-01-08 20:48:00 -05:00
fix(RLN): ensure init params are valid
This commit is contained in:
@@ -10,12 +10,22 @@ import { Groth16Verifier } from "../src/rln/Verifier.sol";
|
||||
import { RLN } from "../src/rln/RLN.sol";
|
||||
|
||||
contract DeployRLNScript is BaseScript {
|
||||
|
||||
error InvalidDepth();
|
||||
error InvalidAddress();
|
||||
|
||||
function run() public returns (RLN, DeploymentConfig) {
|
||||
DeploymentConfig deploymentConfig = new DeploymentConfig(broadcaster);
|
||||
(address deployer,) = deploymentConfig.activeNetworkConfig();
|
||||
|
||||
uint256 depth = vm.envUint("DEPTH");
|
||||
if (depth == 0) {
|
||||
revert InvalidDepth();
|
||||
}
|
||||
address karmaAddress = vm.envAddress("KARMA_ADDRESS");
|
||||
if (karmaAddress == address(0)) {
|
||||
revert InvalidAddress();
|
||||
}
|
||||
|
||||
vm.startBroadcast(deployer);
|
||||
address verifier = (address)(new Groth16Verifier());
|
||||
|
||||
Reference in New Issue
Block a user