• Stars
    star
    113
  • Rank 310,115 (Top 7 %)
  • Language
    C++
  • License
    Other
  • Created about 6 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Bancor Protocol Contracts for EOS

Bancor Protocol Contracts v1.2 (beta)

Bancor is a decentralized liquidity network that provides users with a simple, low-cost way to buy and sell tokens. Bancor’s open-source protocol empowers tokens with built-in convertibility directly through their smart contracts, allowing integrated tokens to be instantly converted for one another, without needing to match buyers and sellers in an exchange. The Bancor Wallet enables automated token conversions directly from within the wallet, at prices that are more predictable than exchanges and resistant to manipulation. To convert tokens instantly, including ETH, EOS, DAI and more, visit the Bancor Web App, join the Bancor Telegram group or read the Bancor Protocol™ Whitepaper for more information.

Overview

The Bancor protocol represents the first technological solution for the classic problem in economics known as the “Double Coincidence of Wants”, in the domain of asset exchange. For barter, the coincidence of wants problem was solved through money. For money, exchanges still rely on labor, via bid/ask orders and trade between external agents, to make markets and supply liquidity.

Through the use of smart-contracts, Smart Tokens can be created that hold one or more other tokens as reserves. Tokens may represent existing national currencies or other types of assets. By using a reserve token model and algorithmically-calculated conversion rates, the Bancor Protocol creates a new type of ecosystem for asset exchange, with no central control. This decentralized hierarchical monetary system lays the foundation for an autonomous decentralized global exchange with numerous and substantial advantages.

Disclaimer

Bancor is a work in progress. Make sure you understand the risks before using it.

Contracts

Bancor protocol is implemented using multiple contracts. The main ones are a version of eosio.token contract, BancorNetwork and BancorConverter.

BancorConverter is responsible for converting between a specific token and its own reserves. BancorNetwork is the entry point for any token to any token conversion.

There are also MultiToken and MultiConverter implementations which allow conversions with numerous several smart tokens (without deploying a separate smart contract for each converter (BancorConverter).

In order to execute a conversion, the caller needs to transfer tokens to the BancorNetwork contract with specific conversion instructions in the transfer memo.

See each contract for a description and general usage information.

Setup:

  • make sure you have node.js+npm installed globally
  • make sure you have both eosio installed and the eosio.CDT globally installed (via apt or brew), or in order to compile latest eosio.contracts, masters cloned from git, built and installed inside the user home directory.
  • npm install from the root project directory.

Testing

Tests are included that may be executed using npm run test commands. Legacy tests using the funguy (legacy zeus) SDK may be found in older commits for historical purposes. Additionally included is a convenience script (chmod u+x it or run with bash) for compiling contracts and deploying on a fresh nodeos instance loaded with eosio.contracts binaries, 1.7.0 latest stable release on 10/16/19:

Running:

  • if you already HAVE nodeos running, run npm run restart
  • if you don't have the contracts compiled before the above, run npm run cstart
  • "restart" and "cstart" will also run tests for you
  • if you DON'T already have nodeosrunning, run npm run start

A local folder called "nodeos" will be created storing the "config" and "data" related to your last deployment session. All nodeos console output will be written to a local file called "stderr".

Prerequisite Software

  • eosio v1.8.4
  • eosio.cdt v1.6.2
  • Node.js v8.11.4+
  • npm v6.4.1+

Collaborators

License

Bancor Protocol is open source and distributed under the Apache License v2.0

More Repositories

1

contracts-solidity

Bancor Protocol Contracts
JavaScript
840
star
2

fastlane-bot

Fast Lane, an open-source arbitrage protocol, allows any user to perform arbitrage between Bancor ecosystem protocols and external exchanges and redirect arbitrage profits back to the protocol.
Jupyter Notebook
136
star
3

contracts-v3

Bancor is a decentralized trading and yield protocol. Its network of on-chain automated market makers (AMMs) supports instant token-to-token trades, as well as single-sided liquidity provision, auto-compounding rewards and 100% impermanent loss protection for any listed asset.
TypeScript
133
star
4

carbon-contracts

Carbon is a fully decentralized protocol for automating on-chain trading strategies.
Solidity
105
star
5

webapp

Bancor Swap/Analytics webapp
TypeScript
32
star
6

bancor-arbitrage

TypeScript
25
star
7

carbon-app

TypeScript
25
star
8

carbon-simulator

This is an open-source python package developed by Bancor Research. It is meant to assist in the design, testing, and validating of the Carbon Protocol.
Jupyter Notebook
25
star
9

webapp-v3

Bancor V3 dApp
TypeScript
19
star
10

sdk

TypeScript
18
star
11

translations

13
star
12

token-governance

Solidity
9
star
13

carbon-sdk

TypeScript
8
star
14

staking-rewards

JavaScript
7
star
15

landing-page

Vue
7
star
16

vote.liquideos.com

LiquidEOS Voting Portal by Bancor
JavaScript
6
star
17

gov-contracts

Bancor Governance contracts
TypeScript
6
star
18

bancor-contracts-solidity-legacy

JavaScript
5
star
19

docs

JavaScript
4
star
20

carbon-simulator-binder

Jupyter Notebook
4
star
21

research

Bancor v3 python spec, simulator, and emulator library. This is an open-source python package developed by Bancor Research. It is meant to assist in the design, testing, and validating of Bancor v3 behavior.
Python
4
star
22

assets

3
star
23

economic-analysis

3
star
24

bntee

JavaScript
3
star
25

carbon-simulator-jupylite

Jupyter Notebook
3
star
26

etl

Databricks ETL for Bancor Protocol V3 dashboard analytics page.
Python
3
star
27

solidity-test-reports

2
star
28

contracts-eos-legacy

C++
2
star
29

tx-analyzer

JavaScript
2
star
30

airhodl

AirHodl (extending https://github.com/bancorprotocol/contracts)
JavaScript
2
star
31

airdrop

JavaScript
2
star
32

research-papers-2024

Jupyter Notebook
2
star
33

carbon-backend

TypeScript
1
star
34

webapp-v2

TypeScript
1
star
35

carbon-subgraph

TypeScript
1
star
36

analytics

ReactJS frontend app for Bancor Protocol V3 dashboard analytics page.
HTML
1
star