Skip to content
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

Draft
wants to merge 15 commits into
base: development
Choose a base branch
from
Draft

TWAP initial working #84

wants to merge 15 commits into from

Conversation

RomanHiden
Copy link
Contributor

No description provided.

@RomanHiden RomanHiden changed the title initial working TWAP initial working Jun 17, 2021
@@ -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/"
Copy link
Contributor Author

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();
Copy link
Contributor Author

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
Copy link
Contributor Author

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) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

format file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants