From 2ac390b8fd00b88bf50d37e31bd900121e9e23c6 Mon Sep 17 00:00:00 2001 From: Lasse Herskind <16536249+LHerskind@users.noreply.github.com> Date: Mon, 23 Aug 2021 16:44:09 +0200 Subject: [PATCH] fix: Use `safeApprove` instead of `approve` in constructor --- contracts/protocol/tokenization/StaticATokenLM.sol | 2 +- .../static-atoken-liquidity-mining-rewards.spec.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contracts/protocol/tokenization/StaticATokenLM.sol b/contracts/protocol/tokenization/StaticATokenLM.sol index a44a5bd3..9b83b587 100644 --- a/contracts/protocol/tokenization/StaticATokenLM.sol +++ b/contracts/protocol/tokenization/StaticATokenLM.sol @@ -76,7 +76,7 @@ contract StaticATokenLM is ERC20 { IERC20 underlyingAsset = IERC20(IAToken(aToken).UNDERLYING_ASSET_ADDRESS()); ASSET = underlyingAsset; - underlyingAsset.approve(address(lendingPool), type(uint256).max); + underlyingAsset.safeApprove(address(lendingPool), type(uint256).max); IAaveIncentivesController incentivesController = IAToken(aToken).getIncentivesController(); INCENTIVES_CONTROLLER = incentivesController; diff --git a/test-suites/test-aave/mainnet/static-atoken-lm/static-atoken-liquidity-mining-rewards.spec.ts b/test-suites/test-aave/mainnet/static-atoken-lm/static-atoken-liquidity-mining-rewards.spec.ts index e3d171fc..f0350c98 100644 --- a/test-suites/test-aave/mainnet/static-atoken-lm/static-atoken-liquidity-mining-rewards.spec.ts +++ b/test-suites/test-aave/mainnet/static-atoken-lm/static-atoken-liquidity-mining-rewards.spec.ts @@ -209,7 +209,7 @@ describe('StaticATokenLM: aToken wrapper with static balances and liquidity mini expect(dynamicBalance).to.be.eq(dynamicBalanceFromStatic); }); - it.skip('Multiple deposits in one block (Breaks if GasReport enabled)', async () => { + it('Multiple deposits in one block (Breaks if GasReport enabled)', async () => { const amountToDeposit = utils.parseEther('5'); // Just preparation @@ -252,7 +252,7 @@ describe('StaticATokenLM: aToken wrapper with static balances and liquidity mini await DRE.network.provider.send('evm_setAutomine', [true]); }); - it.skip('Multiple collectAndUpdate in one block (Breaks if GasReport enabled)', async () => { + it('Multiple collectAndUpdate in one block (Breaks if GasReport enabled)', async () => { const amountToDeposit = utils.parseEther('5'); // Just preparation @@ -965,7 +965,7 @@ describe('StaticATokenLM: aToken wrapper with static balances and liquidity mini expect(await stkAave.balanceOf(user.address)).to.be.gt(0); }); - it.skip('Checks that withdraw and collect in the same block updates _lifetimeRewardsClaimed as expected (Breaks if GasReport is enabled)', async () => { + it('Checks that withdraw and collect in the same block updates _lifetimeRewardsClaimed as expected (Breaks if GasReport is enabled)', async () => { const users = await DRE.ethers.getSigners(); const user = users[0]; const depositAmount = utils.parseEther('1');