I am developing my smart contracts in Hardhat and testing on RSK Testnet. To create signer accounts, I am using a mnemonic seed phrase and the following Hardhat configuration:
require('@nomicfoundation/hardhat-toolbox');
const { mnemonic } = require('./.secret.json');
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: '0.8.16',
networks: {
hardhat: {},
rsktestnet: {
chainId: 31,
url: 'https://public-node.testnet.rsk.co/',
accounts: { // <-- here
mnemonic,
path: "m/44'/60'/0'/0",
},
},
},
// ...
};
In my tests, I usually use an ethers.js
helper function
to get an array of signers in my tests:
const signers = await hre.ethers.getSigners();
However this function returns 20 signer wallets. Is there a way to get a specific amount of wallets, if I don't want this default amount?