All Projects → nori-dot-eco → atomic-markets

nori-dot-eco / atomic-markets

Licence: MIT license
Generalized atomic swap marketplaces for ERC-777(advanced token standard) and ERC-721 (non-fungible tokens)

Programming Languages

solidity
1140 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to atomic-markets

svelte-box
A truffle box for svelte
Stars: ✭ 60 (+100%)
Mutual labels:  dapp, truffle, truffle-box
Eth Crypto
Cryptographic javascript-functions for ethereum and tutorials to use them with web3js and solidity
Stars: ✭ 420 (+1300%)
Mutual labels:  dapp, truffle
Truffle eth class2
Stars: ✭ 330 (+1000%)
Mutual labels:  dapp, truffle
Dapp
TypeScript React Redux Ethereum IPFS Starter Kit
Stars: ✭ 33 (+10%)
Mutual labels:  dapp, truffle
escrow-eth
Escrow contract
Stars: ✭ 41 (+36.67%)
Mutual labels:  dapp, truffle
nifty-game
🃏🎮A NFT(ERC721) card game build on Ethereum, Truffle, Ganache and hosting on IPFS.
Stars: ✭ 222 (+640%)
Mutual labels:  dapp, truffle
Angular Truffle Dapp
Angular + Truffle = Beautiful Material Dapp that can be scaled
Stars: ✭ 12 (-60%)
Mutual labels:  dapp, truffle
React-Ethereum-Movie-Rating-Dapp
React-Ethereum Decentralized App Starter
Stars: ✭ 16 (-46.67%)
Mutual labels:  dapp, truffle
Trace
Supply chain transparency platform proof-of-concept based on the Ethereum blockchain ✍️
Stars: ✭ 52 (+73.33%)
Mutual labels:  dapp, truffle
Starter Kit
An OpenZeppelin starter kit containing React, OpenZeppelin SDK & OpenZeppelin Contracts.
Stars: ✭ 101 (+236.67%)
Mutual labels:  dapp, truffle
Erc20 Generator
Create an ERC20 Token for FREE in less than a minute with the most used Smart Contract Generator for ERC20 Token. No login. No setup. No coding required.
Stars: ✭ 202 (+573.33%)
Mutual labels:  dapp, truffle
contracts
Alice smart contracts
Stars: ✭ 57 (+90%)
Mutual labels:  dapp, truffle
peerai-api
Peerism's Peer.ai API built with Truffle, Node.js, Express.js, Solidity, and Ethereum TestRPC
Stars: ✭ 18 (-40%)
Mutual labels:  dapp, truffle
Love Ethereum
区块链学习
Stars: ✭ 323 (+976.67%)
Mutual labels:  dapp, truffle
Motoro
Smart contracts for decentralized rentals of vehicles.
Stars: ✭ 96 (+220%)
Mutual labels:  dapp, truffle
Eth.social
An Ethereum dApp for posting social events.
Stars: ✭ 17 (-43.33%)
Mutual labels:  dapp, truffle
Eth Vue
Featured in Awesome Vue [https://github.com/vuejs/awesome-vue], a curated list maintained by vuejs of awesome things related to the Vue.js framework, and Awesome List [https://awesomelists.net/150-Vue.js/3863-Open+Source/18749-DOkwufulueze-eth-vue], this Truffle Box provides everything you need to quickly build Ethereum dApps that have authentication features with vue, including configuration for easy deployment to the Ropsten Network. It's also Gravatar-enabled. Connecting to a running Ganache blockchain network from Truffle is also possible -- for fast development and testing purposes. Built on Truffle 5 and Vue 3, eth-vue uses vuex for state management, vuex-persist for local storage of app state, and vue-router for routing. Authentication functionalities are handled by Smart Contracts running on the Ethereum blockchain.
Stars: ✭ 171 (+470%)
Mutual labels:  dapp, truffle
starter-kit-gsn
An OpenZeppelin starter kit focused on GSN.
Stars: ✭ 39 (+30%)
Mutual labels:  dapp, truffle
truffle-react-redux
Template for your next dapp with React and Redux
Stars: ✭ 20 (-33.33%)
Mutual labels:  dapp, truffle
Disperse
React/Redux dApp (decentralized app) boilerplate using Ethereum's blockchain
Stars: ✭ 36 (+20%)
Mutual labels:  dapp, truffle

box-img-sm-template

Everything you need to quickly jump in and begin swapping non-fungible tokens for other tokens


Quick Start

truffle unbox nori-dot-eco/atomic-markets
truffle test

Key features

  • Boilerplate ERC-721 non-fungible token (NFT) contracts super-powered with some extended atomic logic

  • Boilerplate ERC-777 advanced token standard contracts super-powered with some atomic logic

  • Market contracts for price-based atomic swaps of NFT assets for token assets

  • Bring your own UI. Plug your own UI logic directly into the contracts. If UI examples would be helpful let me know. Keep a look out for an upcoming post on medium where Ill dive a bit deeper in to how exactly to do that

Prereqs

  1. Make sure you are using a unix flavor operating system for everything
  2. Install some stuff:

Market Contracts

Background

Check out the latest post on this topic here

There are multiple types of markets: cen

  • Price Based: a market where buyers and sellers can choose which NFT they want to purchase with their tokens.

  • WIP First-in-first-out (FIFO): a market where NFTs are bought and sold in a first-in-first-out queue (similar to a spot market). In this market, buyers do not get to choose which NFTs they are purchasing.

Purpose

The Market contracts are used to buy and sell NFTs using tokens. They are the contracts by which sellers list NFTs and buyers purchase them with tokens.

The Market contracts are designed to never take custody of buyer or seller assets. Instead, they are a medium that is used to swap a NFT asset from a seller's own account to a buyer's account without ever taking custody of the seller's asset itself (nor the buyer's tokens).

At a high-level, the market accomplishes this form of an atomic swap by use of the (modified) ERC 721 and ERC 777 advanced token's approveAndCall function.

When a seller invokes this function, passing in the market address as the intended operator, the market is given authorization to transfer the NFT on behalf of the user as soon as the market receives a corresponding token authorization from a buyer.

When the market does receive this corresponding authorization (done in the same way as the NFT was done-- using the token's approveAndCall function), the Market automatically invokes (via contract introspection described in EIP820) a safeTransferFrom call on the NFT AND an transferFrom call on the token in the same transaction

The result?

An atomic swap of one asset for the other using a single transaction and without an intermediary custodying the assets.

Basically, the market "listens" for sellers who say "I want to sell this NFT", and "listens" for buyers who say "I want to buy some NFTs with my tokens", and when it can match these two conversations, it automatically swaps the token for the NFT.

In other words, you never have to deposit the tokens or the NFTs in an exchange.

Todo:

Documentation

  • write notes on how Nori uses these types of contracts

  • write a note about how it could be extended for updating prices without relisting (might already be possible by re-approving)

  • notes on how this box adds partial erc 820 support, but not full extension for 777 support (but that can be done). It also adds only one additional functions to call when authorizing operator, this call matches erc820 rather than the standard erc721 165 support (but should be backward compatible-- Ive chosen to use 820 support to match that of the token's erc777 support so as not be more ubiquitous and hopefully not to be confusing for readers/users)

Future

  • modify buy/sell to be a generic "create order" so that tokens/nft orders can be added in any order (currently the contracts require creating the NFT sale, and then buying it with a token-- we can instead generalize and just add an order book that checks if there is a matching order upon invoking a function called createOrder)
  • write implementation for FIFO market (for a preview, you can see an implementation of that logic in the Nori contracts github repository
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].