Overview
Fenines Network supports all standard Ethereum JSON-RPC methods. This page focuses on using eth_call to query the FenineSystem smart contract.
System Contract Queries
The FenineSystem contract at 0x0000000000000000000000000000000000001000 exposes view functions that can be queried using eth_call.
Query Pattern
All queries follow this pattern:
curl -X POST https://rpc.fene.app \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_call",
"params": [{
"to": "0x0000000000000000000000000000000000001000",
"data": "<FUNCTION_SELECTOR><ENCODED_PARAMS>"
}, "latest"],
"id": 1
}'
Validator Queries
getActiveValidators()
Get the list of currently active validators.
Function selector: 0x9de70258 (no parameters)
curl -X POST https://rpc.fene.app \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_call",
"params": [{
"to": "0x0000000000000000000000000000000000001000",
"data": "0x9de70258"
}, "latest"],
"id": 1
}'
ABI-encoded array of validator addresses. Decode as address[].
getValidatorInfo(address)
Get detailed information about a specific validator.
Validator address (32-byte padded)
# Replace <VALIDATOR_ADDRESS> with actual address (without 0x)
curl -X POST https://rpc.fene.app \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_call",
"params": [{
"to": "0x0000000000000000000000000000000000001000",
"data": "0xb5d89627000000000000000000000000<VALIDATOR_ADDRESS>"
}, "latest"],
"id": 1
}'
Returns:
0: NOT_EXIST
1: CREATED (registered)
2: STAKED
3: VALIDATED (active)
4: UNSTAKED
Validator’s self-stake amount in wei
Total stake (self + delegated) in wei
Commission rate in basis points (e.g., 500 = 5%)
Pending rewards available to claim in wei
Number of delegators staked to this validator
getValidatorStakers(address)
Get the list of delegators staked to a validator (in proximity order).
Function selector for getValidatorStakers(address)
const validatorAddress = '0x1234567890123456789012345678901234567890';
const data = web3.eth.abi.encodeFunctionCall({
name: 'getValidatorStakers',
type: 'function',
inputs: [{ type: 'address', name: 'vaAddr' }]
}, [validatorAddress]);
const result = await web3.eth.call({
to: '0x0000000000000000000000000000000000001000',
data: data
}, 'latest');
const stakers = web3.eth.abi.decodeParameter('address[]', result);
console.log('Delegators (proximity order):', stakers);
Array of delegator addresses in proximity order (first staker = deepest in chain)
The order matters for proximity rewards. Earlier addresses in the array are deeper in the referral chain.
Delegator Queries
getDelegatorInfo(address delegator, address validator)
Get information about a delegator’s stake with a specific validator.
# Replace addresses (without 0x)
curl -X POST https://rpc.fene.app \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_call",
"params": [{
"to": "0x0000000000000000000000000000000000001000",
"data": "0xa993683f000000000000000000000000<DELEGATOR_ADDRESS>000000000000000000000000<VALIDATOR_ADDRESS>"
}, "latest"],
"id": 1
}'
0: NOT_EXIST
1: ACTIVE
2: UNSTAKING
Delegator’s stake amount in wei
Accumulated pending rewards in wei
Block number when delegator first staked
Position in proximity chain (0-based)
getEstimatedDelegatorReward(address delegator, address validator)
Calculate estimated rewards for a delegator (including proximity and tax effects).
const data = web3.eth.abi.encodeFunctionCall({
name: 'getEstimatedDelegatorReward',
type: 'function',
inputs: [
{ type: 'address', name: 'dcAddr' },
{ type: 'address', name: 'vaAddr' }
]
}, [delegatorAddress, validatorAddress]);
const result = await web3.eth.call({
to: '0x0000000000000000000000000000000000001000',
data: data
}, 'latest');
const [pending, afterProximity, afterTax] = web3.eth.abi.decodeParameters([
'uint256',
'uint256',
'uint256'
], result);
console.log('Pending rewards:', web3.utils.fromWei(pending, 'ether'));
console.log('After proximity:', web3.utils.fromWei(afterProximity, 'ether'));
console.log('After tax:', web3.utils.fromWei(afterTax, 'ether'));
Raw pending rewards before any deductions
Rewards after proximity distribution (may include bonus)
Final amount delegator will receive after tax
Network State Queries
totalNetworkStake()
Get the total amount of FEN staked across all validators.
curl -X POST https://rpc.fene.app \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_call",
"params": [{
"to": "0x0000000000000000000000000000000000001000",
"data": "0x635c8637"
}, "latest"],
"id": 1
}'
Total staked amount in wei
getCurrentEpoch()
Get the current epoch number.
const data = web3.eth.abi.encodeFunctionSignature('getCurrentEpoch()');
const result = await web3.eth.call({
to: '0x0000000000000000000000000000000000001000',
data: data
}, 'latest');
const epoch = web3.eth.abi.decodeParameter('uint256', result);
console.log('Current epoch:', epoch);
getNextEpochReward()
Get the contract balance (reward pool for next epoch distribution).
const balance = await web3.eth.getBalance(
'0x0000000000000000000000000000000000001000'
);
console.log('Next epoch reward pool:', web3.utils.fromWei(balance, 'ether'), 'FEN');
You can also query this via the contract’s getNextEpochReward() view function.
Proximity Configuration
getProximityConfig()
Get the current proximity reward distribution configuration.
const data = web3.eth.abi.encodeFunctionSignature('getProximityConfig()');
const result = await web3.eth.call({
to: '0x0000000000000000000000000000000000001000',
data: data
}, 'latest');
const [totalBps, depth, rewardBps] = web3.eth.abi.decodeParameters([
'uint16',
'uint8',
'uint16[8]'
], result);
console.log('Total proximity allocation:', totalBps / 100, '%');
console.log('Depth levels:', depth);
console.log('Per-level BPS:', rewardBps.map(bps => bps / 100 + '%'));
Total proximity allocation in basis points (e.g., 3000 = 30%)
Number of proximity levels (8)
Per-level distribution in basis points
Using Web3 Libraries
const { ethers } = require('ethers');
const provider = new ethers.JsonRpcProvider('https://rpc.fene.app');
// Get ABI (once)
const abiResponse = await provider.send('fenine_getSystemContractABI', []);
const abi = JSON.parse(abiResponse);
// Create contract instance
const systemContract = new ethers.Contract(
'0x0000000000000000000000000000000000001000',
abi,
provider
);
// Query methods
const validators = await systemContract.getActiveValidators();
const totalStake = await systemContract.totalNetworkStake();
const epoch = await systemContract.getCurrentEpoch();
console.log('Active validators:', validators.length);
console.log('Total stake:', ethers.formatEther(totalStake), 'FEN');
console.log('Current epoch:', epoch.toString());
import { createPublicClient, http } from 'viem';
import { fenineNetwork } from './chains'; // Define your chain
const client = createPublicClient({
chain: fenineNetwork,
transport: http('https://rpc.fene.app')
});
// Read from contract
const validators = await client.readContract({
address: '0x0000000000000000000000000000000000001000',
abi: systemContractABI,
functionName: 'getActiveValidators'
});
const totalStake = await client.readContract({
address: '0x0000000000000000000000000000000000001000',
abi: systemContractABI,
functionName: 'totalNetworkStake'
});
Function Selectors Reference
| Function | Selector | Parameters |
|---|
getActiveValidators() | 0x9de70258 | None |
getValidatorInfo(address) | 0xb5d89627 | address |
getDelegatorInfo(address,address) | 0xa993683f | address, address |
totalNetworkStake() | 0x635c8637 | None |
getCurrentEpoch() | - | None |
getProximityConfig() | - | None |
Next Steps
Smart Contract Reference
Full FenineSystem contract documentation
Quick Reference
Common queries and selectors