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).
1
interface IFujiERC1155 {
2
//Asset Types
3
enum AssetType {
4
//uint8 = 0
5
collateralToken,
6
//uint8 = 1
7
debtToken
8
}
Copied!

General Getter Functions

1
//General Getter Functions
2
function getAssetID(AssetType _type, address _assetAddr) external view returns (uint256);
3
4
function qtyOfManagedAssets() external view returns (uint64);
5
6
function balanceOf(address _account, uint256 _id) external view returns (uint256);
7
Copied!
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

1
function mint(
2
address _account,
3
uint256 _id,
4
uint256 _amount,
5
bytes memory _data
6
) external;
7
8
function burn(
9
address _account,
10
uint256 _id,
11
uint256 _amount
12
) external;
13
14
function updateState(uint256 _assetID, uint256 _newBalance) external;
Copied!
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 1mo ago