📜ABI's

The August Digital SDK includes all necessary contract ABIs (Application Binary Interfaces) for interacting with August vaults and related contracts. All ABIs are exported with the `ABI_` prefix.

Vault ABIs

ABI_LENDING_POOL

Legacy lending pool contract ABI (vault v1.0).

import { ABI_LENDING_POOL } from '@augustdigital/sdk';

Main Functions:

  • deposit(uint256 assets, address receiver)

  • withdraw(uint256 assets, address receiver, address owner)

  • asset() - Get underlying token address

  • totalAssets() - Get total vault assets

  • convertToShares(uint256 assets) - Convert assets to shares

  • convertToAssets(uint256 shares) - Convert shares to assets

ABI_LENDING_POOL_V2

Current lending pool contract ABI (vault v2.0) with separate receipt tokens.

import { ABI_LENDING_POOL_V2 } from '@augustdigital/sdk';

Main Functions:

  • deposit(uint256 assets, address receiver) - Deposit assets

  • requestRedeem(uint256 shares, address receiver, address owner) - Request withdrawal

  • redeem(uint256 year, uint256 month, uint256 day, uint256 receiverIndex, address receiver) - Claim withdrawal

  • asset() - Get underlying token

  • totalAssets() - Get total vault TVL

  • decimals() - Get vault decimals

  • maxDeposit(address) - Check deposit limits

  • previewDeposit(uint256 assets) - Preview deposit

  • previewRedeem(uint256 shares) - Preview redemption

Example:

ABI_LENDING_POOL_V3

Next-generation lending pool contract ABI (vault v3.0).

Similar interface to V2 with additional features and optimizations.

ABI_TOKENIZED_VAULT_V2

Tokenized vault V2 contract ABI.

Main Functions:

  • deposit(uint256 assets, address receiver)

  • mint(uint256 shares, address receiver)

  • withdraw(uint256 assets, address receiver, address owner)

  • redeem(uint256 shares, address receiver, address owner)

ABI_TOKENIZED_VAULT_V2_RECEIPT

Receipt token contract for Tokenized Vault V2.

Standard ERC20 interface for vault receipt tokens.

ABI_TOKENIZED_VAULT_V2_WHITELISTED_ASSETS

Whitelisted assets management for Tokenized Vault V2.

Token ABIs

ABI_ERC20

Standard ERC20 token contract ABI.

Main Functions:

  • balanceOf(address account) - Get token balance

  • allowance(address owner, address spender) - Check allowance

  • approve(address spender, uint256 amount) - Approve spending

  • transfer(address to, uint256 amount) - Transfer tokens

  • transferFrom(address from, address to, uint256 amount) - Transfer from

  • totalSupply() - Get total supply

  • decimals() - Get token decimals

  • symbol() - Get token symbol

  • name() - Get token name

Example:

ABI_ERC4626

Standard ERC4626 tokenized vault ABI.

Main Functions:

  • deposit(uint256 assets, address receiver)

  • mint(uint256 shares, address receiver)

  • withdraw(uint256 assets, address receiver, address owner)

  • redeem(uint256 shares, address receiver, address owner)

  • asset() - Get underlying asset

  • totalAssets() - Get total managed assets

  • convertToShares(uint256 assets)

  • convertToAssets(uint256 shares)

  • previewDeposit(uint256 assets)

  • previewMint(uint256 shares)

  • previewWithdraw(uint256 assets)

  • previewRedeem(uint256 shares)

ABI_ERC721

Standard ERC721 NFT contract ABI.

Main Functions:

  • balanceOf(address owner)

  • ownerOf(uint256 tokenId)

  • transferFrom(address from, address to, uint256 tokenId)

  • safeTransferFrom(address from, address to, uint256 tokenId)

  • approve(address to, uint256 tokenId)

  • getApproved(uint256 tokenId)

  • setApprovalForAll(address operator, bool approved)

Utility ABIs

ABI_LOAN

Loan contract ABI for August lending protocol.

Main Functions:

  • principal() - Get loan principal

  • apr() - Get annual percentage rate

  • borrower() - Get borrower address

  • lender() - Get lender address

  • paymentInterval() - Get payment frequency

  • makePayment(uint256 amount) - Make loan payment

ABI_REWARD_DISTRIBUTOR

Reward distribution contract ABI.

Main Functions:

  • claimRewards(address user) - Claim pending rewards

  • pendingRewards(address user) - Check pending rewards

  • rewardToken() - Get reward token address

Using ABIs

Creating Contract Instances

Reading Contract Data

Writing to Contracts

Last updated