|
| 1 | +// SPDX-License-Identifier: MIT |
| 2 | + |
| 3 | +pragma solidity 0.8.19; |
| 4 | + |
| 5 | +import "forge-std/Script.sol"; |
| 6 | + |
| 7 | +import "script/deployment/root/DeployRootERC20Predicate.s.sol"; |
| 8 | +import "script/deployment/root/DeployChildMintableERC20Predicate.s.sol"; |
| 9 | +import "script/deployment/root/DeployRootERC721Predicate.s.sol"; |
| 10 | +import "script/deployment/root/DeployChildMintableERC721Predicate.s.sol"; |
| 11 | +import "script/deployment/root/DeployRootERC1155Predicate.s.sol"; |
| 12 | +import "script/deployment/root/DeployChildMintableERC1155Predicate.s.sol"; |
| 13 | + |
| 14 | +contract DeployRootTokenContracts is |
| 15 | + RootERC20PredicateDeployer, |
| 16 | + ChildMintableERC20PredicateDeployer, |
| 17 | + RootERC721PredicateDeployer, |
| 18 | + ChildMintableERC721PredicateDeployer, |
| 19 | + RootERC1155PredicateDeployer, |
| 20 | + ChildMintableERC1155PredicateDeployer |
| 21 | +{ |
| 22 | + using stdJson for string; |
| 23 | + |
| 24 | + function run() |
| 25 | + external |
| 26 | + returns ( |
| 27 | + address rootERC20PredicateLogic, |
| 28 | + address rootERC20PredicateProxy, |
| 29 | + address childMintableERC20PredicateLogic, |
| 30 | + address childMintableERC20PredicateProxy, |
| 31 | + address rootERC721PredicateLogic, |
| 32 | + address rootERC721PredicateProxy, |
| 33 | + address childMintableERC721PredicateLogic, |
| 34 | + address childMintableERC721PredicateProxy, |
| 35 | + address rootERC1155PredicateLogic, |
| 36 | + address rootERC1155PredicateProxy, |
| 37 | + address childMintableERC1155PredicateLogic, |
| 38 | + address childMintableERC1155PredicateProxy |
| 39 | + ) |
| 40 | + { |
| 41 | + string memory config = vm.readFile("script/deployment/rootTokenContractsConfig.json"); |
| 42 | + |
| 43 | + (rootERC20PredicateLogic, rootERC20PredicateProxy) = deployRootERC20Predicate( |
| 44 | + config.readAddress('["common"].proxyAdmin'), |
| 45 | + config.readAddress('["common"].stateSender'), |
| 46 | + config.readAddress('["common"].exitHelper'), |
| 47 | + config.readAddress('["RootERC20Predicate"].newChildERC20Predicate'), |
| 48 | + config.readAddress('["common"].newChildTokenTemplate'), |
| 49 | + config.readAddress('["RootERC20Predicate"].nativeTokenRootAddress') |
| 50 | + ); |
| 51 | + |
| 52 | + (childMintableERC20PredicateLogic, childMintableERC20PredicateProxy) = deployChildMintableERC20Predicate( |
| 53 | + config.readAddress('["common"].proxyAdmin'), |
| 54 | + config.readAddress('["common"].stateSender'), |
| 55 | + config.readAddress('["common"].exitHelper'), |
| 56 | + rootERC20PredicateProxy, |
| 57 | + config.readAddress('["common"].newChildTokenTemplate') |
| 58 | + ); |
| 59 | + |
| 60 | + (rootERC721PredicateLogic, rootERC721PredicateProxy) = deployRootERC721Predicate( |
| 61 | + config.readAddress('["common"].proxyAdmin'), |
| 62 | + config.readAddress('["common"].stateSender'), |
| 63 | + config.readAddress('["common"].exitHelper'), |
| 64 | + config.readAddress('["RootERC721Predicate"].newChildERC721Predicate'), |
| 65 | + config.readAddress('["common"].newChildTokenTemplate') |
| 66 | + ); |
| 67 | + |
| 68 | + (childMintableERC721PredicateLogic, childMintableERC721PredicateProxy) = deployChildMintableERC721Predicate( |
| 69 | + config.readAddress('["common"].proxyAdmin'), |
| 70 | + config.readAddress('["common"].stateSender'), |
| 71 | + config.readAddress('["common"].exitHelper'), |
| 72 | + rootERC721PredicateProxy, |
| 73 | + config.readAddress('["common"].newChildTokenTemplate') |
| 74 | + ); |
| 75 | + |
| 76 | + (rootERC1155PredicateLogic, rootERC1155PredicateProxy) = deployRootERC1155Predicate( |
| 77 | + config.readAddress('["common"].proxyAdmin'), |
| 78 | + config.readAddress('["common"].stateSender'), |
| 79 | + config.readAddress('["common"].exitHelper'), |
| 80 | + config.readAddress('["RootERC1155Predicate"].newChildERC1155Predicate'), |
| 81 | + config.readAddress('["common"].newChildTokenTemplate') |
| 82 | + ); |
| 83 | + |
| 84 | + (childMintableERC1155PredicateLogic, childMintableERC1155PredicateProxy) = deployChildMintableERC1155Predicate( |
| 85 | + config.readAddress('["common"].proxyAdmin'), |
| 86 | + config.readAddress('["common"].stateSender'), |
| 87 | + config.readAddress('["common"].exitHelper'), |
| 88 | + rootERC1155PredicateProxy, |
| 89 | + config.readAddress('["common"].newChildTokenTemplate') |
| 90 | + ); |
| 91 | + } |
| 92 | +} |
0 commit comments