-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: deploy batch mint contracts (#1579)
* feat: deploy batch mint contracts * fix: ci * add: mainnet deployments * fix: format
- Loading branch information
Showing
9 changed files
with
3,286 additions
and
6 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,30 @@ | ||
import {DeployFunction} from 'hardhat-deploy/types'; | ||
import {HardhatRuntimeEnvironment} from 'hardhat/types'; | ||
import {skipUnlessL1} from '../../utils/network'; | ||
|
||
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | ||
const {deployments, getNamedAccounts} = hre; | ||
const {deploy, execute, read} = deployments; | ||
const {deployer, sandboxAccount} = await getNamedAccounts(); | ||
const batch = await deploy(`Batch-${sandboxAccount}`, { | ||
contract: `Batch`, | ||
from: deployer, | ||
args: [sandboxAccount], | ||
log: true, | ||
skipIfAlreadyDeployed: true, | ||
}); | ||
const isMinter = await read('Land', 'isMinter', batch.address); | ||
if (!isMinter) { | ||
const admin = await read('Land', 'getAdmin'); | ||
await execute( | ||
'Land', | ||
{from: admin, log: true}, | ||
'setMinter', | ||
batch.address, | ||
true | ||
); | ||
} | ||
}; | ||
export default func; | ||
func.skip = skipUnlessL1; | ||
func.tags = ['DeployerBatchMint', 'DeployerBatchMint_deploy']; |
30 changes: 30 additions & 0 deletions
30
packages/core/deploy_polygon/999_helpers/01_deploy_batch_mint.ts
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,30 @@ | ||
import {DeployFunction} from 'hardhat-deploy/types'; | ||
import {HardhatRuntimeEnvironment} from 'hardhat/types'; | ||
import {skipUnlessL2} from '../../utils/network'; | ||
|
||
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | ||
const {deployments, getNamedAccounts} = hre; | ||
const {deploy, execute, read} = deployments; | ||
const {deployer, sandboxAccount} = await getNamedAccounts(); | ||
const batch = await deploy(`Batch-${sandboxAccount}`, { | ||
contract: `Batch`, | ||
from: deployer, | ||
args: [sandboxAccount], | ||
log: true, | ||
skipIfAlreadyDeployed: true, | ||
}); | ||
const isMinter = await read('PolygonLand', 'isMinter', batch.address); | ||
if (!isMinter) { | ||
const admin = await read('PolygonLand', 'getAdmin'); | ||
await execute( | ||
'PolygonLand', | ||
{from: admin, log: true}, | ||
'setMinter', | ||
batch.address, | ||
true | ||
); | ||
} | ||
}; | ||
export default func; | ||
func.skip = skipUnlessL2; | ||
func.tags = ['DeployerBatchMintPolygon', 'DeployerBatchMintPolygon_deploy']; |
Oops, something went wrong.
af019b4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage for this commit
Coverage Report