LicenseBM.abi.json
Overview
This file defines the Application Binary Interface (ABI) for the LicenseBM smart contract. The ABI specifies the contract's interface for interaction, including its functions, fields (storage variables), and initialization parameters. The contract manages licenses linked to Blockchain Manager (BM) wallets, enabling ownership control, license acceptance or rejection, and token withdrawal operations. It maintains a relationship between license holders and BM wallets, providing mechanisms to update owner credentials and manage wallet associations.
ABI Version and Metadata
ABI version: 2
Contract version: 2.4
Header parameters:
pubkey,time, expire
These header fields are used for message authentication and timing in the contract call context.
Fields (Storage Variables)
Field Name | Type | Initial Value | Description |
|---|---|---|---|
|
| Yes | Public key of the contract owner, initialized during deployment. |
|
| No | Timestamp of the last relevant contract action or update. |
|
| No | Flag indicating if the constructor logic has been executed. |
|
| Yes | Unique identifier for the license managed by this contract instance. |
|
| Yes | Root address associated with the license or contract deployment. |
|
| No | Public key of the current owner; optional since owner can be address-based. |
|
| No | Address of the current owner; optional to allow public key ownership. |
|
| No | Address of the root BM wallet associated with this license. |
|
| No | Address of the BM wallet currently linked to this license. |
|
| No | Amount of tokens rewarded to the license or wallet. |
|
| No | Amount of tokens slashed or penalized. |
|
| No | Timestamp of the last license update or interaction. |
|
| No | Mapping of code cells indexed by integer keys, possibly for upgradeable logic or modular code. |
Functions
constructor(pubkey: uint256, walletCode: cell, rootBM: address)
Description: Initializes the contract with the owner's public key, the wallet code cell, and the root BM wallet address.
Inputs:
pubkey: Owner's public key.walletCode: Code cell representing the wallet's code.rootBM: Address of the root BM wallet.
Outputs: None.
Usage: Called once upon contract deployment to set initial state.
setOwnerAddress(owner: address)
Description: Sets or updates the owner's address of the license.
Inputs:
owner: New owner address.
Outputs: None.
Usage: Used to transfer ownership using an address instead of a public key.
setOwnerPubkey(pubkey: uint256)
Description: Sets or updates the owner's public key.
Inputs:
pubkey: New owner's public key.
Outputs: None.
Usage: Alternative to
setOwnerAddressallowing ownership transfer via public key.
removeBMWallet()
Description: Disassociates the current BM wallet from this license.
Inputs: None.
Outputs: None.
Usage: Used when the BM wallet should be removed or reset from the license.
deleteWallet(reward: uint128, slashSum: uint128)
Description: Deletes the linked wallet, handling token rewards and slashing.
Inputs:
reward: Amount of tokens to reward.slashSum: Amount of tokens to slash or penalize.
Outputs: None.
Usage: Used for wallet removal with economic consequences like reward distribution and penalties.
addBMWallet(pubkey: uint256)
Description: Adds or registers a BM wallet associated with the given public key.
Inputs:
pubkey: Public key of the BM wallet to add.
Outputs: None.
Usage: Allows adding a new BM wallet under this license.
withdrawToken(to: address, value: uint128)
Description: Withdraws tokens from the contract to a specified address.
Inputs:
to: Recipient address.value: Amount of tokens to withdraw.
Outputs: None.
Usage: Allows license or wallet owner to withdraw tokens.
notAcceptLicense(pubkey: uint256)
Description: Registers a BM wallet's refusal to accept the license.
Inputs:
pubkey: Public key of the BM wallet rejecting the license.
Outputs: None.
Usage: Indicates that a BM wallet does not accept or acknowledge the license.
acceptLicense(pubkey: uint256)
Description: Registers a BM wallet's acceptance of the license.
Inputs:
pubkey: Public key of the BM wallet accepting the license.
Outputs: None.
Usage: Indicates acceptance of the license by a BM wallet.
toWithdrawToken(to: address, value: uint128)
Description: Alternative method to withdraw tokens to a specified address.
Inputs:
to: Recipient address.value: Amount of tokens to withdraw.
Outputs: None.
Usage: Similar to
withdrawToken, possibly for different internal logic or access control.
getDetails()
Description: Retrieves detailed information about the license.
Inputs: None.
Outputs:
license_number(uint256): License identifier.bmwallet(optional(address)): Associated BM wallet address, if any.owner_pubkey(optional(uint256)): Owner's public key, if set.owner_address(optional(address)): Owner's address, if set.
Usage: Used to fetch current license state and ownership details.
getBM()
Description: Retrieves the BM wallet address associated with the license.
Inputs: None.
Outputs:
bmwallet(optional(address)): BM wallet address if linked.
Usage: Used to query the BM wallet linked to the license.
getOwner()
Description: Retrieves the owner credentials, either public key or address.
Inputs: None.
Outputs:
owner_pubkey(optional(uint256)): Owner's public key.owner_address(optional(address)): Owner's address.
Usage: Fetches the current owner information.
getVersion()
Description: Returns the version information of the contract.
Inputs: None.
Outputs:
value0(string): Version string part 1.value1(string): Version string part 2.
Usage: Provides contract versioning info for compatibility or debugging.
Implementation Details and Algorithms
The contract uses a combination of public key and address-based ownership to allow flexible owner identification.
BM wallet linkage is managed through optional address fields, allowing dynamic association and disassociation.
Token management (reward and slash) is implemented through
uint128fields and controlled via functions likedeleteWallet.Acceptance and rejection of licenses by BM wallets are tracked by public key inputs, indicating a multi-party agreement or acknowledgment system.
The
_codemap field suggests support for modular or upgradeable code components, stored as cells indexed by an integer key.The contract utilizes time-related fields (
_timestamp,_licenseLastTouch) to track the timing of actions, useful for expiration or update logic.
Interactions with Other System Components
The contract interacts with BM wallets represented by their public keys or addresses, enabling wallet management within the license scope.
Ownership can be transferred or updated both by public key and address, allowing integration with different identity management mechanisms.
Token withdrawal functions suggest interaction with a token ledger or currency management system.
The root BM wallet and root address fields link this contract instance into a broader hierarchy or system of licenses and wallets.
The wallet code cell passed to the constructor implies interaction with wallet contract code, potentially enabling deployment or verification of wallet contracts.
Visual Diagram: LicenseBM Contract Structure
classDiagram
class LicenseBM {
+constructor()
+setOwnerAddress()
+setOwnerPubkey()
+removeBMWallet()
+deleteWallet()
+addBMWallet()
+withdrawToken()
+notAcceptLicense()
+acceptLicense()
+toWithdrawToken()
+getDetails()
+getBM()
+getOwner()
+getVersion()
_pubkey: uint256
_timestamp: uint64
_constructorFlag: bool
_license_number: uint256
_root: address
_owner_pubkey: optional(uint256)
_owner_address: optional(address)
_rootBM: address
_bmwallet: optional(address)
_rewarded: uint128
_slashSum: uint128
_licenseLastTouch: uint64
_code: map(uint8,cell)
}
This diagram shows the contract's functions and its primary storage fields, illustrating the encapsulated license and wallet management functionality.