uniswapExchange instance for gas optimization

This commit is contained in:
Samyak Jain 2019-04-06 21:06:56 +05:30
parent 99786654ef
commit fc3c03d852

View File

@ -107,13 +107,14 @@ contract InstaUniswapPool is Helper {
uint totalSupply, uint totalSupply,
uint ethReserve, uint ethReserve,
uint tokenReserve uint tokenReserve
) )
{ {
UniswapPool uniswapExchange = UniswapPool(poolAddress);
poolAddress = getAddressPool(token); poolAddress = getAddressPool(token);
name = UniswapPool(poolAddress).name(); name = uniswapExchange.name();
symbol = UniswapPool(poolAddress).symbol(); symbol = uniswapExchange.symbol();
decimals = UniswapPool(poolAddress).decimals(); decimals = uniswapExchange.decimals();
totalSupply = UniswapPool(poolAddress).totalSupply(); totalSupply = uniswapExchange.totalSupply();
(ethReserve, tokenReserve) = getBal(token, poolAddress); (ethReserve, tokenReserve) = getBal(token, poolAddress);
} }