AckiNackiBlockKeeperNodeWallet.abi.json

Overview

This file defines the Application Binary Interface (ABI) for the AckiNackiBlockKeeperNodeWallet contract. It specifies the contract's version, initialization parameters, internal state fields, and the complete set of callable functions with their input and output types. The contract serves as a wallet and stake manager for nodes participating in a block-keeping system that involves licensing, staking, and epoch management. The wallet manages licenses, stakes, slashing, and interactions with other contracts such as BlockKeeperEpoch and BlockKeeperPreEpoch.

Functionality includes license management (adding, removing, locking), stake operations (setting, updating, withdrawing), slashing penalties, deployment of epoch-related contracts, and communication with proxy lists. The wallet also holds details about the node's public keys, balances, and epoch-related parameters.

ABI Structure and Components

ABI Metadata

Fields (Contract State Variables)

Field Name

Type

Init Value

Description

_pubkey

uint256

Yes

Public key of the wallet owner.

_timestamp

uint64

No

Last timestamp recorded in the contract.

_constructorFlag

bool

No

Flag indicating if constructor has run.

_code

map(uint8, cell)

No

Mapping of codes for different contract components.

_owner_pubkey

uint256

Yes

Owner's public key for signing.

_root

address

No

Root address, likely for license or stake management.

_activeStakes

map(uint256, tuple)

No

Active stakes with details like amount, sequence, status.

_stakesCnt

uint8

No

Count of active stakes.

_isContinue

bool

No

Flag to indicate continuation state of stake.

_licenses

map(uint256, tuple)

No

License details including reputation, balance, locks.

_licenses_count

uint128

No

Number of licenses managed.

_epochDuration

uint128

No

Duration of an epoch in the staking system.

_freeLicense

uint32

No

Number of free licenses available.

_isWaitStake

bool

No

Flag indicating if waiting for stake acceptance.

_balance

uint128

No

Wallet balance in tokens.

_whiteListLicense

map(uint256, bool)

No

Mapping of licenses allowed on whitelist.

_licenseRoot

address

No

License root address controlling license state.

_isSlashing

bool

No

Flag indicating if slashing is currently active.

_walletLastTouch

uint64

No

Last time wallet was interacted with.

_signing_pubkey

uint256

No

Public key used for signing operations.

_walletTouch

uint8

No

Counter or flag for wallet interaction tracking.

Functions

The contract exposes numerous functions for managing node wallets, licenses, stakes, and related operations. The functions are listed below with detailed descriptions.


constructor


setSigningPubkey


setLockToStake / setLockToStakeByWallet


removeLicense / deleteLicense


setLicenseWhiteList


addLicense


addBalance


setLockStake / deleteLockStake / updateLockStake


slash / slashCooler / slashStake


withdrawToken / withdrawWalletToken


resetWallet


getDetails


getEpochAddress / getSumBalanceForStake / getProxyListAddr / getProxyListCodeHash / getProxyListCode / getVersion


stakeNotAccepted / stakeNotAcceptedContinue / tryCooler / sendBlockKeeperRequestWithStake / sendBlockKeeperRequestWithCancelStakeContinue / cancelContinueStake / sendBlockKeeperRequestWithStakeContinue / deployPreEpochContract / deployBlockKeeperContractContinue / continueStakeNotAccept / continueStakeAccept / deployBlockKeeperContractContinueAfterDestroy / updateLockStakeCooler / unlockStakeCooler


Important Implementation Details

Interactions With Other System Components

Visual Diagram

classDiagram
class AckiNackiBlockKeeperNodeWallet {
-_pubkey: uint256
-_owner_pubkey: uint256
-_root: address
-_activeStakes: map(uint256, tuple)
-_licenses: map(uint256, tuple)
-_epochDuration: uint128
-_balance: uint128
-_whiteListLicense: map(uint256, bool)
+constructor()
+setSigningPubkey()
+addLicense()
+removeLicense()
+setLockToStake()
+setLockStake()
+deleteLockStake()
+updateLockStake()
+slash()
+withdrawToken()
+getDetails()
+getEpochAddress()
+deployPreEpochContract()
+deployBlockKeeperContractContinue()
}
AckiNackiBlockKeeperNodeWallet --> BlockKeeperPreEpochCode
AckiNackiBlockKeeperNodeWallet --> BlockKeeperEpochCode
AckiNackiBlockKeeperNodeWallet --> BlockKeeperEpochCoolerCode
AckiNackiBlockKeeperNodeWallet --> BlockKeeperEpochProxyListCode
AckiNackiBlockKeeperNodeWallet --> LicenseRoot

The diagram depicts the core contract with its fields and key functions, along with its dependencies on other contract codes and license root addresses.


Usage Examples

Adding a License

To add a license to the wallet:

{
  "function": "addLicense",
  "inputs": {
    "license_number": 123456,
    "reputationTime": 1627847284,
    "last_touch": 1627847284,
    "isPrivileged": true
  }
}

This registers a new license with given reputation and timestamp.


Setting a Lock on a License for Staking

To lock a license from staking:

{
  "function": "setLockToStake",
  "inputs": {
    "license_number": 123456,
    "lock": true
  }
}

This prevents the license from participating in staking until unlocked.


Deploying a Pre-Epoch Contract

To deploy a pre-epoch contract with specified parameters:

{
  "function": "deployPreEpochContract",
  "inputs": {
    "epochDuration": 86400,
    "walletTouch": 1,
    "epochCliff": 3600,
    "waitStep": 300,
    "bls_pubkey": "0x...",
    "signerIndex": 0,
    "rep_coef": 1000000,
    "virtualStake": null,
    "ProxyList": {"1": "proxy1.example.com"},
    "reward_sum": 10000,
    "myIp": "192.168.0.1",
    "nodeVersion": "v2.4"
  }
}

This initiates the pre-epoch phase for staking.


Querying Wallet Details

To get a full snapshot of wallet and stake details:

{
  "function": "getDetails",
  "inputs": {}
}

Returns all key wallet data including licenses, active stakes, balances, and epoch parameters.


This contract ABI and structure form an integral part of the node's wallet and staking management system, enabling secure, verifiable, and flexible control over node participation in block keeping and epoch progression.

For related concepts, see Epoch Management, Stake Management, and License Handling.