-
Notifications
You must be signed in to change notification settings - Fork 341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zero Src Qty Handling #483
Conversation
…ontracts into clicky/zero_rate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since we don't do audit.
try to minimize code changes.
please see what can be done.
result.reserve2 = address(0); | ||
result.rateEthToDest = 0; | ||
result.destAmount = 0; | ||
result.rate = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please write this in a way that created minimum code changes.
exapmle: if weiAmount is zero.
try to set result and return it. and leave rest of code untouched.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated!
(didRevert, expectedRate, slippageRate) = safeFindBestRate(src, dest, srcQty, usePermissionless); | ||
if (didRevert) return (0, 0); | ||
if (usePermissionless) { | ||
(bestReserve, expectedRate) = kyberNetwork.findBestRate(src, dest, srcQty); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
best if can write the code as it was before safeFindBestRate was added.
is it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the same as this, right? Minus the check for knc arbitrage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great
thanks
let qty = 0; | ||
|
||
//create malicious reserve | ||
let badReserve = await MaliciousReserve.new(network.address, pricing1.address, admin); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't get why reserve is called malicious?
does it attack network?
or only revert when queried with 0 quantity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It reverts when queried with 0 quantity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see my reply to your comment regarding #434
} else { | ||
slippageRate = expectedRate; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
regarding your PR comment.
I Agree expectedRateSmallQty could fail.
solution would be after this line:
uint ethQty = calcDestAmount(src, ETH_TOKEN_ADDRESS, srcQty, rateSrcToEth)
if ethQty == 0, can use ethqty = 1 or return 0.
both are fine from my side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added!
…ontracts into clicky/zero_rate
…art-contracts into clicky/zero_rate
…ontracts into clicky/zero_rate
…ontracts into clicky/zero_rate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Branch has conflicts in expectedRate.js
please pull development again. solve locally and update PR
maybe it happened since I pulled another PR - to revert arb handling
* Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1, reversing changes made to 80af391. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3, reversing changes made to 6c0a21c. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0e. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock
* Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1, reversing changes made to 80af391. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3, reversing changes made to 6c0a21c. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0e. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Add Eth2Dai reserve and test (#523) * [WIP] Eth2Dai Reserve enhancement (#449) * Add eth2dai contract * Update Eth2Dai reserve * Update Eth2DaiReserve contract and tests * Update trade function tests for eth2dai reserve * Make single test can run on its own * Separate source codes, add some v5 contracts * Update contracts fixed some review comments, remove some unused functions * Update eth2dai contract with enable/disable internal inventory for token * Add test for set internal inventory enable/disable * Put enable/disable internal inventory into internal inventory data * Add internal inventory tests * Change overlow to out of range * Update v5 contracts * Update file name and folder structure * Update folder structure * Fix can not find artifacts for WethTokenV5 * Update test folder structure * Remove KyberOasisReserve source code + test, change WethTokenV5 to WethToken (#524) * remove duplicate files and v5 example
* Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1, reversing changes made to 80af391. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3, reversing changes made to 6c0a21c. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0e. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock
* Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1, reversing changes made to 80af391. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3, reversing changes made to 6c0a21c. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0e. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Ilan/master to development (#525) * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1, reversing changes made to 80af391. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3, reversing changes made to 6c0a21c. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0e. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Add Eth2Dai reserve and test (#523) * [WIP] Eth2Dai Reserve enhancement (#449) * Add eth2dai contract * Update Eth2Dai reserve * Update Eth2DaiReserve contract and tests * Update trade function tests for eth2dai reserve * Make single test can run on its own * Separate source codes, add some v5 contracts * Update contracts fixed some review comments, remove some unused functions * Update eth2dai contract with enable/disable internal inventory for token * Add test for set internal inventory enable/disable * Put enable/disable internal inventory into internal inventory data * Add internal inventory tests * Change overlow to out of range * Update v5 contracts * Update file name and folder structure * Update folder structure * Fix can not find artifacts for WethTokenV5 * Update test folder structure * Remove KyberOasisReserve source code + test, change WethTokenV5 to WethToken (#524) * remove duplicate files and v5 example * Add KyberBancorReserve and test * Fix some tests for kyber bancor reserve * Add more tests for kyber bancor reserve * Remove default value for bnt and bancor eth token * Add end of file line * Update contracts from review comments * Fix contract and test based on comments * Return 0 for rate and revert in trade when srcQty is 0 * Remove v5 example test file' Co-authored-by: Desmond <[email protected]> Co-authored-by: Ilan Doron <[email protected]>
* update git ignore (#544) * Kyber Bancor bridge reserve (#546) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1, reversing changes made to 80af391. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3, reversing changes made to 6c0a21c. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0e. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Ilan/master to development (#525) * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1, reversing changes made to 80af391. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3, reversing changes made to 6c0a21c. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0e. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Add Eth2Dai reserve and test (#523) * [WIP] Eth2Dai Reserve enhancement (#449) * Add eth2dai contract * Update Eth2Dai reserve * Update Eth2DaiReserve contract and tests * Update trade function tests for eth2dai reserve * Make single test can run on its own * Separate source codes, add some v5 contracts * Update contracts fixed some review comments, remove some unused functions * Update eth2dai contract with enable/disable internal inventory for token * Add test for set internal inventory enable/disable * Put enable/disable internal inventory into internal inventory data * Add internal inventory tests * Change overlow to out of range * Update v5 contracts * Update file name and folder structure * Update folder structure * Fix can not find artifacts for WethTokenV5 * Update test folder structure * Remove KyberOasisReserve source code + test, change WethTokenV5 to WethToken (#524) * remove duplicate files and v5 example * Add KyberBancorReserve and test * Fix some tests for kyber bancor reserve * Add more tests for kyber bancor reserve * Remove default value for bnt and bancor eth token * Add end of file line * Update contracts from review comments * Fix contract and test based on comments * Return 0 for rate and revert in trade when srcQty is 0 * Remove v5 example test file' Co-authored-by: Desmond <[email protected]> Co-authored-by: Ilan Doron <[email protected]> Co-authored-by: Le Xuan Manh <[email protected]> Co-authored-by: Desmond <[email protected]>
* update git ignore (#544) * Kyber Bancor bridge reserve (#546) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1, reversing changes made to 80af391. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3, reversing changes made to 6c0a21c. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0e. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Ilan/master to development (#525) * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1, reversing changes made to 80af391. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3, reversing changes made to 6c0a21c. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0e. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Add Eth2Dai reserve and test (#523) * [WIP] Eth2Dai Reserve enhancement (#449) * Add eth2dai contract * Update Eth2Dai reserve * Update Eth2DaiReserve contract and tests * Update trade function tests for eth2dai reserve * Make single test can run on its own * Separate source codes, add some v5 contracts * Update contracts fixed some review comments, remove some unused functions * Update eth2dai contract with enable/disable internal inventory for token * Add test for set internal inventory enable/disable * Put enable/disable internal inventory into internal inventory data * Add internal inventory tests * Change overlow to out of range * Update v5 contracts * Update file name and folder structure * Update folder structure * Fix can not find artifacts for WethTokenV5 * Update test folder structure * Remove KyberOasisReserve source code + test, change WethTokenV5 to WethToken (#524) * remove duplicate files and v5 example * Add KyberBancorReserve and test * Fix some tests for kyber bancor reserve * Add more tests for kyber bancor reserve * Remove default value for bnt and bancor eth token * Add end of file line * Update contracts from review comments * Fix contract and test based on comments * Return 0 for rate and revert in trade when srcQty is 0 * Remove v5 example test file' Co-authored-by: Desmond <[email protected]> Co-authored-by: Ilan Doron <[email protected]> Co-authored-by: Le Xuan Manh <[email protected]> Co-authored-by: Desmond <[email protected]>
* update git ignore (#544) * Kyber Bancor bridge reserve (#546) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1, reversing changes made to 80af391. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3, reversing changes made to 6c0a21c. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0e. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Ilan/master to development (#525) * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1, reversing changes made to 80af391. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3, reversing changes made to 6c0a21c. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0e. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Add Eth2Dai reserve and test (#523) * [WIP] Eth2Dai Reserve enhancement (#449) * Add eth2dai contract * Update Eth2Dai reserve * Update Eth2DaiReserve contract and tests * Update trade function tests for eth2dai reserve * Make single test can run on its own * Separate source codes, add some v5 contracts * Update contracts fixed some review comments, remove some unused functions * Update eth2dai contract with enable/disable internal inventory for token * Add test for set internal inventory enable/disable * Put enable/disable internal inventory into internal inventory data * Add internal inventory tests * Change overlow to out of range * Update v5 contracts * Update file name and folder structure * Update folder structure * Fix can not find artifacts for WethTokenV5 * Update test folder structure * Remove KyberOasisReserve source code + test, change WethTokenV5 to WethToken (#524) * remove duplicate files and v5 example * Add KyberBancorReserve and test * Fix some tests for kyber bancor reserve * Add more tests for kyber bancor reserve * Remove default value for bnt and bancor eth token * Add end of file line * Update contracts from review comments * Fix contract and test based on comments * Return 0 for rate and revert in trade when srcQty is 0 * Remove v5 example test file' Co-authored-by: Desmond <[email protected]> Co-authored-by: Ilan Doron <[email protected]> Co-authored-by: Le Xuan Manh <[email protected]> Co-authored-by: Desmond <[email protected]>
* update git ignore * update development (#547) * update git ignore (#544) * Kyber Bancor bridge reserve (#546) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1, reversing changes made to 80af391. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3, reversing changes made to 6c0a21c. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0e. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Ilan/master to development (#525) * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1, reversing changes made to 80af391. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3, reversing changes made to 6c0a21c. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0e. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Add Eth2Dai reserve and test (#523) * [WIP] Eth2Dai Reserve enhancement (#449) * Add eth2dai contract * Update Eth2Dai reserve * Update Eth2DaiReserve contract and tests * Update trade function tests for eth2dai reserve * Make single test can run on its own * Separate source codes, add some v5 contracts * Update contracts fixed some review comments, remove some unused functions * Update eth2dai contract with enable/disable internal inventory for token * Add test for set internal inventory enable/disable * Put enable/disable internal inventory into internal inventory data * Add internal inventory tests * Change overlow to out of range * Update v5 contracts * Update file name and folder structure * Update folder structure * Fix can not find artifacts for WethTokenV5 * Update test folder structure * Remove KyberOasisReserve source code + test, change WethTokenV5 to WethToken (#524) * remove duplicate files and v5 example * Add KyberBancorReserve and test * Fix some tests for kyber bancor reserve * Add more tests for kyber bancor reserve * Remove default value for bnt and bancor eth token * Add end of file line * Update contracts from review comments * Fix contract and test based on comments * Return 0 for rate and revert in trade when srcQty is 0 * Remove v5 example test file' Co-authored-by: Desmond <[email protected]> Co-authored-by: Ilan Doron <[email protected]> Co-authored-by: Le Xuan Manh <[email protected]> Co-authored-by: Desmond <[email protected]> * Upgrade bancor bridge test to new web3 * Add CR LF for bancor file test Co-authored-by: Ilan Doron <[email protected]> Co-authored-by: Desmond <[email protected]>
* [WIP] Upgrade web3 version to 1.2.4 * Update conversion rate and enhance step func rate tests * Remove openzeplin test helper * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1, reversing changes made to 80af391. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3, reversing changes made to 6c0a21c. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0e. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Add Eth2Dai reserve and test (#523) * [WIP] Eth2Dai Reserve enhancement (#449) * Add eth2dai contract * Update Eth2Dai reserve * Update Eth2DaiReserve contract and tests * Update trade function tests for eth2dai reserve * Make single test can run on its own * Separate source codes, add some v5 contracts * Update contracts fixed some review comments, remove some unused functions * Update eth2dai contract with enable/disable internal inventory for token * Add test for set internal inventory enable/disable * Put enable/disable internal inventory into internal inventory data * Add internal inventory tests * Change overlow to out of range * Update v5 contracts * Update file name and folder structure * Update folder structure * Fix can not find artifacts for WethTokenV5 * Update test folder structure * Rebase from development * Modify kyberNetwork script to be web3 1.x compatible * Clicky's web3 compatibility upgrade (#531) * KNP.js web3 1.x compatible * DutchXReserve.js * Removed addBps function, since we using Helper one * remove web3 instantiation * kyberUniswapReserve.js * Update test for expected rate and fee burner (#532) * Update test for expected rate and fee burner * Remove unused codes * support new web3 lib, especailly new BN (#533) * support new web3 lib, especailly new BN * upgrade kyber weth reserve to web3 * remove unused log function * kyberReserve.js, permissionGroups.js, whitelist.js, volumeImbalanceRecorder.js (#535) * KNP.js web3 1.x compatible * DutchXReserve.js * Removed addBps function, since we using Helper one * remove web3 instantiation * kyberUniswapReserve.js * kyberReserve.js * permissionGroups.js * Small code refactor for volumeImbalanceRecorder * whitelist.js * Remove valueOf() * Move calc src & dst qty functions to helper * wrapper files(3), orderIdManager, orderList, mockDepositxx, mockExchnagexxx, permission less order book reserve lister (#537) * update for web3 version * update wrappers to work with new web3 version * correct use artifacts * order list upgrade web3 * remove some debug info * upgrade permission less oreder book reserve lister to test to new Web3 version * fix some typos * remove some more valueOf() in assert (#538) * remove some valueOf() that are not required. * add CR LF on end * add back correct package lock * add back correct package lock * Update test for helper, liquidity conversion rates and formula (#536) * Update test for helper, liquidity conversion rates and formula * Remove unused logs * Update codes based on comments * Add new line for helper * remove valueOf(), user helper file to assert (#540) * remove valueOf() calls assert.equal --> Helper.assertEqual() * remove valueOf(), use Helper to assert * remove valueOf() * [WIP] Web3 upgrade for eth2 dai (#542) * eth2Dai initial commit * add helper changes * add issues * Fix failing tests, using helper assert func (#543) Co-authored-by: Le Xuan Manh <[email protected]> * remove example test file (#545) * Utils.js, Utils2.js, Utils3.js, update to web3 v1.2.4 (#534) * Updated utils.js to web3 1.2.4 * Updated utils2.js to web3 1.2.4 * Updated utils3.js to web3 1.2.4 * Updated utils*.js, fixed bugs on helper.js * Added modifications from Ilan's feedback * orderbookReserve.js update to web3 v1.2.4 (#555) * orderbookReserve.js update to web3 v1.2.4 * Implemented changes from feedback * Updated TokenWei var to Token18Dec * Changed Token18Dec var to camel case * Web3 upgrade bancor (#577) * update git ignore * update development (#547) * update git ignore (#544) * Kyber Bancor bridge reserve (#546) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1, reversing changes made to 80af391. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3, reversing changes made to 6c0a21c. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0e. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Ilan/master to development (#525) * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1, reversing changes made to 80af391. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3, reversing changes made to 6c0a21c. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0e. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Add Eth2Dai reserve and test (#523) * [WIP] Eth2Dai Reserve enhancement (#449) * Add eth2dai contract * Update Eth2Dai reserve * Update Eth2DaiReserve contract and tests * Update trade function tests for eth2dai reserve * Make single test can run on its own * Separate source codes, add some v5 contracts * Update contracts fixed some review comments, remove some unused functions * Update eth2dai contract with enable/disable internal inventory for token * Add test for set internal inventory enable/disable * Put enable/disable internal inventory into internal inventory data * Add internal inventory tests * Change overlow to out of range * Update v5 contracts * Update file name and folder structure * Update folder structure * Fix can not find artifacts for WethTokenV5 * Update test folder structure * Remove KyberOasisReserve source code + test, change WethTokenV5 to WethToken (#524) * remove duplicate files and v5 example * Add KyberBancorReserve and test * Fix some tests for kyber bancor reserve * Add more tests for kyber bancor reserve * Remove default value for bnt and bancor eth token * Add end of file line * Update contracts from review comments * Fix contract and test based on comments * Return 0 for rate and revert in trade when srcQty is 0 * Remove v5 example test file' Co-authored-by: Desmond <[email protected]> Co-authored-by: Ilan Doron <[email protected]> Co-authored-by: Le Xuan Manh <[email protected]> Co-authored-by: Desmond <[email protected]> * Upgrade bancor bridge test to new web3 * Add CR LF for bancor file test Co-authored-by: Ilan Doron <[email protected]> Co-authored-by: Desmond <[email protected]> Co-authored-by: Ilan Doron <[email protected]> Co-authored-by: Desmond <[email protected]> Co-authored-by: Anton Buenavista <[email protected]>
* Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Ilan/master to development (#525) * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Add Eth2Dai reserve and test (#523) * [WIP] Eth2Dai Reserve enhancement (#449) * Add eth2dai contract * Update Eth2Dai reserve * Update Eth2DaiReserve contract and tests * Update trade function tests for eth2dai reserve * Make single test can run on its own * Separate source codes, add some v5 contracts * Update contracts fixed some review comments, remove some unused functions * Update eth2dai contract with enable/disable internal inventory for token * Add test for set internal inventory enable/disable * Put enable/disable internal inventory into internal inventory data * Add internal inventory tests * Change overlow to out of range * Update v5 contracts * Update file name and folder structure * Update folder structure * Fix can not find artifacts for WethTokenV5 * Update test folder structure * Remove KyberOasisReserve source code + test, change WethTokenV5 to WethToken (#524) * remove duplicate files and v5 example * update git ignore * update development (#547) * update git ignore (#544) * Kyber Bancor bridge reserve (#546) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Ilan/master to development (#525) * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Add Eth2Dai reserve and test (#523) * [WIP] Eth2Dai Reserve enhancement (#449) * Add eth2dai contract * Update Eth2Dai reserve * Update Eth2DaiReserve contract and tests * Update trade function tests for eth2dai reserve * Make single test can run on its own * Separate source codes, add some v5 contracts * Update contracts fixed some review comments, remove some unused functions * Update eth2dai contract with enable/disable internal inventory for token * Add test for set internal inventory enable/disable * Put enable/disable internal inventory into internal inventory data * Add internal inventory tests * Change overlow to out of range * Update v5 contracts * Update file name and folder structure * Update folder structure * Fix can not find artifacts for WethTokenV5 * Update test folder structure * Remove KyberOasisReserve source code + test, change WethTokenV5 to WethToken (#524) * remove duplicate files and v5 example * Add KyberBancorReserve and test * Fix some tests for kyber bancor reserve * Add more tests for kyber bancor reserve * Remove default value for bnt and bancor eth token * Add end of file line * Update contracts from review comments * Fix contract and test based on comments * Return 0 for rate and revert in trade when srcQty is 0 * Remove v5 example test file' Co-authored-by: Desmond <[email protected]> Co-authored-by: Ilan Doron <[email protected]> Co-authored-by: Le Xuan Manh <[email protected]> Co-authored-by: Desmond <[email protected]> * Upgrade web3 version to 1.2.4 (#514) * [WIP] Upgrade web3 version to 1.2.4 * Update conversion rate and enhance step func rate tests * Remove openzeplin test helper * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Add Eth2Dai reserve and test (#523) * [WIP] Eth2Dai Reserve enhancement (#449) * Add eth2dai contract * Update Eth2Dai reserve * Update Eth2DaiReserve contract and tests * Update trade function tests for eth2dai reserve * Make single test can run on its own * Separate source codes, add some v5 contracts * Update contracts fixed some review comments, remove some unused functions * Update eth2dai contract with enable/disable internal inventory for token * Add test for set internal inventory enable/disable * Put enable/disable internal inventory into internal inventory data * Add internal inventory tests * Change overlow to out of range * Update v5 contracts * Update file name and folder structure * Update folder structure * Fix can not find artifacts for WethTokenV5 * Update test folder structure * Rebase from development * Modify kyberNetwork script to be web3 1.x compatible * Clicky's web3 compatibility upgrade (#531) * KNP.js web3 1.x compatible * DutchXReserve.js * Removed addBps function, since we using Helper one * remove web3 instantiation * kyberUniswapReserve.js * Update test for expected rate and fee burner (#532) * Update test for expected rate and fee burner * Remove unused codes * support new web3 lib, especailly new BN (#533) * support new web3 lib, especailly new BN * upgrade kyber weth reserve to web3 * remove unused log function * kyberReserve.js, permissionGroups.js, whitelist.js, volumeImbalanceRecorder.js (#535) * KNP.js web3 1.x compatible * DutchXReserve.js * Removed addBps function, since we using Helper one * remove web3 instantiation * kyberUniswapReserve.js * kyberReserve.js * permissionGroups.js * Small code refactor for volumeImbalanceRecorder * whitelist.js * Remove valueOf() * Move calc src & dst qty functions to helper * wrapper files(3), orderIdManager, orderList, mockDepositxx, mockExchnagexxx, permission less order book reserve lister (#537) * update for web3 version * update wrappers to work with new web3 version * correct use artifacts * order list upgrade web3 * remove some debug info * upgrade permission less oreder book reserve lister to test to new Web3 version * fix some typos * remove some more valueOf() in assert (#538) * remove some valueOf() that are not required. * add CR LF on end * add back correct package lock * add back correct package lock * Update test for helper, liquidity conversion rates and formula (#536) * Update test for helper, liquidity conversion rates and formula * Remove unused logs * Update codes based on comments * Add new line for helper * remove valueOf(), user helper file to assert (#540) * remove valueOf() calls assert.equal --> Helper.assertEqual() * remove valueOf(), use Helper to assert * remove valueOf() * [WIP] Web3 upgrade for eth2 dai (#542) * eth2Dai initial commit * add helper changes * add issues * Fix failing tests, using helper assert func (#543) Co-authored-by: Le Xuan Manh <[email protected]> * remove example test file (#545) * Utils.js, Utils2.js, Utils3.js, update to web3 v1.2.4 (#534) * Updated utils.js to web3 1.2.4 * Updated utils2.js to web3 1.2.4 * Updated utils3.js to web3 1.2.4 * Updated utils*.js, fixed bugs on helper.js * Added modifications from Ilan's feedback * orderbookReserve.js update to web3 v1.2.4 (#555) * orderbookReserve.js update to web3 v1.2.4 * Implemented changes from feedback * Updated TokenWei var to Token18Dec * Changed Token18Dec var to camel case * Web3 upgrade bancor (#577) * update git ignore * update development (#547) * update git ignore (#544) * Kyber Bancor bridge reserve (#546) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Ilan/master to development (#525) * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate a…
* update git ignore (#544) * Kyber Bancor bridge reserve (#546) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1, reversing changes made to 80af391. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3, reversing changes made to 6c0a21c. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0e. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Ilan/master to development (#525) * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1, reversing changes made to 80af391. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3, reversing changes made to 6c0a21c. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0e. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Add Eth2Dai reserve and test (#523) * [WIP] Eth2Dai Reserve enhancement (#449) * Add eth2dai contract * Update Eth2Dai reserve * Update Eth2DaiReserve contract and tests * Update trade function tests for eth2dai reserve * Make single test can run on its own * Separate source codes, add some v5 contracts * Update contracts fixed some review comments, remove some unused functions * Update eth2dai contract with enable/disable internal inventory for token * Add test for set internal inventory enable/disable * Put enable/disable internal inventory into internal inventory data * Add internal inventory tests * Change overlow to out of range * Update v5 contracts * Update file name and folder structure * Update folder structure * Fix can not find artifacts for WethTokenV5 * Update test folder structure * Remove KyberOasisReserve source code + test, change WethTokenV5 to WethToken (#524) * remove duplicate files and v5 example * Add KyberBancorReserve and test * Fix some tests for kyber bancor reserve * Add more tests for kyber bancor reserve * Remove default value for bnt and bancor eth token * Add end of file line * Update contracts from review comments * Fix contract and test based on comments * Return 0 for rate and revert in trade when srcQty is 0 * Remove v5 example test file' Co-authored-by: Desmond <[email protected]> Co-authored-by: Ilan Doron <[email protected]> * Update bancor bridge with new fixed path (#548) * Quick fixes to liquidityReserveDeployer.js script for deployment of APR (#556) * update web3 helpers (#560) * fix web3 contract compilation * add helper to read conversion rate set data * enable more user friendly usage * add script to deploy enhanced step functions contract. * update SetStepFunctionWrapper.sol add it to compileContracts.js * indent fix deploy * update according to review comments * fix function signature for setImbalanceStepFunction (#576) * fix function signature for setImbalanceStepFunction * rename enhanced steps to ConversionRateEnhancedSteps * rename enhanced steps * review changes * fix contract name, require correct addresses on ctor (#585) * Update conversion rate enhanced steps, and bancor bridge test Co-authored-by: Ilan Doron <[email protected]> Co-authored-by: Desmond <[email protected]> Co-authored-by: Anton Buenavista <[email protected]>
* update git ignore (#544) * Kyber Bancor bridge reserve (#546) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1, reversing changes made to 80af391. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3, reversing changes made to 6c0a21c. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0e. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Ilan/master to development (#525) * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1, reversing changes made to 80af391. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3, reversing changes made to 6c0a21c. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0e. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Add Eth2Dai reserve and test (#523) * [WIP] Eth2Dai Reserve enhancement (#449) * Add eth2dai contract * Update Eth2Dai reserve * Update Eth2DaiReserve contract and tests * Update trade function tests for eth2dai reserve * Make single test can run on its own * Separate source codes, add some v5 contracts * Update contracts fixed some review comments, remove some unused functions * Update eth2dai contract with enable/disable internal inventory for token * Add test for set internal inventory enable/disable * Put enable/disable internal inventory into internal inventory data * Add internal inventory tests * Change overlow to out of range * Update v5 contracts * Update file name and folder structure * Update folder structure * Fix can not find artifacts for WethTokenV5 * Update test folder structure * Remove KyberOasisReserve source code + test, change WethTokenV5 to WethToken (#524) * remove duplicate files and v5 example * Add KyberBancorReserve and test * Fix some tests for kyber bancor reserve * Add more tests for kyber bancor reserve * Remove default value for bnt and bancor eth token * Add end of file line * Update contracts from review comments * Fix contract and test based on comments * Return 0 for rate and revert in trade when srcQty is 0 * Remove v5 example test file' Co-authored-by: Desmond <[email protected]> Co-authored-by: Ilan Doron <[email protected]> * Update bancor bridge with new fixed path (#548) * Quick fixes to liquidityReserveDeployer.js script for deployment of APR (#556) * update web3 helpers (#560) * fix web3 contract compilation * add helper to read conversion rate set data * enable more user friendly usage * add script to deploy enhanced step functions contract. * update SetStepFunctionWrapper.sol add it to compileContracts.js * indent fix deploy * update according to review comments * fix function signature for setImbalanceStepFunction (#576) * fix function signature for setImbalanceStepFunction * rename enhanced steps to ConversionRateEnhancedSteps * rename enhanced steps * review changes * fix contract name, require correct addresses on ctor (#585) * Revert change * Change name of mock conversion rate enhanced steps * Update bancor test + conversion rate enhanced file after merged from master * Revert change for conversion rate enhanced file Co-authored-by: Ilan Doron <[email protected]> Co-authored-by: Desmond <[email protected]> Co-authored-by: Anton Buenavista <[email protected]>
* Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Ilan/master to development (#525) * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Add Eth2Dai reserve and test (#523) * [WIP] Eth2Dai Reserve enhancement (#449) * Add eth2dai contract * Update Eth2Dai reserve * Update Eth2DaiReserve contract and tests * Update trade function tests for eth2dai reserve * Make single test can run on its own * Separate source codes, add some v5 contracts * Update contracts fixed some review comments, remove some unused functions * Update eth2dai contract with enable/disable internal inventory for token * Add test for set internal inventory enable/disable * Put enable/disable internal inventory into internal inventory data * Add internal inventory tests * Change overlow to out of range * Update v5 contracts * Update file name and folder structure * Update folder structure * Fix can not find artifacts for WethTokenV5 * Update test folder structure * Remove KyberOasisReserve source code + test, change WethTokenV5 to WethToken (#524) * remove duplicate files and v5 example * update git ignore * update development (#547) * update git ignore (#544) * Kyber Bancor bridge reserve (#546) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Ilan/master to development (#525) * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Add Eth2Dai reserve and test (#523) * [WIP] Eth2Dai Reserve enhancement (#449) * Add eth2dai contract * Update Eth2Dai reserve * Update Eth2DaiReserve contract and tests * Update trade function tests for eth2dai reserve * Make single test can run on its own * Separate source codes, add some v5 contracts * Update contracts fixed some review comments, remove some unused functions * Update eth2dai contract with enable/disable internal inventory for token * Add test for set internal inventory enable/disable * Put enable/disable internal inventory into internal inventory data * Add internal inventory tests * Change overlow to out of range * Update v5 contracts * Update file name and folder structure * Update folder structure * Fix can not find artifacts for WethTokenV5 * Update test folder structure * Remove KyberOasisReserve source code + test, change WethTokenV5 to WethToken (#524) * remove duplicate files and v5 example * Add KyberBancorReserve and test * Fix some tests for kyber bancor reserve * Add more tests for kyber bancor reserve * Remove default value for bnt and bancor eth token * Add end of file line * Update contracts from review comments * Fix contract and test based on comments * Return 0 for rate and revert in trade when srcQty is 0 * Remove v5 example test file' Co-authored-by: Desmond <[email protected]> Co-authored-by: Ilan Doron <[email protected]> Co-authored-by: Le Xuan Manh <[email protected]> Co-authored-by: Desmond <[email protected]> * Upgrade web3 version to 1.2.4 (#514) * [WIP] Upgrade web3 version to 1.2.4 * Update conversion rate and enhance step func rate tests * Remove openzeplin test helper * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Add Eth2Dai reserve and test (#523) * [WIP] Eth2Dai Reserve enhancement (#449) * Add eth2dai contract * Update Eth2Dai reserve * Update Eth2DaiReserve contract and tests * Update trade function tests for eth2dai reserve * Make single test can run on its own * Separate source codes, add some v5 contracts * Update contracts fixed some review comments, remove some unused functions * Update eth2dai contract with enable/disable internal inventory for token * Add test for set internal inventory enable/disable * Put enable/disable internal inventory into internal inventory data * Add internal inventory tests * Change overlow to out of range * Update v5 contracts * Update file name and folder structure * Update folder structure * Fix can not find artifacts for WethTokenV5 * Update test folder structure * Rebase from development * Modify kyberNetwork script to be web3 1.x compatible * Clicky's web3 compatibility upgrade (#531) * KNP.js web3 1.x compatible * DutchXReserve.js * Removed addBps function, since we using Helper one * remove web3 instantiation * kyberUniswapReserve.js * Update test for expected rate and fee burner (#532) * Update test for expected rate and fee burner * Remove unused codes * support new web3 lib, especailly new BN (#533) * support new web3 lib, especailly new BN * upgrade kyber weth reserve to web3 * remove unused log function * kyberReserve.js, permissionGroups.js, whitelist.js, volumeImbalanceRecorder.js (#535) * KNP.js web3 1.x compatible * DutchXReserve.js * Removed addBps function, since we using Helper one * remove web3 instantiation * kyberUniswapReserve.js * kyberReserve.js * permissionGroups.js * Small code refactor for volumeImbalanceRecorder * whitelist.js * Remove valueOf() * Move calc src & dst qty functions to helper * wrapper files(3), orderIdManager, orderList, mockDepositxx, mockExchnagexxx, permission less order book reserve lister (#537) * update for web3 version * update wrappers to work with new web3 version * correct use artifacts * order list upgrade web3 * remove some debug info * upgrade permission less oreder book reserve lister to test to new Web3 version * fix some typos * remove some more valueOf() in assert (#538) * remove some valueOf() that are not required. * add CR LF on end * add back correct package lock * add back correct package lock * Update test for helper, liquidity conversion rates and formula (#536) * Update test for helper, liquidity conversion rates and formula * Remove unused logs * Update codes based on comments * Add new line for helper * remove valueOf(), user helper file to assert (#540) * remove valueOf() calls assert.equal --> Helper.assertEqual() * remove valueOf(), use Helper to assert * remove valueOf() * [WIP] Web3 upgrade for eth2 dai (#542) * eth2Dai initial commit * add helper changes * add issues * Fix failing tests, using helper assert func (#543) Co-authored-by: Le Xuan Manh <[email protected]> * remove example test file (#545) * Utils.js, Utils2.js, Utils3.js, update to web3 v1.2.4 (#534) * Updated utils.js to web3 1.2.4 * Updated utils2.js to web3 1.2.4 * Updated utils3.js to web3 1.2.4 * Updated utils*.js, fixed bugs on helper.js * Added modifications from Ilan's feedback * orderbookReserve.js update to web3 v1.2.4 (#555) * orderbookReserve.js update to web3 v1.2.4 * Implemented changes from feedback * Updated TokenWei var to Token18Dec * Changed Token18Dec var to camel case * Web3 upgrade bancor (#577) * update git ignore * update development (#547) * update git ignore (#544) * Kyber Bancor bridge reserve (#546) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Ilan/master to development (#525) * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update…
* Development to master (#581) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Ilan/master to development (#525) * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Add Eth2Dai reserve and test (#523) * [WIP] Eth2Dai Reserve enhancement (#449) * Add eth2dai contract * Update Eth2Dai reserve * Update Eth2DaiReserve contract and tests * Update trade function tests for eth2dai reserve * Make single test can run on its own * Separate source codes, add some v5 contracts * Update contracts fixed some review comments, remove some unused functions * Update eth2dai contract with enable/disable internal inventory for token * Add test for set internal inventory enable/disable * Put enable/disable internal inventory into internal inventory data * Add internal inventory tests * Change overlow to out of range * Update v5 contracts * Update file name and folder structure * Update folder structure * Fix can not find artifacts for WethTokenV5 * Update test folder structure * Remove KyberOasisReserve source code + test, change WethTokenV5 to WethToken (#524) * remove duplicate files and v5 example * update git ignore * update development (#547) * update git ignore (#544) * Kyber Bancor bridge reserve (#546) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Ilan/master to development (#525) * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Add Eth2Dai reserve and test (#523) * [WIP] Eth2Dai Reserve enhancement (#449) * Add eth2dai contract * Update Eth2Dai reserve * Update Eth2DaiReserve contract and tests * Update trade function tests for eth2dai reserve * Make single test can run on its own * Separate source codes, add some v5 contracts * Update contracts fixed some review comments, remove some unused functions * Update eth2dai contract with enable/disable internal inventory for token * Add test for set internal inventory enable/disable * Put enable/disable internal inventory into internal inventory data * Add internal inventory tests * Change overlow to out of range * Update v5 contracts * Update file name and folder structure * Update folder structure * Fix can not find artifacts for WethTokenV5 * Update test folder structure * Remove KyberOasisReserve source code + test, change WethTokenV5 to WethToken (#524) * remove duplicate files and v5 example * Add KyberBancorReserve and test * Fix some tests for kyber bancor reserve * Add more tests for kyber bancor reserve * Remove default value for bnt and bancor eth token * Add end of file line * Update contracts from review comments * Fix contract and test based on comments * Return 0 for rate and revert in trade when srcQty is 0 * Remove v5 example test file' Co-authored-by: Desmond <[email protected]> Co-authored-by: Ilan Doron <[email protected]> Co-authored-by: Le Xuan Manh <[email protected]> Co-authored-by: Desmond <[email protected]> * Upgrade web3 version to 1.2.4 (#514) * [WIP] Upgrade web3 version to 1.2.4 * Update conversion rate and enhance step func rate tests * Remove openzeplin test helper * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Add Eth2Dai reserve and test (#523) * [WIP] Eth2Dai Reserve enhancement (#449) * Add eth2dai contract * Update Eth2Dai reserve * Update Eth2DaiReserve contract and tests * Update trade function tests for eth2dai reserve * Make single test can run on its own * Separate source codes, add some v5 contracts * Update contracts fixed some review comments, remove some unused functions * Update eth2dai contract with enable/disable internal inventory for token * Add test for set internal inventory enable/disable * Put enable/disable internal inventory into internal inventory data * Add internal inventory tests * Change overlow to out of range * Update v5 contracts * Update file name and folder structure * Update folder structure * Fix can not find artifacts for WethTokenV5 * Update test folder structure * Rebase from development * Modify kyberNetwork script to be web3 1.x compatible * Clicky's web3 compatibility upgrade (#531) * KNP.js web3 1.x compatible * DutchXReserve.js * Removed addBps function, since we using Helper one * remove web3 instantiation * kyberUniswapReserve.js * Update test for expected rate and fee burner (#532) * Update test for expected rate and fee burner * Remove unused codes * support new web3 lib, especailly new BN (#533) * support new web3 lib, especailly new BN * upgrade kyber weth reserve to web3 * remove unused log function * kyberReserve.js, permissionGroups.js, whitelist.js, volumeImbalanceRecorder.js (#535) * KNP.js web3 1.x compatible * DutchXReserve.js * Removed addBps function, since we using Helper one * remove web3 instantiation * kyberUniswapReserve.js * kyberReserve.js * permissionGroups.js * Small code refactor for volumeImbalanceRecorder * whitelist.js * Remove valueOf() * Move calc src & dst qty functions to helper * wrapper files(3), orderIdManager, orderList, mockDepositxx, mockExchnagexxx, permission less order book reserve lister (#537) * update for web3 version * update wrappers to work with new web3 version * correct use artifacts * order list upgrade web3 * remove some debug info * upgrade permission less oreder book reserve lister to test to new Web3 version * fix some typos * remove some more valueOf() in assert (#538) * remove some valueOf() that are not required. * add CR LF on end * add back correct package lock * add back correct package lock * Update test for helper, liquidity conversion rates and formula (#536) * Update test for helper, liquidity conversion rates and formula * Remove unused logs * Update codes based on comments * Add new line for helper * remove valueOf(), user helper file to assert (#540) * remove valueOf() calls assert.equal --> Helper.assertEqual() * remove valueOf(), use Helper to assert * remove valueOf() * [WIP] Web3 upgrade for eth2 dai (#542) * eth2Dai initial commit * add helper changes * add issues * Fix failing tests, using helper assert func (#543) Co-authored-by: Le Xuan Manh <[email protected]> * remove example test file (#545) * Utils.js, Utils2.js, Utils3.js, update to web3 v1.2.4 (#534) * Updated utils.js to web3 1.2.4 * Updated utils2.js to web3 1.2.4 * Updated utils3.js to web3 1.2.4 * Updated utils*.js, fixed bugs on helper.js * Added modifications from Ilan's feedback * orderbookReserve.js update to web3 v1.2.4 (#555) * orderbookReserve.js update to web3 v1.2.4 * Implemented changes from feedback * Updated TokenWei var to Token18Dec * Changed Token18Dec var to camel case * Web3 upgrade bancor (#577) * update git ignore * update development (#547) * update git ignore (#544) * Kyber Bancor bridge reserve (#546) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Ilan/master to development (#525) * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from…
* Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Ilan/master to development (#525) * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Add Eth2Dai reserve and test (#523) * [WIP] Eth2Dai Reserve enhancement (#449) * Add eth2dai contract * Update Eth2Dai reserve * Update Eth2DaiReserve contract and tests * Update trade function tests for eth2dai reserve * Make single test can run on its own * Separate source codes, add some v5 contracts * Update contracts fixed some review comments, remove some unused functions * Update eth2dai contract with enable/disable internal inventory for token * Add test for set internal inventory enable/disable * Put enable/disable internal inventory into internal inventory data * Add internal inventory tests * Change overlow to out of range * Update v5 contracts * Update file name and folder structure * Update folder structure * Fix can not find artifacts for WethTokenV5 * Update test folder structure * Remove KyberOasisReserve source code + test, change WethTokenV5 to WethToken (#524) * remove duplicate files and v5 example * update git ignore * update development (#547) * update git ignore (#544) * Kyber Bancor bridge reserve (#546) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Ilan/master to development (#525) * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Add Eth2Dai reserve and test (#523) * [WIP] Eth2Dai Reserve enhancement (#449) * Add eth2dai contract * Update Eth2Dai reserve * Update Eth2DaiReserve contract and tests * Update trade function tests for eth2dai reserve * Make single test can run on its own * Separate source codes, add some v5 contracts * Update contracts fixed some review comments, remove some unused functions * Update eth2dai contract with enable/disable internal inventory for token * Add test for set internal inventory enable/disable * Put enable/disable internal inventory into internal inventory data * Add internal inventory tests * Change overlow to out of range * Update v5 contracts * Update file name and folder structure * Update folder structure * Fix can not find artifacts for WethTokenV5 * Update test folder structure * Remove KyberOasisReserve source code + test, change WethTokenV5 to WethToken (#524) * remove duplicate files and v5 example * Add KyberBancorReserve and test * Fix some tests for kyber bancor reserve * Add more tests for kyber bancor reserve * Remove default value for bnt and bancor eth token * Add end of file line * Update contracts from review comments * Fix contract and test based on comments * Return 0 for rate and revert in trade when srcQty is 0 * Remove v5 example test file' Co-authored-by: Desmond <[email protected]> Co-authored-by: Ilan Doron <[email protected]> Co-authored-by: Le Xuan Manh <[email protected]> Co-authored-by: Desmond <[email protected]> * Update bancor bridge with new fixed path (#548) * Quick fixes to liquidityReserveDeployer.js script for deployment of APR (#556) * update web3 helpers (#560) * fix web3 contract compilation * add helper to read conversion rate set data * enable more user friendly usage * add script to deploy enhanced step functions contract. * update SetStepFunctionWrapper.sol add it to compileContracts.js * indent fix deploy * update according to review comments * fix function signature for setImbalanceStepFunction (#576) * fix function signature for setImbalanceStepFunction * rename enhanced steps to ConversionRateEnhancedSteps * rename enhanced steps * review changes * Upgrade web3 version to 1.2.4 (#514) * [WIP] Upgrade web3 version to 1.2.4 * Update conversion rate and enhance step func rate tests * Remove openzeplin test helper * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Add Eth2Dai reserve and test (#523) * [WIP] Eth2Dai Reserve enhancement (#449) * Add eth2dai contract * Update Eth2Dai reserve * Update Eth2DaiReserve contract and tests * Update trade function tests for eth2dai reserve * Make single test can run on its own * Separate source codes, add some v5 contracts * Update contracts fixed some review comments, remove some unused functions * Update eth2dai contract with enable/disable internal inventory for token * Add test for set internal inventory enable/disable * Put enable/disable internal inventory into internal inventory data * Add internal inventory tests * Change overlow to out of range * Update v5 contracts * Update file name and folder structure * Update folder structure * Fix can not find artifacts for WethTokenV5 * Update test folder structure * Rebase from development * Modify kyberNetwork script to be web3 1.x compatible * Clicky's web3 compatibility upgrade (#531) * KNP.js web3 1.x compatible * DutchXReserve.js * Removed addBps function, since we using Helper one * remove web3 instantiation * kyberUniswapReserve.js * Update test for expected rate and fee burner (#532) * Update test for expected rate and fee burner * Remove unused codes * support new web3 lib, especailly new BN (#533) * support new web3 lib, especailly new BN * upgrade kyber weth reserve to web3 * remove unused log function * kyberReserve.js, permissionGroups.js, whitelist.js, volumeImbalanceRecorder.js (#535) * KNP.js web3 1.x compatible * DutchXReserve.js * Removed addBps function, since we using Helper one * remove web3 instantiation * kyberUniswapReserve.js * kyberReserve.js * permissionGroups.js * Small code refactor for volumeImbalanceRecorder * whitelist.js * Remove valueOf() * Move calc src & dst qty functions to helper * wrapper files(3), orderIdManager, orderList, mockDepositxx, mockExchnagexxx, permission less order book reserve lister (#537) * update for web3 version * update wrappers to work with new web3 version * correct use artifacts * order list upgrade web3 * remove some debug info * upgrade permission less oreder book reserve lister to test to new Web3 version * fix some typos * remove some more valueOf() in assert (#538) * remove some valueOf() that are not required. * add CR LF on end * add back correct package lock * add back correct package lock * Update test for helper, liquidity conversion rates and formula (#536) * Update test for helper, liquidity conversion rates and formula * Remove unused logs * Update codes based on comments * Add new line for helper * remove valueOf(), user helper file to assert (#540) * remove valueOf() calls assert.equal --> Helper.assertEqual() * remove valueOf(), use Helper to assert * remove valueOf() * [WIP] Web3 upgrade for eth2 dai (#542) * eth2Dai initial commit * add helper changes * add issues * Fix failing tests, using helper assert func (#543) Co-authored-by: Le Xuan Manh <[email protected]> * remove example test file (#545) * Utils.js, Utils2.js, Utils3.js, update to web3 v1.2.4 (#534) * Updated utils.js to web3 1.2.4 * Updated utils2.js to web3 1.2.4 * Updated utils3.js to web3 1.2.4 * Updated utils*.js, fixed bugs on helper.js * Added modifications from Ilan's feedback * orderbookReserve.js update to web3 v1.2.4 (#555) * orderbookReserve.js update to web3 v1.2.4 * Implemented changes from feedback * Updated TokenWei var to Token18Dec * Changed Token18Dec var to camel case * Web3 upgrade bancor (#577) * update git ignore * update development (#547) * update git ignore (#544) * Kyber Bancor bridge reserve (#546) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Ilan/master to development (#525) * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test…
* Development to master (#581) (#606) * Development to master (#581) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Ilan/master to development (#525) * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Add Eth2Dai reserve and test (#523) * [WIP] Eth2Dai Reserve enhancement (#449) * Add eth2dai contract * Update Eth2Dai reserve * Update Eth2DaiReserve contract and tests * Update trade function tests for eth2dai reserve * Make single test can run on its own * Separate source codes, add some v5 contracts * Update contracts fixed some review comments, remove some unused functions * Update eth2dai contract with enable/disable internal inventory for token * Add test for set internal inventory enable/disable * Put enable/disable internal inventory into internal inventory data * Add internal inventory tests * Change overlow to out of range * Update v5 contracts * Update file name and folder structure * Update folder structure * Fix can not find artifacts for WethTokenV5 * Update test folder structure * Remove KyberOasisReserve source code + test, change WethTokenV5 to WethToken (#524) * remove duplicate files and v5 example * update git ignore * update development (#547) * update git ignore (#544) * Kyber Bancor bridge reserve (#546) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Ilan/master to development (#525) * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Add Eth2Dai reserve and test (#523) * [WIP] Eth2Dai Reserve enhancement (#449) * Add eth2dai contract * Update Eth2Dai reserve * Update Eth2DaiReserve contract and tests * Update trade function tests for eth2dai reserve * Make single test can run on its own * Separate source codes, add some v5 contracts * Update contracts fixed some review comments, remove some unused functions * Update eth2dai contract with enable/disable internal inventory for token * Add test for set internal inventory enable/disable * Put enable/disable internal inventory into internal inventory data * Add internal inventory tests * Change overlow to out of range * Update v5 contracts * Update file name and folder structure * Update folder structure * Fix can not find artifacts for WethTokenV5 * Update test folder structure * Remove KyberOasisReserve source code + test, change WethTokenV5 to WethToken (#524) * remove duplicate files and v5 example * Add KyberBancorReserve and test * Fix some tests for kyber bancor reserve * Add more tests for kyber bancor reserve * Remove default value for bnt and bancor eth token * Add end of file line * Update contracts from review comments * Fix contract and test based on comments * Return 0 for rate and revert in trade when srcQty is 0 * Remove v5 example test file' Co-authored-by: Desmond <[email protected]> Co-authored-by: Ilan Doron <[email protected]> Co-authored-by: Le Xuan Manh <[email protected]> Co-authored-by: Desmond <[email protected]> * Upgrade web3 version to 1.2.4 (#514) * [WIP] Upgrade web3 version to 1.2.4 * Update conversion rate and enhance step func rate tests * Remove openzeplin test helper * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Add Eth2Dai reserve and test (#523) * [WIP] Eth2Dai Reserve enhancement (#449) * Add eth2dai contract * Update Eth2Dai reserve * Update Eth2DaiReserve contract and tests * Update trade function tests for eth2dai reserve * Make single test can run on its own * Separate source codes, add some v5 contracts * Update contracts fixed some review comments, remove some unused functions * Update eth2dai contract with enable/disable internal inventory for token * Add test for set internal inventory enable/disable * Put enable/disable internal inventory into internal inventory data * Add internal inventory tests * Change overlow to out of range * Update v5 contracts * Update file name and folder structure * Update folder structure * Fix can not find artifacts for WethTokenV5 * Update test folder structure * Rebase from development * Modify kyberNetwork script to be web3 1.x compatible * Clicky's web3 compatibility upgrade (#531) * KNP.js web3 1.x compatible * DutchXReserve.js * Removed addBps function, since we using Helper one * remove web3 instantiation * kyberUniswapReserve.js * Update test for expected rate and fee burner (#532) * Update test for expected rate and fee burner * Remove unused codes * support new web3 lib, especailly new BN (#533) * support new web3 lib, especailly new BN * upgrade kyber weth reserve to web3 * remove unused log function * kyberReserve.js, permissionGroups.js, whitelist.js, volumeImbalanceRecorder.js (#535) * KNP.js web3 1.x compatible * DutchXReserve.js * Removed addBps function, since we using Helper one * remove web3 instantiation * kyberUniswapReserve.js * kyberReserve.js * permissionGroups.js * Small code refactor for volumeImbalanceRecorder * whitelist.js * Remove valueOf() * Move calc src & dst qty functions to helper * wrapper files(3), orderIdManager, orderList, mockDepositxx, mockExchnagexxx, permission less order book reserve lister (#537) * update for web3 version * update wrappers to work with new web3 version * correct use artifacts * order list upgrade web3 * remove some debug info * upgrade permission less oreder book reserve lister to test to new Web3 version * fix some typos * remove some more valueOf() in assert (#538) * remove some valueOf() that are not required. * add CR LF on end * add back correct package lock * add back correct package lock * Update test for helper, liquidity conversion rates and formula (#536) * Update test for helper, liquidity conversion rates and formula * Remove unused logs * Update codes based on comments * Add new line for helper * remove valueOf(), user helper file to assert (#540) * remove valueOf() calls assert.equal --> Helper.assertEqual() * remove valueOf(), use Helper to assert * remove valueOf() * [WIP] Web3 upgrade for eth2 dai (#542) * eth2Dai initial commit * add helper changes * add issues * Fix failing tests, using helper assert func (#543) Co-authored-by: Le Xuan Manh <[email protected]> * remove example test file (#545) * Utils.js, Utils2.js, Utils3.js, update to web3 v1.2.4 (#534) * Updated utils.js to web3 1.2.4 * Updated utils2.js to web3 1.2.4 * Updated utils3.js to web3 1.2.4 * Updated utils*.js, fixed bugs on helper.js * Added modifications from Ilan's feedback * orderbookReserve.js update to web3 v1.2.4 (#555) * orderbookReserve.js update to web3 v1.2.4 * Implemented changes from feedback * Updated TokenWei var to Token18Dec * Changed Token18Dec var to camel case * Web3 upgrade bancor (#577) * update git ignore * update development (#547) * update git ignore (#544) * Kyber Bancor bridge reserve (#546) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Ilan/master to development (#525) * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integra…
* Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Ilan/master to development (#525) * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Add Eth2Dai reserve and test (#523) * [WIP] Eth2Dai Reserve enhancement (#449) * Add eth2dai contract * Update Eth2Dai reserve * Update Eth2DaiReserve contract and tests * Update trade function tests for eth2dai reserve * Make single test can run on its own * Separate source codes, add some v5 contracts * Update contracts fixed some review comments, remove some unused functions * Update eth2dai contract with enable/disable internal inventory for token * Add test for set internal inventory enable/disable * Put enable/disable internal inventory into internal inventory data * Add internal inventory tests * Change overlow to out of range * Update v5 contracts * Update file name and folder structure * Update folder structure * Fix can not find artifacts for WethTokenV5 * Update test folder structure * Remove KyberOasisReserve source code + test, change WethTokenV5 to WethToken (#524) * remove duplicate files and v5 example * update git ignore * update development (#547) * update git ignore (#544) * Kyber Bancor bridge reserve (#546) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Ilan/master to development (#525) * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Add Eth2Dai reserve and test (#523) * [WIP] Eth2Dai Reserve enhancement (#449) * Add eth2dai contract * Update Eth2Dai reserve * Update Eth2DaiReserve contract and tests * Update trade function tests for eth2dai reserve * Make single test can run on its own * Separate source codes, add some v5 contracts * Update contracts fixed some review comments, remove some unused functions * Update eth2dai contract with enable/disable internal inventory for token * Add test for set internal inventory enable/disable * Put enable/disable internal inventory into internal inventory data * Add internal inventory tests * Change overlow to out of range * Update v5 contracts * Update file name and folder structure * Update folder structure * Fix can not find artifacts for WethTokenV5 * Update test folder structure * Remove KyberOasisReserve source code + test, change WethTokenV5 to WethToken (#524) * remove duplicate files and v5 example * Add KyberBancorReserve and test * Fix some tests for kyber bancor reserve * Add more tests for kyber bancor reserve * Remove default value for bnt and bancor eth token * Add end of file line * Update contracts from review comments * Fix contract and test based on comments * Return 0 for rate and revert in trade when srcQty is 0 * Remove v5 example test file' Co-authored-by: Desmond <[email protected]> Co-authored-by: Ilan Doron <[email protected]> Co-authored-by: Le Xuan Manh <[email protected]> Co-authored-by: Desmond <[email protected]> * Update bancor bridge with new fixed path (#548) * Quick fixes to liquidityReserveDeployer.js script for deployment of APR (#556) * update web3 helpers (#560) * fix web3 contract compilation * add helper to read conversion rate set data * enable more user friendly usage * add script to deploy enhanced step functions contract. * update SetStepFunctionWrapper.sol add it to compileContracts.js * indent fix deploy * update according to review comments * fix function signature for setImbalanceStepFunction (#576) * fix function signature for setImbalanceStepFunction * rename enhanced steps to ConversionRateEnhancedSteps * rename enhanced steps * review changes * Upgrade web3 version to 1.2.4 (#514) * [WIP] Upgrade web3 version to 1.2.4 * Update conversion rate and enhance step func rate tests * Remove openzeplin test helper * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Add Eth2Dai reserve and test (#523) * [WIP] Eth2Dai Reserve enhancement (#449) * Add eth2dai contract * Update Eth2Dai reserve * Update Eth2DaiReserve contract and tests * Update trade function tests for eth2dai reserve * Make single test can run on its own * Separate source codes, add some v5 contracts * Update contracts fixed some review comments, remove some unused functions * Update eth2dai contract with enable/disable internal inventory for token * Add test for set internal inventory enable/disable * Put enable/disable internal inventory into internal inventory data * Add internal inventory tests * Change overlow to out of range * Update v5 contracts * Update file name and folder structure * Update folder structure * Fix can not find artifacts for WethTokenV5 * Update test folder structure * Rebase from development * Modify kyberNetwork script to be web3 1.x compatible * Clicky's web3 compatibility upgrade (#531) * KNP.js web3 1.x compatible * DutchXReserve.js * Removed addBps function, since we using Helper one * remove web3 instantiation * kyberUniswapReserve.js * Update test for expected rate and fee burner (#532) * Update test for expected rate and fee burner * Remove unused codes * support new web3 lib, especailly new BN (#533) * support new web3 lib, especailly new BN * upgrade kyber weth reserve to web3 * remove unused log function * kyberReserve.js, permissionGroups.js, whitelist.js, volumeImbalanceRecorder.js (#535) * KNP.js web3 1.x compatible * DutchXReserve.js * Removed addBps function, since we using Helper one * remove web3 instantiation * kyberUniswapReserve.js * kyberReserve.js * permissionGroups.js * Small code refactor for volumeImbalanceRecorder * whitelist.js * Remove valueOf() * Move calc src & dst qty functions to helper * wrapper files(3), orderIdManager, orderList, mockDepositxx, mockExchnagexxx, permission less order book reserve lister (#537) * update for web3 version * update wrappers to work with new web3 version * correct use artifacts * order list upgrade web3 * remove some debug info * upgrade permission less oreder book reserve lister to test to new Web3 version * fix some typos * remove some more valueOf() in assert (#538) * remove some valueOf() that are not required. * add CR LF on end * add back correct package lock * add back correct package lock * Update test for helper, liquidity conversion rates and formula (#536) * Update test for helper, liquidity conversion rates and formula * Remove unused logs * Update codes based on comments * Add new line for helper * remove valueOf(), user helper file to assert (#540) * remove valueOf() calls assert.equal --> Helper.assertEqual() * remove valueOf(), use Helper to assert * remove valueOf() * [WIP] Web3 upgrade for eth2 dai (#542) * eth2Dai initial commit * add helper changes * add issues * Fix failing tests, using helper assert func (#543) Co-authored-by: Le Xuan Manh <[email protected]> * remove example test file (#545) * Utils.js, Utils2.js, Utils3.js, update to web3 v1.2.4 (#534) * Updated utils.js to web3 1.2.4 * Updated utils2.js to web3 1.2.4 * Updated utils3.js to web3 1.2.4 * Updated utils*.js, fixed bugs on helper.js * Added modifications from Ilan's feedback * orderbookReserve.js update to web3 v1.2.4 (#555) * orderbookReserve.js update to web3 v1.2.4 * Implemented changes from feedback * Updated TokenWei var to Token18Dec * Changed Token18Dec var to camel case * Web3 upgrade bancor (#577) * update git ignore * update development (#547) * update git ignore (#544) * Kyber Bancor bridge reserve (#546) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Istanbul fix, zero rate handling * Arbitrage check shifted to FeeBurner (#433) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test for src==dest token * Revert "Merge branch 'clicky/zero_rate' into development" This reverts commit 795d2f1d28131534604586b7786cba4e79f21e04, reversing changes made to 80af391c738395ac57017f4e18eab904869cf6f7. * Clicky/buidl integration (#459) * Pulling stuff from KN/clicky/buidl-integration branch * Pull changes from expected rate and fee burner * Update kyberNetwork test file * Update kyberNetwork.js * Merge Mike's PR on enhanced step functions (#458) * [WIP] Add new conversion rate contract with step function enhancement (#416) * [WIP] Add new conversion rate contract with step function enhancement * Add more tests to kyberReserve for testing new conversion rate contract * Add more tests for kybetNetwork with new conversion rate contract * Add verify qty and imbalance step function amounts must be increasing * Add case set qty and balance step func with only one or zero element * Check for qty step function all amounts are non negative * Update conversion rate contract and kyber network tests * Fallback to old logics when qty is 0 * Update new conversion rate with inherite from old one, update logics for some edge cases and tests * Fixed typo * Add check for empty step function before executing step function * Fix issue when qty is negative and greater than all step qty * Fix issue with executing step func with 0 as qty (#417) * Remove unnecessary tests in conversionRate2, add more cases to test for new execute step function * Fix issue with execute step func for 0 qty * expose getImbalance function in conversionRate2.sol file (#419) * Update conversion rate contract 2 with new logics for executing step function * Resolve some comments, change name new conversion rates contract to EnhancedStepFunctions * Remove qty step function, compress data for imbalance steps * Resolve solhint max line length * Avoid modifying function params in execute step func * Update comments for each test case of getting correct bps for step func * Update with some comments, add more tests * Add await keyword * Update some comments, fix some old tests in kyber reserve * Fix wrong calculate imbalance of token in reserve test * Change default max imbalance to return when overflow, fix some tests with missing await keyword * Blocking setting qty step function in new conversion rate * Update execute step func with blocking rate, remove updatedRateBlock in getImbalance * Remove redundant stepX value in last step * Add check data when encoding step func, using MAX_VAL as default for last step X * Add checking for max value of step X and tests * Add check for max bps adjustment, check max_imbalance value test * Fixed Failing Tests (#462) * Istanbul fix * Fixed failing tests as per Ilan's feedback * Fixed failing tests * Minor fixes * Minor fixes * Sync enhanced step functions test file * Reduce getDecimals call in findBestRateTokenToToken in network contract (#467) * Reduce getDecimals call in findBestRateTokenToToken in network contract * Fix new line end file * Remove some tests in utils3 * Avoid decimals call when calling handleFees on FeeBurner (#468) * Ilan/merge master (#460) * reserve deployment scripts (#233) * reserve deployment scripts * read valid block duration from config file. (#423) * Weth Reserve Implementation (#304) * Weth Reserve Implementation Includes testing. Also includes an addition in helper to make throw catching more neat. * Add weth reserve test * Add deploy script for oasis reserve * Organize folder structure and update WrapConversionRate.sol #441 && #452 (#453) * Organize folder structure according to issue #441 this includes organizing audit folder and organizing reserves. Remove multisig support from WrapConversionRate.sol according to issue #452 * enable admin to call transfer admin of base contract * enable wrapConversionRate to control all adminOnly functions in conversionRate (#461) * Ilan/modify wrap conversion rate (#466) * enable wrapConversionRate to control all adminOnly functions in conversionRate * enable wrap conversion rate to control all admin functions in conversion rate contract * set admin as msg.sender. to follow base contract logic * remove redundant test. adopt to chainge in admin logic * add CR LF * rename folders. (#469) * rename folders. (remove contract from folder name.) * reset package - lock * move new mock contracts to mock folder. * create web3 object * Upgraded to ganache-cli@istanbul * Removed header * Istanbul fix (#457) * Return zero rate for same src and dest token (#475) * Return zero rate for same src & dest token * Removed unnecessary tests * Echo fork choice, fix broken logic * Try committing new package-lock.json * Added more info * Bumped to node v12.13.0 * Update package fix npm (#474) * Update package fix npm * Update package-lock file * Remove unused packages * Removed eslint * Add colour for better readability of fork choice * Add spacing between example commands * Resolve package-lock conflict * Revert "Bumped to node v12.13.0" This reverts commit 85cb734ed5bfae4fdc5fc0dc8c8dfcc8c3c426ed. * Fixed conflicting files * Revert "Merge branch 'clicky/ganacheIstanbul' into development" This reverts commit 654a1c3e7971319bd802df0cd70daf32337caa95, reversing changes made to 6c0a21c59eb55b44cfe8616a513e7e76533fc9c5. * Upgrade to ganache-cli@istanbul for testing with Istanbul fork (#482) * Added colour and newline to fork choice * Add node and npm version used * Removed eslint * Removed eslint * Got latest changes from Mike's PR * added colour and newline to fork choice * Fix coloring (I hope) * Changed BG to make text stand out * handle zero qty in get rate permission less reserve (#472) * handle zero qty in get rate permission less reserve * undo wrong change * Increase gas limit for 1 test due to Istanbul (#487) * [455] Enable unlist orderbook permissionless reserve (#485) * Add comments in FeeBurner for KNC decimals (#489) * Revert "Arbitrage check shifted to FeeBurner" (#488) * Revert "Arbitrage check shifted to FeeBurner (#433)" This reverts commit 80af391c738395ac57017f4e18eab904869cf6f7. * reverse un needed test changes for kyber NEtwork * Zero Src Qty Handling (#483) * Initial commit for zero rate handling. Need to rewrite tests * Improved comment to code * Modified getConversionRate function to require srcAmt > 0 * Removed tests, added one * Updated contracts as per feedback * Updated comment in test file * Added fix to expectedRateSmallQty * Remove extra = * Add additional section to check network.getExpectedRate doesn't revert as well * Removed redundant tests due to zero rate handling in network contract (#494) * update solidity coverage version (#491) * Added new deployment script and input files (#495) * Ilan/add rates getter (#493) * update solidity coverage version * add getter function for rates * update getter API and return values, add tests * Clicky/rename compile file (#496) * renamed compileOutput.js to compileContracts.js, added more contracts for reserveDeployer * Renamed compileOutput -> compileContracts * Minor spelling edit * update addresses for deployment (#497) * remove multi sig support. add admin functionality (#498) * remove multi sig support. add admin functionality * refactor wrapper contracts, update tests * update tests according to PR comments, add one missing check * Add some comments * Revert "[455] Enable unlist orderbook permissionless reserve (#485)" (#504) This reverts commit 8b63c0ea023b7965a7c00e452279cf52e03f32f2. * Fix deployment script after staging deployment (#505) * Added new deployment script and input files * Remove old file * Added contract instantiation if deployer script breaks halfway through * avoid query to uniswap with zero rate (#510) * avoid query to uniswap with zero rate * test situation where trade result is 0 * enable setting min record resultion in conversion rates using wrapper (#513) * enable setting min record resultion in conversion rates using wrapper * linting, and add missing test * fix uniswap bridge for small amounts src qty (1) (#518) * fix uniswap bridge for smal amounts src qty (1) * avoid reading fee twice * fix uniswap deployer script * Ilan/deployment helper (#516) * some deployment changes, and helper contract" " * add kyber uniswap bridge to compilation. remove wrap conversion rate * small fixes in deployer * Add CR LF * Ilan/merge master (#519) * update some packages. fix solc version to 0.4.18 (#503) * fixed FPR deployment script (#508) * add smartdec audit for APR * use correct package-lock * Ilan/master to development (#525) * Development to Master. Istanbul changes. buidl. (#471) * Shifted arbitrage check to FeeBurner * Shifted relevant tests from expectedRate to feeBurner * Modified failing test, as it requires less gas to fail * Removed redundan >0 rate check, test for feeBurner * Added test…
Fix to issue #434
One issue I want to raise: For token -> token rate queries with 0 src qty, while
network.findBestRate
andnetwork.findBestRateOnlyPermission
returns zero,network.getExpectedRate
will revert if the reserve fails to handle zero src qty properly, because of theexpectedRate.expectedRateSmallQty
function, which callsnetwork.searchBestRate
directly.To be clear, trades will not revert because the trade input checks that
srcAmount != 0
, and it uses thefindBestRateTokenToToken
function (where the fix lies), which is the underlying function used byfindBestRate
andfindBestRateOnlyPermission
.It boils down to how we want to deal with zero source quantity rate queries. Do we want to return something, or just return zero?