Giter Site home page Giter Site logo

enzymefinance / protocol Goto Github PK

View Code? Open in Web Editor NEW
369.0 369.0 152.0 30.73 MB

Enzyme Protocol Implementation

Home Page: https://enzyme.finance

License: GNU General Public License v3.0

Solidity 99.82% Makefile 0.16% Nix 0.02% Shell 0.01%
blockchain defi enzyme ethereum protocol

protocol's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

protocol's Issues

Deploy to ETHPM

Relevant branch: https://github.com/melonproject/protocol/tree/ethpm

root@x2:~/Melon/protocol$ truffle publish
Gathering contracts...
SyntaxError: Expected "!", "!=", "(", ")", "+", "++", "-", "--", "0", "<", "<=", "==", ">", ">=", "[", "^", "delete", "false", "hex", "mapping", "new", "this", "true", "v", "~", [1-9], comment, end of line, identifier, number, string, or whitespace but "{" found.
    at peg$buildStructuredError (/home/reto/.nvm/versions/node/v7.3.0/lib/node_modules/truffle/node_modules/solidity-parser/build/parser.js:1272:12)
    at Object.peg$parse [as parse] (/home/reto/.nvm/versions/node/v7.3.0/lib/node_modules/truffle/node_modules/solidity-parser/build/parser.js:13858:11)
    at Object.parse (/home/reto/.nvm/versions/node/v7.3.0/lib/node_modules/truffle/node_modules/solidity-parser/index.js:34:23)
    at /home/reto/.nvm/versions/node/v7.3.0/lib/node_modules/truffle/node_modules/truffle-compile/profiler.js:259:36
    at tryToString (fs.js:425:3)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:412:12)

Track Module Usage

For Inflation as well as for satellite contracts its important to have the metrics of Module usage

Remove shrinkwrap.json

Remove npm-shrinkwrap.json when solidity-parser version that parses our contracts is incorporated into truffle.

[Re-]write tests where applicable

@retotrinkler suggested a major re-write of the tests in this repo, adn I agree.
When we get a coverage tool working (#55) then we can know where should direct our efforts.

  • Add general tests for asset tokens (preminedAsset)
  • add tests for etherToken
  • add tests for pricefeed
  • tests for Version
  • tests for invest/redeem
  • test Vault

Two tests failing intermittently on Windows 7

When I run truffle test I get errors on two tests sometimes, but not all of the time.

The tests have identical code, but do not always fail together:

An example of the error message I receive:

  1) Contract: PriceFeed Get multiple existent prices relative to Ether:

      Uncaught AssertionError: 4800000 == 5004003202562050000
      + expected - actual

      -4800000
      +5004003202562050000

      at priceFeedContract.getPrice.then (test\pricefeed.js:104:18)
      at process._tickCallback (internal/process/next_tick.js:103:7)

Could this be because these test cases are running in async? (Though I thought async.mapSeries was supposed to run them in order, but I'm not sure)

Split Vault.sol into several files

Vault.sol is getting really big, and may have functionality that could be kicked out into other solidity files.
We can probably make at least 2 files out of it if we wanted.
Lower priority than adding functionality/bugfixes.

Better NPM module

  • Exclude contracts / migrations for NPM
  • Make import happen like import Vault from '@melonproject/protocol/Vault.json'

Add code coverage badge

Requires ability to calculate code coverage.
Can use something like this for that.

  • Waiting on issue
  • Waiting on #64 (coverage doesn't make much sense with failing tests)

Initial Version of Risk Mgmt module

Possibility of jumping orders; There is no enforcement of manager to take best offered order

  • Initial solution:
    Assert that:
    order.owner === address(liquidityProvider)
    for takeOrder

Remove hardcoded static array size in favour of dynamic array

This issue is contingent on merge of subscribe-redeem branch in its current form

Had to use a bit of a hack in order to return an array from an external contract call here.

Apparently we cannot yet return a dynamic array from an external function call in solidity yet, so the current workaround is to just make a very large (mostly empty) static array.

We should not have more than 200 assets in a portfolio for a long long time, so this artificial limit will work for the time being, but should be removed as soon as possible.

There may also be another approach to the problem I haven't thought about. Maybe we can use mappings instead of returning array at all?

getNumberOfActiveOrders on exchange contract

We could optimise the syncing of orders by having a getNumberOfActiveOrders of the exchange contract. With this, we can count the synced active orders against this number and stop as soon as we reached getNumberOfActiveOrders.

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.