StatScienceUpgradeable
Frisky Fox - Defi Kingdoms
StatScience contains the logic to calculate starting stats.
Methods
DEFAULT_ADMIN_ROLE
Returns
_0
bytes32
undefined
WHITELIST_ROLE
ROLES ///
Returns
_0
bytes32
undefined
addRarityBonus
Parameters
_heroStats
HeroStats
undefined
_rarity
enum Rarity
undefined
_crystal
HeroCrystal
undefined
_crystalId
uint256
undefined
Returns
_0
HeroStats
undefined
_1
uint8[8]
undefined
augmentStat
Parameters
_stats
HeroStats
undefined
_stat
uint256
undefined
_increase
uint8
undefined
Returns
_0
HeroStats
undefined
generateStatGrowth
Parameters
_statGenes
uint256
undefined
_1
HeroCrystal
undefined
_2
enum Rarity
undefined
_isPrimary
bool
undefined
Returns
_0
HeroStatGrowth
undefined
generateStats
Parameters
_statGenes
uint256
undefined
_crystal
HeroCrystal
undefined
_rarity
enum Rarity
undefined
_crystalId
uint256
undefined
Returns
_0
HeroStats
undefined
getGene
Parameters
_genes
uint256
undefined
_position
uint8
undefined
Returns
_0
uint8
undefined
getJobTier
Gets the job tier for genes.
Parameters
_class
uint8
undefined
Returns
_0
enum JobTier
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
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
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
supportsInterface
See {IERC165-supportsInterface}.
Parameters
interfaceId
bytes4
undefined
Returns
_0
bool
undefined
Events
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
Last updated