hardhat#getUnnamedAccounts TypeScript Examples

The following examples show how to use hardhat#getUnnamedAccounts. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: seed.ts    From gateway-sol with GNU General Public License v3.0 6 votes vote down vote up
async function main() {
  const others = await getUnnamedAccounts();
  for (let i = 0; i < messages.length; i++) {
    const sender = others[i];
    if (sender) {
      const greetingsRegistryContract = await ethers.getContract(
        'GreetingsRegistry',
        sender
      );
      await waitFor(greetingsRegistryContract.setMessage(messages[i]));
    }
  }
}
Example #2
Source File: setMessage.ts    From gateway-sol with GNU General Public License v3.0 6 votes vote down vote up
async function main() {
  const accountAddress = isNaN(parseInt(account))
    ? account
    : (await getUnnamedAccounts())[parseInt(account)];

  await execute(
    'GreetingsRegistry',
    {from: accountAddress, log: true},
    'setMessage',
    message || 'hello'
  );
}