contracts

package
v0.41.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package contracts embeds compiled Neo contracts and provides access to them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Contract

type Contract struct {
	NEF      nef.File
	Manifest manifest.Manifest
}

Contract groups information about Neo contract stored in the current package.

func Read

func Read() ([]Contract, error)

Read reads compiled contracts stored in the package sorted numerically. File schema:

  • compiled executables (NEF) are named by pattern 'N-C.nef'
  • JSON-encoded manifests are named by pattern 'N-C.manifest.json'

where C is the contract name (a-z) and N is the serial number of the contract starting from 0. Leading zeros are ignored (except zero sequence corresponding to N=0).

If NEF file exists, corresponding manifest file must exist. If manifest file is presented without corresponding NEF file, the contract is ignored.

Read fails if contract files has invalid name or format.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL