Links

TileFacet

AddedToQueue

event AddedToQueue(uint256 _queueId, uint256 _tileId, uint256 _readyBlock, address _sender)

QueueClaimed

event QueueClaimed(uint256 _queueId)

CraftTimeReduced

event CraftTimeReduced(uint256 _queueId, uint256 _blocksReduced)

AddressesUpdated

event AddressesUpdated(address _aavegotchiDiamond, address _realmDiamond, address _gltr)

EditTileType

event EditTileType(uint256 _tileId, struct TileType)

EditDeprecateTime

event EditDeprecateTime(uint256 _tileId, uint256 _newDeprecatetime)

TileIdIO

struct TileIdIO {
uint256 tileId;
uint256 balance;
}

tilesBalances

function tilesBalances(address _account) external view returns (struct TileFacet.TileIdIO[] bals_)
Returns balance for each tile that exists for an account

Parameters

Name
Type
Description
_account
address
Address of the account to query

Return Values

Name
Type
Description
bals_
struct TileFacet.TileIdIO[]
An array of structs,each struct containing details about each tile owned

tilesBalancesWithTypes

function tilesBalancesWithTypes(address _owner) external view returns (struct ItemTypeIO[] output_)
Returns balance for each tile(and their types) that exists for an account

Parameters

Name
Type
Description
_owner
address
Address of the account to query

Return Values

Name
Type
Description
output_
struct ItemTypeIO[]
An array of structs containing details about each tile owned(including the tile types)

balanceOfToken

function balanceOfToken(address _tokenContract, uint256 _tokenId, uint256 _id) public view returns (uint256 value)
Get the balance of a non-fungible parent token

Parameters

Name
Type
Description
_tokenContract
address
The contract tracking the parent token
_tokenId
uint256
The ID of the parent token
_id
uint256
ID of the token

Return Values

Name
Type
Description
value
uint256
The balance of the token

tileBalancesOfToken

function tileBalancesOfToken(address _tokenContract, uint256 _tokenId) public view returns (struct TileFacet.TileIdIO[] bals_)
Returns the balances for all ERC1155 items for a ERC721 token

Parameters

Name
Type
Description
_tokenContract
address
Contract address for the token to query
_tokenId
uint256
Identifier of the token to query

Return Values

Name
Type
Description
bals_
struct TileFacet.TileIdIO[]
An array of structs containing details about each item owned

tileBalancesOfTokenWithTypes

function tileBalancesOfTokenWithTypes(address _tokenContract, uint256 _tokenId) external view returns (struct ItemTypeIO[] tileBalancesOfTokenWithTypes_)
Returns the balances for all ERC1155 items for a ERC721 token

Parameters

Name
Type
Description
_tokenContract
address
Contract address for the token to query
_tokenId
uint256
Identifier of the token to query

Return Values

Name
Type
Description
tileBalancesOfTokenWithTypes_
struct ItemTypeIO[]
An array of structs containing details about each tile owned(including tile types)

tileBalancesOfTokenByIds

function tileBalancesOfTokenByIds(address _tokenContract, uint256 _tokenId, uint256[] _ids) external view returns (uint256[])
Query the tile balances of an ERC721 parent token

Parameters

Name
Type
Description
_tokenContract
address
The token contract of the ERC721 parent token
_tokenId
uint256
The identifier of the ERC721 parent token
_ids
uint256[]
An array containing the ids of the tileTypes to query

Return Values

Name
Type
Description
[0]
uint256[]
An array containing the corresponding balances of the tile types queried

getTileType

function getTileType(uint256 _tileTypeId) external view returns (struct TileType tileType)
Query the item type of a particular tile

Parameters

Name
Type
Description
_tileTypeId
uint256
Item to query

Return Values

Name
Type
Description
tileType
struct TileType
A struct containing details about the item type of an item with identifier _itemId

getTileTypes

function getTileTypes(uint256[] _tileTypeIds) external view returns (struct TileType[] tileTypes_)
Query the item type of multiple tile types

Parameters

Name
Type
Description
_tileTypeIds
uint256[]
An array containing the identifiers of items to query

Return Values

Name
Type
Description
tileTypes_
struct TileType[]
An array of structs,each struct containing details about the item type of the corresponding item

craftTiles

function craftTiles(uint16[] _tileTypes) external
Allow a user to craft tiles one at a time
Puts the tile into a queue

Parameters

Name
Type
Description
_tileTypes
uint16[]
An array containing the identifiers of the tileTypes to craft

BatchCraftTilesInput

struct BatchCraftTilesInput {
uint16 tileID;
uint16 amount;
uint40 gltr;
}

batchCraftTiles

function batchCraftTiles(struct TileFacet.BatchCraftTilesInput[] _inputs) external
Allow a user to craft tiles by batch

claimTiles

function claimTiles(uint256[] _queueIds) external
Allow a user to claim tiles from ready queues
Will throw if the caller is not the queue owner Will throw if one of the queues is not ready

Parameters

Name
Type
Description
_queueIds
uint256[]
An array containing the identifiers of queues to claim

reduceCraftTime

function reduceCraftTime(uint256[] _queueIds, uint40[] _amounts) external
Allow a user to speed up multiple queues(tile craft time) by paying the correct amount of $GLTR tokens
Will throw if the caller is not the queue owner $GLTR tokens are burnt upon usage amount expressed in block numbers

Parameters

Name
Type
Description
_queueIds
uint256[]
An array containing the identifiers of queues to speed up
_amounts
uint40[]
An array containing the corresponding amounts of $GLTR tokens to pay for each queue speedup

equipTile

function equipTile(address _owner, uint256 _realmId, uint256 _tileId) external
Allow a user to equip a tile to a parcel
Will throw if the caller is not the parcel diamond contract Will also throw if various prerequisites for the tile are not met

Parameters

Name
Type
Description
_owner
address
Owner of the tile to equip
_realmId
uint256
The identifier of the parcel to equip the tile to
_tileId
uint256
Identifier of the tile to equip

unequipTile

function unequipTile(address _owner, uint256 _realmId, uint256 _tileId) external
Allow a user to unequip a tile from a parcel
Will throw if the caller is not the parcel diamond contract

Parameters

Name
Type
Description
_owner
address
_realmId
uint256
The identifier of the parcel to unequip the tile from
_tileId
uint256
Identifier of the tile to unequip

getCraftQueue

function getCraftQueue(address _owner) external view returns (struct QueueItem[] output_)
Query details about all ongoing craft queues

Parameters

Name
Type
Description
_owner
address
Address to query queue

Return Values

Name
Type
Description
output_
struct QueueItem[]
An array of structs, each representing an ongoing craft queue

deprecateTiles

function deprecateTiles(uint256[] _tileIds) external
Allow the Diamond owner to deprecate a tile
Deprecated tiles cannot be crafted by users

Parameters

Name
Type
Description
_tileIds
uint256[]
An array containing the identifiers of tiles to deprecate

setAddresses

function setAddresses(address _aavegotchiDiamond, address _realmDiamond, address _gltr, address _pixelcraft, address _aavegotchiDAO) external
Allow the diamond owner to set some important contract addresses

Parameters

Name
Type
Description
_aavegotchiDiamond
address
The aavegotchi diamond address
_realmDiamond
address
The Realm diamond address
_gltr
address
The $GLTR token address
_pixelcraft
address
_aavegotchiDAO
address

addTileTypes

function addTileTypes(struct TileTypeIO[] _tileTypes) external
Allow the diamond owner to add a tile type

Parameters

Name
Type
Description
_tileTypes
struct TileTypeIO[]
An array of structs, each struct representing each tileType to be added

LengthMisMatch

error LengthMisMatch()

editDeprecateTime

function editDeprecateTime(uint256[] _typeIds, uint40[] _deprecateTimes) external

editTileTypes

function editTileTypes(uint256[] _typeIds, struct TileType[] _updatedTiles) external