Skip to content
🚧 Under Development! May be incomplete.Some pages/links may be incomplete or subject to change.

HoneyFactory

0xAd1782b2a7020631249031618fB1Bd09CD926b31 | ABI JSON

This is the router contract for minting and redeeming Honey.

Functions

mint

Mint Honey by sending ERC20 to this contract.

Assest must be registered and must be a good collateral.

solidity
function mint(address asset, uint256 amount, address receiver) external returns (uint256);

Parameters

NameTypeDescription
assetaddress
amountuint256The amount of ERC20 to mint with.
receiveraddressThe address that will receive Honey.

Returns

NameTypeDescription
<none>uint256The amount of Honey minted.

redeem

Redeem assets by sending Honey in to burn.

solidity
function redeem(address asset, uint256 honeyAmount, address receiver) external returns (uint256[] memory);

Parameters

NameTypeDescription
assetaddress
honeyAmountuint256The amount of Honey to redeem.
receiveraddressThe address that will receive assets.

Returns

NameTypeDescription
<none>uint256[]The amount of assets redeemed.

liquidate

Liquidate a bad collateral asset.

solidity
function liquidate(
    address badCollateral,
    address goodCollateral,
    uint256 goodAmount
)
    external
    returns (uint256 badAmount);

Parameters

NameTypeDescription
badCollateraladdressThe ERC20 asset to liquidate.
goodCollateraladdressThe ERC20 asset to provide in place.
goodAmountuint256The amount provided.

Returns

NameTypeDescription
badAmountuint256The amount obtained.

recapitalize

Recapitalize a collateral vault.

solidity
function recapitalize(address asset, uint256 amount) external;

Parameters

NameTypeDescription
assetaddressThe ERC20 asset to recapitalize.
amountuint256The amount provided.

isBasketModeEnabled

Get the status of the basket mode.

On mint, basket mode is enabled if all collaterals are either depegged or bad.

On redeem, basket mode is enabled if at least one asset is deppegged except for the collateral assets that have been fully liquidated.

solidity
function isBasketModeEnabled(bool isMint) public view returns (bool basketMode);

Events

MintRateSet

Emitted when a mint rate is set for an asset.

solidity
event MintRateSet(address indexed asset, uint256 rate);

RedeemRateSet

Emitted when a redemption rate is set for an asset.

solidity
event RedeemRateSet(address indexed asset, uint256 rate);

POLFeeCollectorFeeRateSet

Emitted when the POLFeeCollector fee rate is set.

solidity
event POLFeeCollectorFeeRateSet(uint256 rate);

HoneyMinted

Emitted when honey is minted

solidity
event HoneyMinted(
    address indexed from, address indexed to, address indexed asset, uint256 assetAmount, uint256 mintAmount
);

Parameters

NameTypeDescription
fromaddressThe account that supplied assets for the minted honey.
toaddressThe account that received the honey.
assetaddressThe asset used to mint the honey.
assetAmountuint256The amount of assets supplied for minting the honey.
mintAmountuint256The amount of honey that was minted.

HoneyRedeemed

Emitted when honey is redeemed

solidity
event HoneyRedeemed(
    address indexed from, address indexed to, address indexed asset, uint256 assetAmount, uint256 redeemAmount
);

Parameters

NameTypeDescription
fromaddressThe account that redeemed the honey.
toaddressThe account that received the assets.
assetaddressThe asset for redeeming the honey.
assetAmountuint256The amount of assets received for redeeming the honey.
redeemAmountuint256The amount of honey that was redeemed.

BasketModeForced

Emitted when the basked mode is forced.

solidity
event BasketModeForced(bool forced);

Parameters

NameTypeDescription
forcedboolThe flag that represent the forced basket mode.

DepegOffsetsSet

Emitted when the depeg offsets are changed.

solidity
event DepegOffsetsSet(address asset, uint256 lower, uint256 upper);

Parameters

NameTypeDescription
assetaddressThe asset that the depeg offsets are changed.
loweruint256The lower depeg offset.
upperuint256The upper depeg offset.

LiquidationStatusSet

Emitted when the liquidation is enabled or disabled.

solidity
event LiquidationStatusSet(bool enabled);

Parameters

NameTypeDescription
enabledboolThe flag that represent the liquidation status.

ReferenceCollateralSet

Emitted when the reference collateral is set.

solidity
event ReferenceCollateralSet(address old, address asset);

Parameters

NameTypeDescription
oldaddressThe old reference collateral.
assetaddressThe new reference collateral.

RecapitalizeBalanceThresholdSet

Emitted when the recapitalize balance threshold is set.

solidity
event RecapitalizeBalanceThresholdSet(address asset, uint256 target);

Parameters

NameTypeDescription
assetaddressThe asset that the recapitalize balance threshold is set.
targetuint256The target balance threshold.

MinSharesToRecapitalizeSet

Emitted when the min shares to recapitalize is set.

solidity
event MinSharesToRecapitalizeSet(uint256 minShareAmount);

Parameters

NameTypeDescription
minShareAmountuint256The min shares to recapitalize.

MaxFeedDelaySet

Emitted when the max feed delay is set.

solidity
event MaxFeedDelaySet(uint256 maxFeedDelay);

Parameters

NameTypeDescription
maxFeedDelayuint256The max feed delay.

LiquidationRateSet

Emitted when the liquidation rate is set.

solidity
event LiquidationRateSet(address asset, uint256 rate);

Parameters

NameTypeDescription
assetaddressThe asset that the liquidation rate is set.
rateuint256The liquidation rate.

GlobalCapSet

Emitted when the global cap is set.

solidity
event GlobalCapSet(uint256 globalCap);

Parameters

NameTypeDescription
globalCapuint256The global cap.

RelativeCapSet

Emitted when the relative cap is set.

solidity
event RelativeCapSet(address asset, uint256 relativeCap);

Parameters

NameTypeDescription
assetaddressThe asset that the relative cap is set.
relativeCapuint256The relative cap.

Liquidated

Emitted when the liquidate is performed.

solidity
event Liquidated(address badAsset, address goodAsset, uint256 amount, address sender);

Parameters

NameTypeDescription
badAssetaddressThe bad asset that is liquidated.
goodAssetaddressThe good asset that is provided.
amountuint256The amount of good asset provided.
senderaddressThe account that performed the liquidation.

Recapitalized

Emitted when the collateral vault is recapitalized.

solidity
event Recapitalized(address asset, uint256 amount, address sender);

Parameters

NameTypeDescription
assetaddressThe asset that is recapitalized.
amountuint256The amount of asset provided.
senderaddressThe account that performed the recapitalization.