fix: Use safeApprove instead of approve in constructor

This commit is contained in:
Lasse Herskind 2021-08-23 16:44:09 +02:00
parent 03f5ea9b23
commit 2ac390b8fd
2 changed files with 4 additions and 4 deletions

View File

@ -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;

View File

@ -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');