diff --git a/contracts/powerindex-mining/DeprecatedPoolsLens.sol b/contracts/powerindex-mining/DeprecatedPoolsLens.sol index 93ba5f7..de9e892 100644 --- a/contracts/powerindex-mining/DeprecatedPoolsLens.sol +++ b/contracts/powerindex-mining/DeprecatedPoolsLens.sol @@ -13,13 +13,6 @@ https://powerpool.finance/ pragma solidity 0.8.11; -import "hardhat/console.sol"; - -interface IUniswapV2Router { - function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); - function quote(uint256 amountA, uint256 reserveA, uint256 reserveB) external view returns (uint256 amountB); -} - interface IVestedLpMining { function pools(uint256 index) external view returns (Pool calldata); function users(uint256 poolId, address userAddress) external view returns (miningUserDataStruct calldata); @@ -137,6 +130,7 @@ struct LiquidityTokens { address tokenAddress; uint256 balance; uint8 decimals; + string symbol; uint256 tokenAmountForOneLpSingle; uint256 tokenAmountForOneLpMulti; } @@ -161,23 +155,15 @@ struct RemoveLiquidityData { contract DeprecatedPoolsLens { IVestedLpMining public mining; - IUniswapV2Router public uniRouter; - address public stableAddress; - address immutable public wethAddress; address immutable public cvpAddress; mapping(uint8 => uint8) public earnPidMap; constructor( IVestedLpMining _mining, - IUniswapV2Router _router, - address _wethAddress, - address _stableAddress, address _cvpAddress ) { mining = _mining; - uniRouter = _router; - wethAddress = _wethAddress; cvpAddress = _cvpAddress; earnPidMap[0] = 13; @@ -400,6 +386,11 @@ contract DeprecatedPoolsLens { token.tokenAddress = ILpToken(pool.lpToken).getFinalTokens()[i]; token.balance = ERC20(ILpToken(pool.lpToken).getFinalTokens()[i]).balanceOf(_user); token.decimals = ERC20(ILpToken(pool.lpToken).getFinalTokens()[i]).decimals(); + if (ILpToken(pool.lpToken).getFinalTokens()[i] == 0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2) { + token.symbol = 'MKR'; + } else { + token.symbol = ILpToken(ILpToken(pool.lpToken).getFinalTokens()[i]).symbol(); + } token.tokenAmountForOneLpSingle = getSingleTokenOut(_pid, token.tokenAddress); token.tokenAmountForOneLpMulti = getMultiTokensOut(_pid, token.tokenAddress, token.decimals); } diff --git a/hardhat.config.js b/hardhat.config.js index 7444c79..f598d18 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -90,7 +90,7 @@ const config = { mainnet: { url: 'https://rough-compatible-hill.quiknode.pro/b7052dc47d31d455c2a770377f7db70735924fba/', accounts: getAccounts('mainnet'), - gasPrice: 9 * 10 ** 9, + gasPrice: 5 * 10 ** 9, gasMultiplier: 1.2, timeout: 2000000, }, diff --git a/tasks/deployDeprecatedPoolsLens.js b/tasks/deployDeprecatedPoolsLens.js index c7ec8fe..16e1898 100644 --- a/tasks/deployDeprecatedPoolsLens.js +++ b/tasks/deployDeprecatedPoolsLens.js @@ -11,9 +11,6 @@ task('deploy-deprecated-pools-lens', 'Deploy deprecated pools lens').setAction(a const sendOptions = { from: deployer }; const poolsLens = await PoolsLens.new( '0xF09232320eBEAC33fae61b24bB8D7CA192E58507', - '0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D', - '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', - '0xdAC17F958D2ee523a2206206994597C13D831ec7', '0x38e4adB44ef08F22F5B5b76A8f0c2d0dCbE7DcA1', sendOptions, ); diff --git a/test/DeprecatedPoolsLens.test.js b/test/DeprecatedPoolsLens.test.js index 6e7f5c9..f705c60 100644 --- a/test/DeprecatedPoolsLens.test.js +++ b/test/DeprecatedPoolsLens.test.js @@ -8,15 +8,12 @@ describe.only('DeprecatedPoolsLens', async () => { it('chore test pass', async () => { this.poolsLens = await PoolsLens.new( '0xF09232320eBEAC33fae61b24bB8D7CA192E58507', - '0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D', - '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', - '0xdAC17F958D2ee523a2206206994597C13D831ec7', '0x38e4adB44ef08F22F5B5b76A8f0c2d0dCbE7DcA1', ); // const result = await this.poolsLens.getPoolData(ethers.constants.AddressZero); + // const result = await this.poolsLens.getFarmingDetail('0x8b19f6F51501dA80FCEFb578427907f223005F7A', 6); // const result = await this.poolsLens.getEarnList('0x8b19f6F51501dA80FCEFb578427907f223005F7A'); - - const result = await this.poolsLens.RemoveLiquidityInfo('0x8b19f6F51501dA80FCEFb578427907f223005F7A', 6); // balancer + // const result = await this.poolsLens.removeLiquidityInfo('0x8b19f6F51501dA80FCEFb578427907f223005F7A', 6); // balancer // const result = await this.poolsLens.getSecondaryLiquidityRemoveInfo('0x8b19f6F51501dA80FCEFb578427907f223005F7A', 7); // balancer // const result = await this.poolsLens.getSecondaryLiquidityRemoveInfo('0x8b19f6F51501dA80FCEFb578427907f223005F7A', 11); // sushi diff --git a/verify-args.js b/verify-args.js index fa40541..5e8019a 100644 --- a/verify-args.js +++ b/verify-args.js @@ -1,7 +1,4 @@ module.exports = [ '0xF09232320eBEAC33fae61b24bB8D7CA192E58507', - '0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D', - '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', - '0xdAC17F958D2ee523a2206206994597C13D831ec7', - '0x38e4adB44ef08F22F5B5b76A8f0c2d0dCbE7DcA1' + '0x38e4adB44ef08F22F5B5b76A8f0c2d0dCbE7DcA1', ]