Comments (2)
Note that since this hasn't been proved mathematically yet, I added a require statement right before the last operation of both "hTokenOutForUnderlyingIn" and "underlyingOutForHTokenIn". But I didn't write tests that cover this require branch because I don't know any inputs which can trigger it.
from hifi.
Benson worked on this and came up with a beautiful explanation for why this construction is safe in the realm of pure mathematics. Now the question is to prove whether Solidity’s inevitable rounding errors don’t break the purely mathematical logic.
Construction_Safety_for_OutForIn_Functions.pdf
from hifi.
Related Issues (20)
- [proxy-target] Check "hTokenOut" against "hTokenRequired" in "buyHTokenAndAddLiquidity" HOT 1
- [flash-swap] Bond dust left behind upon liquidation HOT 3
- [protocol] Test zero underlying case in "redeem" function HOT 1
- [flash-swap] Add token withdraw method HOT 1
- [flash-swap] Repay the 0.3% Uniswap V2 in USDC HOT 1
- Export the types and the factories from an index file
- [flash-swap] Merge the "CollateralFlashUniswapV2" and "UnderlyingFlashUniswapV2" contracts HOT 2
- [flash-swap] Handle division by zero in "getRepayAmount" function HOT 3
- Exclude the "Name" column when the returned value does not have a name HOT 2
- Avoid the endline when the function does not have params HOT 1
- Add NatSpec comments to events in "IHifiPool.sol" and "IFlashUniswapV2.sol" HOT 1
- Implement a "pow" function with a normalization factor to stave off overflow when time to maturity is large HOT 1
- Upgrade dependencies
- [protocol] Issue concerning wrong param ordering in emitted `RepayBorrow` event HOT 4
- [flash-swap] Install "@openzeppelin/contracts-upgradeable" as dependency HOT 1
- [protocol] Update the "OwnableUpgradeable" contract to conform to the latest OpenZeppelin implementation HOT 1
- Fix paths in ".gitignore" files such that factories are kept in version control HOT 1
- Define "waitForConfirmations" Hardhat task only once
- [amm] Mark the "trackPool" and "untrackPool" functions as "external"
- Add solhint rule to enforce that all interface function implementations should be "override"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hifi.