PopCoinRoot.abi.json
Overview
This file defines the Application Binary Interface (ABI) of the PopCoinRoot smart contract version 2.4. It specifies the contract's functions, their inputs and outputs, persistent fields, and constructor parameters. The contract appears to manage a collection of "Popits"—digital entities with associated media and metadata—and handles operations such as creation, activation, destruction, and reward minting related to these Popits. It also manages access control via public/private state and maintains supply information.
The ABI allows interaction with the contract's methods programmatically, enabling other system components or external clients to invoke functions, retrieve contract state, and respond to events.
Detailed Descriptions
Contract Functions
constructor
Purpose: Initializes the contract with essential parameters and state.
Inputs:
PopCoinWalletCode(cell): Code reference for the wallet logic related to PopCoin.popitgamehash(uint256): A hash identifier for the Popit game.maxPopitIndex(uint16): Maximum allowed index for Popits.popits_media(map(uint16,tuple)): Map of Popit indices to their media metadata:media(string): Media URI or descriptor.id(uint256): Unique identifier for each Popit.protopopit(optional(uint32)): Optional prototype version or identifier.
description(string): Textual description of the root contract or collection.root_pubkey(uint256): Public key associated with the root for access control.isPublic(bool): Flag indicating if the contract is publicly accessible.index(uint128): Numeric index for the contract instance.popitGameOwner(address): Address of the owner of the Popit game.
Outputs: None.
Usage Example:
constructor(
PopCoinWalletCode,
popitgamehash,
maxPopitIndex,
popits_media,
description,
root_pubkey,
isPublic,
index,
popitGameOwner
)
setIsPublic
Purpose: Sets the public accessibility state of the contract.
Inputs:
isPublic(bool): New public state.
Outputs: None.
Usage: Toggles contract visibility to public or private.
setPopitMedia
Purpose: Updates media information for a specific Popit by index.
Inputs:
index(uint16): Popit index to update.data(tuple): Media data tuple containing:media(string): Media descriptor.id(uint256): Popit identifier.protopopit(optional(uint32)): Optional prototype info.
Outputs: None.
Usage: Modifies media metadata for an existing Popit.
addNewPopit / addNewPopitPublic
Purpose: Adds a new Popit to the collection.
Inputs:
media(string): Media URI or descriptor for the new Popit.protopopit(optional(uint32)): Optional prototype version or identifier.
Outputs: None.
Differences:
addNewPopitPubliclikely allows adding by public users, whileaddNewPopitmay require special permissions.Usage: Introduces new Popits dynamically.
activate
Purpose: Activates the contract or a specific logic depending on the state.
Inputs:
isOld(bool): Flag indicating activation mode or legacy support.
Outputs: None.
Usage: Initializes or switches contract operational mode.
activatePopit
Purpose: Activates a Popit by its ID, optionally updating media.
Inputs:
id(uint256): Identifier of the Popit to activate.media(optional(string)): Optional media update.
Outputs: None.
Usage: Enables or refreshes a Popit's active state.
deleteCandidate
Purpose: Removes a candidate Popit entry by ID.
Inputs:
id(uint256): Candidate Popit identifier to delete.
Outputs: None.
Usage: Cleans up or retracts candidate Popits.
getTapReward
Purpose: Processes or grants rewards related to a tap action on a Popit.
Inputs:
id(uint256): Identifier of the Popit.media(optional(string)): Optional media reference.
Outputs: None.
Usage: Handles reward logic tied to user interaction.
destroy / destroyNode
Purpose: Destroys the contract or a specific node.
Inputs: None.
Outputs: None.
Usage: Terminates contract instance or elements.
mintValue / mintValuePopit / mintValueOld
Purpose: Mints token values to specified owners.
Inputs:
For
mintValue:owner(address): Recipient address.value(uint64): Amount to mint.mbiCur(uint64): Current MBI parameter.
For
mintValuePopit:owner(address): Recipient address.dataId(uint256): Popit data ID.dataValue(uint64): Value associated with the Popit.mbiCur(uint64): Current MBI parameter.
For
mintValueOld:owner(address): Recipient address.value(uint64): Amount to mint.
Outputs: None.
Usage: Token distribution and reward minting mechanics.
isReady / isReadyPopit
Purpose: Checks readiness state for operations.
Inputs:
For
isReady:owner(address): User address.value(uint64): Value to verify.popitGameAddress(address): Address of the Popit game contract.mbi(uint128): MBI parameter.
For
isReadyPopit:owner(address): User address.indexRoot(uint16): Root index.candidateId(uint256): Candidate Popit ID.candidateValue(uint128): Candidate value.popitGameAddress(address): Address of the Popit game contract.mbi(uint128): MBI parameter.
Outputs: None.
Usage: Readiness verification for state transitions or minting.
getDetails
Purpose: Retrieves detailed state information of the contract.
Inputs: None.
Outputs:
root(address): Contract root address.name(string): Contract or collection name.totalSupply(uint128): Total supply of tokens.maxPopitIndex(uint16): Maximum Popit index.popits_value(map(uint16,tuple)): Map of Popit indices to value tuples:rewards(uint128),value(uint64),leftTaps(uint128),leftRewards(uint128),MBNLst(uint64[]),TAPLst(uint64[]),BCLst(uint64[])
popits_media(map(uint16,tuple)): Popit media metadata.rewards(uint128): Total rewards.popits_candidate(map(uint256,tuple)): Candidate Popits with data tuples:value,media,protopopit,time,MBNLst,TAPLst,BCLst
isReadyStatus(bool): Readiness status.popitGameOwner(address): Owner address.description(string): Description text.deployed(uint64): Deployment timestamp or identifier.
Usage: Provides comprehensive contract state snapshot.
getVersion
Purpose: Returns the current contract version.
Inputs: None.
Outputs:
value0(string): ABI version string.value1(string): Contract version string.
Usage: Version tracking and verification.
Persistent Fields
_pubkey(uint256): Public key initialized during deployment._timestamp(uint64): Timestamp tracking._constructorFlag(bool): Indicates constructor completion._code(map(uint8,cell)): Map of code cells for internal usage._isReady(bool): Readiness flag._popitgamehash(uint256): Hash identifier for the game._root(address): Root contract address._name(string): Contract name._isPublic(bool): Public visibility flag._totalSupply(uint128): Total token supply._maxPopitIndex(uint16): Maximum Popit index._popits_value(map(uint16,tuple)): Popit value data._popits_media(map(uint16,tuple)): Popit media data._popits_candidate(map(uint256,tuple)): Candidate Popits data._root_pubkey(uint256): Root public key._description(string): Contract description._rewards(uint128): Reward accumulator._basicRewards(uint128): Basic reward value._popitGameOwner(address): Owner's address._MBNLst(uint64[]),_TAPLst(uint64[]),_BCLst(uint64[]): Lists possibly related to reward or tap tracking._deployed(uint64): Deployment timestamp.
Implementation Details and Algorithms
Media and Popit Management: The contract manages media and metadata for Popits using maps keyed by indices or IDs. This supports efficient lookup and update operations.
Reward Systems: Multiple functions relate to minting values and handling tap rewards, indicating an algorithmic system where user interactions (taps) generate rewards that are tracked and distributed.
Activation and Readiness: The contract uses readiness flags and activation functions to control lifecycle states, possibly enabling phased deployment or legacy support (
isOldflag).Access Control: Public/private state toggling (
setIsPublic) and public key management ensure controlled access to contract functionality.Candidate Popits: The contract tracks candidate Popits separately, allowing for validation or approval workflows before full activation.
Versioning: The contract maintains version information to support compatibility and upgrade paths.
Interactions with Other System Components
PopCoinWalletCode: The constructor requires wallet code cells, suggesting interaction with wallet contracts or modules for token handling.
PopitGameContract: The contract references
popitGameAddressandpopitGameOwner, indicating coordination with a game logic contract that owns or manages Popits.Users and External Calls: Various functions accept
owneraddresses and process minting or readiness checks, facilitating user interactions and external client calls.Media Storage: Media strings likely reference external storage or decentralized media hosting, linking this contract's metadata with off-chain resources.
Visual Diagram: Structure of PopCoinRoot Contract ABI
classDiagram
class PopCoinRoot {
<<contract>>
+constructor()
+setIsPublic()
+setPopitMedia()
+addNewPopit()
+addNewPopitPublic()
+activate()
+activatePopit()
+deleteCandidate()
+getTapReward()
+destroy()
+mintValue()
+mintValuePopit()
+mintValueOld()
+isReady()
+isReadyPopit()
+destroyNode()
+getDetails()
+getVersion()
-_pubkey
-_timestamp
-_constructorFlag
-_code
-_isReady
-_popitgamehash
-_root
-_name
-_isPublic
-_totalSupply
-_maxPopitIndex
-_popits_value
-_popits_media
-_popits_candidate
-_root_pubkey
-_description
-_rewards
-_basicRewards
-_popitGameOwner
-_MBNLst
-_TAPLst
-_BCLst
-_deployed
}