Skip to content

Commit 6999e84

Browse files
authored
fix(interfaces): add IAirdropModule, IClaimModule, and IWrapModuleV2 (#252)
1 parent 301a592 commit 6999e84

File tree

3 files changed

+165
-0
lines changed

3 files changed

+165
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
Copyright 2022 Set Labs Inc.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
16+
SPDX-License-Identifier: Apache License, Version 2.0
17+
*/
18+
19+
pragma solidity 0.6.10;
20+
pragma experimental "ABIEncoderV2";
21+
22+
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
23+
24+
import { AddressArrayUtils } from "../lib/AddressArrayUtils.sol";
25+
import { ISetToken } from "./ISetToken.sol";
26+
27+
interface IAirdropModule {
28+
using AddressArrayUtils for address[];
29+
30+
struct AirdropSettings {
31+
address[] airdrops; // Array of tokens manager is allowing to be absorbed
32+
address feeRecipient; // Address airdrop fees are sent to
33+
uint256 airdropFee; // Percentage in preciseUnits of airdrop sent to feeRecipient (1e16 = 1%)
34+
bool anyoneAbsorb; // Boolean indicating if any address can call absorb or just the manager
35+
}
36+
37+
struct AirdropReturnSettings {
38+
address feeRecipient;
39+
uint256 airdropFee;
40+
bool anyoneAbsorb;
41+
}
42+
43+
function initialize(ISetToken _setToken, AirdropSettings memory _airdropSettings) external;
44+
45+
function airdropSettings(ISetToken _setToken) external view returns(AirdropReturnSettings memory);
46+
function batchAbsorb(ISetToken _setToken, address[] memory _tokens) external;
47+
function absorb(ISetToken _setToken, IERC20 _token) external;
48+
function addAirdrop(ISetToken _setToken, IERC20 _airdrop) external;
49+
function removeAirdrop(ISetToken _setToken, IERC20 _airdrop) external;
50+
function updateAnyoneAbsorb(ISetToken _setToken, bool _anyoneAbsorb) external;
51+
function updateFeeRecipient(ISetToken _setToken, address _newFeeRecipient) external;
52+
function updateAirdropFee(ISetToken _setToken, uint256 _newFee) external;
53+
function removeModule() external;
54+
function getAirdrops(ISetToken _setToken) external returns(address[] memory);
55+
function isAirdropToken(ISetToken _setToken, IERC20 _token) external returns(bool);
56+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
Copyright 2022 Set Labs Inc.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
16+
SPDX-License-Identifier: Apache License, Version 2.0
17+
*/
18+
19+
pragma solidity 0.6.10;
20+
pragma experimental "ABIEncoderV2";
21+
22+
import { ISetToken } from "./ISetToken.sol";
23+
24+
interface IClaimModule {
25+
function initialize(
26+
ISetToken _setToken,
27+
bool _anyoneClaim,
28+
address[] calldata _rewardPools,
29+
string[] calldata _integrationNames
30+
) external;
31+
32+
function anyoneClaim(ISetToken _setToken) external view returns(bool);
33+
function claim(ISetToken _setToken, address _rewardPool, string calldata _integrationName) external;
34+
function batchClaim(ISetToken _setToken, address[] calldata _rewardPools, string[] calldata _integrationNames) external;
35+
function updateAnyoneClaim(ISetToken _setToken, bool _anyoneClaim) external;
36+
function addClaim(ISetToken _setToken, address _rewardPool, string calldata _integrationName) external;
37+
function batchAddClaim(ISetToken _setToken, address[] calldata _rewardPools, string[] calldata _integrationNames) external;
38+
function removeClaim(ISetToken _setToken, address _rewardPool, string calldata _integrationName) external;
39+
function batchRemoveClaim(ISetToken _setToken, address[] calldata _rewardPools, string[] calldata _integrationNames) external;
40+
function removeModule() external;
41+
function getRewardPools(ISetToken _setToken) external returns(address[] memory);
42+
function isRewardPool(ISetToken _setToken, address _rewardPool) external returns(bool);
43+
function getRewardPoolClaims(ISetToken _setToken, address _rewardPool) external returns(address[] memory);
44+
function isRewardPoolClaim(ISetToken _setToken, address _rewardPool, string calldata _integrationName) external returns (bool);
45+
function getRewards(ISetToken _setToken, address _rewardPool, string calldata _integrationName) external returns (uint256);
46+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
Copyright 2022 Set Labs Inc.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
16+
SPDX-License-Identifier: Apache License, Version 2.0
17+
*/
18+
19+
pragma solidity 0.6.10;
20+
pragma experimental "ABIEncoderV2";
21+
22+
import { ISetToken } from "./ISetToken.sol";
23+
import { IWETH } from "./external/IWETH.sol";
24+
25+
interface IWrapModuleV2 {
26+
function weth() external view returns(IWETH);
27+
28+
function initialize(ISetToken _setToken) external;
29+
30+
function wrap(
31+
ISetToken _setToken,
32+
address _underlyingToken,
33+
address _wrappedToken,
34+
uint256 _underlyingUnits,
35+
string calldata _integrationName,
36+
bytes memory _wrapData
37+
) external;
38+
39+
function wrapWithEther(
40+
ISetToken _setToken,
41+
address _wrappedToken,
42+
uint256 _underlyingUnits,
43+
string calldata _integrationName,
44+
bytes memory _wrapData
45+
) external;
46+
47+
function unwrap(
48+
ISetToken _setToken,
49+
address _underlyingToken,
50+
address _wrappedToken,
51+
uint256 _wrappedUnits,
52+
string calldata _integrationName,
53+
bytes memory _unwrapData
54+
) external;
55+
56+
function unwrapWithEther(
57+
ISetToken _setToken,
58+
address _wrappedToken,
59+
uint256 _wrappedUnits,
60+
string calldata _integrationName,
61+
bytes memory _unwrapData
62+
) external;
63+
}

0 commit comments

Comments
 (0)