Skip to content
Lattice

IComet

Git Source

Title: IComet

Author: ABI-equivalent interface authored fresh from Compound v3's public ABI

(https://github.com/compound-finance/comet/blob/main/contracts/CometMainInterface.sol). Upstream license: BUSL-1.1 (not copied). Only the selectors the adapter calls are declared.

Minimal ABI-equivalent interface of a Compound v3 Comet market (base-asset supply leg).

Functions

supply

Supplies amount of asset (the base asset) to the caller's position.

function supply(address asset, uint256 amount) external;

Parameters

NameTypeDescription
assetaddress
amountuint256

withdraw

Withdraws amount of asset (base asset) to the caller.

function withdraw(address asset, uint256 amount) external;

Parameters

NameTypeDescription
assetaddress
amountuint256

balanceOf

Returns the caller's supplied base-asset balance (accrues interest, 1:1 base units).

function balanceOf(address account) external view returns (uint256);

Parameters

NameTypeDescription
accountaddress

Returns

NameTypeDescription
<none>uint256

baseToken

Returns the base token (the yield-bearing asset) of this market.

function baseToken() external view returns (address);

Returns

NameTypeDescription
<none>address

accrueAccount

Accrues interest/rewards state for account so reads are fresh.

function accrueAccount(address account) external;

Parameters

NameTypeDescription
accountaddress