Utils
NotAllowed
error NotAllowed()
the not allowed method is a general error that signifies non descript permissions issues. All transactions should always be simulated either by using gas estimations or through a static call
TARGET
address TARGET
the hex contract to target - because this is the same on ethereum and pulsechain, we can leave it as a constant
MAX_DAYS
uint256 MAX_DAYS
a constant for the max number of days that can be used when determining the number algorhythmically
MAX_UINT_256
uint256 MAX_UINT_256
the max uint256 that can be used
SLOTS
uint256 SLOTS
the number of binary slots in a 256 sized uint
TEN_K
uint256 TEN_K
a number to use as the denominator when determining basis points
ADDRESS_BIT_LENGTH
uint256 ADDRESS_BIT_LENGTH
the number of bits in an address
MIN_INT_16
int256 MIN_INT_16
the minimum value that can exist in a int16 (-2^15)
MAX_UINT_8
uint256 MAX_UINT_8
the max value that can fit in a uint8 slot (255)
ZERO
uint256 ZERO
a uint256 as 0 in a constant
ONE
uint256 ONE
a uint256 as 1 in a constant
TWO
uint256 TWO
a uint256 as 2 in a constant
THREE
uint256 THREE
a uint256 as 3 in a constant
FOUR
uint256 FOUR
a uint256 as 4 in a constant
EIGHT
uint256 EIGHT
a uint256 as 8 in a constant
SIXTEEN
uint256 SIXTEEN
a uint256 as 16 in a constant
TWENTY_FOUR
uint256 TWENTY_FOUR
a uint256 as 24 in a constant
THIRTY_TWO
uint256 THIRTY_TWO
a uint256 as 32 in a constant
FOURTY_EIGHT
uint256 FOURTY_EIGHT
a uint256 as 48 in a constant
FIFTY_SIX
uint256 FIFTY_SIX
a uint256 as 56 in a constant
SIXTY_FOUR
uint256 SIXTY_FOUR
a uint256 as 64 in a constant
SEVENTY_TWO
uint256 SEVENTY_TWO
a uint256 as 72 in a constant
HEDRON
address HEDRON
the hedron contract to interact with and mint hedron tokens from
HSIM
address HSIM
the hedron stake instance manager contract to interact with and transfer hsi tokens from and end stakes through
isOneAtIndex
function isOneAtIndex(uint256 settings, uint256 index) external pure returns (bool isOne)
check if the number, in binary form, has a 1 at the provided index
Parameters
Name | Type | Description |
---|---|---|
settings | uint256 | the settings number that holds up to 256 flags as 1/0 |
index | uint256 | the index to check for a 1 |
_isOneAtIndex
function _isOneAtIndex(uint256 settings, uint256 index) internal pure returns (bool isOne)
_bubbleRevert
function _bubbleRevert(bytes data) internal pure
after an error is caught, it can be reverted again
Parameters
Name | Type | Description |
---|---|---|
data | bytes | the data to repackage and revert with |