MCPcopy Create free account
hub / github.com/LearnWeb3DAO/Defi-Exchange / main

Function main

hardhat-tutorial/scripts/deploy.js:5–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3const { CRYPTO_DEV_TOKEN_CONTRACT_ADDRESS } = require("../constants");
4
5async function main() {
6 const cryptoDevTokenAddress = CRYPTO_DEV_TOKEN_CONTRACT_ADDRESS;
7 /*
8 A ContractFactory in ethers.js is an abstraction used to deploy new smart contracts,
9 so exchangeContract here is a factory for instances of our Exchange contract.
10*/
11 const exchangeContract = await ethers.getContractFactory("Exchange");
12
13 // here we deploy the contract
14 const deployedExhangeContract = await exchangeContract.deploy(
15 cryptoDevTokenAddress
16 );
17
18 // print the address of the deployed contract
19 console.log("Exchange Contract Address:", deployedExhangeContract.address);
20}
21
22// Call the main function and catch if there is any error
23main()

Callers 1

deploy.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected