Skip to content

GenericUnit

Git Source

Inherits: IGenericShare, ERC20Mintable

A mintable ERC20 token that represents stable unit within the Generic Protocol.

This contract extends ERC20Mintable to provide a mintable ERC20 token that adheres to the IERC7575Share interface. It includes functionality to query associated vaults for specific assets. The controller address receives mint/burn privileges upon deployment.

Functions

constructor

Initializes the GenericUnit token with metadata and sets the owner.

The owner address gets mint/burn privileges.

constructor(
    address controller,
    string memory name,
    string memory symbol
)
    ERC20Mintable(controller, name, symbol);
Parameters
NameTypeDescription
controlleraddressAddress to be set as the owner
namestringERC20 token name
symbolstringERC20 token symbol

vault

Returns the address of the Vault for the given asset.

Vault changes do not emit VaultChange event as this is handled by the Controller.

function vault(address asset) external view returns (address);
Parameters
NameTypeDescription
assetaddressThe address of the asset.
Returns
NameTypeDescription
<none>addressThe address of the associated Vault.

supportsInterface

Checks if the contract supports a specific interface.

Returns true for IERC165, IERC20, and IERC7575Share interfaces.

function supportsInterface(bytes4 interfaceId) external pure returns (bool);
Parameters
NameTypeDescription
interfaceIdbytes4The interface identifier to check
Returns
NameTypeDescription
<none>boolTrue if the interface is supported, false otherwise