-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from 1inch/chore/adjust-deploument-scripts
chore: adjust deployment scripts
- Loading branch information
Showing
2 changed files
with
44 additions
and
3 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,35 @@ | ||
const hre = require('hardhat'); | ||
// const { ethers } = hre; | ||
const { getChainId } = hre; | ||
|
||
module.exports = async ({ deployments, getNamedAccounts }) => { | ||
const networkName = hre.network.name; | ||
console.log(`running ${networkName} deploy script`); | ||
const chainId = await getChainId(); | ||
console.log('network id ', chainId); | ||
if (chainId !== hre.config.networks[networkName].chainId.toString()) { | ||
console.log(`network chain id: ${hre.config.networks[networkName].chainId}, your chain id ${chainId}`); | ||
console.log('skipping wrong chain id deployment'); | ||
return; | ||
} | ||
|
||
const { deploy } = deployments; | ||
const { deployer } = await getNamedAccounts(); | ||
|
||
const contractName = 'AddressTokenMetadata'; | ||
const contract = await deploy('AddressTokenMetadata', { | ||
from: deployer, | ||
contract: contractName, | ||
skipIfAlreadyDeployed: true, | ||
}); | ||
|
||
console.log(`${contractName} deployed to: ${contract.address}`); | ||
|
||
if (chainId !== '31337') { | ||
await hre.run('verify:verify', { | ||
address: contract.address, | ||
}); | ||
} | ||
}; | ||
|
||
module.exports.skip = async () => true; |
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