()
| 8 | const { getSelectors, FacetCutAction } = require('./js/diamond.js') |
| 9 | |
| 10 | export async function deploy() { |
| 11 | const [deployer] = await ethers.getSigners() |
| 12 | const balance = await deployer.getBalance() |
| 13 | |
| 14 | console.log( |
| 15 | `Deploying contracts with account: ${ |
| 16 | deployer.address |
| 17 | } and balance: ${balance.toString()}`, |
| 18 | ) |
| 19 | |
| 20 | const mode = subnetCreationPrivileges() |
| 21 | console.log( |
| 22 | ` |
| 23 | *************************************************************** |
| 24 | ** ** |
| 25 | ** Subnet creation privileges: ${mode} ** |
| 26 | ** ** |
| 27 | *************************************************************** |
| 28 | `, |
| 29 | ) |
| 30 | |
| 31 | const gatewayAddress = GATEWAY.Gateway |
| 32 | const txArgs = await getTransactionFees() |
| 33 | |
| 34 | const subnetActorDeployFacets = [] |
| 35 | |
| 36 | // deploy |
| 37 | const getterFacet = await deployContractWithDeployer( |
| 38 | deployer, |
| 39 | 'SubnetActorGetterFacet', |
| 40 | { |
| 41 | SubnetIDHelper: LIBMAP['SubnetIDHelper'], |
| 42 | }, |
| 43 | txArgs, |
| 44 | ) |
| 45 | const getterSelectors = getSelectors(getterFacet) |
| 46 | |
| 47 | subnetActorDeployFacets.push({ |
| 48 | name: 'SubnetActorGetterFacet', |
| 49 | libs: { |
| 50 | SubnetIDHelper: LIBMAP['SubnetIDHelper'], |
| 51 | }, |
| 52 | address: getterFacet.address, |
| 53 | }) |
| 54 | |
| 55 | const managerFacet = await deployContractWithDeployer( |
| 56 | deployer, |
| 57 | 'SubnetActorManagerFacet', |
| 58 | {}, |
| 59 | txArgs, |
| 60 | ) |
| 61 | const managerSelectors = getSelectors(managerFacet) |
| 62 | |
| 63 | subnetActorDeployFacets.push({ |
| 64 | name: 'SubnetActorManagerFacet', |
| 65 | libs: {}, |
| 66 | address: managerFacet.address, |
| 67 | }) |
nothing calls this directly
no test coverage detected