From e6c85271bd95bd17fcef39459e281c2e9f0fce78 Mon Sep 17 00:00:00 2001 From: Jakub Nowakowski Date: Tue, 17 Aug 2021 11:55:08 +0200 Subject: [PATCH] Transfer TBTC token ownership to VendingMachine It is expected that VendingMachine becomes owner of TBTC token to manage minting of the token. --- solidity/deploy/02_deploy_vending_machine.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/solidity/deploy/02_deploy_vending_machine.ts b/solidity/deploy/02_deploy_vending_machine.ts index 94995f826..546ec2414 100644 --- a/solidity/deploy/02_deploy_vending_machine.ts +++ b/solidity/deploy/02_deploy_vending_machine.ts @@ -2,7 +2,7 @@ import { HardhatRuntimeEnvironment } from "hardhat/types" import { DeployFunction } from "hardhat-deploy/types" const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - const { deployments, getNamedAccounts } = hre + const { deployments, helpers, getNamedAccounts } = hre const { deploy } = deployments const { deployer } = await getNamedAccounts() @@ -11,11 +11,17 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const unmintFee = 0 - await deploy("VendingMachine", { + const VendingMachine = await deploy("VendingMachine", { from: deployer, args: [TBTCToken.address, TBTC.address, unmintFee], log: true, }) + + await helpers.ownable.transferOwnership( + "TBTC", + VendingMachine.address, + deployer + ) } export default func