Getter Functions
This section details all available getter functions in the contract, providing comprehensive information about the contract's state and configuration.
Contract State Retrieval Functions
getAddressHistory
Function Type: view
Function Signature: getAddressHistory(address _account)
Retrieves the complete transaction history for a specified user address.
Input Parameters
Parameter | Type | Description |
---|---|---|
_account | address | Address of the user to retrieve history for |
Return Value
Returns an array of HistoryMetadata
structs containing the user's transaction history:
struct HistoryMetadata {
bytes1 transactionType; // 0x01 for staking, 0x02 for unstaking
uint256 amount; // Amount of sMATE staked/unstaked
uint256 timestamp; // Transaction timestamp
uint256 totalStaked; // User's total staked sMATE after transaction
}
getSizeOfAddressHistory
Function Type: view
Function Signature: getSizeOfAddressHistory(address _account)
Returns the total number of transactions in a user's history.
Input Parameters
Parameter | Type | Description |
---|---|---|
_account | address | Address of the user to query |
Return Value
Type | Description |
---|---|
uint256 | Number of transactions in user's history |
getAddressHistoryByIndex
Function Type: view
Function Signature: getAddressHistoryByIndex(address _account, uint256 _index)
Retrieves a specific transaction from a user's history based on its index.
Input Parameters
Parameter | Type | Description |
---|---|---|
_account | address | Address of the user to query |
_index | uint256 | Index of the transaction to retrieve |
Return Value
Returns a single HistoryMetadata
struct:
struct HistoryMetadata {
bytes1 transactionType; // 0x01 for staking, 0x02 for unstaking
uint256 amount; // Amount of sMATE staked/unstaked
uint256 timestamp; // Transaction timestamp
uint256 totalStaked; // User's total staked sMATE after transaction
}
Price and Token Functions
priceOfSMate
Function Type: view
Function Signature: priceOfSMate()
Calculates the current exchange rate between sMATE and MATE tokens.
Return Value
Type | Description |
---|---|
uint256 | Current exchange rate (sMATE to MATE) |
User Time Lock Functions
getTimeToUserUnlockFullUnstakingTime
Function Type: view
Function Signature: getTimeToUserUnlockFullUnstakingTime(address _account)
Calculates when a user becomes eligible for full unstaking based on their transaction history.
Input Parameters
Parameter | Type | Description |
---|---|---|
_account | address | Address of the user to query |
Return Value
Type | Description |
---|---|
uint256 | Timestamp when user can perform full unstaking |
Execution Flow
- Searches user's transaction history for the last time their total staked amount was
0
- Returns that transaction's timestamp plus the current
secondsToUnllockFullUnstaking.actual
value - If no such transaction exists, returns
0
(user has never fully unstaked)
getTimeToUserUnlockStakingTime
Function Type: view
Function Signature: getTimeToUserUnlockStakingTime(address _account)
Calculates when a user becomes eligible to stake again after their last full unstaking.
Input Parameters
Parameter | Type | Description |
---|---|---|
_account | address | Address of the user to query |
Return Value
Type | Description |
---|---|
uint256 | Timestamp when user can perform staking |
Execution Flow
- Examines the user's most recent transaction history
- If no history exists, returns
0
(user can stake immediately) - Otherwise, returns the last transaction timestamp plus the current
secondsToUnlockStaking.actual
value
System Configuration Functions
getSecondsToUnlockFullUnstaking
Function Type: view
Function Signature: getSecondsToUnlockFullUnstaking()
Retrieves the current full unstaking unlock period in seconds.
Return Value
Type | Description |
---|---|
uint256 | Current full unstaking time lock period |
getSecondsToUnlockStaking
Function Type: view
Function Signature: getSecondsToUnlockStaking()
Retrieves the current staking unlock period in seconds.
Return Value
Type | Description |
---|---|
uint256 | Current staking time lock period |
User Asset Functions
getUserAmountStaked
Function Type: view
Function Signature: getUserAmountStaked(address _account)
Retrieves the total amount of sMATE currently staked by a user.
Input Parameters
Parameter | Type | Description |
---|---|---|
_account | address | Address of the user to query |
Return Value
Type | Description |
---|---|
uint256 | Total amount of sMATE staked by the user |
Security and Validation Functions
checkIfStakeNonceUsed
Function Type: view
Function Signature: checkIfStakeNonceUsed(uint256 _nonce)
Checks if a specific asynchronous contract nonce has already been used.
Input Parameters
Parameter | Type | Description |
---|---|---|
_nonce | uint256 | The nonce to check for prior usage |
Return Value
Type | Description |
---|---|
bool | true if nonce has been used, false otherwise |
Contract Reference Functions
getGoldenFisher
Function Type: view
Function Signature: getGoldenFisher()
Retrieves the address of the Golden Fisher contract.
Return Value
Type | Description |
---|---|
address | Address of the Golden Fisher contract |
getGoldenFisherProposal
Function Type: view
Function Signature: getGoldenFisherProposal()
Retrieves the address of the Golden Fisher contract proposal.
Return Value
Type | Description |
---|---|
address | Address of the Golden Fisher contract proposal |
getEvvmAddress
Function Type: view
Function Signature: getEvvmAddress()
Retrieves the address of the EVVM contract.
Return Value
Type | Description |
---|---|
address | Address of the EVVM contract |
getMateAddress
Function Type: view
Function Signature: getMateAddress()
Retrieves the address of the sMATE token contract.
Return Value
Type | Description |
---|---|
address | Address of the sMATE token contract |
getOwner
Function Type: view
Function Signature: getOwner()
Retrieves the address of the contract owner.
Return Value
Type | Description |
---|---|
address | Address of the contract owner |
Presale Staker Information
getPresaleStaker
Function Type: view
Function Signature: getPresaleStaker(address _account)
Determines if a user is a presale staker and retrieves their staked amount.
Input Parameters
Parameter | Type | Description |
---|---|---|
_account | address | Address of the user to query |
Return Value
Type | Description |
---|---|
bool | true if user is a presale staker, false otherwise |
uint256 | Amount of sMATE staked by the user during presale |
getPresaleStakerCount
Function Type: view
Function Signature: getPresaleStakerCount()
Retrieves the total number of presale stakers in the contract.
Return Value
Type | Description |
---|---|
uint256 | Number of presale stakers in the contract |
Contract Status Functions
getAllDataOfAllowPublicStaking
Function Type: view
Function Signature: getAllDataOfAllowPublicStaking()
Retrieves the value of the allowPublicStaking
variable in BoolTypeProposal
struct.
Return Value
Type | Description |
---|---|
BoolTypeProposal | Value of allowPublicStaking variable in BoolTypeProposal struct |
The struct contains the following fields:
struct BoolTypeProposal {
bool flag; // Current value of the allowPublicStaking variable
uint256 timeToAccept; // Timestamp when the change should be accepted
}
getAllowPresaleStaking
Function Type: view
Function Signature: getAllowPresaleStaking()
Retrieves the value of the allowPresaleStaking
variable in BoolTypeProposal
struct.
Return Value
Type | Description |
---|---|
BoolTypeProposal | Value of allowPresaleStaking variable in BoolTypeProposal struct |
The struct contains the following fields:
struct BoolTypeProposal {
bool flag; // Current value of the allowPresaleStaking variable
uint256 timeToAccept; // Timestamp when the change should be accepted
}