Skip to content

Honey Berachain ​

Git Source

Honey’s collateral can only be updated through a governance vote.

Note: Link to existing contract ABI's can be found on Github here.

Interface of the Honey module's precompiled contract

Functions ​

previewMint ​

Previews the amount of honey out using the given collateral.

solidity
function previewMint(Cosmos.Coin calldata collateral) external view returns (uint256);
function previewMint(Cosmos.Coin calldata collateral) external view returns (uint256);

Parameters

NameTypeDescription
collateralCosmos.CoinThe collateral to use.

Returns

NameTypeDescription
<none>uint256honey The amount of honey that would be minted.

previewRedeem ​

Previews the amount of collateral to be returned for redeeming honey.

solidity
function previewRedeem(uint256 amount, string calldata denomOut) external view returns (uint256);
function previewRedeem(uint256 amount, string calldata denomOut) external view returns (uint256);

Parameters

NameTypeDescription
amountuint256The amount of honey to redeem.
denomOutstringThe denom of collateral to redeem.

Returns

NameTypeDescription
<none>uint256collateral The amount of collateral that would be returned.

previewRequiredCollateral ​

previews the amount of collateral required to mint a certain amount of honey.

solidity
function previewRequiredCollateral(uint256 honeyOut, string calldata denomIn) external view returns (uint256);
function previewRequiredCollateral(uint256 honeyOut, string calldata denomIn) external view returns (uint256);

Parameters

NameTypeDescription
honeyOutuint256The amount of honey to mint.
denomInstringThe collateral to use.

Returns

NameTypeDescription
<none>uint256collateral The amount of collateral required.

previewExactOutCollateral ​

Previews the amount of honey required to redeem a certain amount of target collateral.

solidity
function previewExactOutCollateral(Cosmos.Coin calldata collateralOut) external view returns (uint256);
function previewExactOutCollateral(Cosmos.Coin calldata collateralOut) external view returns (uint256);

Parameters

NameTypeDescription
collateralOutCosmos.CoinThe amount of collateral to receive.

Returns

NameTypeDescription
<none>uint256honey The amount of honey required.

getParams ​

Gets the parameters of the honey module.

solidity
function getParams() external returns (Exchangeable[] memory);
function getParams() external returns (Exchangeable[] memory);

Returns

NameTypeDescription
<none>Exchangeable[]params The parameters of the honey module. This includes the redemption reward rates, and minting fees of all accepted collaterals.

getTotalSupply ​

Gets the total supply of honey.

solidity
function getTotalSupply() external view returns (uint256);
function getTotalSupply() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256honey The total supply of honey.

getTotalCollateral ​

Gets the total collateral locked in the honey module.

solidity
function getTotalCollateral() external view returns (Cosmos.Coin[] memory);
function getTotalCollateral() external view returns (Cosmos.Coin[] memory);

Returns

NameTypeDescription
<none>Cosmos.Coin[]collateral The total collateral locked in the honey module.

getAMOCurrentLimit ​

Gets the current limit of the specified AMO.

solidity
function getAMOCurrentLimit(string calldata amoType, address amoAddr) external view returns (uint256);
function getAMOCurrentLimit(string calldata amoType, address amoAddr) external view returns (uint256);

Parameters

NameTypeDescription
amoTypestringThe type of AMO to get the limit of.
amoAddraddressThe address of the AMO to get the limit of.

Returns

NameTypeDescription
<none>uint256limit The current limit of the specified AMO.

mint ​

Mints new honey coins for the given account using the given collateral.

solidity
function mint(address to, Cosmos.Coin calldata collateral) external returns (Cosmos.Coin memory);
function mint(address to, Cosmos.Coin calldata collateral) external returns (Cosmos.Coin memory);

Parameters

NameTypeDescription
toaddressThe account to mint coins for.
collateralCosmos.CoinThe collateral to use.

Returns

NameTypeDescription
<none>Cosmos.Coinhoney The amount of honey that was minted.

redeem ​

Redeems honey coins for the given account using the given collateral.

solidity
function redeem(address from, uint256 amount, string calldata denomOut) external returns (bool);
function redeem(address from, uint256 amount, string calldata denomOut) external returns (bool);

Parameters

NameTypeDescription
fromaddressThe account to redeem coins for.
amountuint256The amount of honey to redeem.
denomOutstringThe denom of collateral to redeem.

requestHoney ​

Request honey from the amo.

solidity
function requestHoney(address to, uint256 amount, string calldata amoType) external returns (bool);
function requestHoney(address to, uint256 amount, string calldata amoType) external returns (bool);

Parameters

NameTypeDescription
toaddressThe account to mint the honey to, needs to be the user that has the allowance.
amountuint256The amount of honey to mint.
amoTypestring

updateParams ​

The caller of this function must be the governance module account.

Updates the parameters of the honey module.

solidity
function updateParams(Exchangeable[] memory params) external returns (bool);
function updateParams(Exchangeable[] memory params) external returns (bool);

Parameters

NameTypeDescription
paramsExchangeable[]The new parameters to update to.

Events ​

HoneyMinted ​

Emitted when honey is minted

solidity
event HoneyMinted(address from, address to, Cosmos.Coin collateral, uint256 mintAmount, uint256 totalHoneySupply);
event HoneyMinted(address from, address to, Cosmos.Coin collateral, uint256 mintAmount, uint256 totalHoneySupply);

Parameters

NameTypeDescription
fromaddressThe account that supplied collateral for the minted honey.
toaddressThe account that recevied the honey.
collateralCosmos.CoinThe collateral used to mint the honey.
mintAmountuint256The amount of honey that was minted.
totalHoneySupplyuint256The total supply of honey after the mint.

HoneyRedeemed ​

Emitted when honey is redeemed

solidity
event HoneyRedeemed(address from, uint256 redeemAmount, Cosmos.Coin redeemAmountOut, uint256 totalHoneySupply);
event HoneyRedeemed(address from, uint256 redeemAmount, Cosmos.Coin redeemAmountOut, uint256 totalHoneySupply);

Parameters

NameTypeDescription
fromaddressThe account that redeemed the honey.
redeemAmountuint256The amount that of honey that was redeemed.
redeemAmountOutCosmos.CoinThe amount of collateral received for redeeming the honey.
totalHoneySupplyuint256The total supply of honey after the mint.

Structs ​

Exchangeable ​

The parameters of the honey module.

solidity
struct Exchangeable {
    string denom;
    bool enabled;
    uint256 mintRate;
    uint256 redemptionRate;
}
struct Exchangeable {
    string denom;
    bool enabled;
    uint256 mintRate;
    uint256 redemptionRate;
}

Properties

NameTypeDescription
denomstringThe denom of the collateral.
enabledboolWhether the collateral is enabled.
mintRateuint256The mint rate of the collateral.
redemptionRateuint256The redemption rate of the collateral.