CollateralFacet
event IncreaseStake(uint256 _tokenId, uint256 _stakeAmount)
event DecreaseStake(uint256 _tokenId, uint256 _reduceAmount)
event ExperienceTransfer(uint256 _fromTokenId, uint256 _toTokenId, uint256 experience)
function collaterals(uint256 _hauntId) external view returns (address[] collateralTypes_)
Query addresses about all collaterals available for a particular haunt
Name | Type | Description |
---|---|---|
_hauntId | uint256 | identifier of the haunt to query |
Name | Type | Description |
---|---|---|
collateralTypes_ | address[] | An array containing the addresses of all collaterals available for haunt _hauntId |
function collateralInfo(uint256 _hauntId, uint256 _collateralId) external view returns (struct AavegotchiCollateralTypeIO collateralInfo_)
Query all details about a collateral in a haunt
Name | Type | Description |
---|---|---|
_hauntId | uint256 | The identifier of the haunt to query |
_collateralId | uint256 | the identifier of the collateral to query return collateralInfo_ A struct containing extensive details about a collateral of identifier _collateralId in haunt _hauntId |
function getCollateralInfo(uint256 _hauntId) external view returns (struct AavegotchiCollateralTypeIO[] collateralInfo_)
Query all details about all collaterals in a haunt
Name | Type | Description |
---|---|---|
_hauntId | uint256 | The identifier of the haunt to query return collateralInfo_ An array of structs where each struct contains extensive details about each collateral that is available in haunt _hauntId |
function getAllCollateralTypes() external view returns (address[])
Query the address of all collaterals that are available universally throughout all haunts
Name | Type | Description |
---|---|---|
[0] | address[] | An array of addresses,each address representing a collateral's contract address |
function collateralBalance(uint256 _tokenId) external view returns (address collateralType_, address escrow_, uint256 balance_)
Query the collateral address,balance and escrow contract of an NFT
Only valid for claimed aavegotchis
Name | Type | Description |
---|---|---|
_tokenId | uint256 | the identifier of the NFT to query |
Name | Type | Description |
---|---|---|
collateralType_ | address | The contract address of the collateral |
escrow_ | address | The contract address of the NFT's escrow contract |
balance_ | uint256 | The collateral balance of the NFT |
function increaseStake(uint256 _tokenId, uint256 _stakeAmount) external
Allow the owner of a claimed aavegotchi to increase its collateral stake
Only valid for claimed aavegotchis
Name | Type | Description |
---|---|---|
_tokenId | uint256 | The identifier of the NFT to increase |
_stakeAmount | uint256 | The amount of collateral tokens to increase the current collateral by |
function decreaseStake(uint256 _tokenId, uint256 _reduceAmount) external
Allow the owner of a claimed aavegotchi to decrease its collateral stake
Only valid for claimed aavegotchis Will throw if it is reduced less than the minimum stake
Name | Type | Description |
---|---|---|
_tokenId | uint256 | The identifier of the NFT to decrease |
_reduceAmount | uint256 | The amount of collateral tokens to decrease the current collateral by |
function decreaseAndDestroy(uint256 _tokenId, uint256 _toId) external
Allow the owner of an aavegotchi to destroy his aavegotchi and transfer the XP points to another aavegotchi
Only valid for claimed aavegotchisi Name assigned to destroyed aavegotchi is freed up for use by another aavegotch
Name | Type | Description |
---|---|---|
_tokenId | uint256 | Identifier of NFT to destroy |
_toId | uint256 | Identifier of another claimed aavegotchi where the XP of the sacrificed aavegotchi will be sent |
function setCollateralEyeShapeSvgId(address _collateralToken, uint8 _svgId) external
Set the SVG id for a supported/existing collateral
Name | Type | Description |
---|---|---|
_collateralToken | address | The contract address for the collateral token |
_svgId | uint8 | The identifier for the onchain svg to be mapped to the collateral |