Skip to content

ERC20 Honey Berachain

Git Source

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

State Variables

erc20Module

solidity
IERC20BankModule public immutable erc20Module = IERC20BankModule(0x0000000000000000000000000000000000696969);
IERC20BankModule public immutable erc20Module = IERC20BankModule(0x0000000000000000000000000000000000696969);

honeyModule

solidity
IHoneyModule public immutable honeyModule = IHoneyModule(0xa55e2E3846A51F6Ad0ABfdfbdEA2ba0E5e0c76B5);
IHoneyModule public immutable honeyModule = IHoneyModule(0xa55e2E3846A51F6Ad0ABfdfbdEA2ba0E5e0c76B5);

honey

solidity
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.

solidity
function previewMint(IERC20 collateral, uint256 amount) external view returns (uint256);
function previewMint(IERC20 collateral, uint256 amount) external view returns (uint256);

Parameters

NameTypeDescription
collateralIERC20The ERC20 to mint with.
amountuint256The amount of ERC20 to mint with.

Returns

NameTypeDescription
<none>uint256The amount of Honey that can be minted.

previewRedeem

Get the amount of ERC20 that can be redeemed with the given Honey.

solidity
function previewRedeem(IERC20 collateral, uint256 amount) public view returns (uint256);
function previewRedeem(IERC20 collateral, uint256 amount) public view returns (uint256);

Parameters

NameTypeDescription
collateralIERC20The ERC20 to redeem.
amountuint256The amount of Honey to redeem.

Returns

NameTypeDescription
<none>uint256The amount of ERC20 that can be redeemed.

getExchangable

Get the parameters of the ERC20 exchangeable.

solidity
function getExchangable() external returns (ERC20Exchangable[] memory);
function getExchangable() external returns (ERC20Exchangable[] memory);

Returns

NameTypeDescription
<none>ERC20Exchangable[]The parameters of the ERC20 exchangeable.

getTotalSupply

Gets the total supply of honey.

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

Returns

NameTypeDescription
<none>uint256The total supply of honey.

getTotalCollateral

Gets the total collateral locked in the honey module.

solidity
function getTotalCollateral() external view returns (address[] memory, uint256[] memory);
function getTotalCollateral() external view returns (address[] memory, uint256[] memory);

Returns

NameTypeDescription
<none>address[]The total collateral locked in the honey module.
<none>uint256[]

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>uint256The current limit of the specified AMO.

previewRequiredCollateral

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

solidity
function previewRequiredCollateral(uint256 honeyOut, address assetIn) external view returns (uint256);
function previewRequiredCollateral(uint256 honeyOut, address assetIn) external view returns (uint256);

Parameters

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

previewExactOutCollateral

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

solidity
function previewExactOutCollateral(uint256 amountOut, address assetOut) external view returns (uint256);
function previewExactOutCollateral(uint256 amountOut, address assetOut) external view returns (uint256);

Parameters

NameTypeDescription
amountOutuint256is the amount of collateral to receive.
assetOutaddressis the address of the collateral to receive.

mint

Mint Honey by sending ERC20 to this contract.

solidity
function mint(address to, IERC20 collateral, uint256 amount) external returns (uint256);
function mint(address to, IERC20 collateral, uint256 amount) external returns (uint256);

Parameters

NameTypeDescription
toaddressThe address that will receive the Honey.
collateralIERC20The ERC20 to mint with.
amountuint256The amount of ERC20 to mint with.

Returns

NameTypeDescription
<none>uint256The amount of Honey minted.

redeem

Redeem ERC20 by sending Honey to this contract.

solidity
function redeem(address to, uint256 amount, IERC20 collateral) external returns (uint256);
function redeem(address to, uint256 amount, IERC20 collateral) external returns (uint256);

Parameters

NameTypeDescription
toaddressThe address that will receive the ERC20.
amountuint256The amount of Honey to redeem.
collateralIERC20The ERC20 to redeem.

Returns

NameTypeDescription
<none>uint256The amount of ERC20 redeemed.

updateParams

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

Updates the parameters of the honey module.

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

Parameters

NameTypeDescription
paramsERC20Exchangable[]The new parameters to update to.

Structs

ERC20Exchangable

solidity
struct ERC20Exchangable {
    IERC20 collateral;
    bool enabled;
    uint256 mintRate;
    uint256 redemptionRate;
}
struct ERC20Exchangable {
    IERC20 collateral;
    bool enabled;
    uint256 mintRate;
    uint256 redemptionRate;
}