Skip to main content

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

ParameterTypeDescription
_accountaddressAddress 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

ParameterTypeDescription
_accountaddressAddress of the user to query

Return Value

TypeDescription
uint256Number 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

ParameterTypeDescription
_accountaddressAddress of the user to query
_indexuint256Index 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

TypeDescription
uint256Current 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

ParameterTypeDescription
_accountaddressAddress of the user to query

Return Value

TypeDescription
uint256Timestamp when user can perform full unstaking

Execution Flow

  1. Searches user's transaction history for the last time their total staked amount was 0
  2. Returns that transaction's timestamp plus the current secondsToUnllockFullUnstaking.actual value
  3. If no such transaction exists, returns 0 (user has never fully unstaked)

Get Time To User Unlock Full Unstaking Time


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

ParameterTypeDescription
_accountaddressAddress of the user to query

Return Value

TypeDescription
uint256Timestamp when user can perform staking

Execution Flow

  1. Examines the user's most recent transaction history
  2. If no history exists, returns 0 (user can stake immediately)
  3. 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

TypeDescription
uint256Current full unstaking time lock period

getSecondsToUnlockStaking

Function Type: view
Function Signature: getSecondsToUnlockStaking()

Retrieves the current staking unlock period in seconds.

Return Value

TypeDescription
uint256Current 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

ParameterTypeDescription
_accountaddressAddress of the user to query

Return Value

TypeDescription
uint256Total 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

ParameterTypeDescription
_nonceuint256The nonce to check for prior usage

Return Value

TypeDescription
booltrue 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

TypeDescription
addressAddress of the Golden Fisher contract

getGoldenFisherProposal

Function Type: view
Function Signature: getGoldenFisherProposal()

Retrieves the address of the Golden Fisher contract proposal.

Return Value

TypeDescription
addressAddress of the Golden Fisher contract proposal

getEvvmAddress

Function Type: view
Function Signature: getEvvmAddress()

Retrieves the address of the EVVM contract.

Return Value

TypeDescription
addressAddress of the EVVM contract

getMateAddress

Function Type: view
Function Signature: getMateAddress()

Retrieves the address of the sMATE token contract.

Return Value

TypeDescription
addressAddress of the sMATE token contract

getOwner

Function Type: view
Function Signature: getOwner()

Retrieves the address of the contract owner.

Return Value

TypeDescription
addressAddress 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

ParameterTypeDescription
_accountaddressAddress of the user to query

Return Value

TypeDescription
booltrue if user is a presale staker, false otherwise
uint256Amount 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

TypeDescription
uint256Number 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

TypeDescription
BoolTypeProposalValue 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

TypeDescription
BoolTypeProposalValue 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
}