vault creation loop bugfix

This commit is contained in:
Tim Olson
2023-12-28 18:26:58 -04:00
parent 0be3737d44
commit 3426056195
2 changed files with 7 additions and 3 deletions

View File

@@ -17,11 +17,13 @@ export async function faucet( chainId, owner, vault=null ) {
)
let nonce = await provider.getTransactionCount(faucet.address, 'pending')
faucet = new ethers.NonceManager(faucet)
console.log('faucet sending native coin to', owner)
await faucet.sendTransaction({to:owner, value:1n *10n**18n, nonce: nonce++})
const info = chainInfo[chainId]
if( info.mockCoins ) {
const [coinAddr, usdAddr] = info.mockCoins
const signer = await provider.getSigner()
console.log('faucet minting tokens to', vault)
await new ethers.Contract(coinAddr, mockErc20Abi, signer).mint(vault, 10n *10n**18n)
await new ethers.Contract(usdAddr, mockErc20Abi, signer).mint(vault, 10_1000n *10n**6n)
}