HeroCoreUpgradeable
Last updated
Last updated
Frisky Fox - Defi Kingdoms
Core contract for Heroes.
Holds the base structs, events, and data.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
ROLES ///
See {IERC721-approve}.
See {IERC721-balanceOf}.
See {IERC721-getApproved}.
Gets a hero object.
Returns the admin role that controls role
. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.
Grants role
to account
. If account
had not been already granted role
, emits a {RoleGranted} event. Requirements: - the caller must have role
's admin role.
Returns true
if account
has been granted role
.
The initialize function is the constructor for upgradeable contracts.
See {IERC721-isApprovedForAll}.
See {IERC721Metadata-name}.
See {IERC721-ownerOf}.
ADMIN FUNCTION ///
Returns true if the contract is paused, and false otherwise.
Revokes role
from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked role
, emits a {RoleRevoked} event. Requirements: - the caller must be account
.
Revokes role
from account
. If account
had been granted role
, emits a {RoleRevoked} event. Requirements: - the caller must have role
's admin role.
See {IERC721-safeTransferFrom}.
See {IERC721-safeTransferFrom}.
See {IERC721-setApprovalForAll}.
See {IERC721Metadata-symbol}.
See {IERC721Enumerable-tokenByIndex}.
See {IERC721Enumerable-tokenOfOwnerByIndex}.
See {IERC721Metadata-tokenURI}.
See {IERC721Enumerable-totalSupply}.
See {IERC721-transferFrom}.
EVENTS ///
The HeroSummoned event is fired whenever a new hero is created.
The HeroUpdated event is fired whenever a hero is updated.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
_0
bytes32
undefined
_0
bytes32
undefined
_0
bytes32
undefined
_0
bytes32
undefined
_0
bytes32
undefined
to
address
undefined
tokenId
uint256
undefined
owner
address
undefined
_0
uint256
undefined
_id
uint256
undefined
_to
address
undefined
_statGenes
uint256
undefined
_visualGenes
uint256
undefined
_rarity
enum Rarity
undefined
_shiny
bool
undefined
_crystal
HeroCrystal
undefined
_crystalId
uint256
undefined
_0
uint256
undefined
tokenId
uint256
undefined
_0
address
undefined
_id
uint256
The hero id.
_0
Hero
undefined
role
bytes32
undefined
_0
bytes32
undefined
_address
address
undefined
_0
Hero[]
undefined
role
bytes32
undefined
account
address
undefined
role
bytes32
undefined
account
address
undefined
_0
bool
undefined
_0
uint256
undefined
id
uint256
undefined
summoningInfo
SummoningInfo
undefined
info
HeroInfo
undefined
state
HeroState
undefined
stats
HeroStats
undefined
primaryStatGrowth
HeroStatGrowth
undefined
secondaryStatGrowth
HeroStatGrowth
undefined
professions
HeroProfessions
undefined
_name
string
undefined
_symbol
string
undefined
_statScience
address
undefined
owner
address
undefined
operator
address
undefined
_0
bool
undefined
_0
string
undefined
_0
uint256
undefined
tokenId
uint256
undefined
_0
address
undefined
_0
bool
undefined
role
bytes32
undefined
account
address
undefined
role
bytes32
undefined
account
address
undefined
from
address
undefined
to
address
undefined
tokenId
uint256
undefined
from
address
undefined
to
address
undefined
tokenId
uint256
undefined
_data
bytes
undefined
operator
address
undefined
approved
bool
undefined
interfaceId
bytes4
undefined
_0
bool
undefined
_0
string
undefined
index
uint256
undefined
_0
uint256
undefined
owner
address
undefined
index
uint256
undefined
_0
uint256
undefined
tokenId
uint256
undefined
_0
string
undefined
_0
uint256
undefined
from
address
undefined
to
address
undefined
tokenId
uint256
undefined
_hero
Hero
undefined
owner indexed
address
undefined
approved indexed
address
undefined
tokenId indexed
uint256
undefined
owner indexed
address
undefined
operator indexed
address
undefined
approved
bool
undefined
owner indexed
address
undefined
heroId
uint256
undefined
summonerId
uint256
undefined
assistantId
uint256
undefined
statGenes
uint256
undefined
visualGenes
uint256
undefined
owner indexed
address
undefined
heroId
uint256
undefined
hero
Hero
undefined
account
address
undefined
role indexed
bytes32
undefined
previousAdminRole indexed
bytes32
undefined
newAdminRole indexed
bytes32
undefined
role indexed
bytes32
undefined
account indexed
address
undefined
sender indexed
address
undefined
role indexed
bytes32
undefined
account indexed
address
undefined
sender indexed
address
undefined
from indexed
address
undefined
to indexed
address
undefined
tokenId indexed
uint256
undefined
account
address
undefined