GiverV3.abi.json

Overview

This file defines the Application Binary Interface (ABI) for the GiverV3 smart contract, specifying its version, header, functions, events, and fields. The ABI acts as a contract between the contract and clients (or other contracts), detailing how to encode function calls and decode responses. This ABI adheres to version 2 with header parameters for time and expire, indicating that transactions include timing constraints for validity.

The GiverV3 contract is primarily designed to send tokens or currency to specified addresses with flexible options, record messages, and support contract upgrades. It also emits events to signal the execution of currency transfers. The ABI provides the necessary interface for interacting with the contract's functions programmatically.


ABI Structure and Components

Header

Fields

Field Name

Type

Initialization

Description

_pubkey

uint256

true

Public key initialized during contract setup.

_timestamp

uint64

false

Stores timestamp, likely updated during operations.

_constructorFlag

bool

false

Flag to indicate constructor state or initialization.

m_messages

map(uint256,uint32)

false

Mapping which stores messages; keys are uint256 hashes, values are expiration timestamps (uint32).


Functions

constructor


sendTransaction


sendCurrency


sendCurrencyWithFlag


sendFreeToken


getMessages


upgrade


Events

Events facilitate off-chain clients or other contracts to listen to important state changes or actions.

SentCurrency


SentCurrencyWithFlag


Implementation Details and Algorithms


Interaction with Other System Components


Visual Diagram: Flowchart of Main Functions and Their Relationships

flowchart TD
A[constructor] --> B[sendTransaction]
A --> C[sendCurrency]
A --> D[sendCurrencyWithFlag]
A --> E[sendFreeToken]
A --> F[getMessages]
A --> G[upgrade]
B --> H[External Address]
C --> H
D --> H
E --> H
C --> I[ECC Map]
D --> I
D --> J[Flag]
F --> K[m_messages storage]
G --> L[New Contract Code]

The diagram illustrates how the contract initializes via constructor, then supports several currency sending functions that interact with external addresses, optionally making use of ECC maps and flags. The getMessages function reads from internal storage, while upgrade replaces contract code with new logic.