DAOFacet
event DaoTransferred(address previousDao, address newDao)
event DaoTreasuryTransferred(address previousDaoTreasury, address newDaoTreasury)
event ForgeTransferred(address previousForge, address newForge)
event UpdateCollateralModifiers(int16[6] _oldModifiers, int16[6] _newModifiers)
event AddCollateralType(struct AavegotchiCollateralTypeIO _collateralType)
event AddItemType(struct ItemType _itemType)
event UpdateItemType(uint256 _itemId, struct ItemType _itemType)
event CreateHaunt(uint256 _hauntId, uint256 _hauntMaxSize, uint256 _portalPrice, bytes32 _bodyColor)
event GrantExperience(uint256[] _tokenIds, uint256[] _xpValues)
event AddWearableSet(struct WearableSet _wearableSet)
event UpdateWearableSet(uint256 _setId, struct WearableSet _wearableSet)
event ItemTypeMaxQuantity(uint256[] _itemIds, uint256[] _maxQuanities)
event GameManagerAdded(address gameManager_, uint256 limit_, uint256 refreshTime_)
event GameManagerRemoved(address gameManager_)
event ItemManagerAdded(address newItemManager_)
event ItemManagerRemoved(address itemManager_)
event WearableSlotPositionsSet(uint256 _wearableId, bool[16] _slotPositions)
event ItemModifiersSet(uint256 _wearableId, int8[6] _traitModifiers, uint8 _rarityScoreModifier)
event RemoveExperience(uint256[] _tokenIds, uint256[] _xpValues)
event UpdateItemPrice(uint256 _itemId, uint256 _priceInWei)
function isGameManager(address _manager) external view returns (bool)
Query if an address is a game manager
Name | Type | Description |
---|---|---|
_manager | address | Address to query |
Name | Type | Description |
---|---|---|
[0] | bool | True if _manager is a game manager,False otherwise |
function gameManagerBalance(address _manager) external view returns (uint256)
Query the balance of a game manager
Name | Type | Description |
---|---|---|
_manager | address | Address to query |
Name | Type | Description |
---|---|---|
[0] | uint256 | Balance of game manager _manager |
function gameManagerRefreshTime(address _manager) external view returns (uint256)
Query the refresh time of a game manager
Name | Type | Description |
---|---|---|
_manager | address | Address to query |
Name | Type | Description |
---|---|---|
[0] | uint256 | Refresh time of game manager _manager |
function setDao(address _newDao, address _newDaoTreasury) external
Allow the Diamond owner or DAO to set a new Dao address and Treasury address
Name | Type | Description |
---|---|---|
_newDao | address | New DAO address |
_newDaoTreasury | address | New treasury address |
function setForge(address _newForge) external
Allow the Diamond owner or DAO to set a new Forge address
Name | Type | Description |
---|---|---|
_newForge | address | New DAO address |
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
Name | Type | Description |
---|---|---|
_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 |
function addItemManagers(address[] _newItemManagers) external
Allow the Diamond owner or DAO to add item managers
Name | Type | Description |
---|---|---|
_newItemManagers | address[] | An array containing the addresses that need to be added as item managers |
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 managerName | Type | Description |
---|---|---|
_itemManagers | address[] | An array containing the addresses that need to be removed from existing item managers |
function updateCollateralModifiers(address _collateralType, int16[6] _modifiers) external
Allow the Diamond owner or DAO to update the collateral modifiers of an existing collateral
Name | Type | Description |
---|---|---|
_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 |
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
Name | Type | Description |
---|---|---|
_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 |
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
Name | Type | Description |
---|---|---|
_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 |
struct CreateHauntPayload {
uint24 _hauntMaxSize;
uint96 _portalPrice;
bytes3 _bodyColor;
struct AavegotchiCollateralTypeIO[] _collateralTypes;
string _collateralSvg;
struct LibSvg.SvgTypeAndSizes[] _collateralTypesAndSizes;
string _eyeShapeSvg;
struct LibSvg.SvgTypeAndSizes[] _eyeShapeTypesAndSizes;
}
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
Name | Type | Description |
---|---|---|
_payload | struct DAOFacet.CreateHauntPayload | A struct containing all details needed to be uploaded for a new Haunt |
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
Name | Type | Description |
---|---|---|
_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 |
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
Name | Type | Description |
---|---|---|
_tokenIds | uint256[] | The identifiers of the aavegotchis to grant XP to |
_xpValues | uint256[] | The amount XP to grant each aavegotchi |
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
Name | Type | Description |
---|---|---|
_tokenIds | uint256[] | The identifiers of the aavegotchis to grant XP to |
_xpValues | uint256[] | The amount XP to grant each aavegotchi |
function addItemTypes(struct ItemType[] _itemTypes) external
Allow an item manager to add item types
Name | Type | Description |
---|---|---|
_itemTypes | struct ItemType[] | An array of structs where each struct contains details about each item to be added |
function addItemTypesAndSvgs(struct ItemType[] _itemTypes, string _svg, struct LibSvg.SvgTypeAndSizes[] _typesAndSizes) external
Allow an item manager to add item types and their svgs
Name | Type | Description |
---|---|---|
_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 |
function updateItemTypes(uint256[] _indices, struct ItemType[] _itemTypes) external
Allow an item manager to update item types
Name | Type | Description |
---|---|---|
_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 |
function addWearableSets(struct WearableSet[] _wearableSets) external
Allow an item manager to add a wearable set
Name | Type | Description |
---|---|---|
_wearableSets | struct WearableSet[] | An array of structs, each struct containing the details about each wearableset to be added |
function updateWearableSets(uint256[] _setIds, struct WearableSet[] _wearableSets) external
Allow an item manager to update existing wearablesets
Name | Type | Description |
---|---|---|
_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 |
function addGameManagers(address[] _newGameManagers, uint256[] _limits) external
Allow the DAO or the aavegotchi diamond owner to add new game managers and their corresponding limits
Name | Type | Description |
---|---|---|
_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 |
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
Name | Type | Description |
---|---|---|
_gameManagers | address[] | An array containing the addresses to be removed from existing game managers |
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
Name | Type | Description |
---|---|---|
_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 |
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
Name | Type | Description |
---|---|---|
_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 |
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
Name | Type | Description |
---|---|---|
_itemIds | uint256[] | The items whose price is to be changed |
_newPrices | uint256[] | The new prices of the items |