Skip to content

Chain-Reactor/dex-smart-contracts

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SmarDex Contracts

Tests

Description

Uniswap-like dex protocol that allow a better incentivization for liquidity providers. This repo includes an SDEX pool (rewards comes from the dex) and farming capabilities (rewards requires external income source).

Website

https://smardex.io

Documentation

See the link to the technical paper or visit the Smardex Developer docs

Getting Started

Installation

Install dependencies:

yarn install

Compile

yarn compile

To rebuild typechain specifically:

yarn typechain

Run tests

yarn test                           # run tests without traces

yarn test --traceError              # prints calls for failed txs
yarn test --fulltraceError          # prints calls and storage ops for failed txs
yarn test --trace                   # prints calls for all txs
yarn test --fulltrace               # prints calls and storage ops for all txs

yarn test --v                       # same as --traceError
yarn test --vv                      # same as --fulltraceError
yarn test --vvv                     # same as --trace
yarn test --vvvv                    # same as --fulltrace

# specify opcode
yarn test --v --opcodes ADD,SUB     # shows any opcode specified for only failed txs
yarn test --vvv --opcodes ADD,SUB   # shows any opcode specified for all txs

Deploy

Testnet (mumbai)

yarn deploy_testnet

Hardhat (test deploy script)

yarn deploy

Prettier

Run linter (required before each commit):

yarn prettier

Check code is properly linted:

yarn prettier:check

Slither

For quick and automatic syntaxic analysis, you can use Slither tool : Slither is a Solidity static analysis framework. It runs a suite of vulnerability detectors, prints visual information about contract details. [...] Slither enables developers to find vulnerabilities, enhance their code comprehension, and quickly prototype custom analyses.

Install

See for options : https://github.com/crytic/slither#how-to-install

Run

At project level (where package.json is):

slither . --json slither_output.json
#slither is called system wide, but an absolute or relative binary call can also be used

Better run with yarn to avoid errors & with config to choose printers_to_run : yarn slither

Contributors

Implemented by Stéphane Ballmer, Paul-Alexandre Tessier, Côme Pecorari, Léo Fasano, Yoan Capron, Sami Darnaud

Licensing

The primary license for Smardex is the Business Source License 1.1 (BUSL-1.1), see LICENSE. However, smart-contract files imported from other projects do respect their original license (GPL-3, GPL-2, MIT, ...)

  • All files under periphery are GPL-2
  • All files under core except core/libraries/SmardexLibrary.sol are GPL-2
  • contracts/rewards/FarmingRange.sol is licensed under MIT, fork from Alpaca Finance

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 62.7%
  • Solidity 37.1%
  • Other 0.2%