Comments (2)
spoke with @haydenadams about this, we're leaning towards not doing it to avoid having inter-interface dependencies (e.g. IUniswapV2Factory
would need to rely on IUniswapV2
), as well as for enhanced clarity on the data types of variables (as opposed to their function). going to leave the issue open though for further thought!
from v2-core.
avoid having inter-interface dependencies
The following is valid Solidity:
interface IApple {
function color() external returns (address);
}
interface IColor { }
contract Apple is IApple {
IColor public color;
}
You could follow a pattern like this to avoid inter-interface dependencies.
enhanced clarity on the data types of variables (as opposed to their function).
Opinion: The most "clear" code in terms of what it actually does is assembly, but such code is also the most unreadable. In my experience, readable code will result in fewer bugs than "clear" code, so should be preferred unless there is a strong argument against readability. In this case, the code is more readable if the type information expresses what exactly is being mapped, and it gives you the added benefit of giving additional compiler checks (another great reducer of bugs).
from v2-core.
Related Issues (20)
- Uniswap getPair() does not deliver address(0) HOT 1
- Error Building v2-core HOT 1
- Token migration issue, balance not loading
- Yarn compile has error. HOT 1
- No SPDX License Identifier HOT 2
- Ultraswap
- `CheckContract` for token contracts HOT 3
- .
- how to get the full and right address[] path for swapExactTokensForTokens ? HOT 1
- 0xd5173949c2d40c9863b9aD6B91a4CCAD3c9B05Fe
- Let's earn the bitcoins daily!
- getPair call via Ethers.Contract does not return a pair address HOT 1
- Both Amount0In and Amount0Out Present in Logs
- Store dynamic bytes to call swap function with solidity assembly HOT 3
- Keccak256 init code hash
- yarn test meet error HOT 4
- How to run this?
- Improve Integer Square Root
- getAmountsOut returns amount which is way less than the actual amount showing in UniSwap app
- When Add Liquidity got Error HOT 1
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 v2-core.