forked from Moloch-Mystics/Baal
-
Notifications
You must be signed in to change notification settings - Fork 19
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 #123 from HausDAO/feat/factory-upgrade
Factory upgrade
- Loading branch information
Showing
14 changed files
with
2,557 additions
and
575 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
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
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,42 @@ | ||
import { HardhatRuntimeEnvironment } from 'hardhat/types'; | ||
const { ethers, upgrades } = require("hardhat"); | ||
import { DeployFunction } from 'hardhat-deploy/types'; | ||
|
||
import { getSetupAddresses } from '../src/addresses/setup'; | ||
|
||
const deployFn: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { | ||
|
||
const { deployments, ethers, getChainId, getNamedAccounts, network } = hre; | ||
|
||
const { deployer } = await getNamedAccounts(); | ||
const chainId = await getChainId(); | ||
|
||
const _addresses = await getSetupAddresses(chainId, network, deployments); | ||
|
||
if ((!_addresses.DAO || _addresses.DAO === ethers.constants.AddressZero) && network.name !== 'hardhat') { | ||
console.log('You need to set DAO address to transfer ownership of summoner', _addresses.DAO); | ||
return; | ||
} | ||
|
||
console.log('\n\nDeploying BaalSummoner factory on network:', network.name); | ||
console.log('Deployer address:', `${chainId}:${deployer}`); | ||
console.log( | ||
'Deployer balance:', | ||
ethers.utils.formatEther(await ethers.provider.getBalance(deployer)), | ||
); | ||
|
||
const { deploy } = deployments; | ||
|
||
const summonerDeeployed = await deploy('BaalSummoner', { | ||
contract: 'BaalSummoner', | ||
from: deployer, | ||
args: [], | ||
log: true, | ||
}); | ||
console.log('BaalSummoner deployment Tx ->', summonerDeeployed.transactionHash); | ||
|
||
|
||
}; | ||
|
||
export default deployFn; | ||
deployFn.tags = ['UpgradeBaalSummoner']; |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.