BlockKeeperEpochProxyList.abi.json
Overview
This file defines the Application Binary Interface (ABI) for a smart contract module named BlockKeeperEpochProxyList. It specifies the contract’s version, functions, fields, and headers that control proxy management for epochs in a blockchain system. The contract maintains a dynamic list of proxies, supports ownership management, and handles lifecycle states such as closing and destruction. Its primary role is to maintain and update a proxy list mapped by unique keys, managing access and versioning of this critical data structure.
Fields
_pubkey (uint256, init: true)
The public key associated with the contract, initialized at deployment._timestamp (uint64)
Stores the timestamp of the last update or relevant event._constructorFlag (bool)
A flag to indicate if the constructor logic has been executed._code (map(uint8, cell))
Holds the contract code segments, indexed by an 8-bit unsigned integer._ProxyList (map(uint8, string))
The main proxy list mapping from an 8-bit index to a string identifier (likely network addresses or identifiers)._owner (optional(address))
Optionally holds the owner’s address of the contract._owner_pubkey (uint256, init: true)
The public key of the owner, initialized at deployment._root (address)
The root address associated with the contract, potentially for governance or hierarchical purposes.status (bool)
Boolean flag indicating the operational status of the contract._is_closed (bool)
Indicates if the contract is in a closed state, disallowing certain operations.
Functions
constructor(code, seqNoStart, ProxyList)
Purpose: Initializes the contract with provided code segments, a starting sequence number, and an initial proxy list.
Parameters:
code(map(uint8, cell)) – Contract code modules.seqNoStart (uint64) – Starting sequence number for versioning.
ProxyList(map(uint8, string)) – Initial proxy list.
Returns: None.
Usage: Called once during contract deployment to set up initial state.
setNewProxyList(seqNoStart, ProxyList)
Purpose: Replaces the current proxy list with a new one starting at a given sequence number.
Parameters:
seqNoStart (uint64) – Sequence number for the update.
ProxyList(map(uint8, string)) – New proxy list to set.
Returns: None.
Usage: Used to update the entire proxy list atomically.
toClose(seqNoStart)
Purpose: Marks the contract for closure starting from a given sequence number.
Parameters:
seqNoStart (uint64) – Sequence number indicating when closure begins.
Returns: None.
Usage: Transitions the contract into a closing state, potentially disabling updates.
destroy(seqNoStart)
Purpose: Permanently destroys the contract after a given sequence number.
Parameters:
seqNoStart (uint64) – Sequence number after which destruction is valid.
Returns: None.
Usage: Used to decommission the contract.
destroyPreEpoch(seqNoStart)
Purpose: Destroys the contract related to the pre-epoch phase.
Parameters:
seqNoStart (uint64) – Sequence number marking destruction eligibility.
Returns: None.
Usage: Specifically targets pre-epoch related contract destruction.
setOwner(owner)
Purpose: Sets or updates the owner of the contract.
Parameters:
owner(optional(address)) – The new owner’s address or none to clear ownership.
Returns: None.
Usage: Manages ownership rights and control.
addProxyList(data)
Purpose: Adds new entries to the existing proxy list.
Parameters:
data (map(uint8, string)) – Proxy entries to add.
Returns: None.
Usage: Incrementally expands the proxy list.
deleteProxyList(data)
Purpose: Deletes specified entries from the proxy list.
Parameters:
data (map(uint8, string)) – Proxy entries to remove.
Returns: None.
Usage: Removes proxies from the list.
iterateProxyList(data, member, is_add)
Purpose: Iteratively processes the proxy list, adding or removing entries based on
is_add.Parameters:
Returns: None.
Usage: Internal utility for managing proxy list changes.
getDetails()
Purpose: Retrieves current contract details.
Parameters: None.
Returns:
pubkey(uint256) – Contract’s public key.root(address) – Root address.ProxyList(map(uint8, string)) – Current proxy list.owner(optional(address)) – Current owner address.
Usage: Provides state snapshot for external callers.
getVersion()
Purpose: Returns the contract version information.
Parameters: None.
Returns:
value0(string) – First part of the version string.value1(string) – Second part of the version string.
Usage: Used for version tracking and compatibility checks.
Implementation Details
The contract uses a
map(uint8, string)data structure to store proxy entries, allowing efficient lookup and management by small integer keys.Versioning and lifecycle management are controlled via the seqNoStart parameter passed to state-changing functions such as
setNewProxyList,toClose, anddestroy.Ownership is managed optionally, allowing the contract to operate with or without a designated owner.
The
iterateProxyListfunction provides a generic mechanism to process additions or deletions by iterating over proxy map entries and applying changes dynamically.Contract lifecycle flags (
_constructorFlag,status,_is_closed) govern the operational state and prevent unauthorized or invalid state transitions.
Interactions with Other System Components
The
codefield, a map of code cells, suggests interaction with modular code components or upgradable contract code segments.Ownership and root address fields imply integration with higher-level governance or administrative contracts.
Proxy lists managed here likely coordinate with networking or consensus modules that require dynamic proxy configuration per epoch.
Sequence numbers (seqNoStart) facilitate synchronization with external epoch or block progression mechanisms.
Diagram: Contract Structure and Functionality
classDiagram
class BlockKeeperEpochProxyList {
+uint256 _pubkey
+uint64 _timestamp
+bool _constructorFlag
+map _code
+map _ProxyList
+optional _owner
+uint256 _owner_pubkey
+address _root
+bool status
+bool _is_closed
+constructor()
+setNewProxyList()
+toClose()
+destroy()
+destroyPreEpoch()
+setOwner()
+addProxyList()
+deleteProxyList()
+iterateProxyList()
+getDetails()
+getVersion()
}
The diagram illustrates the single contract class encapsulating state fields and the key functions that manipulate the proxy list, ownership, and lifecycle states.