uint(0) -> uint(1) and some minor changes

This commit is contained in:
Samyak Jain 2019-04-07 02:44:28 +05:30
parent 3ff43069e1
commit 222f6ec10e

View File

@ -24,10 +24,7 @@ interface UniswapPool {
) external returns (uint256, uint256);
// ERC20 comaptibility for liquidity tokens
function name() external returns (bytes32);
function symbol() external returns (bytes32);
function decimals() external returns (uint256);
function totalSupply() external returns (uint256);
uint256 public totalSupply;
}
@ -89,12 +86,9 @@ contract Helper {
contract InstaUniswapPool is Helper {
/**
* @title Uniswap's pool basic details
* @dev Uniswap's pool basic details
* @param token token address to get pool. Eg:- DAI address, MKR address, etc
* @param poolAddress Uniswap pool's address
* @param name name of pool token
* @param symbol symbol of pool token
* @param decimals decimals of pool token
* @param totalSupply total supply of pool token
* @param ethReserve Total ETH balance of uniswap's pool
* @param tokenReserve Total Token balance of uniswap's pool
@ -103,9 +97,6 @@ contract InstaUniswapPool is Helper {
address token
) public view returns (
address poolAddress,
bytes32 name,
bytes32 symbol,
uint256 decimals,
uint totalSupply,
uint ethReserve,
uint tokenReserve
@ -113,15 +104,12 @@ contract InstaUniswapPool is Helper {
{
UniswapPool uniswapExchange = UniswapPool(poolAddress);
poolAddress = getAddressPool(token);
name = uniswapExchange.name();
symbol = uniswapExchange.symbol();
decimals = uniswapExchange.decimals();
totalSupply = uniswapExchange.totalSupply();
(ethReserve, tokenReserve) = getBal(token, poolAddress);
}
/**
* @title to add liquidity in pool
* @dev to add liquidity in pool
* @dev payable function token qty to deposit is decided as per the ETH sent by the user
* @param token ERC20 address of Uniswap's pool (eg:- DAI address, MKR address, etc)
* @param maxDepositedTokens Max token to be deposited
@ -134,14 +122,14 @@ contract InstaUniswapPool is Helper {
IERC20(token).transferFrom(msg.sender, address(this), tokenToDeposit);
setApproval(token, tokenToDeposit, poolAddr);
tokensMinted = UniswapPool(poolAddr).addLiquidity.value(msg.value)(
uint(0),
uint(1),
tokenToDeposit,
uint(1899063809) // 6th March 2030 GMT // no logic
);
}
/**
* @title to remove liquidity from pool
* @dev to remove liquidity from pool
* @dev ETH and token quantity is decided as per the exchange token qty to burn
* @param token ERC20 address of Uniswap's pool (eg:- DAI address, MKR address, etc)
* @param amount Uniswap pool's ERC20 token QTY to burn