ERC20 Honey Berachain
Note: Link to existing contract ABI's can be found on Github here.
State Variables
erc20Module
IERC20BankModule public immutable erc20Module = IERC20BankModule(0x0000000000000000000000000000000000696969);
IERC20BankModule public immutable erc20Module = IERC20BankModule(0x0000000000000000000000000000000000696969);
honeyModule
IHoneyModule public immutable honeyModule = IHoneyModule(0xa55e2E3846A51F6Ad0ABfdfbdEA2ba0E5e0c76B5);
IHoneyModule public immutable honeyModule = IHoneyModule(0xa55e2E3846A51F6Ad0ABfdfbdEA2ba0E5e0c76B5);
honey
IERC20 public immutable honey = IERC20(0x7EeCA4205fF31f947EdBd49195a7A88E6A91161B);
IERC20 public immutable honey = IERC20(0x7EeCA4205fF31f947EdBd49195a7A88E6A91161B);
Functions
previewMint
Get the amount of Honey that can be minted with the given ERC20.
function previewMint(IERC20 collateral, uint256 amount) external view returns (uint256);
function previewMint(IERC20 collateral, uint256 amount) external view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
collateral | IERC20 | The ERC20 to mint with. |
amount | uint256 | The amount of ERC20 to mint with. |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The amount of Honey that can be minted. |
previewRedeem
Get the amount of ERC20 that can be redeemed with the given Honey.
function previewRedeem(IERC20 collateral, uint256 amount) public view returns (uint256);
function previewRedeem(IERC20 collateral, uint256 amount) public view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
collateral | IERC20 | The ERC20 to redeem. |
amount | uint256 | The amount of Honey to redeem. |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The amount of ERC20 that can be redeemed. |
getExchangable
Get the parameters of the ERC20 exchangeable.
function getExchangable() external returns (ERC20Exchangable[] memory);
function getExchangable() external returns (ERC20Exchangable[] memory);
Returns
Name | Type | Description |
---|---|---|
<none> | ERC20Exchangable[] | The parameters of the ERC20 exchangeable. |
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 | The total supply of honey. |
getTotalCollateral
Gets the total collateral locked in the honey module.
function getTotalCollateral() external view returns (address[] memory, uint256[] memory);
function getTotalCollateral() external view returns (address[] memory, uint256[] memory);
Returns
Name | Type | Description |
---|---|---|
<none> | address[] | The total collateral locked in the honey module. |
<none> | uint256[] |
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 | The current limit of the specified AMO. |
previewRequiredCollateral
previews the amount of collateral required to mint a certain amount of honey.
function previewRequiredCollateral(uint256 honeyOut, address assetIn) external view returns (uint256);
function previewRequiredCollateral(uint256 honeyOut, address assetIn) external view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
honeyOut | uint256 | The amount of honey to mint. |
assetIn | address | The collateral to use. |
previewExactOutCollateral
Previews the amount of honey required to redeem a certain amount of target collateral.
function previewExactOutCollateral(uint256 amountOut, address assetOut) external view returns (uint256);
function previewExactOutCollateral(uint256 amountOut, address assetOut) external view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
amountOut | uint256 | is the amount of collateral to receive. |
assetOut | address | is the address of the collateral to receive. |
mint
Mint Honey by sending ERC20 to this contract.
function mint(address to, IERC20 collateral, uint256 amount) external returns (uint256);
function mint(address to, IERC20 collateral, uint256 amount) external returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
to | address | The address that will receive the Honey. |
collateral | IERC20 | The ERC20 to mint with. |
amount | uint256 | The amount of ERC20 to mint with. |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The amount of Honey minted. |
redeem
Redeem ERC20 by sending Honey to this contract.
function redeem(address to, uint256 amount, IERC20 collateral) external returns (uint256);
function redeem(address to, uint256 amount, IERC20 collateral) external returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
to | address | The address that will receive the ERC20. |
amount | uint256 | The amount of Honey to redeem. |
collateral | IERC20 | The ERC20 to redeem. |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The amount of ERC20 redeemed. |
updateParams
The caller of this function must be the governance module account.
Updates the parameters of the honey module.
function updateParams(ERC20Exchangable[] memory params) external returns (bool);
function updateParams(ERC20Exchangable[] memory params) external returns (bool);
Parameters
Name | Type | Description |
---|---|---|
params | ERC20Exchangable[] | The new parameters to update to. |
Structs
ERC20Exchangable
struct ERC20Exchangable {
IERC20 collateral;
bool enabled;
uint256 mintRate;
uint256 redemptionRate;
}
struct ERC20Exchangable {
IERC20 collateral;
bool enabled;
uint256 mintRate;
uint256 redemptionRate;
}