diff --git a/contracts/interfaces/IAirdropModule.sol b/contracts/interfaces/IAirdropModule.sol new file mode 100644 index 000000000..65647cec8 --- /dev/null +++ b/contracts/interfaces/IAirdropModule.sol @@ -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); +} \ No newline at end of file diff --git a/contracts/interfaces/IClaimModule.sol b/contracts/interfaces/IClaimModule.sol new file mode 100644 index 000000000..7feb72cdc --- /dev/null +++ b/contracts/interfaces/IClaimModule.sol @@ -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); +} \ No newline at end of file diff --git a/contracts/interfaces/IWrapModuleV2.sol b/contracts/interfaces/IWrapModuleV2.sol new file mode 100644 index 000000000..efcc806af --- /dev/null +++ b/contracts/interfaces/IWrapModuleV2.sol @@ -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; +}