AlchemicaFacet

StartSurveying

event StartSurveying(uint256 _realmId, uint256 _round)

ChannelAlchemica

event ChannelAlchemica(uint256 _realmId, uint256 _gotchiId, uint256[4] _alchemica, uint256 _spilloverRate, uint256 _spilloverRadius)

ExitAlchemica

event ExitAlchemica(uint256 _gotchiId, uint256[] _alchemica)

SurveyingRoundProgressed

event SurveyingRoundProgressed(uint256 _newRound)

TransferTokensToGotchi

event TransferTokensToGotchi(address _sender, uint256 _gotchiId, address _tokenAddresses, uint256 _amount)

ERC20TransferFailed

error ERC20TransferFailed(string _tokenName)

isSurveying

function isSurveying(uint256 _realmId) external view returns (bool)

startSurveying

function startSurveying(uint256 _realmId) external

getAlchemicaAddresses

function getAlchemicaAddresses() external view returns (address[4])

getTotalAlchemicas

function getTotalAlchemicas() external view returns (uint256[4][5])

Query details about all total alchemicas present

Return Values

NameTypeDescription

[0]

uint256[4][5]

output_ A two dimensional array, each representing an alchemica value

getRealmAlchemica

function getRealmAlchemica(uint256 _realmId) external view returns (uint256[4])

Query details about the remaining alchemica in a parcel

Parameters

NameTypeDescription

_realmId

uint256

The identifier of the parcel to query

Return Values

NameTypeDescription

[0]

uint256[4]

output_ An array containing details about each remaining alchemica in the parcel

getParcelCurrentRound

function getParcelCurrentRound(uint256 _realmId) external view returns (uint256)

Query details about the remaining alchemica in a parcel

Parameters

NameTypeDescription

_realmId

uint256

The identifier of the parcel to query

Return Values

NameTypeDescription

[0]

uint256

output_ An array containing details about each remaining alchemica in the parcel

progressSurveyingRound

function progressSurveyingRound() external

Allow the diamond owner to increment the surveying round

getRoundAlchemica

function getRoundAlchemica(uint256 _realmId, uint256 _roundId) external view returns (uint256[])

Query details about all alchemica gathered in a surveying round in a parcel

Parameters

NameTypeDescription

_realmId

uint256

Identifier of the parcel to query

_roundId

uint256

Identifier of the surveying round to query

Return Values

NameTypeDescription

[0]

uint256[]

output_ An array representing the numbers of alchemica gathered in a round

getRoundBaseAlchemica

function getRoundBaseAlchemica(uint256 _realmId, uint256 _roundId) external view returns (uint256[])

Query details about the base alchemica gathered in a surveying round in a parcel

Parameters

NameTypeDescription

_realmId

uint256

Identifier of the parcel to query

_roundId

uint256

Identifier of the surveying round to query

Return Values

NameTypeDescription

[0]

uint256[]

output_ An array representing the numbers of base alchemica gathered in a round

setVars

function setVars(uint256[4][5] _alchemicas, uint256[4] _boostMultipliers, uint256[4] _greatPortalCapacity, address _installationsDiamond, address _vrfCoordinator, address _linkAddress, address[4] _alchemicaAddresses, address _gltrAddress, bytes _backendPubKey, address _gameManager, address _tileDiamond, address _aavegotchiDiamond) external

Allow the diamond owner to set some important diamond state variables

Parameters

NameTypeDescription

_alchemicas

uint256[4][5]

A nested array containing the amount of alchemicas available

_boostMultipliers

uint256[4]

The boost multiplers applied to each parcel

_greatPortalCapacity

uint256[4]

The individual alchemica capacity of the great portal

_installationsDiamond

address

The installations diamond address

_vrfCoordinator

address

The chainlink vrfCoordinator address

_linkAddress

address

The link token address

_alchemicaAddresses

address[4]

The four alchemica token addresses

_gltrAddress

address

_backendPubKey

bytes

The Realm(gotchiverse) backend public key

_gameManager

address

The address of the game manager

_tileDiamond

address

_aavegotchiDiamond

address

setTotalAlchemicas

function setTotalAlchemicas(uint256[4][5] _totalAlchemicas) external

getAvailableAlchemica

function getAvailableAlchemica(uint256 _realmId) public view returns (uint256[4] _availableAlchemica)

Query the available alchemica in a parcel

Parameters

NameTypeDescription

_realmId

uint256

identifier of parcel to query

Return Values

NameTypeDescription

_availableAlchemica

uint256[4]

An array representing the available quantity of alchemicas

TransferAmounts

struct TransferAmounts {
  uint256 owner;
  uint256 spill;
}

lastClaimedAlchemica

function lastClaimedAlchemica(uint256 _realmId) external view returns (uint256)

claimAvailableAlchemica

function claimAvailableAlchemica(uint256 _realmId, uint256 _gotchiId, bytes _signature) external

Allow parcel owner to claim available alchemica with his parent NFT(Aavegotchi)

Parameters

NameTypeDescription

_realmId

uint256

Identifier of parcel to claim alchemica from

_gotchiId

uint256

Identifier of Aavegotchi to use for alchemica collecction/claiming

_signature

bytes

Message signature used for backend validation

getHarvestRates

function getHarvestRates(uint256 _realmId) external view returns (uint256[] harvestRates)

getCapacities

function getCapacities(uint256 _realmId) external view returns (uint256[] capacities)

getTotalClaimed

function getTotalClaimed(uint256 _realmId) external view returns (uint256[] totalClaimed)

channelAlchemica

function channelAlchemica(uint256 _realmId, uint256 _gotchiId, uint256 _lastChanneled, bytes _signature) external

Allow a parcel owner to channel alchemica

_This transfers alchemica to the parent ERC721 token with id gotchiId and also to the great portal

Parameters

NameTypeDescription

_realmId

uint256

Identifier of parcel where alchemica is being channeled from

_gotchiId

uint256

Identifier of parent ERC721 aavegotchi which alchemica is channeled to

_lastChanneled

uint256

The last time alchemica was channeled in this _realmId

_signature

bytes

Message signature used for backend validation

getLastChanneled

function getLastChanneled(uint256 _gotchiId) public view returns (uint256)

Return the last timestamp of a channeling

used as a parameter in channelAlchemica

Parameters

NameTypeDescription

_gotchiId

uint256

Identifier of parent ERC721 aavegotchi

Return Values

NameTypeDescription

[0]

uint256

last channeling timestamp

getParcelLastChanneled

function getParcelLastChanneled(uint256 _parcelId) public view returns (uint256)

Return the last timestamp of an altar channeling

used as a parameter in channelAlchemica

Parameters

NameTypeDescription

_parcelId

uint256

Identifier of ERC721 parcel

Return Values

NameTypeDescription

[0]

uint256

last channeling timestamp

batchTransferAlchemica

function batchTransferAlchemica(address[] _targets, uint256[4][] _amounts) external

Helper function to batch transfer alchemica

_The inner array element order for amounts is FUD, FOMO, ALPHA, KEK

Parameters

NameTypeDescription

_targets

address[]

Array of target addresses

_amounts

uint256[4][]

Nested array of amounts to transfer.

batchTransferTokensToGotchis

function batchTransferTokensToGotchis(uint256[] _gotchiIds, address[] _tokenAddresses, uint256[][] _amounts) external

Helper function to batch transfer alchemica to Aavegotchis

Parameters

NameTypeDescription

_gotchiIds

uint256[]

Array of Gotchi IDs

_tokenAddresses

address[]

Array of tokens to transfer

_amounts

uint256[][]

Nested array of amounts to transfer.

setChannelingLimits

function setChannelingLimits(uint256[] _altarLevel, uint256[] _limits) external

Owner function to change the altars channeling limits @param _altarLevel Array of altars level

Parameters

NameTypeDescription

_altarLevel

uint256[]

_limits

uint256[]

Array of time limits

batchTransferTokens

function batchTransferTokens(address[][] _tokens, uint256[][] _amounts, address[] _to) external