Skip to content

Honey

0xFCBD14DC51f0A4d49d5E53C2E0950e0bC26d0Dce | ABI JSON

Git Source

This is the ERC20 token representation of Berachain's native stablecoin, Honey. The contract is upgradeable and access-controlled, with minting and burning restricted to the HoneyFactory contract.

Inherits: ERC20, AccessControlUpgradeable, UUPSUpgradeable, IHoneyErrors

State Variables

factory

The factory contract address that has exclusive permission to mint and burn Honey.

solidity
address public factory;

View Functions

name

Returns the name of the token: "Honey"

solidity
function name() public pure override returns (string memory);

symbol

Returns the symbol of the token: "HONEY"

solidity
function symbol() public pure override returns (string memory);

Functions

initialize

Initializes the contract with governance and factory addresses. Can only be called once.

Access: Only during deployment Errors:

  • ZeroAddress: If either _governance or _factory is the zero address
solidity
function initialize(address _governance, address _factory) external initializer;

mint

Mints Honey tokens to a specified address.

Access: Only HoneyFactory Errors:

  • NotFactory: If called by any address other than the factory
solidity
function mint(address to, uint256 amount) external onlyFactory;

burn

Burns Honey tokens from a specified address.

Access: Only HoneyFactory Errors:

  • NotFactory: If called by any address other than the factory
solidity
function burn(address from, uint256 amount) external onlyFactory;

Events

Transfer

Emitted when tokens are transferred between accounts.

solidity
event Transfer(address indexed from, address indexed to, uint256 value);

Approval

Emitted when an account approves another account to spend tokens on their behalf.

solidity
event Approval(address indexed owner, address indexed spender, uint256 value);

Errors

ZeroAddress

solidity
error ZeroAddress();

Thrown when attempting to initialize with a zero address.

NotFactory

solidity
error NotFactory();

Thrown when a restricted function is called by an address other than the factory.

Other Errors

The contract inherits additional errors from IHoneyErrors that may be relevant in the broader system context.