Skip to main content

Getter Functions

This section details all available getter functions in the EVVM contract, providing comprehensive information about the contract's state, configuration, and user data.

System Configuration Functions

getEvvmMetadata

Function Type: view
Function Signature: getEvvmMetadata()

Returns the complete EVVM metadata configuration containing system-wide parameters and economic settings.

Return Value

Returns an EvvmMetadata struct containing:

FieldTypeDescription
principalTokenAddressaddressAddress of the principal token (MATE token)
rewarduint256Current reward amount per transaction
totalSupplyuint256Total supply tracking for era transitions
eraTokensuint256Era tokens threshold for reward transitions

getEvvmID

Function Type: view
Function Signature: getEvvmID()

Gets the unique identifier for this EVVM instance used for signature verification and distinguishing between different EVVM deployments.

Return Value

TypeDescription
uint256Unique identifier for this EVVM instance

getNameServiceAddress

Function Type: view
Function Signature: getNameServiceAddress()

Gets the current NameService contract address used for identity resolution in payments.

Return Value

TypeDescription
addressAddress of the integrated NameService contract

getStakingContractAddress

Function Type: view
Function Signature: getStakingContractAddress()

Gets the authorized staking contract address that can modify staker status and receive rewards.

Return Value

TypeDescription
addressAddress of the integrated staking contract

Nonce Management Functions

getNextCurrentSyncNonce

Function Type: view
Function Signature: getNextCurrentSyncNonce(address)

Returns the expected nonce for the next synchronous payment transaction for a specific user.

Input Parameters

ParameterTypeDescription
useraddressAddress to check sync nonce for

Return Value

TypeDescription
uint256Next synchronous nonce value

getIfUsedAsyncNonce

Function Type: view
Function Signature: getIfUsedAsyncNonce(address,uint256)

Checks if a specific asynchronous nonce has been used by a user to prevent replay attacks.

Input Parameters

ParameterTypeDescription
useraddressAddress to check nonce usage for
nonceuint256Specific nonce value to verify

Return Value

TypeDescription
boolTrue if the nonce has been used, false if available

getAsyncNonceReservation

Function Type: view
Function Signature: getAsyncNonceReservation(address,uint256)

Gets the service address that has reserved a specific async nonce for a user. Returns address(0) if the nonce is not reserved.

Input Parameters

ParameterTypeDescription
useraddressAddress of the user who owns the nonce
nonceuint256Async nonce to check reservation for

Return Value

TypeDescription
addressService address that reserved the nonce, or address(0) if not reserved

Example

// Check if nonce 100 is reserved for a user
address reservedService = core.getAsyncNonceReservation(userAddress, 100);

if (reservedService == address(0)) {
// Nonce is not reserved, any service can use it
} else if (reservedService == nameServiceAddress) {
// Nonce is reserved for NameService
} else {
// Nonce is reserved for another service
}

asyncNonceStatus

Function Type: view
Function Signature: asyncNonceStatus(address,uint256)

Gets comprehensive status of an async nonce, indicating whether it's available, used, or reserved.

Input Parameters

ParameterTypeDescription
useraddressAddress of the user who owns the nonce
nonceuint256Async nonce to check status for

Return Value

TypeDescription
bytes1Status code: 0x00 (available), 0x01 (used), 0x02 (reserved)

Status Codes

  • 0x00 (Available): Nonce can be used by any service
  • 0x01 (Used): Nonce has been consumed and cannot be reused
  • 0x02 (Reserved): Nonce is reserved for a specific service

Example

// Check status of nonce 200
bytes1 status = core.asyncNonceStatus(userAddress, 200);

if (status == 0x00) {
// Nonce is available
} else if (status == 0x01) {
// Nonce has been used
} else if (status == 0x02) {
// Nonce is reserved for a specific service
address reservedFor = core.getAsyncNonceReservation(userAddress, 200);
}

getNextFisherDepositNonce

Function Type: view
Function Signature: getNextFisherDepositNonce(address)

Returns the expected nonce for the next Fisher Bridge cross-chain deposit.

Input Parameters

ParameterTypeDescription
useraddressAddress to check deposit nonce for

Return Value

TypeDescription
uint256Next Fisher Bridge deposit nonce

Balance and Staking Functions

getBalance

Function Type: view
Function Signature: getBalance(address,address)

Gets the balance of a specific token for a user stored in the EVVM system.

Input Parameters

ParameterTypeDescription
useraddressAddress to check balance for
tokenaddressToken contract address to check

Return Value

TypeDescription
uintCurrent token balance for the user

isAddressStaker

Function Type: view
Function Signature: isAddressStaker(address)

Checks if an address is registered as a staker with transaction processing privileges and reward eligibility.

Input Parameters

ParameterTypeDescription
useraddressAddress to check staker status for

Return Value

TypeDescription
boolTrue if the address is a registered staker

Economic System Functions

getEraPrincipalToken

Function Type: view
Function Signature: getEraPrincipalToken()

Gets the current era token threshold that triggers the next reward halving in the deflationary tokenomics system.

Return Value

TypeDescription
uint256Current era tokens threshold

getRewardAmount

Function Type: view
Function Signature: getRewardAmount()

Gets the current MATE token reward amount distributed to stakers for transaction processing.

Return Value

TypeDescription
uint256Current reward amount in MATE tokens

getPrincipalTokenTotalSupply

Function Type: view
Function Signature: getPrincipalTokenTotalSupply()

Gets the total supply of the principal token (MATE) used for era transition calculations.

Return Value

TypeDescription
uint256Total supply of MATE tokens

Token Management Functions

getWhitelistTokenToBeAdded

Function Type: view
Function Signature: getWhitelistTokenToBeAdded()

Gets the address of the token that is pending whitelist approval after the time delay.

Return Value

TypeDescription
addressAddress of the token prepared for whitelisting (zero if none)

getWhitelistTokenToBeAddedDateToSet

Function Type: view
Function Signature: getWhitelistTokenToBeAddedDateToSet()

Gets the acceptance deadline for pending token whitelist proposals.

Return Value

TypeDescription
uint256Timestamp when pending token can be whitelisted (0 if no pending proposal)

Proxy and Governance Functions

getCurrentImplementation

Function Type: view
Function Signature: getCurrentImplementation()

Gets the current active implementation contract address used by the proxy for delegatecalls.

Return Value

TypeDescription
addressAddress of the current implementation contract

getProposalImplementation

Function Type: view
Function Signature: getProposalImplementation()

Gets the proposed implementation contract address pending approval for proxy upgrade.

Return Value

TypeDescription
addressAddress of the proposed implementation contract (zero if none)

getTimeToAcceptImplementation

Function Type: view
Function Signature: getTimeToAcceptImplementation()

Gets the acceptance deadline for the pending implementation upgrade.

Return Value

TypeDescription
uint256Timestamp when implementation upgrade can be executed (0 if no pending proposal)

Administrative Functions

getCurrentAdmin

Function Type: view
Function Signature: getCurrentAdmin()

Gets the current admin address with administrative privileges over the contract.

Return Value

TypeDescription
addressAddress of the current admin

getProposalAdmin

Function Type: view
Function Signature: getProposalAdmin()

Gets the proposed admin address pending approval for admin privileges.

Return Value

TypeDescription
addressAddress of the proposed admin (zero if no pending proposal)

getTimeToAcceptAdmin

Function Type: view
Function Signature: getTimeToAcceptAdmin()

Gets the acceptance deadline for the pending admin change.

Return Value

TypeDescription
uint256Timestamp when admin change can be executed (0 if no pending proposal)

UserValidator Functions

getUserValidatorAddress

Function Type: view
Function Signature: getUserValidatorAddress()

Gets the current active UserValidator contract address. Returns address(0) if no validator is configured.

Return Value

TypeDescription
addressAddress of active UserValidator contract or address(0)
What is UserValidator?

UserValidator is an optional contract that can filter which users are allowed to execute transactions in the EVVM ecosystem. See UserValidator System for details.


getUserValidatorAddressDetails

Function Type: view
Function Signature: getUserValidatorAddressDetails()

Gets full details of the UserValidator proposal including current validator, proposed validator, and time-lock information.

Return Value

Returns an AddressTypeProposal struct containing:

FieldTypeDescription
currentaddressCurrent active UserValidator address
proposaladdressProposed validator address (zero if no proposal)
timeToAcceptuint256Timestamp when proposal can be accepted

Example

// Get full validator details
ProposalStructs.AddressTypeProposal memory validatorDetails =
core.getUserValidatorAddressDetails();

if (validatorDetails.proposal != address(0)) {
// There's a pending proposal
if (block.timestamp >= validatorDetails.timeToAccept) {
// Proposal is ready to accept
} else {
// Still waiting for time-lock
uint256 timeRemaining = validatorDetails.timeToAccept - block.timestamp;
}
}

Usage Examples

Checking User Balance

// Check MATE token balance for a user
uint256 mateBalance = evvm.getBalance(userAddress, mateTokenAddress);

// Check if user is a staker
bool isStaker = evvm.isAddressStaker(userAddress);

Nonce Management

// Get next sync nonce for a user
uint256 nextNonce = evvm.getNextCurrentSyncNonce(userAddress);

// Check if async nonce is used
bool nonceUsed = evvm.getIfUsedAsyncNonce(userAddress, customNonce);

Token Management Verification

// Check if token is pending whitelist
address pendingToken = evvm.getWhitelistTokenToBeAdded();

// Get deadline for whitelist proposal
uint256 deadline = evvm.getWhitelistTokenToBeAddedDateToSet();