Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

oxheadalpha/smart-contracts

Repository files navigation

FA2 Contracts Implementation

This repository contains multiple sub-projects implementing different flavors of the FA2 token standard.

Shared LIGO code

shared directory contains common code shared by all sub-project. The FA2-related LIGO artifacts are:

Sub-Projects Structure

The sub-projects symlink shared code into their respective directories. Each sub-project has ligo directory that contains all LIGO-related files:

  • symlinked shared common code.
  • src directory with the LIGO implementation of the particular FA2 contract(s).
  • out directory with the contracts compiled to Michelson.

The design of each FA2 contract follows the same pattern and consists of the following source files:

  • fa2_xxx_token.mligo - implementation of the FA2 entry points and FA2 core logic.
  • token_manager.mligo - implementation of mint, burn, create token(s) entry points.
  • fa2_xxx_asset.mligo - assembly of different modules into a complete FA2 contract. The assembly includes FA2 entry points and core logic (fa2_xxx_token.mligo), mint/burn entry points (token_manager.mligo) and the administrator entry points (shared/fa2_modules/simple_admin.mligo).

Implemented FA2 Contracts

fa2_single_asset.mligo implementation of the FA2 contract that supports single fungible tokens (a.k.a ERC-20).

fa2_single_asset_with_hooks.mligo implementation of the FA2 contract that supports single fungible tokens (a.k.a ERC-20) and sender/receiver hooks.

fa12_lorentz.tz implementation of the FA1.2 contract that supports single fungible tokens (a.k.a. ERC-20).

fa2_multi_asset.mligo implementation of the FA2 contract that supports multiple fungible tokens (a.k.a. ERC-1155).

fa2_granular_multi_asset.mligo implementation of the FA2 contract that supports multiple fungible tokens (a.k.a. ERC-1155) that allows pausing/un-pausing transfers on individual tokens.

fa2_multi_asset.mligo implementation of the FA2 contract that supports multiple fungible tokens (a.k.a. ERC-1155) and sender/receiver hooks.

fa2_nft_asset.mligo implementation of the NFT FA2 contract (a.k.a. ERC-721). The contract supports multiple "families" of NFT tokens that share the same token metadata.

fa2_fixed_collection_asset.mligo implementation of the fixed collection of NFT tokens (a.k.a. ERC-721). The FA2 contract is originated with the predefined set of NFT tokens. Tokens cannot be minted or burned.

fractional_dao.mligo implementation of DAO that manages fractional ownership of NFT tokens. The DAO is the owner of an NFT token in the corresponding FA2 NFT contract and also manages fractional ownership fungible token for each owned NFT. Holders of the linked ownership fungible tokens can vote (directly or using signed permit) on transfer of the NFT token to some other address.

fractional_dao.mligo implementation of a generic fractional DAO user fractional voting to control any generic operation represented by a lambda function. Such lambda can transfer tokens, buy/sell tokens on market place or auction or perform any other generic operation. Fractional ownership is controlled by allocation of the ownership fungible token managed by the DAO. The DAO itself is a FA2 contracts that supports standard FA2 API to manage the ownership token.