English
Search
K
Links
Comment on page

Fuji1155

This contract tracks all the tokens stored on the Fuji Vaults, simplifying the task of switching protocols for the Flasher. Also helps the Fuji Liquidator in case a user's position is not healthy.
ERC-1155 takes a new approach to defining tokens. Items are now stored in a single contract with the minimum possible amount of data needed to distinguish the token from other ones.

Interface

Fuji1155 is the contract where all tokens are stored - both collateral (ETH) and debt tokens (DAI/USDC).
interface IFujiERC1155 {
//Asset Types
enum AssetType {
//uint8 = 0
collateralToken,
//uint8 = 1
debtToken
}

General Getter Functions

//General Getter Functions
function getAssetID(AssetType _type, address _assetAddr) external view returns (uint256);
function qtyOfManagedAssets() external view returns (uint64);
function balanceOf(address _account, uint256 _id) external view returns (uint256);
getAssetID: identifies the asset's type and address which can be called externally.
qtyOfManagedAssets: this function gives the overview of all the assets in Fuji Vaults.
balanceOf: generic function to receive an address' balance.

Permit Controlled Functions

function mint(
address _account,
uint256 _id,
uint256 _amount,
bytes memory _data
) external;
function burn(
address _account,
uint256 _id,
uint256 _amount
) external;
function updateState(uint256 _assetID, uint256 _newBalance) external;
mint: this function mints a new Fuji token when a user deposits collateral into the protocol.
burn: when a Fuji token is redeemd and collateral withdrawn, the burn function burns the Fuji token and thus the debt from the protocol.
updateState: function to update the Fuji1155 account.
Last modified 1yr ago