Honey Berachain β
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.
function previewMint(Cosmos.Coin calldata collateral) external view returns (uint256);
function previewMint(Cosmos.Coin calldata collateral) external view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
collateral | Cosmos.Coin | The collateral to use. |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | honey The amount of honey that would be minted. |
previewRedeem β
Previews the amount of collateral to be returned for redeeming honey.
function previewRedeem(uint256 amount, string calldata denomOut) external view returns (uint256);
function previewRedeem(uint256 amount, string calldata denomOut) external view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | The amount of honey to redeem. |
denomOut | string | The denom of collateral to redeem. |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | collateral The amount of collateral that would be returned. |
previewRequiredCollateral β
previews the amount of collateral required to mint a certain amount of honey.
function previewRequiredCollateral(uint256 honeyOut, string calldata denomIn) external view returns (uint256);
function previewRequiredCollateral(uint256 honeyOut, string calldata denomIn) external view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
honeyOut | uint256 | The amount of honey to mint. |
denomIn | string | The collateral to use. |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | collateral The amount of collateral required. |
previewExactOutCollateral β
Previews the amount of honey required to redeem a certain amount of target collateral.
function previewExactOutCollateral(Cosmos.Coin calldata collateralOut) external view returns (uint256);
function previewExactOutCollateral(Cosmos.Coin calldata collateralOut) external view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
collateralOut | Cosmos.Coin | The amount of collateral to receive. |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | honey The amount of honey required. |
getParams β
Gets the parameters of the honey module.
function getParams() external returns (Exchangeable[] memory);
function getParams() external returns (Exchangeable[] memory);
Returns
Name | Type | Description |
---|---|---|
<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.
function getTotalSupply() external view returns (uint256);
function getTotalSupply() external view returns (uint256);
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | honey The total supply of honey. |
getTotalCollateral β
Gets the total collateral locked in the honey module.
function getTotalCollateral() external view returns (Cosmos.Coin[] memory);
function getTotalCollateral() external view returns (Cosmos.Coin[] memory);
Returns
Name | Type | Description |
---|---|---|
<none> | Cosmos.Coin[] | collateral The total collateral locked in the honey module. |
getAMOCurrentLimit β
Gets the current limit of the specified AMO.
function getAMOCurrentLimit(string calldata amoType, address amoAddr) external view returns (uint256);
function getAMOCurrentLimit(string calldata amoType, address amoAddr) external view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
amoType | string | The type of AMO to get the limit of. |
amoAddr | address | The address of the AMO to get the limit of. |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | limit The current limit of the specified AMO. |
mint β
Mints new honey coins for the given account using the given collateral.
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
Name | Type | Description |
---|---|---|
to | address | The account to mint coins for. |
collateral | Cosmos.Coin | The collateral to use. |
Returns
Name | Type | Description |
---|---|---|
<none> | Cosmos.Coin | honey The amount of honey that was minted. |
redeem β
Redeems honey coins for the given account using the given collateral.
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
Name | Type | Description |
---|---|---|
from | address | The account to redeem coins for. |
amount | uint256 | The amount of honey to redeem. |
denomOut | string | The denom of collateral to redeem. |
requestHoney β
Request honey from the amo.
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
Name | Type | Description |
---|---|---|
to | address | The account to mint the honey to, needs to be the user that has the allowance. |
amount | uint256 | The amount of honey to mint. |
amoType | string |
updateParams β
The caller of this function must be the governance module account.
Updates the parameters of the honey module.
function updateParams(Exchangeable[] memory params) external returns (bool);
function updateParams(Exchangeable[] memory params) external returns (bool);
Parameters
Name | Type | Description |
---|---|---|
params | Exchangeable[] | The new parameters to update to. |
Events β
HoneyMinted β
Emitted when honey is minted
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
Name | Type | Description |
---|---|---|
from | address | The account that supplied collateral for the minted honey. |
to | address | The account that recevied the honey. |
collateral | Cosmos.Coin | The collateral used to mint the honey. |
mintAmount | uint256 | The amount of honey that was minted. |
totalHoneySupply | uint256 | The total supply of honey after the mint. |
HoneyRedeemed β
Emitted when honey is redeemed
event HoneyRedeemed(address from, uint256 redeemAmount, Cosmos.Coin redeemAmountOut, uint256 totalHoneySupply);
event HoneyRedeemed(address from, uint256 redeemAmount, Cosmos.Coin redeemAmountOut, uint256 totalHoneySupply);
Parameters
Name | Type | Description |
---|---|---|
from | address | The account that redeemed the honey. |
redeemAmount | uint256 | The amount that of honey that was redeemed. |
redeemAmountOut | Cosmos.Coin | The amount of collateral received for redeeming the honey. |
totalHoneySupply | uint256 | The total supply of honey after the mint. |
Structs β
Exchangeable β
The parameters of the honey module.
struct Exchangeable {
string denom;
bool enabled;
uint256 mintRate;
uint256 redemptionRate;
}
struct Exchangeable {
string denom;
bool enabled;
uint256 mintRate;
uint256 redemptionRate;
}
Properties
Name | Type | Description |
---|---|---|
denom | string | The denom of the collateral. |
enabled | bool | Whether the collateral is enabled. |
mintRate | uint256 | The mint rate of the collateral. |
redemptionRate | uint256 | The redemption rate of the collateral. |