HeroCoreUpgradeable
Frisky Fox - Defi Kingdoms
Core contract for Heroes.
Holds the base structs, events, and data.
Methods
BRIDGE_ROLE
Returns
_0
bytes32
undefined
DEFAULT_ADMIN_ROLE
Returns
_0
bytes32
undefined
HERO_MODERATOR_ROLE
Returns
_0
bytes32
undefined
MINTER_ROLE
Returns
_0
bytes32
undefined
MODERATOR_ROLE
ROLES ///
Returns
_0
bytes32
undefined
approve
See {IERC721-approve}.
Parameters
to
address
undefined
tokenId
uint256
undefined
balanceOf
See {IERC721-balanceOf}.
Parameters
owner
address
undefined
Returns
_0
uint256
undefined
bridgeMint
Parameters
_id
uint256
undefined
_to
address
undefined
createHero
Parameters
_statGenes
uint256
undefined
_visualGenes
uint256
undefined
_rarity
enum Rarity
undefined
_shiny
bool
undefined
_crystal
HeroCrystal
undefined
_crystalId
uint256
undefined
Returns
_0
uint256
undefined
getApproved
See {IERC721-getApproved}.
Parameters
tokenId
uint256
undefined
Returns
_0
address
undefined
getHero
Gets a hero object.
Parameters
_id
uint256
The hero id.
Returns
_0
Hero
undefined
getRoleAdmin
Returns the admin role that controls role
. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.
Parameters
role
bytes32
undefined
Returns
_0
bytes32
undefined
getUserHeroes
Parameters
_address
address
undefined
Returns
_0
Hero[]
undefined
grantRole
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.
Parameters
role
bytes32
undefined
account
address
undefined
hasRole
Returns true
if account
has been granted role
.
Parameters
role
bytes32
undefined
account
address
undefined
Returns
_0
bool
undefined
heroes
Parameters
_0
uint256
undefined
Returns
id
uint256
undefined
summoningInfo
SummoningInfo
undefined
info
HeroInfo
undefined
state
HeroState
undefined
stats
HeroStats
undefined
primaryStatGrowth
HeroStatGrowth
undefined
secondaryStatGrowth
HeroStatGrowth
undefined
professions
HeroProfessions
undefined
initialize
The initialize function is the constructor for upgradeable contracts.
Parameters
_name
string
undefined
_symbol
string
undefined
_statScience
address
undefined
isApprovedForAll
See {IERC721-isApprovedForAll}.
Parameters
owner
address
undefined
operator
address
undefined
Returns
_0
bool
undefined
name
See {IERC721Metadata-name}.
Returns
_0
string
undefined
nextHeroId
Returns
_0
uint256
undefined
ownerOf
See {IERC721-ownerOf}.
Parameters
tokenId
uint256
undefined
Returns
_0
address
undefined
pause
ADMIN FUNCTION ///
paused
Returns true if the contract is paused, and false otherwise.
Returns
_0
bool
undefined
renounceRole
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
.
Parameters
role
bytes32
undefined
account
address
undefined
revokeRole
Revokes role
from account
. If account
had been granted role
, emits a {RoleRevoked} event. Requirements: - the caller must have role
's admin role.
Parameters
role
bytes32
undefined
account
address
undefined
safeTransferFrom
See {IERC721-safeTransferFrom}.
Parameters
from
address
undefined
to
address
undefined
tokenId
uint256
undefined
safeTransferFrom
See {IERC721-safeTransferFrom}.
Parameters
from
address
undefined
to
address
undefined
tokenId
uint256
undefined
_data
bytes
undefined
setApprovalForAll
See {IERC721-setApprovalForAll}.
Parameters
operator
address
undefined
approved
bool
undefined
supportsInterface
Parameters
interfaceId
bytes4
undefined
Returns
_0
bool
undefined
symbol
See {IERC721Metadata-symbol}.
Returns
_0
string
undefined
tokenByIndex
See {IERC721Enumerable-tokenByIndex}.
Parameters
index
uint256
undefined
Returns
_0
uint256
undefined
tokenOfOwnerByIndex
See {IERC721Enumerable-tokenOfOwnerByIndex}.
Parameters
owner
address
undefined
index
uint256
undefined
Returns
_0
uint256
undefined
tokenURI
See {IERC721Metadata-tokenURI}.
Parameters
tokenId
uint256
undefined
Returns
_0
string
undefined
totalSupply
See {IERC721Enumerable-totalSupply}.
Returns
_0
uint256
undefined
transferFrom
See {IERC721-transferFrom}.
Parameters
from
address
undefined
to
address
undefined
tokenId
uint256
undefined
unpause
updateHero
Parameters
_hero
Hero
undefined
Events
Approval
Parameters
owner indexed
address
undefined
approved indexed
address
undefined
tokenId indexed
uint256
undefined
ApprovalForAll
Parameters
owner indexed
address
undefined
operator indexed
address
undefined
approved
bool
undefined
HeroSummoned
EVENTS ///
The HeroSummoned event is fired whenever a new hero is created.
Parameters
owner indexed
address
undefined
heroId
uint256
undefined
summonerId
uint256
undefined
assistantId
uint256
undefined
statGenes
uint256
undefined
visualGenes
uint256
undefined
HeroUpdated
The HeroUpdated event is fired whenever a hero is updated.
Parameters
owner indexed
address
undefined
heroId
uint256
undefined
hero
Hero
undefined
Paused
Parameters
account
address
undefined
RoleAdminChanged
Parameters
role indexed
bytes32
undefined
previousAdminRole indexed
bytes32
undefined
newAdminRole indexed
bytes32
undefined
RoleGranted
Parameters
role indexed
bytes32
undefined
account indexed
address
undefined
sender indexed
address
undefined
RoleRevoked
Parameters
role indexed
bytes32
undefined
account indexed
address
undefined
sender indexed
address
undefined
Transfer
Parameters
from indexed
address
undefined
to indexed
address
undefined
tokenId indexed
uint256
undefined
Unpaused
Parameters
account
address
undefined
Last updated