2024-05-21 06:16:07 +05:30
|
|
|
// SPDX-License-Identifier: UNLICENSED
|
|
|
|
|
pragma solidity >=0.8.19 <=0.9.0;
|
|
|
|
|
|
2024-05-23 18:33:41 +05:30
|
|
|
import { WakuRlnV2 } from "../src/WakuRlnV2.sol";
|
2024-05-30 19:21:55 +05:30
|
|
|
import { PoseidonT3 } from "poseidon-solidity/PoseidonT3.sol";
|
|
|
|
|
import { LazyIMT } from "@zk-kit/imt.sol/LazyIMT.sol";
|
|
|
|
|
import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
|
|
|
|
|
import { UUPSUpgradeable } from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
|
|
|
|
|
|
2024-05-21 06:16:07 +05:30
|
|
|
import { BaseScript } from "./Base.s.sol";
|
|
|
|
|
import { DeploymentConfig } from "./DeploymentConfig.s.sol";
|
|
|
|
|
|
|
|
|
|
contract Deploy is BaseScript {
|
2024-05-30 19:21:55 +05:30
|
|
|
function run() public broadcast returns (WakuRlnV2 w, address impl) {
|
|
|
|
|
impl = address(new WakuRlnV2());
|
2024-06-27 13:59:24 +05:30
|
|
|
bytes memory data = abi.encodeCall(WakuRlnV2.initialize, 100);
|
2024-05-30 19:21:55 +05:30
|
|
|
address proxy = address(new ERC1967Proxy(impl, data));
|
|
|
|
|
w = WakuRlnV2(proxy);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
contract DeployLibs is BaseScript {
|
|
|
|
|
function run() public broadcast returns (address poseidonT3, address lazyImt) {
|
|
|
|
|
bytes memory poseidonT3Bytecode = type(PoseidonT3).creationCode;
|
|
|
|
|
assembly {
|
|
|
|
|
poseidonT3 := create(0, add(poseidonT3Bytecode, 0x20), mload(poseidonT3Bytecode))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bytes memory lazyImtBytecode = type(LazyIMT).creationCode;
|
|
|
|
|
assembly {
|
|
|
|
|
lazyImt := create(0, add(lazyImtBytecode, 0x20), mload(lazyImtBytecode))
|
|
|
|
|
}
|
2024-05-21 06:16:07 +05:30
|
|
|
}
|
|
|
|
|
}
|