Files
sre-04-dice-game/packages/hardhat/deploy/01_deploy_riggedRoll.ts
han b241a84555
Some checks failed
Lint / ci (lts/*, ubuntu-latest) (push) Has been cancelled
feat: finish challenge
2026-01-21 20:39:51 +07:00

34 lines
1.0 KiB
TypeScript

import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { ethers } from "hardhat/";
import { DiceGame, RiggedRoll } from "../typechain-types";
const deployRiggedRoll: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { deployer } = await hre.getNamedAccounts();
const { deploy } = hre.deployments;
const diceGame: DiceGame = await ethers.getContract("DiceGame");
const diceGameAddress = await diceGame.getAddress();
// Uncomment to deploy RiggedRoll contract
await deploy("RiggedRoll", {
from: deployer,
log: true,
args: [diceGameAddress],
autoMine: true,
});
const riggedRoll: RiggedRoll = await ethers.getContract("RiggedRoll", deployer);
// Please replace the text "Your Address" with your own address.
try {
await riggedRoll.transferOwnership("0xD70D3fC875061A950d61cD5CDACb4aE4bF90608A");
} catch (err) {
console.log(err);
}
};
export default deployRiggedRoll;
deployRiggedRoll.tags = ["RiggedRoll"];