Skip to content

Commit 13bf184

Browse files
bweickrichardliang
authored andcommitted
Add deletion of isAirdrop from removeModule.
1 parent 39f4dd4 commit 13bf184

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

contracts/protocol/modules/AirdropModule.sol

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,12 @@ contract AirdropModule is ModuleBase, ReentrancyGuard {
246246
* Airdrops are not absorbed.
247247
*/
248248
function removeModule() external override {
249+
address[] memory airdrops = airdropSettings[ISetToken(msg.sender)].airdrops;
250+
251+
for (uint256 i =0; i < airdrops.length; i++) {
252+
isAirdrop[ISetToken(msg.sender)][IERC20(airdrops[i])] = false;
253+
}
254+
249255
delete airdropSettings[ISetToken(msg.sender)];
250256
}
251257

test/protocol/modules/airdropModule.spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -981,6 +981,16 @@ describe("AirdropModule", () => {
981981
expect(airdropSettings.airdropFee).to.eq(ZERO);
982982
expect(airdropSettings.anyoneAbsorb).to.be.false;
983983
});
984+
985+
it("should reset the isAirdrop mapping", async () => {
986+
await subject();
987+
988+
const wethIsAirdrop = await airdropModule.isAirdrop(subjectModule, setup.weth.address);
989+
const usdcIsAirdrop = await airdropModule.isAirdrop(subjectModule, setup.usdc.address);
990+
991+
expect(wethIsAirdrop).to.be.false;
992+
expect(usdcIsAirdrop).to.be.false;
993+
});
984994
});
985995

986996
describe("CONTEXT: Airdrop add/remove", async () => {

0 commit comments

Comments
 (0)