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