-
Notifications
You must be signed in to change notification settings - Fork 39
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
TWAP initial working #84
base: development
Are you sure you want to change the base?
Conversation
This reverts commit c959eee.
Uniswap v3 TWAP Feed
@@ -41,6 +41,7 @@ compiler: | |||
remappings: | |||
- "@openzeppelin-3.4.0=./node_modules/openzeppelin-3.4.0" | |||
- "@openzeppelin-2.5.0=./node_modules/openzeppelin-2.5.0" | |||
- "@uniswap=./node_modules/@uniswap/" |
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.
I would name it uniswapv3
} else { | ||
uint256 sourceTokenDecimals = decimals[sourceToken]; | ||
if (sourceTokenDecimals == 0) | ||
sourceTokenDecimals = ERC20Detailed(sourceToken).decimals(); |
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.
there is a mapping (address => uint256) public decimals;
cheaper to use
|
||
pool = _pool; | ||
(token0, token1) = _tokenA < _tokenB ? (_tokenA,_tokenB):(_tokenB,_tokenA); | ||
baseAmount = uint128(10**(ERC20(token0).decimals())); //set to 10**token0Decimals |
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.
this is good
address public token0; | ||
address public token1; | ||
address public assignedToken0; | ||
constructor(address _pool, uint32 _period, address _tokenA, address _tokenB) { |
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.
format file
No description provided.