BlockKeeperCoolerContract.abi.json

Overview

This file defines the Application Binary Interface (ABI) version 2.4 for the BlockKeeperCoolerContract, a smart contract designed to manage staking-related operations, licensing, and node reputation within a blockchain network. The contract exposes functions for initialization (constructor), state updates (touch), punitive actions (slash), and retrieval of contract-specific details (getDetails and getVersion). It maintains persistent state fields related to public keys, ownership, licensing, staking, and sequence numbers.

Structure and Key Components

ABI Metadata

Persistent Fields

These fields represent the contract's internal state and some are initialized during construction (init: true):

Field Name

Type

Initialized

Description

_pubkey

uint256

Yes

Public key associated with the contract.

_timestamp

uint64

No

Last timestamp recorded in the contract.

_constructorFlag

bool

No

Indicates if constructor actions are done.

_owner_pubkey

uint256

Yes

Public key of the contract owner.

_root

address

No

Root address linked to the contract.

_seqNoStart

uint64

Yes

Starting sequence number in the contract lifecycle.

_seqNoFinish

uint64

No

Ending sequence number of a particular contract state.

_owner

address

No

Owner address of the contract instance.

_stake

uint128

No

Stake amount held by the contract owner.

_signerIndex

uint16

No

Index identifier for the signer.

_licenses

tuple[]

No

List of license tuples with num and stake fields.

Functions

constructor

Parameter

Type

Description

waitStep

uint64

Waiting period step for staking or other timing logic.

owner

address

Address of the contract owner.

root

address

Root address associated with the contract.

signerIndex

uint16

Index of the signer within a signer list.

licenses

tuple[]

Array of licenses, each with num (uint256) and stake (uint128).

stake

uint128

Initial stake amount.

isContinue

bool

Flag indicating if continuation parameters apply.

stakeContinue

uint128

Stake amount to continue from previous state.

epochDurationContinue

uint64

Duration for the epoch continuation.

waitStepContinue

uint64

Wait step for continuation.

bls_pubkeyContinue

bytes

BLS public key for continuing the contract.

signerIndexContinue

uint16

Signer index for continued state.

licensesContinue

tuple[]

Licenses array for continuation.

virtualStakeContinue

optional(uint128)

Optional virtual stake for continued state.

reward_sum_continue

uint128

Sum of rewards to continue from previous state.

myIp

string

IP address of the node.

unixtimeStart

uint32

Unix timestamp marking contract start.

sumReputationCoefContinue

uint128

Sum of reputation coefficients for continuation.

nodeVersionContinue

optional(string)

Optional node version string.

slash_type

optional(uint8)

Optional slash type for penalization.

constructor(
  waitStep,
  owner,
  root,
  signerIndex,
  licenses,
  stake,
  isContinue,
  stakeContinue,
  epochDurationContinue,
  waitStepContinue,
  bls_pubkeyContinue,
  signerIndexContinue,
  licensesContinue,
  virtualStakeContinue,
  reward_sum_continue,
  myIp,
  unixtimeStart,
  sumReputationCoefContinue,
  nodeVersionContinue,
  slash_type
);

slash

Parameter

Type

Description

slash_type

uint8

Type of slash to apply.

isFromEpoch

bool

Indicates if the slash is epoch-based.

slash(slash_type, isFromEpoch);

touch

touch();

getDetails

Output Name

Type

Description

pubkey

uint256

Public key associated with the contract.

root

address

Root address linked to the contract.

seqNoStart

uint64

Sequence number at the start of the contract's lifecycle.

seqNoFinish

uint64

Sequence number at the finish point.

owner

address

Address of the current owner.

signerIndex

uint16

Index of the signer.

NACKLBalance

varuint32

Balance of the NACKL token or relevant staking balance.

(pubkey, root, seqNoStart, seqNoFinish, owner, signerIndex, NACKLBalance) = getDetails();

getVersion

Output Name

Type

Description

value0

string

Primary version string.

value1

string

Secondary version string or build metadata.

(value0, value1) = getVersion();

Implementation Details and Algorithms

Interactions with Other System Components

Diagram: Contract Structure and Function Relationships

flowchart TD
constructor -->|initializes| _pubkey
constructor --> _owner_pubkey
constructor --> _licenses
constructor --> _stake
constructor --> _seqNoStart
constructor --> other_fields
slash -->|penalizes| _stake
slash -->|updates| _constructorFlag
touch -->|updates| _timestamp
getDetails -->|reads| _pubkey
getDetails --> _root
getDetails --> _seqNoStart
getDetails --> _seqNoFinish
getDetails --> _owner
getDetails --> _signerIndex
getDetails --> NACKLBalance
getVersion -->|returns| version_strings
subgraph Persistent Fields
_pubkey
_timestamp
_constructorFlag
_owner_pubkey
_root
_seqNoStart
_seqNoFinish
_owner
_stake
_signerIndex
_licenses
end

This flowchart illustrates the initialization of persistent fields via the constructor, the state updates triggered by slash and touch, and data retrieval by getDetails and getVersion. It highlights the flow of contract state changes and data queries.


For further reference on data types and smart contract design patterns, see Smart Contract Data Types and Contract Upgrade Patterns. For understanding slashing mechanisms in blockchain networks, refer to Slashing and Punishment Mechanisms.