-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { HardhatRuntimeEnvironment } from "hardhat/types"; | ||
import { DeployFunction } from "hardhat-deploy/types"; | ||
import { one, listSelectors, listRouters } from "../scripts/params"; | ||
|
||
/** | ||
* Deploys a contract named "Registrar.sol" using the deployer account and | ||
* constructor arguments set to the deployer address | ||
* | ||
* @param hre HardhatRuntimeEnvironment object. | ||
*/ | ||
const registrarContract: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | ||
const { deployer } = await hre.getNamedAccounts(); | ||
const { deploy } = hre.deployments; | ||
|
||
const chainId = parseInt(await hre.getChainId()); | ||
const networkParams = one(chainId); | ||
const destSelectors = listSelectors(chainId); | ||
const destRouters = listRouters(chainId); | ||
await deploy("LinkedFactory", { | ||
from: deployer, | ||
// Contract constructor arguments | ||
args: [networkParams.selector, networkParams.router, destSelectors, destRouters], | ||
log: true, | ||
}); | ||
}; | ||
|
||
export default registrarContract; | ||
|
||
// Tags are useful if you have multiple deploy files and only want to run one of them. | ||
// e.g. yarn deploy --tags Registrar.sol | ||
registrarContract.tags = ["Factory"]; |