Skip to content

Commit de8a597

Browse files
authored
Use airdrop recipient and fee as provided by operator (#103)
1 parent 7de4d9a commit de8a597

File tree

2 files changed

+4
-35
lines changed

2 files changed

+4
-35
lines changed

contracts/adapters/AirdropExtension.sol

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ contract AirdropExtension is BaseExtension {
6161
* @param _airdropSettings Settings to initially the AirdropModule with
6262
*/
6363
function initializeAirdropModule(IAirdropModule.AirdropSettings memory _airdropSettings) external onlyOperator {
64-
_airdropSettings.feeRecipient = address(manager);
65-
_airdropSettings.airdropFee = 0;
66-
6764
invokeManager(
6865
address(airdropModule),
6966
abi.encodeWithSignature("initialize(address,(address[],address,uint256,bool))", setToken, _airdropSettings)

test/adapters/airdropExtension.spec.ts

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import "module-alias/register";
22

33
import { Address, Account, AirdropSettings } from "@utils/types";
4-
import { ADDRESS_ZERO, MAX_UINT_256, ONE, ZERO } from "@utils/constants";
4+
import { ADDRESS_ZERO, MAX_UINT_256, ONE } from "@utils/constants";
55
import { AirdropExtension, BaseManagerV2 } from "@utils/contracts/index";
66
import { SetToken } from "@utils/contracts/setV2";
77
import DeployHelper from "@utils/deploys";
@@ -134,8 +134,8 @@ describe("AirdropExtension", () => {
134134
subjectCaller = operator;
135135
subjectAirdropSettings = {
136136
airdrops: [setV2Setup.dai.address],
137-
feeRecipient: baseManagerV2.address,
138-
airdropFee: BigNumber.from(0),
137+
feeRecipient: await getRandomAddress(),
138+
airdropFee: BigNumber.from(12345),
139139
anyoneAbsorb: false,
140140
};
141141
});
@@ -172,34 +172,6 @@ describe("AirdropExtension", () => {
172172
expect(airdrops[0]).to.eq(setV2Setup.dai.address);
173173
});
174174

175-
context("when the fee recipient is not the manager", async () => {
176-
beforeEach(async () => {
177-
subjectAirdropSettings.feeRecipient = await getRandomAddress();
178-
});
179-
180-
it("should override the fee recipient address to be the manager", async () => {
181-
await subject();
182-
183-
const settings = await setV2Setup.airdropModule.airdropSettings(setToken.address);
184-
185-
expect(settings.feeRecipient).to.eq(baseManagerV2.address);
186-
});
187-
});
188-
189-
context("when the airdrop fee is nonzero", async () => {
190-
beforeEach(async () => {
191-
subjectAirdropSettings.airdropFee = BigNumber.from(12345);
192-
});
193-
194-
it("should override the airdrop fee to be zero", async () => {
195-
await subject();
196-
197-
const settings = await setV2Setup.airdropModule.airdropSettings(setToken.address);
198-
199-
expect(settings.airdropFee).to.eq(ZERO);
200-
});
201-
});
202-
203175
context("when the operator is not the caller", async () => {
204176
beforeEach(async () => {
205177
subjectCaller = await getRandomAccount();
@@ -402,4 +374,4 @@ describe("AirdropExtension", () => {
402374
});
403375
});
404376
});
405-
});
377+
});

0 commit comments

Comments
 (0)