AckiNackiBlockManagerNodeWallet.abi.json
Overview
This file defines the Application Binary Interface (ABI) for the AckiNackiBlockManagerNodeWallet smart contract. It outlines the contract's interface including its public functions, state fields, and their types, as well as the versioning and header information. The ABI version 2 and semantic version 2.4 indicate the contract's compliance with specific runtime and interface standards.
The contract is designed to manage licenses, rewards, slashing (penalties), and wallet interactions within a block manager node ecosystem. It includes mechanisms for license addition and removal, reward distribution, slashing enforcement, and wallet token withdrawal. The contract maintains several state variables to track its operational status, time-related controls, and cryptographic keys for signing and ownership.
Detailed Description of Functions
constructor
Purpose: Initializes the contract with essential parameters such as license code, whitelist of licenses, root address, timing parameters, signing public key, and wallet touch configuration.
Inputs:
LicenseBMCode (cell): The license block manager code in serialized cell form.
whiteListLicense(map(uint256,bool)): A mapping of license numbers to boolean flags indicating their whitelist status.licenseBMRoot(address): The root address associated with license block management.start_time(uint32): The start timestamp for contract operation.waitStep(uint64): A timing parameter controlling waiting periods in the contract's operation.signing_pubkey(uint256): Public key used for signing operations.walletTouch(uint8): Configuration parameter related to wallet interaction frequency or threshold.
Outputs: None
Usage Example: Used once during contract deployment to set initial parameters.
removeLicense
Purpose: Removes a license from the contract's whitelist or active license list.
Inputs:
license_number (uint256): The identifier of the license to be removed.
Outputs: None
Usage Example: Called when a license is revoked or no longer valid.
setSigningPubkey
Purpose: Updates the signing public key used by the contract.
Inputs:
pubkey(uint256): New public key for signing.
Outputs: None
Usage Example: Used for rotating or updating cryptographic keys.
setLicenseWhiteList
Purpose: Sets or replaces the whitelist of licenses.
Inputs:
whiteListLicense(map(uint256,bool)): New license whitelist mapping.
Outputs: None
Usage Example: Batch update of licenses allowed to interact or operate.
addLicense
Purpose: Adds a new license along with associated reward and penalty values.
Inputs:
license_number (uint256): License identifier.
reward(uint128): Reward amount attached to the license.slashSum(uint128): Penalty amount associated with the license.
Outputs: None
Usage Example: Registering a new license with financial parameters.
slash
Purpose: Enforces slashing (penalty) on the contract or a license.
Inputs: None
Outputs: None
Usage Example: Called when misbehavior is detected requiring penalization.
noRewards
Purpose: Indicates that no rewards are available or to reset reward state.
Inputs: None
Outputs: None
Usage Example: Resetting or signaling zero reward state.
withdrawToken
Purpose: Withdraws tokens from the contract to a specified address.
Inputs:
to(address): Destination address for token withdrawal.value (varuint32): Amount of tokens to withdraw.
Outputs: None
Usage Example: Executing token transfers from contract balance.
startBM
Purpose: Starts the block manager operation.
Inputs: None
Outputs: None
Usage Example: Initiate block management processes after setup.
getReward
Purpose: Triggers or calculates the reward distribution.
Inputs: None
Outputs: None
Usage Example: Used to compute or claim rewards.
takeReward
Purpose: Takes or claims rewards with respect to wallet interaction parameters and epoch timing.
Inputs:
walletTouch(uint8): Wallet interaction parameter.waitStep(uint64): Waiting step parameter affecting reward timing.epochStart(uint32): Start of the epoch for reward calculation.epochEnd(uint64): End of the epoch for reward calculation.
Outputs: None
Usage Example: Claim rewards for a specified epoch interval.
stopBM
Purpose: Stops the block manager operation.
Inputs: None
Outputs: None
Usage Example: Halt block management activities.
getDetails
Purpose: Retrieves detailed information about the contract’s current state.
Inputs: None
Outputs:
pubkey(uint256): The owner or operator public key.root(address): The root address the contract is associated with.balance (uint256): Current balance of the contract.
license_num(optional(uint256)): Current license number if present.minstake (uint128): Minimum stake required.
signerPubkey(uint256): Public key used for signing.
Usage Example: Query to monitor contract status or for external systems to retrieve operational parameters.
getVersion
Purpose: Returns the contract version information.
Inputs: None
Outputs:
value0(string): Version identifier (likely major version).value1(string): Version identifier (likely minor or patch version).
Usage Example: Used to verify contract version for compatibility checks.
Fields and State Variables
_pubkey (uint256, init): Public key for the contract or owner.
_timestamp (
uint64): Timestamp of the last relevant event or update._constructorFlag (
bool): Indicates if the constructor has been executed._code (
map(uint8,cell)): Mapping of code cells, possibly for managing different states or upgrades._owner_pubkey (uint256, init): Public key of the contract owner.
_root (address): Root address linked to license or block management.
_license_num (
optional(uint256)): Currently active license number._whiteListLicense (
map(uint256,bool)): Map indicating which licenses are whitelisted._licenseBMRoot (address): Address of the license block manager root.
_start_bm (
optional(uint32)): Optional start time for block manager activity._wallet_reward (
uint128): Accumulated reward balance for the wallet._slashSum (
uint128): Total slashing amount applied._start_time (
uint32): Start time parameter for operations._stop_seqno (
uint32): Sequence number indicating stop or halt event occurrence._waitStep (
uint64): Waiting step parameter for timing control._rewarded (
uint32): Counter or flag indicating reward distribution status._epochStart (
uint32): Epoch start time for reward calculation._epochEnd (
uint64): Epoch end time for reward calculation._walletLastTouch (
uint64): Timestamp of the last wallet interaction._isSlashing (
bool): Flag indicating if slashing is currently active._tryReward (
uint32): Counter or flag related to reward attempts._walletTouch (
uint8): Wallet interaction parameter._signing_pubkey (uint256): Public key used for cryptographic signing.
Implementation Details and Algorithms
The contract manages a whitelist of licenses using a map from license numbers (uint256) to boolean flags, enabling efficient lookup and permission control.
Reward and slashing logic is handled through
addLicense,slash,noRewards,getReward, andtakeRewardfunctions, which track and manipulate balances and penalty amounts.Time-based controls are implemented using
_start_time,_waitStep,_epochStart,_epochEnd, and related fields, coordinating when rewards or slashing can occur.Cryptographic public keys
_pubkeyand_signing_pubkeyare central to ownership and signing operations, ensuring secure authentication and authorization.The use of optional types for
_license_numand_start_bmallows for conditional presence of these values, accommodating different contract states.Withdrawal of tokens is restricted via the
withdrawTokenfunction, which requires a destination address and amount, ensuring controlled token flow.The contract supports lifecycle management of block manager operations through
startBMandstopBMfunctions, toggling active states.
Interaction with Other System Components
The contract interacts with license block manager roots and license whitelist maps, indicating integration with external license management systems or registries.
The
withdrawTokenfunction suggests interaction with token contracts or wallets for asset transfers.Public keys and addresses embedded in the contract facilitate communication and verification with external users, nodes, or other smart contracts.
Timing and epoch parameters imply synchronization with network time or block height to coordinate reward and penalty cycles.
The license management functions imply that this contract is part of a larger license and reward distribution infrastructure, likely involving multiple contracts or off-chain components.
Visual Diagram
classDiagram
class AckiNackiBlockManagerNodeWallet {
+constructor()
+removeLicense()
+setSigningPubkey()
+setLicenseWhiteList()
+addLicense()
+slash()
+noRewards()
+withdrawToken()
+startBM()
+getReward()
+takeReward()
+stopBM()
+getDetails()
+getVersion()
-_pubkey
-_timestamp
-_constructorFlag
-_code
-_owner_pubkey
-_root
-_license_num
-_whiteListLicense
-_licenseBMRoot
-_start_bm
-_wallet_reward
-_slashSum
-_start_time
-_stop_seqno
-_waitStep
-_rewarded
-_epochStart
-_epochEnd
-_walletLastTouch
-_isSlashing
-_tryReward
-_walletTouch
-_signing_pubkey
}
This diagram highlights the contract's core functions and state variables, illustrating the structure of the contract interface and internal storage.