fenine_getSystemContractABI
curl --request GET \
--url https://api.example.com/fenine_getSystemContractABIimport requests
url = "https://api.example.com/fenine_getSystemContractABI"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/fenine_getSystemContractABI', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/fenine_getSystemContractABI",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/fenine_getSystemContractABI"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/fenine_getSystemContractABI")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/fenine_getSystemContractABI")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"result": "<string>"
}fenine_* Methods
fenine_getSystemContractABI
Get the ABI of FenineSystem contract
GET
fenine_getSystemContractABI
fenine_getSystemContractABI
curl --request GET \
--url https://api.example.com/fenine_getSystemContractABIimport requests
url = "https://api.example.com/fenine_getSystemContractABI"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/fenine_getSystemContractABI', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/fenine_getSystemContractABI",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/fenine_getSystemContractABI"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/fenine_getSystemContractABI")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/fenine_getSystemContractABI")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"result": "<string>"
}Overview
Returns the complete ABI (Application Binary Interface) of the FenineSystem contract. Use this to create contract instances in your Web3 library.Parameters
NoneResponse
string
JSON string containing the complete contract ABI
Examples
curl -X POST https://rpc.fene.app \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "fenine_getSystemContractABI",
"params": [],
"id": 1
}'
const Web3 = require('web3');
const web3 = new Web3('https://rpc.fene.app');
// Get ABI
web3.extend({
methods: [{
name: 'getSystemContractABI',
call: 'fenine_getSystemContractABI',
params: 0
}]
});
const abiJson = await web3.getSystemContractABI();
const abi = JSON.parse(abiJson);
// Create contract instance
const systemContract = new web3.eth.Contract(
abi,
'0x0000000000000000000000000000000000001000'
);
// Use it
const validators = await systemContract.methods.getActiveValidators().call();
console.log('Active validators:', validators);
const { ethers } = require('ethers');
const provider = new ethers.JsonRpcProvider('https://rpc.fene.app');
// Get ABI
const abiJson = await provider.send('fenine_getSystemContractABI', []);
const abi = JSON.parse(abiJson);
// Create contract instance
const systemContract = new ethers.Contract(
'0x0000000000000000000000000000000000001000',
abi,
provider
);
// Use it
const validators = await systemContract.getActiveValidators();
console.log('Active validators:', validators);
Usage Pattern
1
Get ABI Once
Fetch the ABI once and cache it in your application
const abi = JSON.parse(await provider.send('fenine_getSystemContractABI', []));
2
Create Contract Instance
Use the ABI to create a contract instance
const contract = new web3.eth.Contract(abi, SYSTEM_CONTRACT_ADDRESS);
3
Call Contract Methods
Now you can call any contract method
const info = await contract.methods.getValidatorInfo(address).call();
Best Practices
Cache the ABI
Cache the ABI
The ABI is static and won’t change. Fetch it once during initialization and cache it.
// Bad: Fetching every time
async function getValidators() {
const abi = JSON.parse(await web3.getSystemContractABI());
const contract = new web3.eth.Contract(abi, address);
return await contract.methods.getActiveValidators().call();
}
// Good: Cache and reuse
const ABI_CACHE = JSON.parse(await web3.getSystemContractABI());
const systemContract = new web3.eth.Contract(ABI_CACHE, address);
async function getValidators() {
return await systemContract.methods.getActiveValidators().call();
}
Version in Production
Version in Production
In production, consider hardcoding the ABI or loading from a file to avoid RPC calls.
This ABI includes all functions: user functions (stake, claim), view functions (getValidatorInfo), and admin functions. Your wallet will only be able to call functions you have permission for.
Related Methods
fenine_getNFTPassportABI
Get NFT Passport contract ABI
fenine_getTaxManagerABI
Get Tax Manager contract ABI
fenine_getSystemContractAddress
Get System Contract address