Skip to content

Commit

Permalink
feat: deploy batch mint contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
lionseal committed Aug 28, 2024
1 parent f7e209a commit 2aa513d
Show file tree
Hide file tree
Showing 5 changed files with 1,656 additions and 7 deletions.
22 changes: 22 additions & 0 deletions packages/core/deploy_polygon/999_helpers/01_deploy_batch_mint.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { DeployFunction } from 'hardhat-deploy/types';
import { HardhatRuntimeEnvironment } from 'hardhat/types';

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.tags = ['DeployerBatchMint', 'DeployerBatchMint_deploy'];
Loading

0 comments on commit 2aa513d

Please sign in to comment.