DAOFacet

DaoTransferred

event DaoTransferred(address previousDao, address newDao)

DaoTreasuryTransferred

event DaoTreasuryTransferred(address previousDaoTreasury, address newDaoTreasury)

ForgeTransferred

event ForgeTransferred(address previousForge, address newForge)

UpdateCollateralModifiers

event UpdateCollateralModifiers(int16[6] _oldModifiers, int16[6] _newModifiers)

AddCollateralType

event AddCollateralType(struct AavegotchiCollateralTypeIO _collateralType)

AddItemType

event AddItemType(struct ItemType _itemType)

UpdateItemType

event UpdateItemType(uint256 _itemId, struct ItemType _itemType)

CreateHaunt

event CreateHaunt(uint256 _hauntId, uint256 _hauntMaxSize, uint256 _portalPrice, bytes32 _bodyColor)

GrantExperience

event GrantExperience(uint256[] _tokenIds, uint256[] _xpValues)

AddWearableSet

event AddWearableSet(struct WearableSet _wearableSet)

UpdateWearableSet

event UpdateWearableSet(uint256 _setId, struct WearableSet _wearableSet)

ItemTypeMaxQuantity

event ItemTypeMaxQuantity(uint256[] _itemIds, uint256[] _maxQuanities)

GameManagerAdded

event GameManagerAdded(address gameManager_, uint256 limit_, uint256 refreshTime_)

GameManagerRemoved

event GameManagerRemoved(address gameManager_)

ItemManagerAdded

event ItemManagerAdded(address newItemManager_)

ItemManagerRemoved

event ItemManagerRemoved(address itemManager_)

WearableSlotPositionsSet

event WearableSlotPositionsSet(uint256 _wearableId, bool[16] _slotPositions)

ItemModifiersSet

event ItemModifiersSet(uint256 _wearableId, int8[6] _traitModifiers, uint8 _rarityScoreModifier)

RemoveExperience

event RemoveExperience(uint256[] _tokenIds, uint256[] _xpValues)

UpdateItemPrice

event UpdateItemPrice(uint256 _itemId, uint256 _priceInWei)

isGameManager

function isGameManager(address _manager) external view returns (bool)

Query if an address is a game manager

Parameters

NameTypeDescription

_manager

address

Address to query

Return Values

NameTypeDescription

[0]

bool

True if _manager is a game manager,False otherwise

gameManagerBalance

function gameManagerBalance(address _manager) external view returns (uint256)

Query the balance of a game manager

Parameters

NameTypeDescription

_manager

address

Address to query

Return Values

NameTypeDescription

[0]

uint256

Balance of game manager _manager

gameManagerRefreshTime

function gameManagerRefreshTime(address _manager) external view returns (uint256)

Query the refresh time of a game manager

Parameters

NameTypeDescription

_manager

address

Address to query

Return Values

NameTypeDescription

[0]

uint256

Refresh time of game manager _manager

setDao

function setDao(address _newDao, address _newDaoTreasury) external

Allow the Diamond owner or DAO to set a new Dao address and Treasury address

Parameters

NameTypeDescription

_newDao

address

New DAO address

_newDaoTreasury

address

New treasury address

setForge

function setForge(address _newForge) external

Allow the Diamond owner or DAO to set a new Forge address

Parameters

NameTypeDescription

_newForge

address

New DAO address

addCollateralTypes

function addCollateralTypes(uint256 _hauntId, struct AavegotchiCollateralTypeIO[] _collateralTypes) public

Allow an item manager to add new collateral types to a haunt

If a certain collateral exists already, it will be overwritten

Parameters

NameTypeDescription

_hauntId

uint256

Identifier for haunt to add the collaterals to

_collateralTypes

struct AavegotchiCollateralTypeIO[]

An array of structs where each struct contains details about a particular collateral

addItemManagers

function addItemManagers(address[] _newItemManagers) external

Allow the Diamond owner or DAO to add item managers

Parameters

NameTypeDescription

_newItemManagers

address[]

An array containing the addresses that need to be added as item managers

removeItemManagers

function removeItemManagers(address[] _itemManagers) external

Allow the Diamond owner or DAO to remove item managers

Will throw if one of the addresses in _itemManagers is not an item manager

Parameters

NameTypeDescription

_itemManagers

address[]

An array containing the addresses that need to be removed from existing item managers

updateCollateralModifiers

function updateCollateralModifiers(address _collateralType, int16[6] _modifiers) external

Allow the Diamond owner or DAO to update the collateral modifiers of an existing collateral

Parameters

NameTypeDescription

_collateralType

address

The address of the existing collateral to update

_modifiers

int16[6]

An array containing the new numeric traits modifiers which will be applied to collateral _collateralType

updateItemTypeMaxQuantity

function updateItemTypeMaxQuantity(uint256[] _itemIds, uint256[] _maxQuantities) external

Allow an item manager to increase the max quantity of an item

Will throw if the new maxquantity is less than the existing quantity

Parameters

NameTypeDescription

_itemIds

uint256[]

An array containing the identifiers of items whose quantites are to be increased

_maxQuantities

uint256[]

An array containing the new max quantity of each item

createHaunt

function createHaunt(uint24 _hauntMaxSize, uint96 _portalPrice, bytes3 _bodyColor) external returns (uint256 hauntId_)

Allow the Diamond owner or DAO to create a new Haunt

Will throw if the previous haunt is not full yet

Parameters

NameTypeDescription

_hauntMaxSize

uint24

The maximum number of portals in the new haunt

_portalPrice

uint96

The base price of portals in the new haunt(in $GHST)

_bodyColor

bytes3

The universal body color applied to NFTs in the new haunt

CreateHauntPayload

struct CreateHauntPayload {
  uint24 _hauntMaxSize;
  uint96 _portalPrice;
  bytes3 _bodyColor;
  struct AavegotchiCollateralTypeIO[] _collateralTypes;
  string _collateralSvg;
  struct LibSvg.SvgTypeAndSizes[] _collateralTypesAndSizes;
  string _eyeShapeSvg;
  struct LibSvg.SvgTypeAndSizes[] _eyeShapeTypesAndSizes;
}

createHauntWithPayload

function createHauntWithPayload(struct DAOFacet.CreateHauntPayload _payload) external returns (uint256 hauntId_)

allow an item manager to create a new Haunt, also uploagding the collateral types,collateral svgs,eyeshape types and eyeshape svgs all in one transaction

Parameters

NameTypeDescription

_payload

struct DAOFacet.CreateHauntPayload

A struct containing all details needed to be uploaded for a new Haunt

mintItems

function mintItems(address _to, uint256[] _itemIds, uint256[] _quantities) external

Allow an item manager to mint new ERC1155 items

Will throw if a particular item current supply has reached its maximum supply

Parameters

NameTypeDescription

_to

address

The address to mint the items to

_itemIds

uint256[]

An array containing the identifiers of the items to mint

_quantities

uint256[]

An array containing the number of items to mint

grantExperience

function grantExperience(uint256[] _tokenIds, uint256[] _xpValues) external

Allow the DAO, a game manager or the aavegotchi diamond owner to grant XP(experience points) to multiple aavegotchis

recipients must be claimed aavegotchis

Parameters

NameTypeDescription

_tokenIds

uint256[]

The identifiers of the aavegotchis to grant XP to

_xpValues

uint256[]

The amount XP to grant each aavegotchi

removeExperience

function removeExperience(uint256[] _tokenIds, uint256[] _xpValues) external

Allow the DAO, a game manager or the aavegotchi diamond owner to remove XP(experience points) from multiple aavegotchis

recipients must be claimed aavegotchis

Parameters

NameTypeDescription

_tokenIds

uint256[]

The identifiers of the aavegotchis to grant XP to

_xpValues

uint256[]

The amount XP to grant each aavegotchi

addItemTypes

function addItemTypes(struct ItemType[] _itemTypes) external

Allow an item manager to add item types

Parameters

NameTypeDescription

_itemTypes

struct ItemType[]

An array of structs where each struct contains details about each item to be added

addItemTypesAndSvgs

function addItemTypesAndSvgs(struct ItemType[] _itemTypes, string _svg, struct LibSvg.SvgTypeAndSizes[] _typesAndSizes) external

Allow an item manager to add item types and their svgs

Parameters

NameTypeDescription

_itemTypes

struct ItemType[]

An array of structs where each struct contains details about each item to be added

_svg

string

The svg to be added

_typesAndSizes

struct LibSvg.SvgTypeAndSizes[]

An array of structs, each struct containing details about the item types and sizes

updateItemTypes

function updateItemTypes(uint256[] _indices, struct ItemType[] _itemTypes) external

Allow an item manager to update item types

Parameters

NameTypeDescription

_indices

uint256[]

An array of item id to be updated

_itemTypes

struct ItemType[]

An array of structs where each struct contains details about each item to be updated

addWearableSets

function addWearableSets(struct WearableSet[] _wearableSets) external

Allow an item manager to add a wearable set

Parameters

NameTypeDescription

_wearableSets

struct WearableSet[]

An array of structs, each struct containing the details about each wearableset to be added

updateWearableSets

function updateWearableSets(uint256[] _setIds, struct WearableSet[] _wearableSets) external

Allow an item manager to update existing wearablesets

Parameters

NameTypeDescription

_setIds

uint256[]

An array containing the identifiers of the wearablesets to be updated

_wearableSets

struct WearableSet[]

An array oof structs,each struct representing the updated wearableset details

addGameManagers

function addGameManagers(address[] _newGameManagers, uint256[] _limits) external

Allow the DAO or the aavegotchi diamond owner to add new game managers and their corresponding limits

Parameters

NameTypeDescription

_newGameManagers

address[]

An array containing the addresses to be added as game managers

_limits

uint256[]

An array containing the corresponding limits applied to ech address in _newGameManagers

removeGameManagers

function removeGameManagers(address[] _gameManagers) external

Allow the DAO or the aavegotchi diamond owner to remove existing game managers

It also resets the limit of each removed game manager to 0

Parameters

NameTypeDescription

_gameManagers

address[]

An array containing the addresses to be removed from existing game managers

setWearableSlotPositions

function setWearableSlotPositions(uint256 _wearableId, bool[16] _slotPositions) external

Allow the DAO or the aavegotchi diamond owner to set the wearable slot position for a particular wearable

Parameters

NameTypeDescription

_wearableId

uint256

The identifier of the wearable to change its slot position

_slotPositions

bool[16]

An array of booleans pointing out where _wearableId is now assigned to. True if assigned to a slot, False if otherwise

setItemTraitModifiersAndRarityModifier

function setItemTraitModifiersAndRarityModifier(uint256 _wearableId, int8[6] _traitModifiers, uint8 _rarityScoreModifier) external

Allow an item manager to set the trait and rarity modifiers of an item/wearable

Only valid for existing wearables

Parameters

NameTypeDescription

_wearableId

uint256

The identifier of the wearable to set

_traitModifiers

int8[6]

An array containing the new trait modifiers to be applied to a wearable with identifier _wearableId

_rarityScoreModifier

uint8

The new rarityScore modifier of a wearable with identifier _wearableId

batchUpdateItemsPrice

function batchUpdateItemsPrice(uint256[] _itemIds, uint256[] _newPrices) public

Allow an item manager to set the price of multiple items in GHST

Only valid for existing items that can be purchased with GHST

Parameters

NameTypeDescription

_itemIds

uint256[]

The items whose price is to be changed

_newPrices

uint256[]

The new prices of the items