ItemsFacet.sol
Documentation for ItemsFacet.sol

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

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

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

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

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

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

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

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

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

‌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

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

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

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

‌Transfer tokens from owner address to a token.

‌Transfer token from a token to an address.

‌Transfer a token from a token to another token

‌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.

‌Uses a Consumable Item, applies the bonuses to the Aavegotchi, then burns the Item.
Copy link
On this page
READ FUNCTIONS
function itemBalances(address) external
function balanceOf(address, uint256) external
function balanceOfToken(address, uint256, uint256) external
function itemBalancesOfToken(address, uint256) external
function balanceOfBatch(address[], uint256[]) external
function equippedWearables(uint256) external
function getWearableSets() external
function getWearableSet(uint256) external
function totalWearableSets() external
function getItemType(uint256) public
function getItemTypes(uint256[]) external
WRITE FUNCTIONS
function safeTransferFrom(address, address, uint256, uint256, bytes) external
function safeBatchTransferFrom(address, address, uint256[], uint256[], bytes) external
function transferToParent(address, address, uint256, uint256, uint256) external
function transferFromParent(address, uint256, address, uint256, uint256) external
function transferAsChild(address, uint256, address, uint256, uint256, uint256) external
function equipWearables(uint256, uint16[16] calldata _equippedWearables) external
function useConsumable(uint256, uint256) external