-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(feat) Managers deployed to everything other than eth, I think. Now r…
…outing.
- Loading branch information
1 parent
4b64fac
commit 674967d
Showing
11 changed files
with
219 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
69 changes: 69 additions & 0 deletions
69
smart-contracts/script/arb/deploy/02_deployCoreUpgradeable.s.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// SPDX-License-Identifier: MIT OR Apache-2.0 | ||
pragma solidity ^0.8.20; | ||
|
||
import {Script} from "forge-std/Script.sol"; | ||
import {ValidatorManagerUpgradeable} from "contracts/core-upgradeable/ValidatorManagerUpgradeable.sol"; | ||
import {ChainGatewayUpgradeable} from "contracts/core-upgradeable/ChainGatewayUpgradeable.sol"; | ||
import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; | ||
import "forge-std/console.sol"; | ||
|
||
contract Deployment is Script { | ||
function run() external { | ||
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY_OWNER"); | ||
address owner = vm.addr(deployerPrivateKey); | ||
console.log("Owner is %s", owner); | ||
address validator = address(0x250572Ed005BaD64Ff24FbDc0d41875dAF58944f); | ||
console.log("Validator is %s", validator); | ||
|
||
address[] memory validators = new address[](1); | ||
validators[0] = owner; | ||
|
||
vm.startBroadcast(deployerPrivateKey); | ||
|
||
// Deploy Validator Manager | ||
address vmImplementation = address( | ||
new ValidatorManagerUpgradeable{salt: "arb"}() | ||
); | ||
bytes memory vmInitCall = abi.encodeWithSelector( | ||
ValidatorManagerUpgradeable.initialize.selector, | ||
owner, | ||
validators | ||
); | ||
address vmProxy = address( | ||
new ERC1967Proxy{salt: "arb"}(vmImplementation, vmInitCall) | ||
); | ||
ValidatorManagerUpgradeable validatorManager = ValidatorManagerUpgradeable( | ||
vmProxy | ||
); | ||
console.log( | ||
"ValidatorManager Deployed: %s, owner is validator: %s, and size %s", | ||
address(validatorManager), | ||
validatorManager.isValidator(validators[0]), | ||
validatorManager.validatorsSize() | ||
); | ||
|
||
// Deploy Chain Gateway | ||
address cgImplementation = address( | ||
new ChainGatewayUpgradeable{salt: "arb"}() | ||
); | ||
bytes memory cgInitCall = abi.encodeWithSelector( | ||
ChainGatewayUpgradeable.initialize.selector, | ||
address(validatorManager), | ||
owner | ||
); | ||
address cgProxy = address( | ||
new ERC1967Proxy{salt: "arb"}(cgImplementation, cgInitCall) | ||
); | ||
ChainGatewayUpgradeable chainGateway = ChainGatewayUpgradeable(cgProxy); | ||
console.log( | ||
"ChainGateway Deployed: %s, with validatorManager %s", | ||
address(chainGateway), | ||
address(chainGateway.validatorManager()) | ||
); | ||
|
||
console.log("arbChainGatewayAddress = %s;", address(chainGateway)); | ||
console.log("arbValidatorManager = %s;", address(validatorManager)); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
smart-contracts/script/arb/deploy/03_deployTokenManagers.s.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// SPDX-License-Identifier: MIT OR Apache-2.0 | ||
pragma solidity ^0.8.20; | ||
|
||
import {Script} from "forge-std/Script.sol"; | ||
import "forge-std/console.sol"; | ||
import {LockProxyTokenManagerUpgradeableV3} from "contracts/periphery/TokenManagerV3/LockProxyTokenManagerUpgradeableV3.sol"; | ||
import {LockAndReleaseOrNativeTokenManagerUpgradeableV3} from "contracts/periphery/TokenManagerV3/LockAndReleaseOrNativeTokenManagerUpgradeableV3.sol"; | ||
import { MainnetConfig } from "script/mainnetConfig.s.sol"; | ||
import { TokenManagerDeployerUtil } from "script/tokenManagerDeployerUtil.s.sol"; | ||
|
||
contract deployZilbridgeTokenManagers is Script, MainnetConfig, TokenManagerDeployerUtil { | ||
function run() external { | ||
// 0.00025 ZIL | ||
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY_OWNER"); | ||
uint fees = 0.00025 ether; | ||
vm.startBroadcast(deployerPrivateKey); | ||
LockAndReleaseOrNativeTokenManagerUpgradeableV3 lockAndReleaseOrNativeTokenManager = deployLockAndReleaseOrNativeTokenManager(arbChainGatewayAddress, fees); | ||
LockProxyTokenManagerUpgradeableV3 lockProxyTokenManager = deployLockProxyTokenManager(arbChainGatewayAddress, fees); | ||
console.log(" arbLockAndReleaseOrNativeTokenManagerUpgradeable = %s;", address(lockAndReleaseOrNativeTokenManager)); | ||
console.log(" arbLockProxyTokenManager = %s;", address(lockProxyTokenManager)); | ||
vm.stopBroadcast(); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
smart-contracts/script/arb/deploy/04_registerTokenManagers.s.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// SPDX-License-Identifier: MIT OR Apache-2.0 | ||
pragma solidity ^0.8.20; | ||
|
||
import {Script} from "forge-std/Script.sol"; | ||
import "forge-std/console.sol"; | ||
import {LockProxyTokenManagerUpgradeableV3} from "contracts/periphery/TokenManagerV3/LockProxyTokenManagerUpgradeableV3.sol"; | ||
import {LockAndReleaseOrNativeTokenManagerUpgradeableV3} from "contracts/periphery/TokenManagerV3/LockAndReleaseOrNativeTokenManagerUpgradeableV3.sol"; | ||
import {ChainGatewayUpgradeable} from "contracts/core-upgradeable/ChainGatewayUpgradeable.sol"; | ||
import { MainnetConfig } from "script/mainnetConfig.s.sol"; | ||
|
||
contract registerLockProxy is Script, MainnetConfig { | ||
function run() external { | ||
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY_OWNER"); | ||
vm.startBroadcast(deployerPrivateKey); | ||
// The lock proxy token manager needs to know where its lock proxy is. | ||
LockProxyTokenManagerUpgradeableV3 lockProxyTokenManager = LockProxyTokenManagerUpgradeableV3(payable(arbLockProxyTokenManager)); | ||
LockAndReleaseOrNativeTokenManagerUpgradeableV3 lockAndReleaseOrNativeTokenManager = LockAndReleaseOrNativeTokenManagerUpgradeableV3(payable(arbLockAndReleaseOrNativeTokenManagerUpgradeable)); | ||
ChainGatewayUpgradeable chainGateway = ChainGatewayUpgradeable(arbChainGatewayAddress); | ||
|
||
lockProxyTokenManager.setLockProxyData(polLockProxy, polLockProxyProxy); | ||
chainGateway.register(address(lockProxyTokenManager)); | ||
chainGateway.register(address(lockAndReleaseOrNativeTokenManager)); | ||
vm.stopBroadcast(); | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
smart-contracts/script/arb/deploy/05_registerTokenManagerWithLockProxyProxy.s.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// SPDX-License-Identifier: MIT OR Apache-2.0 | ||
pragma solidity ^0.8.20; | ||
|
||
import {Script} from "forge-std/Script.sol"; | ||
import "forge-std/console.sol"; | ||
import {LockProxyTokenManagerUpgradeableV3} from "contracts/periphery/TokenManagerV3/LockProxyTokenManagerUpgradeableV3.sol"; | ||
import {LockAndReleaseOrNativeTokenManagerUpgradeableV3} from "contracts/periphery/TokenManagerV3/LockAndReleaseOrNativeTokenManagerUpgradeableV3.sol"; | ||
import {LockProxyProxy} from "contracts/periphery/LockProxyProxy.sol"; | ||
import {ChainGatewayUpgradeable} from "contracts/core-upgradeable/ChainGatewayUpgradeable.sol"; | ||
import { MainnetConfig } from "script/mainnetConfig.s.sol"; | ||
|
||
contract registerLockProxy is Script, MainnetConfig { | ||
function run() external { | ||
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY_OWNER"); | ||
vm.startBroadcast(deployerPrivateKey); | ||
// The lock proxy token manager needs to know where its lock proxy is. | ||
LockProxyTokenManagerUpgradeableV3 lockProxyTokenManager = LockProxyTokenManagerUpgradeableV3(payable(arbLockProxyTokenManager)); | ||
LockProxyProxy lockProxyProxy = LockProxyProxy(payable(arbLockProxyProxy)); | ||
lockProxyProxy.addCaller(address(lockProxyTokenManager)); | ||
vm.stopBroadcast(); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
smart-contracts/script/bsc/deploy/04_registerTokenManagerWithLockProxyProxy.s.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// SPDX-License-Identifier: MIT OR Apache-2.0 | ||
pragma solidity ^0.8.20; | ||
|
||
import {Script} from "forge-std/Script.sol"; | ||
import "forge-std/console.sol"; | ||
import {LockProxyTokenManagerUpgradeableV3} from "contracts/periphery/TokenManagerV3/LockProxyTokenManagerUpgradeableV3.sol"; | ||
import {LockAndReleaseOrNativeTokenManagerUpgradeableV3} from "contracts/periphery/TokenManagerV3/LockAndReleaseOrNativeTokenManagerUpgradeableV3.sol"; | ||
import {LockProxyProxy} from "contracts/periphery/LockProxyProxy.sol"; | ||
import {ChainGatewayUpgradeable} from "contracts/core-upgradeable/ChainGatewayUpgradeable.sol"; | ||
import { MainnetConfig } from "script/mainnetConfig.s.sol"; | ||
|
||
contract registerLockProxy is Script, MainnetConfig { | ||
function run() external { | ||
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY_OWNER"); | ||
vm.startBroadcast(deployerPrivateKey); | ||
// The lock proxy token manager needs to know where its lock proxy is. | ||
LockProxyTokenManagerUpgradeableV3 lockProxyTokenManager = LockProxyTokenManagerUpgradeableV3(payable(bscLockProxyTokenManager)); | ||
LockProxyProxy lockProxyProxy = LockProxyProxy(payable(bscLockProxyProxy)); | ||
lockProxyProxy.addCaller(address(lockProxyTokenManager)); | ||
vm.stopBroadcast(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
smart-contracts/script/pol/deploy/05_registerTokenManagerWithLockProxyProxy.s.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// SPDX-License-Identifier: MIT OR Apache-2.0 | ||
pragma solidity ^0.8.20; | ||
|
||
import {Script} from "forge-std/Script.sol"; | ||
import "forge-std/console.sol"; | ||
import {LockProxyTokenManagerUpgradeableV3} from "contracts/periphery/TokenManagerV3/LockProxyTokenManagerUpgradeableV3.sol"; | ||
import {LockAndReleaseOrNativeTokenManagerUpgradeableV3} from "contracts/periphery/TokenManagerV3/LockAndReleaseOrNativeTokenManagerUpgradeableV3.sol"; | ||
import {LockProxyProxy} from "contracts/periphery/LockProxyProxy.sol"; | ||
import {ChainGatewayUpgradeable} from "contracts/core-upgradeable/ChainGatewayUpgradeable.sol"; | ||
import { MainnetConfig } from "script/mainnetConfig.s.sol"; | ||
|
||
contract registerLockProxy is Script, MainnetConfig { | ||
function run() external { | ||
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY_OWNER"); | ||
vm.startBroadcast(deployerPrivateKey); | ||
// The lock proxy token manager needs to know where its lock proxy is. | ||
LockProxyTokenManagerUpgradeableV3 lockProxyTokenManager = LockProxyTokenManagerUpgradeableV3(payable(polLockProxyTokenManager)); | ||
LockProxyProxy lockProxyProxy = LockProxyProxy(payable(polLockProxyProxy)); | ||
lockProxyProxy.addCaller(address(lockProxyTokenManager)); | ||
vm.stopBroadcast(); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
smart-contracts/script/zq/deploy/04_registerTokenManagerWithLockProxyProxy.s.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// SPDX-License-Identifier: MIT OR Apache-2.0 | ||
pragma solidity ^0.8.20; | ||
|
||
import {Script} from "forge-std/Script.sol"; | ||
import "forge-std/console.sol"; | ||
import {LockProxyTokenManagerUpgradeableV3} from "contracts/periphery/TokenManagerV3/LockProxyTokenManagerUpgradeableV3.sol"; | ||
import {LockAndReleaseOrNativeTokenManagerUpgradeableV3} from "contracts/periphery/TokenManagerV3/LockAndReleaseOrNativeTokenManagerUpgradeableV3.sol"; | ||
import {LockProxyProxy} from "contracts/periphery/LockProxyProxy.sol"; | ||
import {ChainGatewayUpgradeable} from "contracts/core-upgradeable/ChainGatewayUpgradeable.sol"; | ||
import { MainnetConfig } from "script/mainnetConfig.s.sol"; | ||
|
||
contract registerLockProxy is Script, MainnetConfig { | ||
function run() external { | ||
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY_OWNER"); | ||
vm.startBroadcast(deployerPrivateKey); | ||
// The lock proxy token manager needs to know where its lock proxy is. | ||
LockProxyTokenManagerUpgradeableV3 lockProxyTokenManager = LockProxyTokenManagerUpgradeableV3(payable(zilLockProxyTokenManager)); | ||
LockProxyProxy lockProxyProxy = LockProxyProxy(payable(zilUnrestrictedLockProxyProxy)); | ||
lockProxyProxy.addCaller(address(lockProxyTokenManager)); | ||
vm.stopBroadcast(); | ||
} | ||
} |