Links

ItemsFacet.sol

Documentation for ItemsFacet.sol

READ FUNCTIONS

function itemBalances(address) external

‌Returns balance for each item that exists for an account
RETURNS tuple<bals_>[]
bals_
TYPE
itemId
uint256
balance
uint256

function balanceOf(address, uint256) external

‌Returns the balance of an account's tokens.
RETURNS uint256

function balanceOfToken(address, uint256, uint256) external

Get the balance of a non-fungible parent token.
RETURNS uint256

function itemBalancesOfToken(address, uint256) external

‌Returns the balances for all items for a token
RETURNS tuple<bals_>[]

function balanceOfBatch(address[], uint256[]) external

‌Get the balance of multiple account/token pairs
RETURNS uint256[]

function equippedWearables(uint256) external

‌Returns the Ids of all equipped Wearables.
RETURNS uint16[16]

function getWearableSets() external

Returns information about all of the Wearable Sets.
RETURNS tuple<wearableSet_>[]
wearableSet_
TYPES
name
string
allowedCollaterals
uint8[]
wearableIds
uint16[]
traitsBonuses
int8[5]

function getWearableSet(uint256) external

Returns information about the given Wearable Set.
RETURNS tuple<wearableSet_>[]

function totalWearableSets() external

‌Returns a count of the total Wearable Sets.
RETURNS uint256

function getItemType(uint256) public

‌Returns information about the given Item.
itemType_
TYPE
name
string
description
string
author
string
traitModifiers
int8[6]
slotPositions
bool[16]
allowedCollaterals
uint8[]
dimensions
x
y
width
height
tuple
uint8
uint8
uint8
uint8
ghstPrice
uint256
maxQuantity
uint256
totalQuantity
uint256
svgId
uint32
rarityScoreModifier
uint8
canPurchaseWithGhst
bool
minLevel
uint16
canBeTransferred
bool
category
uint8
kinshipBonus
int16
experienceBonus
uint32

function getItemTypes(uint256[]) external

‌Returns information about multiple Items.
RETURNS tuple<itemType_>[]

WRITE FUNCTIONS

function safeTransferFrom(address, address, uint256, uint256, bytes) external

‌Transfers _value amount of an _id from the _from address to the _to address specified (with safety call).

function safeBatchTransferFrom(address, address, uint256[], uint256[], bytes) external

‌Transfers _values amount(s) of _ids from the _from address to the _to address specified (with safety call).

function transferToParent(address, address, uint256, uint256, uint256) external

‌Transfer tokens from owner address to a token.

function transferFromParent(address, uint256, address, uint256, uint256) external

‌Transfer token from a token to an address.

function transferAsChild(address, uint256, address, uint256, uint256, uint256) external

‌Transfer a token from a token to another token

function equipWearables(uint256, uint16[16] calldata _equippedWearables) external

‌Equips the given Wearables to a given Aavegotchi.
Equipping rules:
  1. 1.
    If the new value for a slot is non-zero and is the same as the old value then it means don't unequip the item.
  2. 2.
    If the new value for a slot is non-zero and the old value is non-zero but not the same then it means unequip the wearable and equip the new wearable in the slot.
  3. 3.
    If the new value for a slot is non-zero and the old value is 0 it means equip the slot.
  4. 4.
    If the new value for a slot is 0 and the old value is non-zero it means unequp the slot.
  5. 5.
    If the new value for a slot is 0 and the old value is 0 then don't do anything with the slot.

function useConsumable(uint256, uint256) external

‌Uses a Consumable Item, applies the bonuses to the Aavegotchi, then burns the Item.