Skip to content

Repository files navigation

AtomicAssets

AtomicAssets is a Non Fungible Token (NFT) standard for eosio blockchains developed by pink.network.

It offers a powerful feature set while keeping unnecessary complexity to a minimum and focusses on RAM efficiency.

Useful links

Key Features

  • Powerful structure

    NFTs are grouped by collections rather than their author, which allows for flexible authorizations.
    Schemas give NFTs an extensible data structure, which is used for the serialization.
    Templates store data and can be referenced by assets. This allows grouping similar assets together and saving RAM by not having to store the same data for each asset individually. Templates can also make NFTs non-transferable or non-burnable.
    Assets always belong to a collection and a schema, and can optionally reference a template.

  • Data Serialization

    AtomicAssets uses a custom built serialization inspired by Protobuf, which significantly reduces RAM costs compared to traditional methods (e.g. JSON strings). Serialization is done within the contract, which guarantees that no corrupt data enters the blockchain state.

  • No RAM Costs for users

    The RAM cost is paid fully by the dapps that create the assets. Even when transfering assets, this stays the same. The maximum an end user will ever have to pay are 112 bytes for their own scope, and even that will likely only rarely be necessary. This also means that AtomicAssets works without claims. Transfers are instant and no further user action is required.

  • Minimal fixed RAM costs

    Creating an asset only costs 151 bytes (112 of which are for the necessary index). Additionally, each token owner needs to have a scope, which costs 112 bytes.

  • Notifications for Smart Contracts

    Smart Contracts can get notified automatically about any relevant events related to their assets. This enables them to make the assets an integral part of their game rather than just a static token.

  • Backing assets with Fungible Tokens (disabled in v2)

    Native backing is deprecated. The backasset action fails on the v2 contract, so no new asset can be backed. Value already backed is unaffected. Burning an asset still credits its backed tokens to the burner's AtomicAssets token balance, which is claimed with the withdraw action as before; the burn itself does not transfer tokens.

  • Powerful Trade Offers

    AtomicAssets features a native implementation of two sided trade offers (similar to Steam or WAX Express Trade). This allows creating and accepting offers with a single action. The implementation of the offers also allows for peer to peer marketplaces that don't require transferring ownership to a market contract.

Build contract

$ make clean
$ make build

Releases

Tagged versions are published as GitHub Releases with the atomicassets.wasm, atomicassets.abi and SHA256SUMS assets attached. RELEASING.md covers how a release is cut and what its notes carry, and CHANGELOG.md holds the notes for each version.

Testing

Test Framework

  • Uses Vert framework for EOSIO contract testing (migrated from Hydra)
  • Tests written in JavaScript using Jest
  • Test configuration in jest.config.js with 10-minute timeout

Export contract memory

  • VeRT requires exported memory in your contract.
  • If you are using CDT to compile your contracts, you need to export memory in your contract manually prior to version 4.1.0.
# if you don't have wabt:
$ apt-get install wabt

$ make export-memory

Running Tests

$ yarn install
$ yarn test        # Run all tests
$ yarn test addconf  # Run specific test files matching pattern

Test Structure

Tests are organized in directories by functionality:

  • tests/admin-actions/ - Administrative operations
  • tests/asset-actions/ - Asset creation and management
  • tests/author-swap-actions/ - Collection author swap offers
  • tests/collection-actions/ - Collection management
  • tests/deposit-withdraw-back-burn-actions/ - Token backing operations
  • tests/interface-header/ - Interface header consumer compile check
  • tests/schema-actions/ - Schema operations
  • tests/template-actions/ - Template management
  • tests/transfer-offer-actions/ - Transfer and trading functionality

Credits

AtomicAssets is the work of many contributors, recorded in AUTHORS.md.

About

Smart Contract of the AtomicAssets standard.

Resources

Stars

3 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages