@@ -11,6 +11,7 @@ import {Bridge} from "../src/Bridge.sol";
1111
1212import {CrossChainERC20} from "../src/CrossChainERC20.sol " ;
1313import {CrossChainERC20Factory} from "../src/CrossChainERC20Factory.sol " ;
14+ import {ISMVerification} from "../src/ISMVerification.sol " ;
1415import {Twin} from "../src/Twin.sol " ;
1516import {HelperConfig} from "./HelperConfig.s.sol " ;
1617
@@ -27,20 +28,28 @@ contract DeployScript is Script {
2728
2829 vm.startBroadcast (msg .sender );
2930 address twinBeacon = _deployTwinBeacon ({cfg: cfg, precomputedBridgeAddress: precomputedBridgeAddress});
31+ address ismVerification = _deployISMVerification ({cfg: cfg});
3032 address factory = _deployFactory ({cfg: cfg, precomputedBridgeAddress: precomputedBridgeAddress});
31- address bridge = _deployBridge ({cfg: cfg, twinBeacon: twinBeacon, crossChainErc20Factory: factory});
33+ address bridge = _deployBridge ({
34+ cfg: cfg,
35+ twinBeacon: twinBeacon,
36+ ismVerification: ismVerification,
37+ crossChainErc20Factory: factory
38+ });
3239 vm.stopBroadcast ();
3340
3441 require (address (bridge) == precomputedBridgeAddress, "Bridge address mismatch " );
3542
3643 console.log ("Deployed TwinBeacon at: %s " , twinBeacon);
44+ console.log ("Deployed ISMVerification at: %s " , ismVerification);
3745 console.log ("Deployed Bridge at: %s " , bridge);
3846 console.log ("Deployed CrossChainERC20Factory at: %s " , factory);
3947
4048 string memory obj = "root " ;
4149 string memory json = vm.serializeAddress ({objectKey: obj, valueKey: "Bridge " , value: bridge});
4250 json = vm.serializeAddress ({objectKey: obj, valueKey: "CrossChainERC20Factory " , value: factory});
4351 json = vm.serializeAddress ({objectKey: obj, valueKey: "Twin " , value: twinBeacon});
52+ json = vm.serializeAddress ({objectKey: obj, valueKey: "ISMVerification " , value: ismVerification});
4453 vm.writeJson (json, string .concat ("deployments/ " , chain.chainAlias, ".json " ));
4554
4655 return (Twin (payable (twinBeacon)), Bridge (bridge), CrossChainERC20Factory (factory), helperConfig);
@@ -54,14 +63,31 @@ contract DeployScript is Script {
5463 return address (new UpgradeableBeacon ({initialOwner: cfg.initialOwner, initialImplementation: twinImpl}));
5564 }
5665
57- function _deployBridge (HelperConfig.NetworkConfig memory cfg , address twinBeacon , address crossChainErc20Factory )
58- private
59- returns (address )
60- {
66+ function _deployISMVerification (HelperConfig.NetworkConfig memory cfg ) private returns (address ) {
67+ ISMVerification ismImpl = new ISMVerification ({
68+ _validators: cfg.initialValidators,
69+ _threshold: cfg.initialThreshold,
70+ _owner: cfg.initialOwner
71+ });
72+
73+ return ERC1967Factory (cfg.erc1967Factory).deployDeterministic ({
74+ implementation: address (ismImpl),
75+ admin: cfg.initialOwner,
76+ salt: _salt ("ism_verif " )
77+ });
78+ }
79+
80+ function _deployBridge (
81+ HelperConfig.NetworkConfig memory cfg ,
82+ address twinBeacon ,
83+ address ismVerification ,
84+ address crossChainErc20Factory
85+ ) private returns (address ) {
6186 Bridge bridgeImpl = new Bridge ({
6287 remoteBridge: cfg.remoteBridge,
6388 trustedRelayer: cfg.trustedRelayer,
6489 twinBeacon: twinBeacon,
90+ ismVerification: ismVerification,
6591 crossChainErc20Factory: crossChainErc20Factory
6692 });
6793
0 commit comments