Skip to content

Commit

Permalink
fix(interfaces): add IAirdropModule, IClaimModule, and IWrapModuleV2 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
pblivin0x authored May 17, 2022
1 parent 301a592 commit 6999e84
Show file tree
Hide file tree
Showing 3 changed files with 165 additions and 0 deletions.
56 changes: 56 additions & 0 deletions contracts/interfaces/IAirdropModule.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
Copyright 2022 Set Labs Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
SPDX-License-Identifier: Apache License, Version 2.0
*/

pragma solidity 0.6.10;
pragma experimental "ABIEncoderV2";

import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

import { AddressArrayUtils } from "../lib/AddressArrayUtils.sol";
import { ISetToken } from "./ISetToken.sol";

interface IAirdropModule {
using AddressArrayUtils for address[];

struct AirdropSettings {
address[] airdrops; // Array of tokens manager is allowing to be absorbed
address feeRecipient; // Address airdrop fees are sent to
uint256 airdropFee; // Percentage in preciseUnits of airdrop sent to feeRecipient (1e16 = 1%)
bool anyoneAbsorb; // Boolean indicating if any address can call absorb or just the manager
}

struct AirdropReturnSettings {
address feeRecipient;
uint256 airdropFee;
bool anyoneAbsorb;
}

function initialize(ISetToken _setToken, AirdropSettings memory _airdropSettings) external;

function airdropSettings(ISetToken _setToken) external view returns(AirdropReturnSettings memory);
function batchAbsorb(ISetToken _setToken, address[] memory _tokens) external;
function absorb(ISetToken _setToken, IERC20 _token) external;
function addAirdrop(ISetToken _setToken, IERC20 _airdrop) external;
function removeAirdrop(ISetToken _setToken, IERC20 _airdrop) external;
function updateAnyoneAbsorb(ISetToken _setToken, bool _anyoneAbsorb) external;
function updateFeeRecipient(ISetToken _setToken, address _newFeeRecipient) external;
function updateAirdropFee(ISetToken _setToken, uint256 _newFee) external;
function removeModule() external;
function getAirdrops(ISetToken _setToken) external returns(address[] memory);
function isAirdropToken(ISetToken _setToken, IERC20 _token) external returns(bool);
}
46 changes: 46 additions & 0 deletions contracts/interfaces/IClaimModule.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
Copyright 2022 Set Labs Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
SPDX-License-Identifier: Apache License, Version 2.0
*/

pragma solidity 0.6.10;
pragma experimental "ABIEncoderV2";

import { ISetToken } from "./ISetToken.sol";

interface IClaimModule {
function initialize(
ISetToken _setToken,
bool _anyoneClaim,
address[] calldata _rewardPools,
string[] calldata _integrationNames
) external;

function anyoneClaim(ISetToken _setToken) external view returns(bool);
function claim(ISetToken _setToken, address _rewardPool, string calldata _integrationName) external;
function batchClaim(ISetToken _setToken, address[] calldata _rewardPools, string[] calldata _integrationNames) external;
function updateAnyoneClaim(ISetToken _setToken, bool _anyoneClaim) external;
function addClaim(ISetToken _setToken, address _rewardPool, string calldata _integrationName) external;
function batchAddClaim(ISetToken _setToken, address[] calldata _rewardPools, string[] calldata _integrationNames) external;
function removeClaim(ISetToken _setToken, address _rewardPool, string calldata _integrationName) external;
function batchRemoveClaim(ISetToken _setToken, address[] calldata _rewardPools, string[] calldata _integrationNames) external;
function removeModule() external;
function getRewardPools(ISetToken _setToken) external returns(address[] memory);
function isRewardPool(ISetToken _setToken, address _rewardPool) external returns(bool);
function getRewardPoolClaims(ISetToken _setToken, address _rewardPool) external returns(address[] memory);
function isRewardPoolClaim(ISetToken _setToken, address _rewardPool, string calldata _integrationName) external returns (bool);
function getRewards(ISetToken _setToken, address _rewardPool, string calldata _integrationName) external returns (uint256);
}
63 changes: 63 additions & 0 deletions contracts/interfaces/IWrapModuleV2.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
Copyright 2022 Set Labs Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
SPDX-License-Identifier: Apache License, Version 2.0
*/

pragma solidity 0.6.10;
pragma experimental "ABIEncoderV2";

import { ISetToken } from "./ISetToken.sol";
import { IWETH } from "./external/IWETH.sol";

interface IWrapModuleV2 {
function weth() external view returns(IWETH);

function initialize(ISetToken _setToken) external;

function wrap(
ISetToken _setToken,
address _underlyingToken,
address _wrappedToken,
uint256 _underlyingUnits,
string calldata _integrationName,
bytes memory _wrapData
) external;

function wrapWithEther(
ISetToken _setToken,
address _wrappedToken,
uint256 _underlyingUnits,
string calldata _integrationName,
bytes memory _wrapData
) external;

function unwrap(
ISetToken _setToken,
address _underlyingToken,
address _wrappedToken,
uint256 _wrappedUnits,
string calldata _integrationName,
bytes memory _unwrapData
) external;

function unwrapWithEther(
ISetToken _setToken,
address _wrappedToken,
uint256 _wrappedUnits,
string calldata _integrationName,
bytes memory _unwrapData
) external;
}

0 comments on commit 6999e84

Please sign in to comment.