mirror of
https://github.com/Instadapp/smart-contract.git
synced 2024-07-29 22:08:07 +00:00
uint(0) -> uint(1) and some minor changes
This commit is contained in:
parent
3ff43069e1
commit
222f6ec10e
|
@ -24,10 +24,7 @@ interface UniswapPool {
|
||||||
) external returns (uint256, uint256);
|
) external returns (uint256, uint256);
|
||||||
|
|
||||||
// ERC20 comaptibility for liquidity tokens
|
// ERC20 comaptibility for liquidity tokens
|
||||||
function name() external returns (bytes32);
|
uint256 public totalSupply;
|
||||||
function symbol() external returns (bytes32);
|
|
||||||
function decimals() external returns (uint256);
|
|
||||||
function totalSupply() external returns (uint256);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -89,12 +86,9 @@ contract Helper {
|
||||||
contract InstaUniswapPool is 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 token token address to get pool. Eg:- DAI address, MKR address, etc
|
||||||
* @param poolAddress Uniswap pool's address
|
* @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 totalSupply total supply of pool token
|
||||||
* @param ethReserve Total ETH balance of uniswap's pool
|
* @param ethReserve Total ETH balance of uniswap's pool
|
||||||
* @param tokenReserve Total Token balance of uniswap's pool
|
* @param tokenReserve Total Token balance of uniswap's pool
|
||||||
|
@ -103,9 +97,6 @@ contract InstaUniswapPool is Helper {
|
||||||
address token
|
address token
|
||||||
) public view returns (
|
) public view returns (
|
||||||
address poolAddress,
|
address poolAddress,
|
||||||
bytes32 name,
|
|
||||||
bytes32 symbol,
|
|
||||||
uint256 decimals,
|
|
||||||
uint totalSupply,
|
uint totalSupply,
|
||||||
uint ethReserve,
|
uint ethReserve,
|
||||||
uint tokenReserve
|
uint tokenReserve
|
||||||
|
@ -113,15 +104,12 @@ contract InstaUniswapPool is Helper {
|
||||||
{
|
{
|
||||||
UniswapPool uniswapExchange = UniswapPool(poolAddress);
|
UniswapPool uniswapExchange = UniswapPool(poolAddress);
|
||||||
poolAddress = getAddressPool(token);
|
poolAddress = getAddressPool(token);
|
||||||
name = uniswapExchange.name();
|
|
||||||
symbol = uniswapExchange.symbol();
|
|
||||||
decimals = uniswapExchange.decimals();
|
|
||||||
totalSupply = uniswapExchange.totalSupply();
|
totalSupply = uniswapExchange.totalSupply();
|
||||||
(ethReserve, tokenReserve) = getBal(token, poolAddress);
|
(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
|
* @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 token ERC20 address of Uniswap's pool (eg:- DAI address, MKR address, etc)
|
||||||
* @param maxDepositedTokens Max token to be deposited
|
* @param maxDepositedTokens Max token to be deposited
|
||||||
|
@ -134,14 +122,14 @@ contract InstaUniswapPool is Helper {
|
||||||
IERC20(token).transferFrom(msg.sender, address(this), tokenToDeposit);
|
IERC20(token).transferFrom(msg.sender, address(this), tokenToDeposit);
|
||||||
setApproval(token, tokenToDeposit, poolAddr);
|
setApproval(token, tokenToDeposit, poolAddr);
|
||||||
tokensMinted = UniswapPool(poolAddr).addLiquidity.value(msg.value)(
|
tokensMinted = UniswapPool(poolAddr).addLiquidity.value(msg.value)(
|
||||||
uint(0),
|
uint(1),
|
||||||
tokenToDeposit,
|
tokenToDeposit,
|
||||||
uint(1899063809) // 6th March 2030 GMT // no logic
|
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
|
* @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 token ERC20 address of Uniswap's pool (eg:- DAI address, MKR address, etc)
|
||||||
* @param amount Uniswap pool's ERC20 token QTY to burn
|
* @param amount Uniswap pool's ERC20 token QTY to burn
|
||||||
|
|
Loading…
Reference in New Issue
Block a user