BlockKeeperEpochProxyList.sol

Overview

BlockKeeperEpochProxyList.sol is a smart contract designed to manage and update a list of proxy nodes within an epoch in a blockchain-based system. Its primary function is to maintain the _ProxyList mapping, which holds proxy node identifiers keyed by uint8 indices. This contract ensures integrity and control over proxy list modifications, including additions and deletions, via owner permissions and inter-contract communication with epoch-related contracts.

The contract also enforces strict validation of code versions and addresses upon construction to prevent unauthorized deployment or interaction. It supports lifecycle operations such as closing the proxy list for further modifications and self-destruction triggered by authorized epoch contracts.


Contract: BlockKeeperEpochProxyList

Version

State Variables

Variable

Type

Description

_code

mapping(uint8 => TvmCell)

Stores TvmCell code snippets indexed by code identifiers.

_ProxyList

mapping(uint8 => string)

The main proxy list, mapping proxy IDs to their string values.

_owner

optional(address)

Optional owner address for privileged modifications.

_owner_pubkey

uint256 static

Static public key used to verify ownership.

_root

address

Root contract address, used for self-destruct and validations.

status

bool

Indicates if a proxy list modification operation is in progress.

_is_closed

bool

Flag to mark the proxy list as closed for further changes.


Constructor

constructor (
    mapping(uint8 => TvmCell) code,
    uint64 seqNoStart,
    mapping(uint8 => string) ProxyList
) accept

Public Methods

setNewProxyList

function setNewProxyList(uint64 seqNoStart, mapping(uint8 => string) ProxyList) public senderIs(...) accept

toClose

function toClose(uint64 seqNoStart) public senderIs(...) accept

destroy

function destroy(uint64 seqNoStart) public senderIs(...) accept

destroyPreEpoch

function destroyPreEpoch(uint64 seqNoStart) public senderIs(...) accept

setOwner

function setOwner(optional(address) owner) public onlyOwnerWallet(_owner, _owner_pubkey) accept

addProxyList

function addProxyList(mapping(uint8 => string) data) public onlyOwnerWallet(_owner, _owner_pubkey) accept

deleteProxyList

function deleteProxyList(mapping(uint8 => string) data) public onlyOwnerWallet(_owner, _owner_pubkey) accept

iterateProxyList

function iterateProxyList(mapping(uint8 => string) data, optional(uint8, string) member, bool is_add) public senderIs(address(this)) accept

ensureBalance

function ensureBalance() private pure

Fallback / Receive

receive() external

Getters

getDetails

function getDetails() external view returns(
    uint256 pubkey,
    address root,
    mapping(uint8 => string) ProxyList,
    optional(address) owner
)

getVersion

function getVersion() external pure returns(string, string)

Important Implementation Details


Interaction with Other Contracts


Visual Diagram: Class Structure of BlockKeeperEpochProxyList

classDiagram
class BlockKeeperEpochProxyList {
+string version
-mapping(uint8, TvmCell) _code
-mapping(uint8, string) _ProxyList
-optional(address) _owner
-uint256 _owner_pubkey
-address _root
-bool status
-bool _is_closed
+constructor(mapping, uint64, mapping)
+setNewProxyList(uint64, mapping)
+toClose(uint64)
+destroy(uint64)
+destroyPreEpoch(uint64)
+setOwner(optional(address))
+addProxyList(mapping)
+deleteProxyList(mapping)
+iterateProxyList(mapping, optional(uint8, string), bool)
+getDetails() returns (uint256, address, mapping, optional(address))
+getVersion() returns (string, string)
}

This diagram illustrates the contract’s core properties and its public methods, highlighting the state variables managing proxies and ownership, as well as its lifecycle and proxy list manipulation capabilities.