enzymefinance / protocol Goto Github PK
View Code? Open in Web Editor NEWEnzyme Protocol Implementation
Home Page: https://enzyme.finance
License: GNU General Public License v3.0
Enzyme Protocol Implementation
Home Page: https://enzyme.finance
License: GNU General Public License v3.0
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)
For Inflation as well as for satellite
contracts its important to have the metrics of Module usage
Remove npm-shrinkwrap.json
when solidity-parser
version that parses our contracts is incorporated into truffle.
Add them to this issue. Right now:
Prev. assumed that etherToken
would be referenceAsset
.
Better to have this generalised; I.e. manager can decide which asset he/she would like to be measured against
Requires string manipulation in Solidity, and (most likely) using CryptoCompare-compatible identifiers in the token contracts (which we may get rid of soon anyway).
PrevValue better description of usecase of this struct
You have mistakenly installed the `babel` package, which is a no-op in Babel 6.
Babel's CLI commands have been moved from the `babel` package to the `babel-cli` package.
npm uninstall babel
npm install babel-cli
See http://babeljs.io/docs/usage/cli/ for setup instructions.
More info: https://babeljs.io/docs/usage/cli/
Affected code: https://github.com/melonproject/protocol/blob/master/package.json#L47
@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.
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)
As for initial version trade will be restricted to:
only takeOrders and
takeOrders only from LiquidityProvider (i.e. order.owner == LiquidityProviderAddress)
no makeOrder functionality
in takeOrder only if order.owner == liquidityprovider
Subscribe with only Ether and redeem by receiving only Ether
Write a script to update (at minimum) the addresses in this config, and perhaps others, with newly-deployed addresses (available by truffle networks
or through truffle's contract abstractions).
https://github.com/melonproject/protocol/blob/master/contracts/governance/Governance.sol#L37
we can make this simple: doesn't even need to be multisig initially (mutlisig would require some testing for contract to contract calls)
could just be one account that controlls this - if we have time we can implement and test multisig solution
See this comment.
Some options for build scripts:
Related:
Travis' comment https://github.com/melonproject/satellite/issues/15
Abstraction done on Interface layer not contract layer
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.
import Vault from '@melonproject/protocol/Vault.json'
Redeem option that is independent of active data feed.
From limit order
option to percentage of ownership
option
Function name of redeemInReferenceAsset
would change to redeemInMelon
, or similar.
Eg something like
would also help solve #6
uint decimals
not part of ERC20 standard - hence better to not assume they are there for all such assets
Currently, our dev-env and stage.melonport.com all point to the same smart contracts.
But there should be two:
To differentiate between stage and live, add -stage
to the version like specified in http://semver.org/#spec-item-9
using require
and assert
instead of modifiers
to enforce pre and post conditions throughout
This occurs when the offered value is less than total value of shares in fund.
More of a constant thing we can do, but good to do this thoroughly at this stage as well.
Testability resources:
Possibility of jumping orders; There is no enforcement of manager to take best offered order
order.owner === address(liquidityProvider)
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?
similar to #75
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.
For interface reasons on portal and to make subscribe module function more efficient
In core
contract use:
createShares(..)
createSharesOnBehalf(..)
Participation Module as a way to invest in portfolio using only one asset, that gets split up into protfolio 'split' which gets added to core.
Rational: less friction for portfolio manager.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.