Get set up with some testnet ERC20 tokens
To try swaps end-to-end you'll need a balance of the demo tokens that live on Fuji.
Agora provides faucet contracts that mint small amounts of each asset to any address on request.
Prerequisite
Make sure your Fuji wallet already holds a little AVAX for gas (see Wallet Setup). A single transaction costs only a few gwei, but the transaction will fail if your balance is zero.
1. Faucet addresses
| Token | Symbol | Faucet contract |
|---|---|---|
| Agora USD | AUSD | 0xd236c18D274E54FAccC3dd9DDA4b27965a73ee6C |
| Constant Token | CTK | 0xB2C2E6c8507360123B2B2D62F2C0Cd4F2d3cE6a8 |
2. Helper to read the functions
const { request } = await client.simulateContract({
address: AUSD_FAUCET,
abi: ausdFaucetAbi,
functionName: "requestFunds",
args: [callerAddress],
});
3. Run the query
(async () => {
// Ensure the wallet is configured properly.
const [callerAddress] = await client.getAddresses();
console.log(`Caller Address ${callerAddress}`);
const { request } = await client.simulateContract({
address: AUSD_FAUCET,
abi: ausdFaucetAbi,
functionName: "requestFunds",
args: [callerAddress],
});
let txHash = await client.writeContract(request);
console.log("AUSD - Approve transaction hash:", txHash);
})();
AUSD - Approve transaction hash: 0x2ede80f87afe463d3766b547af02780d149e2cc002b88629370d86e28d9db01b
We can check the status of the transaction hash by going to Snowtrace
As expected, the transaction was successful and now we should have 10,000 AUSD in our balance.