본문으로 건너뛰기

Accounts

Initialize
import { ethers } from 'hardhat' or '@coinmeca/ethers';
import { Accounts } from '@coinmeca/ethers/accounts';
import { ERC20 } from '@coinmeca/ethers/interfaces';

async function something() {
const METH: = await ERC20(await (await ethers.getContractFactory("MockEthereum")).deploy());

const { User } = await Accounts();
}
Initialize with contracts
import { ethers } from 'hardhat' or '@coinmeca/ethers';
import { Accounts } from '@coinmeca/ethers/accounts';
import { ERC20 } from '@coinmeca/ethers/interfaces';

async function something() {
const Tokens = {
METH: await ERC20(await (await ethers.getContractFactory("MockEthereum")).deploy()),
MDAI: await ERC20(await (await ethers.getContractFactory("MockDai")).deploy()),
MUSDT: await ERC20(await (await ethers.getContractFactory("MockUsdTether")).deploy()),
}

const { User } = await Accounts({ tokens: Tokens });
}