Overview
Returns important contract constants and configuration values from the FenineSystem contract. Useful for understanding network parameters without querying the contract directly.
Parameters
None
Response
FenineSystem contract address (always 0x0000000000000000000000000000000000001000)
Number of blocks per epoch (200)
Maximum number of active validators (101)
Minimum validator self-stake in wei (10,000 FEN = “10000000000000000000000”)
Minimum delegator stake in wei (1,000 FEN = “1000000000000000000000”)
Validator unstake lock period in blocks (50,000 ≈ 3.5 days)
Delegator unstake lock period in blocks (25,000 ≈ 1.75 days)
Default commission rate in basis points (500 = 5%)
Maximum commission rate in basis points (1000 = 10%)
Examples
curl -X POST https://rpc.fene.app \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "fenine_getContractConstants",
"params": [],
"id": 1
}'
Response Example
{
"jsonrpc" : "2.0" ,
"id" : 1 ,
"result" : {
"systemContractAddress" : "0x0000000000000000000000000000000000001000" ,
"blockEpoch" : 200 ,
"maxValidators" : 101 ,
"minValidatorStake" : "10000000000000000000000" ,
"minDelegatorStake" : "1000000000000000000000" ,
"validatorLockPeriod" : 50000 ,
"delegatorLockPeriod" : 25000 ,
"defaultCommission" : 500 ,
"maxCommission" : 1000
}
}
Use Cases
const constants = await web3 . getContractConstants ();
const currentBlock = await web3 . eth . getBlockNumber ();
const currentEpoch = Math . floor ( currentBlock / constants . blockEpoch );
const blocksUntilNextEpoch = constants . blockEpoch - ( currentBlock % constants . blockEpoch );
const estimatedSeconds = blocksUntilNextEpoch * 3 ; // 3s block time
console . log ( `Current epoch: ${ currentEpoch } ` );
console . log ( `Next epoch in ~ ${ Math . floor ( estimatedSeconds / 60 ) } minutes` );
const constants = await web3 . getContractConstants ();
const lockPeriodDays = ( constants . validatorLockPeriod * 3 ) / ( 60 * 60 * 24 );
console . log ( `Unstaking lock period: ~ ${ lockPeriodDays . toFixed ( 1 ) } days` );
Helper Functions
// Convert basis points to percentage
function bpsToPercent ( bps ) {
return bps / 100 ;
}
// Convert blocks to approximate time
function blocksToTime ( blocks , blockTime = 3 ) {
const seconds = blocks * blockTime ;
const days = seconds / ( 60 * 60 * 24 );
return {
seconds ,
minutes: seconds / 60 ,
hours: seconds / 3600 ,
days
};
}
// Usage
const constants = await web3 . getContractConstants ();
console . log ( 'Default commission:' , bpsToPercent ( constants . defaultCommission ), '%' );
console . log ( 'Lock period:' , blocksToTime ( constants . validatorLockPeriod ). days , 'days' );
fenine_getSystemContractAddress Get System Contract address
getCurrentEpoch Get current epoch number