SignerIndex.abi.json
Overview
This file defines the Application Binary Interface (ABI) for the SignerIndex smart contract, version 2.4, using ABI version 2. The contract manages signer indices related to blockchain validators or nodes. It includes functions for initializing the contract, validating signer acceptance criteria, continuing acceptance checks, querying readiness status, and retrieving version information. The contract maintains several internal fields representing keys, timestamps, state flags, and addresses relevant to signer management.
The ABI describes the contract interface, including function signatures, input/output parameters, and persistent storage fields, providing a blueprint for interaction with the contract on the blockchain.
ABI Structure and Components
Header
The
headersection specifies three standard fields included in all external inbound messages to the contract:pubkey: Public key used to verify message signatures.time: Timestamp of the message.expire: Expiration time of the message.
Fields
The contract maintains the following fields, some initialized at deployment (init: true), others updated during the contract lifecycle:
Field Name | Type | Initialized | Description |
|---|---|---|---|
|
| Yes | Public key associated with signer index. |
|
| No | Last updated timestamp. |
| No | Flag indicating if constructor logic was executed. | |
|
| Yes | Numeric index of the signer. |
|
| Yes | Address of the root contract or controller. |
|
| No | Wallet address linked to signer. |
|
| No | Readiness status of the signer index. |
Functions
constructor
{
"name": "constructor",
"inputs": [{"name":"wallet","type":"address"}],
"outputs": []
}
Purpose: Initializes the contract with the given wallet address.
Parameters:
wallet(address): The wallet address to associate with this signer index.
Returns: None.
Usage: Called once during contract deployment to set the wallet.
isSignerIndexAccept
{
"name": "isSignerIndexAccept",
"inputs": [
{"name":"wallet","type":"address"},
{"name":"blsKey","type":"bytes"},
{"name":"pubkey","type":"uint256"},
{"name":"rep_coef","type":"uint128"},
{"name":"stake","type":"uint128"},
{"name":"virtualStake","type":"optional(uint128)"},
{"name":"ProxyList","type":"map(uint8,string)"},
{"name":"myIp","type":"string"},
{"name":"nodeVersion","type":"optional(string)"}
],
"outputs": []
}
Purpose: Performs initial acceptance checks to determine if a signer index is acceptable based on various criteria.
Parameters:
wallet(address): Wallet address of the signer candidate.blsKey(bytes): BLS public key bytes for cryptographic verification.pubkey(uint256): Public key identifier.rep_coef(uint128): Reputation coefficient of the signer.stake(uint128): Stake amount held by the signer.virtualStake(optional(uint128)): Optional virtual stake, if any.ProxyList(map(uint8,string)): Mapping of proxy identifiers to strings, representing allowed proxies or delegations.myIp(string): IP address of the signer node.nodeVersion(optional(string)): Optional version string of the node software.
Returns: None.
Usage: Used to validate signer eligibility during registration or update procedures.
isSignerIndexAcceptContinue
{
"name": "isSignerIndexAcceptContinue",
"inputs": [
{"name":"wallet","type":"address"},
{"name":"blsKey","type":"bytes"},
{"name":"pubkey","type":"uint256"},
{"name":"seqNoStartOld","type":"uint64"},
{"name":"stake","type":"uint128"},
{"name":"virtualStake","type":"optional(uint128)"},
{"name":"ProxyList","type":"map(uint8,string)"},
{"name":"sumReputationCoef","type":"uint128"},
{"name":"nodeVersion","type":"optional(string)"}
],
"outputs": []
}
Purpose: Continues or extends the acceptance verification process for a signer index, possibly for updates or revalidation.
Parameters:
wallet(address): Wallet address of the signer candidate.blsKey(bytes): BLS public key bytes.pubkey(uint256): Public key identifier.seqNoStartOld(uint64): Sequence number indicating the starting point for old data or state.stake(uint128): Stake amount.virtualStake(optional(uint128)): Optional virtual stake.ProxyList(map(uint8,string)): Proxy mappings.sumReputationCoef(uint128): Aggregate reputation coefficient.nodeVersion(optional(string)): Optional node version.
Returns: None.
Usage: Used to continue complex acceptance workflows that depend on historical or accumulated data.
destroy
{
"name": "destroy",
"inputs": [],
"outputs": []
}
Purpose: Destroys the contract instance, releasing resources or invalidating the signer index.
Parameters: None.
Returns: None.
Usage: Invoked to clean up or remove the signer index contract.
getReadyStatus
{
"name": "getReadyStatus",
"inputs": [],
"outputs": [{"name":"ready","type":"bool"}]
}
Purpose: Retrieves the readiness status of the signer index.
Parameters: None.
Returns:
ready(bool): Boolean indicating if the signer index is ready.
Usage: Called to check if the signer index is fully initialized and operational.
getVersion
{
"name": "getVersion",
"inputs": [],
"outputs": [
{"name":"value0","type":"string"},
{"name":"value1","type":"string"}
]
}
Purpose: Returns version information about the contract.
Parameters: None.
Returns:
value0(string): Primary version string.value1(string): Secondary version or build metadata.
Usage: Used for compatibility checks and diagnostics.
Important Implementation Details
The contract uses a set of fields initialized during deployment (
_pubkey,_signerIndex,_root) and updated over time (_wallet,_ready,_timestamp, etc.).Optional types (
optional(uint128),optional(string)) indicate parameters that may or may not be present, accommodating flexible input.The
ProxyListparameter is a map from an 8-bit unsigned integer to a string, likely representing a list of proxy identifiers and their associated metadata or addresses.Functions
isSignerIndexAcceptandisSignerIndexAcceptContinuelikely implement multi-step validation algorithms to ensure that only valid signers with appropriate reputation and stake are accepted into the network.The contract maintains a readiness flag (
_ready) to indicate operational status, which can be queried usinggetReadyStatus.The
destroyfunction allows for contract self-destruction, which is important for lifecycle management and resource cleanup.The version strings provided by
getVersionassist in ensuring that interactions with this contract are compatible with client software expectations.
Interactions with Other System Components
The
_rootfield suggests a hierarchical relationship with a root or controller contract, possibly for governance or coordination.The wallet address (
_wallet) links this signer index to a user's or node's wallet, enabling identity and ownership tracking.The BLS key and public key parameters relate to cryptographic validation mechanisms, referenced in Cryptographic Primitives.
The proxy list supports delegation models or proxy voting as described in Delegation Mechanisms.
Versioning and readiness status may be used by monitoring tools or management services to track network health and signer participation, relevant to Network Monitoring.
Visual Diagram
flowchart TD
A["constructor(wallet)"] --> B["isSignerIndexAccept(...)"]
B --> C["isSignerIndexAcceptContinue(...)"]
C --> D["getReadyStatus()"]
D --> E["getVersion()"]
B --> F["destroy()"]
C --> F
style A fill:#f9f,stroke:#333,stroke-width:1px
style B fill:#bbf,stroke:#333,stroke-width:1px
style C fill:#bbf,stroke:#333,stroke-width:1px
style D fill:#bfb,stroke:#333,stroke-width:1px
style E fill:#bfb,stroke:#333,stroke-width:1px
style F fill:#f88,stroke:#333,stroke-width:1px
The diagram illustrates the main functions and their typical call relationships within the contract lifecycle: starting with the constructor, proceeding through acceptance checks, querying status and version, and optionally destruction.