neofs-contract

module
v0.19.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: GPL-3.0

README

NeoFS

NeoFS related smart contracts.


Overview

NeoFS-Contract contains all NeoFS related contracts written for neo-go compiler. These contracts are deployed both in the mainchain and the sidechain.

Mainchain contracts:

  • neofs
  • processing

Sidechain contracts:

  • alphabet
  • audit
  • balance
  • container
  • neofsid
  • netmap
  • nns
  • proxy
  • reputation

Getting started

Prerequisites

To compile smart contracts you need:

Compilation

To build and compile smart contract, run make all command. Compiled contracts *_contract.nef and manifest config.json files are placed in the corresponding directories. Generated RPC binding files rpcbinding.go are placed in the corresponding rpc directories.

$ make all
/home/user/go/bin/cli contract compile -i alphabet -c alphabet/config.yml -m alphabet/config.json -o alphabet/alphabet_contract.nef --bindings alphabet/bindings_config.yml
mkdir -p rpc/alphabet
/home/user/go/bin/cli contract generate-rpcwrapper -o rpc/alphabet/rpcbinding.go -m alphabet/config.json --config alphabet/bindings_config.yml
...

You can specify path to the neo-go binary with NEOGO environment variable:

$ NEOGO=/home/user/neo-go/bin/neo-go make all

Remove compiled files with make clean or make mr_proper command.

Building Debian package

To build Debian package containing compiled contracts, run make debpackage command. Package will install compiled contracts *_contract.nef and manifest config.json with corresponding directories to /var/lib/neofs/contract for further usage. It will download and build neo-go, if needed.

To clean package-related files, use make debclean.

Testing

Smartcontract tests reside in tests/ directory. To execute test suite after applying changes, simply run make test.

$ make test
ok      github.com/nspcc-dev/neofs-contract/tests       0.462s

NeoFS API compatibility

neofs-contract version supported NeoFS API versions
v0.9.x v2.7.0, v2.8.0
v0.10.x v2.7.0, v2.8.0
v0.11.x v2.7.0, v2.8.0, v2.9.0
v0.12.x v2.10.0
v0.13.x v2.11.0
v0.14.x v2.11.0
v0.15.x v2.11.0, v2.12.0
v0.15.x v2.11.0, v2.12.0
v0.16.x v2.14.0

License

This project is licensed under the GPLv3 License - see the LICENSE.md file for details

Directories

Path Synopsis
Package alphabet contains implementation of Alphabet contract deployed in NeoFS sidechain.
Package alphabet contains implementation of Alphabet contract deployed in NeoFS sidechain.
Package audit contains implementation of Audit contract deployed in NeoFS sidechain.
Package audit contains implementation of Audit contract deployed in NeoFS sidechain.
Package balance contains implementation of Balance contract deployed in NeoFS sidechain.
Package balance contains implementation of Balance contract deployed in NeoFS sidechain.
cmd
Package container contains implementation of Container contract deployed in NeoFS sidechain.
Package container contains implementation of Container contract deployed in NeoFS sidechain.
Package neofs contains implementation of NeoFS contract deployed in NeoFS mainchain.
Package neofs contains implementation of NeoFS contract deployed in NeoFS mainchain.
Package neofsid contains implementation of NeoFSID contract deployed in NeoFS sidechain.
Package neofsid contains implementation of NeoFSID contract deployed in NeoFS sidechain.
Package netmap contains implementation of the Netmap contract for NeoFS systems.
Package netmap contains implementation of the Netmap contract for NeoFS systems.
Package nns contains non-divisible non-fungible NEP11-compatible token implementation.
Package nns contains non-divisible non-fungible NEP11-compatible token implementation.
Package processing contains implementation of Processing contract deployed in NeoFS mainchain.
Package processing contains implementation of Processing contract deployed in NeoFS mainchain.
Package proxy contains implementation of Proxy contract deployed in NeoFS sidechain.
Package proxy contains implementation of Proxy contract deployed in NeoFS sidechain.
Package reputation contains implementation of Reputation contract deployed in NeoFS sidechain.
Package reputation contains implementation of Reputation contract deployed in NeoFS sidechain.
rpc
alphabet
Package alphabet contains RPC wrappers for NeoFS Alphabet contract.
Package alphabet contains RPC wrappers for NeoFS Alphabet contract.
audit
Package audit contains RPC wrappers for NeoFS Audit contract.
Package audit contains RPC wrappers for NeoFS Audit contract.
balance
Package balance contains RPC wrappers for NeoFS Balance contract.
Package balance contains RPC wrappers for NeoFS Balance contract.
container
Package container contains RPC wrappers for NeoFS Container contract.
Package container contains RPC wrappers for NeoFS Container contract.
neofs
Package neofs contains RPC wrappers for NeoFS contract.
Package neofs contains RPC wrappers for NeoFS contract.
neofsid
Package neofsid contains RPC wrappers for NeoFS ID contract.
Package neofsid contains RPC wrappers for NeoFS ID contract.
netmap
Package netmap contains RPC wrappers for NeoFS Netmap contract.
Package netmap contains RPC wrappers for NeoFS Netmap contract.
nns
Package nns contains RPC wrappers for NameService contract.
Package nns contains RPC wrappers for NameService contract.
processing
Package processing contains RPC wrappers for NeoFS Multi Signature Processing contract.
Package processing contains RPC wrappers for NeoFS Multi Signature Processing contract.
proxy
Package proxy contains RPC wrappers for NeoFS Notary Proxy contract.
Package proxy contains RPC wrappers for NeoFS Notary Proxy contract.
reputation
Package reputation contains RPC wrappers for NeoFS Reputation contract.
Package reputation contains RPC wrappers for NeoFS Reputation contract.
dump
Package dump provides I/O operations for collected states of the Neo smart contracts.
Package dump provides I/O operations for collected states of the Neo smart contracts.
migration
Package migration provides framework to test migration of the NeoFS smart contracts.
Package migration provides framework to test migration of the NeoFS smart contracts.

Jump to

Keyboard shortcuts

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