AavegotchiFacet.sol
Documentation for AavegotchiFacet.sol

READ FUNCTIONS

function aavegotchiNameAvailable(string) external

Checks if a given name has been taken.
RETURNS bool

function currentHaunt() public

‌Returns the current hauntId and haunt information
RETURNS hauntId_ : uint256 haunt_: tuple
haunt_
TYPE
bodyColor
bytes3
hauntMaxSize
uint256
portalPrice
uint256
totalCount
uint24

function revenueShares()

‌Returns the addresses used for GHST revenue sharing.
RETURNS
name
TYPE
burnAddress
address
daoAddress
address
pixelCraft
address
rarityFarming
address

function toNumericTraits(uint256) internal

‌Converts the Chainlink VRF generated randomNumber into the int256 used for numericTraits.

function singlePortalAavegotchiTraits(uint256, uint256) internal

‌Returns trait information about a single, unclaimed Aavegotchi.

function portalAavegotchiTraits(uint256) public

‌Returns an array of traits for all 10 Aavegotchis in a Portal.
RETURNS tuple<portalAavegotchiTraits_>[10]
portalAavegotchiTraits_
TYPE
collateralType
address
minimumStake
uint256
numericTraits
int16[6]
randomNumber
uint256

function ghstAddress() external

‌Returns the GHST contract address for the current network.
RETURNS address

function balanceOf(address) external

‌Returns the number of NFTs assigned to the owner.
RETURNS uint256

function getAavegotchi(uint256) public

‌Returns information about a single claimed Aavegotchi.
RETURNS
aavegotchiInfo_
TYPE
tokenId
uint256
name
string
owner
address
randomNumber
uint256
status
uint256
numericTraits
int16[6]
modifiedNumericTraits
int16[6]
equippedWearables
uint16[6]
collateral
address
escrow
address
stakedAmount
uint256
minimumStake
uint256
kinship
uint256
lastInteracted
uint256
experience
uint256
toNextLevel
uint256
usedSkillPoints
uint256
level
uint256
hauntId
uint256
baseRarityScore
uint256
modifiedRarityScore
uint256
locked
bool
items
balance
itemId
itemType
tuple
uint256
uint256
tuple<ItemType_>

function availableSkillPoints(uint256) public

‌Returns the number of skill points available for the given Aavegotchi based on its current level.
RETURNS uint256

function abs(int8) private

‌Returns the absolute value of the given int8.

function aavegotchiLevel(uint32) public

‌Returns the Aavegotchi level given the amount of experience.
RETURNS uint256

function rarityMultiplier(int256, address) public

‌Returns how many DAI/USD worth of collateral is required for the base rarity score of an Aavegotchi.
RETURNS uint256

function baseRarityScore(int256, address) public

‌Returns the base rarity score for an Aavegotchi calculated from its numeric traits and collateral type.
RETURNS uint256

function modifiedRarityScore(uint256) external

‌Returns the rarity score of an Aavegotchi, including all equipped wearables.
RETURNS uint256

function kinship(uint256) external

Returns the current kinship value of a given Aavegotchi.
RETURNS uint256

function tokenIdsOfOwner(address) external

‌Returns all the Aavegotchi Ids of a given owner.
RETURNS uint32[]

function allAavegotchisOfOwner(address) external

‌Returns detailed information about all the Aavegotchis of a given owner.
RETURNS tuple<aavegotchiInfo_>[]

function ownerOf(uint256) external

‌Returns the owner of a given Aavegotchi.
RETURNS address

function getApproved(uint256) external

‌Get the approved address for a single Aavegotchi.
RETURNS address

function isApprovedForAll(address, address) external

‌Returns if an address is an authorized operator for another address.
RETURNS bool

WRITE FUNCTIONS

function setAavegotchiName(uint256, string) external

‌Sets the unique name of an Aavegotchi to the given string, if available.

function setBatchId(uint256[]) external

‌Includes the given Aavegotchis in the next Chainlink VRF batch call.

function spendSkillPoints(uint256, int8[4]) external

‌Spends the given number of skill points on the specified trait modifiers.

function claimAavegotchi(uint256, uint256, uint256) external

‌Claims an Aavegotchi from the Portal and transfers the required collateral from msg.sender to the Aavegotchi's escrow address.

function interact(uint256) public

‌Performs a basic interaction with the Aavegotchi to increase kinship.

function lockAavegotchi(uint256, uint256) external

‌Prevents transferring and equipping wearables for a given period of time. Used to ensure that Aavegotchis listed on the secondary marketplace cannot be rugpulled by their owners.

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

‌Transfers the ownership of an NFT from one address to another address

function safeTransfer(address, address, uint256) external

‌Transfers the ownership of an NFT from one address to another address

function transferFrom(address, address, uint256) external

‌Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE /// TO CONFIRM THAT _to IS CAPABLE OF RECEIVING NFTS OR ELSE /// THEY MAY BE PERMANENTLY LOST

function internalTransferFrom(address, address, uint256) internal

‌This function is used by transfer functions.

function approve(address, uint256) external

‌Change or reaffirm the approved address for an NFT.

function setApprovalForAll(address, bool) external

‌Enable or disable approval for a third party ("operator") to manage.
Last modified 5mo ago
Copy link
Contents
READ FUNCTIONS
function aavegotchiNameAvailable(string) external
function currentHaunt() public
function revenueShares()
function toNumericTraits(uint256) internal
function singlePortalAavegotchiTraits(uint256, uint256) internal
function portalAavegotchiTraits(uint256) public
function ghstAddress() external
function balanceOf(address) external
function getAavegotchi(uint256) public
function availableSkillPoints(uint256) public
function abs(int8) private
function aavegotchiLevel(uint32) public
function rarityMultiplier(int256, address) public
function baseRarityScore(int256, address) public
function modifiedRarityScore(uint256) external
function kinship(uint256) external
function tokenIdsOfOwner(address) external
function allAavegotchisOfOwner(address) external
function ownerOf(uint256) external
function getApproved(uint256) external
function isApprovedForAll(address, address) external
WRITE FUNCTIONS
function setAavegotchiName(uint256, string) external
function setBatchId(uint256[]) external
function spendSkillPoints(uint256, int8[4]) external
function claimAavegotchi(uint256, uint256, uint256) external
function interact(uint256) public
function lockAavegotchi(uint256, uint256) external
function safeTransferFrom(address, address, uint256, bytes) external
function safeTransfer(address, address, uint256) external
function transferFrom(address, address, uint256) external
function internalTransferFrom(address, address, uint256) internal
function approve(address, uint256) external
function setApprovalForAll(address, bool) external