boa3.builtin package

public(*args)

This decorator identifies which methods should be included in the abi file.

metadata(*args)

This decorator identifies the function that returns the metadata object of the smart contract. This can be used to only one function. Using this decorator in multiple functions will raise a compiler error.

contract(script_hash: Union[str, bytes])

This decorator identifies a class that should be interpreted as an interface to an existing contract.

to_script_hash(data_bytes: Any)bytes

Converts a data to a script hash.

Parameters

data_bytes (Any) – data to hash

Returns

the script hash of the data

Return type

bytes

sqrt(x: int)int

Gets the square root of a number.

Parameters

x (int) – a non-negative number

Returns

the square root of a number

Return type

int

Raises

Exception – raised when number is negative.

Event(*args, **kwargs)

Describes an action that happened in the blockchain.

CreateNewEvent(arguments: List[Tuple[str, type]] = [], event_name: str = '')boa3.builtin.Event

Creates a new event.

Parameters
  • arguments (List[Tuple[str, type]]) – the list of the events args’ names and types

  • event_name (str) – custom name of the event. It’s filled with the variable name if not specified

Returns

the new event

Return type

Event

class NeoMetadata

Bases: object

This class stores the smart contract manifest information.

Variables
  • supported_standards (List[str]) – Neo standards supported by this smart contract. Empty by default;

  • author (str or None) – the smart contract author. None by default;

  • email (str or None) – the smart contract author email. None by default;

  • description (str or None) – the smart contract description. None by default;

  • extras (Dict[str, Any]) – A json object with additional information. Empty by default;

property extra: Dict[str, Any]

Gets the metadata extra information.

Returns

a dictionary that maps each extra value with its name. Empty by default