Skip to content

Commit

Permalink
Registrar deployment linted with the SourceNftLib
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmetson committed Dec 3, 2023
1 parent e6d0548 commit 244ddc6
Showing 1 changed file with 8 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { listSelectors, listRouters, one } from "../scripts/params";
import * as net from "net";

type NetworkParams = {
selector: number | string;
router: string;
registrar: string;
};
import Deployments from "../scripts/deployments";

/**
* Deploys a contract named "Registrar.sol" using the deployer account and
Expand All @@ -16,20 +10,13 @@ type NetworkParams = {
* @param hre HardhatRuntimeEnvironment object.
*/
const registrarContract: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
/*
On localhost, the deployer account is the one that comes with Hardhat, which is already funded.
When deploying to live networks (e.g `yarn deploy --network goerli`), the deployer account
should have sufficient balance to pay for the gas fees for contract creation.
You can generate a random account with `yarn generate` which will fill DEPLOYER_PRIVATE_KEY
with a random private key in the .env file (then used on hardhat.config.ts)
You can run the `yarn account` command to check your balance in every network.
*/
const { deployer } = await hre.getNamedAccounts();
const { deploy } = hre.deployments;

const chainId = parseInt(await hre.getChainId());
const chainId = await hre.getChainId();

const deployments = Deployments[chainId][0];
const sourceLib: string = deployments.contracts["SourceNftLib"].address;

const networkParams = one(chainId);
const destSelectors = listSelectors(chainId);
Expand All @@ -39,6 +26,9 @@ const registrarContract: DeployFunction = async function (hre: HardhatRuntimeEnv
// Contract constructor arguments
args: [networkParams.selector, networkParams.router, destSelectors, destRouters],
log: true,
libraries: {
SourceNftLib: sourceLib,
},
});
};

Expand Down

0 comments on commit 244ddc6

Please sign in to comment.