CollateralFacet

IncreaseStake

event IncreaseStake(uint256 _tokenId, uint256 _stakeAmount)

DecreaseStake

event DecreaseStake(uint256 _tokenId, uint256 _reduceAmount)

ExperienceTransfer

event ExperienceTransfer(uint256 _fromTokenId, uint256 _toTokenId, uint256 experience)

collaterals

function collaterals(uint256 _hauntId) external view returns (address[] collateralTypes_)

Query addresses about all collaterals available for a particular haunt

Parameters

NameTypeDescription

_hauntId

uint256

identifier of the haunt to query

Return Values

NameTypeDescription

collateralTypes_

address[]

An array containing the addresses of all collaterals available for haunt _hauntId

collateralInfo

function collateralInfo(uint256 _hauntId, uint256 _collateralId) external view returns (struct AavegotchiCollateralTypeIO collateralInfo_)

Query all details about a collateral in a haunt

Parameters

NameTypeDescription

_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

getCollateralInfo

function getCollateralInfo(uint256 _hauntId) external view returns (struct AavegotchiCollateralTypeIO[] collateralInfo_)

Query all details about all collaterals in a haunt

Parameters

NameTypeDescription

_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

getAllCollateralTypes

function getAllCollateralTypes() external view returns (address[])

Query the address of all collaterals that are available universally throughout all haunts

Return Values

NameTypeDescription

[0]

address[]

An array of addresses,each address representing a collateral's contract address

collateralBalance

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

Parameters

NameTypeDescription

_tokenId

uint256

the identifier of the NFT to query

Return Values

NameTypeDescription

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

increaseStake

function increaseStake(uint256 _tokenId, uint256 _stakeAmount) external

Allow the owner of a claimed aavegotchi to increase its collateral stake

Only valid for claimed aavegotchis

Parameters

NameTypeDescription

_tokenId

uint256

The identifier of the NFT to increase

_stakeAmount

uint256

The amount of collateral tokens to increase the current collateral by

decreaseStake

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

Parameters

NameTypeDescription

_tokenId

uint256

The identifier of the NFT to decrease

_reduceAmount

uint256

The amount of collateral tokens to decrease the current collateral by

decreaseAndDestroy

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

Parameters

NameTypeDescription

_tokenId

uint256

Identifier of NFT to destroy

_toId

uint256

Identifier of another claimed aavegotchi where the XP of the sacrificed aavegotchi will be sent

setCollateralEyeShapeSvgId

function setCollateralEyeShapeSvgId(address _collateralToken, uint8 _svgId) external

Set the SVG id for a supported/existing collateral

Parameters

NameTypeDescription

_collateralToken

address

The contract address for the collateral token

_svgId

uint8

The identifier for the onchain svg to be mapped to the collateral