forked from 1inch/limit-order-protocol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.js
31 lines (24 loc) · 949 Bytes
/
deploy.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const hre = require('hardhat');
const { getChainId, network } = hre;
const wethByNetwork = {
hardhat: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
mainnet: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
};
module.exports = async ({ getNamedAccounts, deployments }) => {
console.log('running deploy script');
console.log('network id ', await getChainId());
const { deploy } = deployments;
const { deployer } = await getNamedAccounts();
const limitOrderProtocol = await deploy('LimitOrderProtocol', {
from: deployer,
args: [wethByNetwork[network.name]],
});
console.log('LimitOrderProtocol deployed to:', limitOrderProtocol.address);
if (await getChainId() !== '31337') {
await hre.run('verify:verify', {
address: limitOrderProtocol.address,
constructorArguments: [wethByNetwork[network.name]],
});
}
};
module.exports.skip = async () => true;