HeroCoreUpgradeable

Frisky Fox - Defi Kingdoms

Core contract for Heroes.

Holds the base structs, events, and data.

Methods

BRIDGE_ROLE

function BRIDGE_ROLE() external view returns (bytes32)

Returns

Name
Type
Description

_0

bytes32

undefined

DEFAULT_ADMIN_ROLE

function DEFAULT_ADMIN_ROLE() external view returns (bytes32)

Returns

Name
Type
Description

_0

bytes32

undefined

HERO_MODERATOR_ROLE

function HERO_MODERATOR_ROLE() external view returns (bytes32)

Returns

Name
Type
Description

_0

bytes32

undefined

MINTER_ROLE

Returns

Name
Type
Description

_0

bytes32

undefined

MODERATOR_ROLE

ROLES ///

Returns

Name
Type
Description

_0

bytes32

undefined

approve

See {IERC721-approve}.

Parameters

Name
Type
Description

to

address

undefined

tokenId

uint256

undefined

balanceOf

See {IERC721-balanceOf}.

Parameters

Name
Type
Description

owner

address

undefined

Returns

Name
Type
Description

_0

uint256

undefined

bridgeMint

Parameters

Name
Type
Description

_id

uint256

undefined

_to

address

undefined

createHero

Parameters

Name
Type
Description

_statGenes

uint256

undefined

_visualGenes

uint256

undefined

_rarity

enum Rarity

undefined

_shiny

bool

undefined

_crystal

HeroCrystal

undefined

_crystalId

uint256

undefined

Returns

Name
Type
Description

_0

uint256

undefined

getApproved

See {IERC721-getApproved}.

Parameters

Name
Type
Description

tokenId

uint256

undefined

Returns

Name
Type
Description

_0

address

undefined

getHero

Gets a hero object.

Parameters

Name
Type
Description

_id

uint256

The hero id.

Returns

Name
Type
Description

_0

Hero

undefined

getRoleAdmin

Returns the admin role that controls role. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.

Parameters

Name
Type
Description

role

bytes32

undefined

Returns

Name
Type
Description

_0

bytes32

undefined

getUserHeroes

Parameters

Name
Type
Description

_address

address

undefined

Returns

Name
Type
Description

_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

Name
Type
Description

role

bytes32

undefined

account

address

undefined

hasRole

Returns true if account has been granted role.

Parameters

Name
Type
Description

role

bytes32

undefined

account

address

undefined

Returns

Name
Type
Description

_0

bool

undefined

heroes

Parameters

Name
Type
Description

_0

uint256

undefined

Returns

Name
Type
Description

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
Type
Description

_name

string

undefined

_symbol

string

undefined

_statScience

address

undefined

isApprovedForAll

See {IERC721-isApprovedForAll}.

Parameters

Name
Type
Description

owner

address

undefined

operator

address

undefined

Returns

Name
Type
Description

_0

bool

undefined

name

See {IERC721Metadata-name}.

Returns

Name
Type
Description

_0

string

undefined

nextHeroId

Returns

Name
Type
Description

_0

uint256

undefined

ownerOf

See {IERC721-ownerOf}.

Parameters

Name
Type
Description

tokenId

uint256

undefined

Returns

Name
Type
Description

_0

address

undefined

pause

ADMIN FUNCTION ///

paused

Returns true if the contract is paused, and false otherwise.

Returns

Name
Type
Description

_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

Name
Type
Description

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

Name
Type
Description

role

bytes32

undefined

account

address

undefined

safeTransferFrom

See {IERC721-safeTransferFrom}.

Parameters

Name
Type
Description

from

address

undefined

to

address

undefined

tokenId

uint256

undefined

safeTransferFrom

See {IERC721-safeTransferFrom}.

Parameters

Name
Type
Description

from

address

undefined

to

address

undefined

tokenId

uint256

undefined

_data

bytes

undefined

setApprovalForAll

See {IERC721-setApprovalForAll}.

Parameters

Name
Type
Description

operator

address

undefined

approved

bool

undefined

supportsInterface

Parameters

Name
Type
Description

interfaceId

bytes4

undefined

Returns

Name
Type
Description

_0

bool

undefined

symbol

See {IERC721Metadata-symbol}.

Returns

Name
Type
Description

_0

string

undefined

tokenByIndex

See {IERC721Enumerable-tokenByIndex}.

Parameters

Name
Type
Description

index

uint256

undefined

Returns

Name
Type
Description

_0

uint256

undefined

tokenOfOwnerByIndex

See {IERC721Enumerable-tokenOfOwnerByIndex}.

Parameters

Name
Type
Description

owner

address

undefined

index

uint256

undefined

Returns

Name
Type
Description

_0

uint256

undefined

tokenURI

See {IERC721Metadata-tokenURI}.

Parameters

Name
Type
Description

tokenId

uint256

undefined

Returns

Name
Type
Description

_0

string

undefined

totalSupply

See {IERC721Enumerable-totalSupply}.

Returns

Name
Type
Description

_0

uint256

undefined

transferFrom

See {IERC721-transferFrom}.

Parameters

Name
Type
Description

from

address

undefined

to

address

undefined

tokenId

uint256

undefined

unpause

updateHero

Parameters

Name
Type
Description

_hero

Hero

undefined

Events

Approval

Parameters

Name
Type
Description

owner indexed

address

undefined

approved indexed

address

undefined

tokenId indexed

uint256

undefined

ApprovalForAll

Parameters

Name
Type
Description

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

Name
Type
Description

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

Name
Type
Description

owner indexed

address

undefined

heroId

uint256

undefined

hero

Hero

undefined

Paused

Parameters

Name
Type
Description

account

address

undefined

RoleAdminChanged

Parameters

Name
Type
Description

role indexed

bytes32

undefined

previousAdminRole indexed

bytes32

undefined

newAdminRole indexed

bytes32

undefined

RoleGranted

Parameters

Name
Type
Description

role indexed

bytes32

undefined

account indexed

address

undefined

sender indexed

address

undefined

RoleRevoked

Parameters

Name
Type
Description

role indexed

bytes32

undefined

account indexed

address

undefined

sender indexed

address

undefined

Transfer

Parameters

Name
Type
Description

from indexed

address

undefined

to indexed

address

undefined

tokenId indexed

uint256

undefined

Unpaused

Parameters

Name
Type
Description

account

address

undefined

Last updated

Was this helpful?