Aave testnet faucet operations.
Mints test ERC-20 tokens on Aave testnets (Sepolia). The faucet contract
is testnet-only — calling mint/4 with a mainnet network will return
{:error, {:unknown_contract, :faucet}} from the address registry.
Error Format
Errors pass through from underlying modules:
| Source | Error Shape |
|---|---|
Onchain.Address.validate/1 | {:error, {:invalid_address, input}} |
Onchain.Aave.Contracts.address/2 | {:error, {:unknown_contract, :faucet}} |
Onchain.ABI.encode_call/2 | {:error, {:encode_error, ...}} |
Onchain.Signer.send_transaction/3 | {:error, {:missing_option, ...}}, {:error, {:sign_error, ...}}, etc. |
Functions
| Function | Purpose |
|---|---|
mint/4 | Mint test tokens from the faucet (returns tx hash) |
mint!/4 | Same, raises on error |
API Functions
| Function | Arity | Description | Param Kinds |
|---|---|---|---|
mint! | 4 | Mint test ERC-20 tokens from the Aave testnet faucet. Raises on error. | token: value, to: value, amount: value, opts: value |
mint | 4 | Mint test ERC-20 tokens from the Aave testnet faucet. | token: value, to: value, amount: value, opts: value |
Summary
Functions
Mint test ERC-20 tokens from the Aave testnet faucet.
Mint test ERC-20 tokens from the Aave testnet faucet. Raises on error.
Functions
@spec mint(String.t() | binary(), String.t() | binary(), non_neg_integer(), keyword()) :: {:ok, String.t()} | {:error, term()}
Mint test ERC-20 tokens from the Aave testnet faucet.
Parameters
token- ERC-20 token contract address to mint (value)to- Recipient address (value)amount- Amount to mint (raw integer, not decimal-adjusted) (value)opts- Required: :private_key, :nonce, :chain_id, :rpc_url, :network. Optional: :gas_limit (default 200k), :max_fee_per_gas, :max_priority_fee_per_gas (value)
Returns
Transaction hash hex string ({:ok, String.t()} | {:error, term()})
# descripex:contract
%{
params: %{
opts: %{
description: "Required: :private_key, :nonce, :chain_id, :rpc_url, :network. Optional: :gas_limit (default 200k), :max_fee_per_gas, :max_priority_fee_per_gas",
kind: :value
},
token: %{description: "ERC-20 token contract address to mint", kind: :value},
to: %{description: "Recipient address", kind: :value},
amount: %{
description: "Amount to mint (raw integer, not decimal-adjusted)",
kind: :value
}
},
returns: %{
type: "{:ok, String.t()} | {:error, term()}",
description: "Transaction hash hex string"
}
}
@spec mint!( String.t() | binary(), String.t() | binary(), non_neg_integer(), keyword() ) :: String.t()
Mint test ERC-20 tokens from the Aave testnet faucet. Raises on error.
Parameters
token- ERC-20 token contract address to mint (value)to- Recipient address (value)amount- Amount to mint (raw integer, not decimal-adjusted) (value)opts- Required: :private_key, :nonce, :chain_id, :rpc_url, :network. Optional: :gas_limit (default 200k), :max_fee_per_gas, :max_priority_fee_per_gas (value)
Returns
Transaction hash hex string (string)
# descripex:contract
%{
params: %{
opts: %{
description: "Required: :private_key, :nonce, :chain_id, :rpc_url, :network. Optional: :gas_limit (default 200k), :max_fee_per_gas, :max_priority_fee_per_gas",
kind: :value
},
token: %{description: "ERC-20 token contract address to mint", kind: :value},
to: %{description: "Recipient address", kind: :value},
amount: %{
description: "Amount to mint (raw integer, not decimal-adjusted)",
kind: :value
}
},
returns: %{type: :string, description: "Transaction hash hex string"}
}