PopitGame.abi.json

Overview

This file defines the Application Binary Interface (ABI) for the PopitGame smart contract version 2.4, specifying its callable functions, events, and persistent state fields. It serves as a contract interface description facilitating interaction with the PopitGame contract on the blockchain. Primarily, the contract manages a system of "PopCoin" tokens, their wallets, and related game mechanics such as value assignment, deployment, and withdrawal.

The ABI describes:

Structure and Contents

ABI Metadata

Fields (Persistent State Variables)

Name

Type

Initialization

Description

_pubkey

uint256

Yes

Public key associated with the contract owner.

_timestamp

uint64

No

Timestamp representing contract-related time data.

_constructorFlag

bool

No

Flag indicating if the constructor has been executed.

_code

map(uint8,cell)

No

Code storage mapping, likely for wallet or token logic.

_owner

address

Yes

Address of the contract owner.

_mbiCur

uint64

No

Current mbi (possibly a metric or index) value.

_root

address

No

Address of the root contract or entity.

_startTime

uint32

No

Start time for contract logic or game initialization.

_root_pubkey

uint256

No

Public key of the root entity or contract.

_boost

address

No

Address associated with boosting mechanics.

_rewards

uint128

No

Reward amount or pool tracked by the contract.

Functions

constructor

popitGame.constructor(codeMap, rootPublicKey, index);

addValuePopit

popitGame.addValuePopit("GoldToken", 12345, 1000);

popCoinRootDeployed


popCoinWalletDeployed


setMbiCur


deployPopCoinWallet


deployPopCoinWalletOldTransfer


withdraw

popitGame.withdraw(5000, "0xabc123...");

getPopCoinWalletAddress

const walletAddress = popitGame.getPopCoinWalletAddress("GoldToken");

getDetails

const details = popitGame.getDetails();
console.log(details.owner, details.rewards);

getVersion


Events

Two events are declared to notify external listeners of significant state changes:

These events support asynchronous monitoring of contract state by external systems or interfaces.


Implementation Details


Interaction with Other System Components


Mermaid Diagram: Contract Structure

classDiagram
class PopitGame {
+_pubkey: uint256
+_timestamp: uint64
+_constructorFlag: bool
+_code: map(uint8,cell)
+_owner: address
+_mbiCur: uint64
+_root: address
+_startTime: uint32
+_root_pubkey: uint256
+_boost: address
+_rewards: uint128
+constructor()
+addValuePopit()
+popCoinRootDeployed()
+popCoinWalletDeployed()
+setMbiCur()
+deployPopCoinWallet()
+deployPopCoinWalletOldTransfer()
+withdraw()
+getPopCoinWalletAddress()
+getDetails()
+getVersion()
}
PopitGame ..> "1" PopCoinWallet : deploys >
PopitGame ..> "1" PopCoinRoot : interacts >
PopitGame ..> BoostMechanism : references >

This diagram illustrates the core contract PopitGame with its persistent fields and exposed methods. The arrows indicate interactions with other entities such as PopCoin wallets, root contracts, and boost mechanisms.