Skip to content

Latest commit

 

History

History
198 lines (131 loc) · 2.77 KB

bonding.md

File metadata and controls

198 lines (131 loc) · 2.77 KB
description
description

Bonding

Read methods

Config

description

function config(address asset) external view returns (AssetConfig memory);

Allowance Interval

description

function allowanceInterval() external view returns (uint256);

Bond Price Time Stamp Delay

description

function bondPriceTimestampDelay() external view returns (uint256);

Interval Start At

description

function intervalStartAt() external view returns (uint256);

Is Enabled

description

function isEnabled(address asset) external view returns (bool);

Enabled

description

function enabled() external view returns (address[] memory);

Estimate Token Amount

description

function estimateTokenAmount(IKEI.Snapshot memory k, address asset, uint256 assetAmount) external view returns (uint256);

Current Bond Interval

description

function currentBondInterval() external view returns (uint256);

Current Interval Token Bonded

description

function currentIntervalTokensBonded(address asset) external view returns (uint256);

Remaining Bond Allowance

description

function remainingBondAllowance(address asset) external view returns (uint256);

Bond Price

description

function bondPrice(
    IKEI.Snapshot memory k,
    uint256 floorPrice,
    address asset
) external view returns (uint256);

Write Methods

Approve

description

function approve() external;

Enable

description

function enable(address asset) external;

Disable

description

function disable(address asset) external;

Update Config

description

function updateConfig(address asset, AssetConfig memory config) external;

Bond

description

function bond(
    IKEI.Snapshot memory k,
    address asset,
    uint256 assetAmount,
    uint256 stakingDuration
) external returns (BondDetails memory);

Events

Bonds created

description

event BondCreated(BondDetails details, address indexed sender);

Asset Config Update

description

event AssetConfigUpdated(AssetConfig prevConfig, AssetConfig newConfig, address indexed sender);

Structs

Asset Config

description

struct AssetConfig {
    uint256 allowance;
    uint256 lockDuration;
    uint256 discountPercent;
    uint256 baseIncrementPercent;
}

Bond Details

description

struct BondDetails {
    address asset;
    uint256 assetAmount;
    uint256 assetReceived;
    uint256 assetReceivedBASE;
    uint256 tokensAllocated;
    uint256 bondPrice;
    uint256 stakeId;
}