UNPKG

@dydxfoundation/governance

Version:
27 lines (26 loc) 1.06 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.impersonateAndFundAccount = exports.impersonateAccount = exports.fundAccount = exports.IMPERSONATED_ACCOUNT_STIPEND = void 0; const hre_1 = require("../../hre"); exports.IMPERSONATED_ACCOUNT_STIPEND = '0x1000000000000000'; async function fundAccount(address) { const [firstSigner] = await (0, hre_1.getHre)().ethers.getSigners(); await firstSigner.sendTransaction({ to: address, value: exports.IMPERSONATED_ACCOUNT_STIPEND, }); } exports.fundAccount = fundAccount; async function impersonateAccount(address) { await (0, hre_1.getHre)().network.provider.request({ method: 'hardhat_impersonateAccount', params: [address], }); return (0, hre_1.getHre)().ethers.getSigner(address); } exports.impersonateAccount = impersonateAccount; async function impersonateAndFundAccount(address) { await fundAccount(address); return impersonateAccount(address); } exports.impersonateAndFundAccount = impersonateAndFundAccount;