Skip to main content

Overview

Fenines Network supports all standard Ethereum JSON-RPC methods. This page focuses on using eth_call to query the FenineSystem smart contract.
For complete Ethereum JSON-RPC documentation, see the Ethereum JSON-RPC Specification.

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.
selector
string
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
  }'
result
bytes
ABI-encoded array of validator addresses. Decode as address[].

getValidatorInfo(address)

Get detailed information about a specific validator.
selector
string
0xb5d89627
validator
address
required
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
  }'
result
tuple
Returns:

getValidatorStakers(address)

Get the list of delegators staked to a validator (in proximity order).
selector
string
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);
result
address[]
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.
selector
string
0xa993683f
# 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
  }'
result
tuple

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'));
result
tuple
pending
uint256
Raw pending rewards before any deductions
afterProximity
uint256
Rewards after proximity distribution (may include bonus)
afterTax
uint256
Final amount delegator will receive after tax

Network State Queries

totalNetworkStake()

Get the total amount of FEN staked across all validators.
selector
string
0x635c8637
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
  }'
result
uint256
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 + '%'));
result
tuple
totalBps
uint16
Total proximity allocation in basis points (e.g., 3000 = 30%)
depth
uint8
Number of proximity levels (8)
rewardBps
uint16[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());

Function Selectors Reference

FunctionSelectorParameters
getActiveValidators()0x9de70258None
getValidatorInfo(address)0xb5d89627address
getDelegatorInfo(address,address)0xa993683faddress, address
totalNetworkStake()0x635c8637None
getCurrentEpoch()-None
getProximityConfig()-None
For a complete list of function selectors, see the Quick Reference page.

Next Steps

Smart Contract Reference

Full FenineSystem contract documentation

Quick Reference

Common queries and selectors