Code Monkey home page Code Monkey logo

plenty-smart-contracts's Introduction

Smart-Contracts

Project structure

.
├──  StableSwap/ # Similar Asset Swap Automated Market Maker
├──  Staking/ # Token Distribution Contract
├──  VolatileSwap/ # Volatile Asset Swap Automated Market Maker
├──  xPlenty/ # Flash loan resistant Governance Token
├──  README.md # current file
├──  LICENSE

Prerequisites

  • Installed NodeJS

  • Installed Python3

  • SmartPy CLI

Either the above can be installed or online smartpy ide can be utilised for compilation, testing or deployment.

Staking Contract

Staking Contract is reward token distribution contract inspired from Synthetix dapp which takes in consideration of amount staked, duration of staking while calcualting the rewards for each user. All the reward calculation can be done in constant time complexity.

Volatile Swap

Volatile Swap is an automated market maker which facilitates in exchanging of two tokens irrespective of their nature.

StableSwap

StableSwap is an automated marketm maker which helps in exchanging in similar priced assets in an optimised manner by reducing slippage irrespective of the trade size.

xPlenty

xPlenty is the governance token utilised for voting on the PIP-3 which facilate additon of new pairs, mint reduction, managing reward distribution.

Compilation

To compile the contracts run:

 ~/smartpy-cli/SmartPy.sh compile <smart-contract-folder>/<smart-contract> <output-directory>

The contracts can also be compiled using the online IDE.

Deployment

For Deployment of the smart contract, either online ide or CLI can be utilised.

  ~/smartpy-cli/SmartPy.sh originate-contract --code code.json --storage storage.json --rpc <rpc> --private-key <private-key>

Testing

For testing of the smart contracts, either custom testcase can be written and smart contracts be imported into the respective file and various scenarios can be evaluted.

~/smartpy-cli/SmartPy.sh test <custom-test-case-file> <output-directory>

NOTE: This repository is open-sourced, and is under active improvements based on suggestions and bug-reports. Users are requested to double check the transaction details on their wallet's confirmation page. The authors take no responsibility for the loss of digital assets.

plenty-smart-contracts's People

Contributors

parizval avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.