Giter Club home page Giter Club logo

ricobank-example's Introduction

Rico Credit System

RICO is an ERC20 token that's designed to be stable with respect to RISK, an ERC20 token used to purchase accumulated fees from debt positions.

For a brief primer, see the Litepaper.

overview

  • bank.sol -- core RCS functions
  • math.sol -- internal math funcitons
  • flog.sol -- external function call events
  • palm.sol -- storage variable modified events

developing

You need node/npm, and you need ipfs daemon running. This repo uses submodules for managing some dependencies.

  • npm run initialize -- this will perform:
    • npm install
    • npm run download-submodules
    • npm run install-submodules
    • npm run build:all
  • FOUNDRY_PROFILE=lite npm test

To run js tests with ipfs daemon running:

  • npm run js-test

To deploy from hardhat console:

  • pack = await hre.run('deploy-ricobank', { writepack: 'true', netname: <network name from which to load settings>, tokens: './tokens.json', mock: 'true', gasLimit: <gas limit> })

dpack

To deploy ricobank and create a new pack for it, run the deploy-ricobank task. It will return the pack object and also write it to a json file in ./pack/. To load the pack,

  • pack = require(path_to_pack_file) or pack = hre.run('deploy-ricobank', ...)
  • dapp = await dpack.load(pack, ethers, signer)
  • bank = dapp.bank

dapp contains bank, the core ricobank object and some other contracts, all as ethers.js Contract objects.

To create a CDP, approve your tokens to bank, and run bank.frob(dink, dart) using the ethers Solidity ABI.

  • bank.keep() - balance surplus/deficit and poke the par price
  • bank.bail(usr) - liquidate a position

Notice

See NOTICE file for copyrights and credits.

ricobank-example's People

Contributors

kbrav avatar

Stargazers

 avatar

Watchers

 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.