feat: add balancer v2 executor
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
interface IArbitrumFeeProvider {
|
||||
function getArbitrumFees()
|
||||
external
|
||||
view
|
||||
returns (
|
||||
uint256 gasLimit,
|
||||
uint256 gasPrice,
|
||||
uint256 maxSubmissionCost
|
||||
);
|
||||
|
||||
function setArbitrumFees(
|
||||
uint64 gasLimit,
|
||||
uint64 gasPrice,
|
||||
uint64 maxSubmissionCost
|
||||
) external;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
import "../solidity-utils/helpers/IAuthentication.sol";
|
||||
import "../vault/IVault.sol";
|
||||
|
||||
interface IAuthorizerAdaptor is IAuthentication {
|
||||
/**
|
||||
* @notice Returns the Balancer Vault
|
||||
*/
|
||||
function getVault() external view returns (IVault);
|
||||
|
||||
/**
|
||||
* @notice Returns the Authorizer
|
||||
*/
|
||||
function getAuthorizer() external view returns (IAuthorizer);
|
||||
|
||||
/**
|
||||
* @notice Performs an arbitrary function call on a target contract, provided the caller is authorized to do so.
|
||||
* @param target - Address of the contract to be called
|
||||
* @param data - Calldata to be sent to the target contract
|
||||
* @return The bytes encoded return value from the performed function call
|
||||
*/
|
||||
function performAction(address target, bytes calldata data) external payable returns (bytes memory);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
import "./IAuthorizerAdaptor.sol";
|
||||
|
||||
/**
|
||||
* @notice Interface for `AuthorizerAdaptorEntrypoint`.
|
||||
*/
|
||||
interface IAuthorizerAdaptorEntrypoint is IAuthorizerAdaptor {
|
||||
/**
|
||||
* @notice Returns the Authorizer Adaptor
|
||||
*/
|
||||
function getAuthorizerAdaptor() external view returns (IAuthorizerAdaptor);
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
import "../solidity-utils/openzeppelin/IERC20.sol";
|
||||
|
||||
/**
|
||||
* @dev Base minter interface, applicable to Mainnet minter or L2 pseudo minters.
|
||||
*/
|
||||
interface IBalancerMinter {
|
||||
event Minted(address indexed recipient, address gauge, uint256 minted);
|
||||
|
||||
/**
|
||||
* @notice Returns the address of the Balancer Governance Token
|
||||
*/
|
||||
function getBalancerToken() external view returns (IERC20);
|
||||
|
||||
/**
|
||||
* @notice Mint everything which belongs to `msg.sender` and send to them
|
||||
* @param gauge `LiquidityGauge` address to get mintable amount from
|
||||
*/
|
||||
function mint(address gauge) external returns (uint256);
|
||||
|
||||
/**
|
||||
* @notice Mint everything which belongs to `msg.sender` across multiple gauges
|
||||
* @param gauges List of `LiquidityGauge` addresses
|
||||
*/
|
||||
function mintMany(address[] calldata gauges) external returns (uint256);
|
||||
|
||||
/**
|
||||
* @notice Mint tokens for `user`
|
||||
* @dev Only possible when `msg.sender` has been approved by `user` to mint on their behalf
|
||||
* @param gauge `LiquidityGauge` address to get mintable amount from
|
||||
* @param user Address to mint to
|
||||
*/
|
||||
function mintFor(address gauge, address user) external returns (uint256);
|
||||
|
||||
/**
|
||||
* @notice Mint tokens for `user` across multiple gauges
|
||||
* @dev Only possible when `msg.sender` has been approved by `user` to mint on their behalf
|
||||
* @param gauges List of `LiquidityGauge` addresses
|
||||
* @param user Address to mint to
|
||||
*/
|
||||
function mintManyFor(address[] calldata gauges, address user) external returns (uint256);
|
||||
|
||||
/**
|
||||
* @notice The total number of tokens minted for `user` from `gauge`
|
||||
*/
|
||||
function minted(address user, address gauge) external view returns (uint256);
|
||||
|
||||
/**
|
||||
* @notice Whether `minter` is approved to mint tokens for `user`
|
||||
*/
|
||||
function getMinterApproval(address minter, address user) external view returns (bool);
|
||||
|
||||
/**
|
||||
* @notice Set whether `minter` is approved to mint tokens on your behalf
|
||||
*/
|
||||
function setMinterApproval(address minter, bool approval) external;
|
||||
|
||||
/**
|
||||
* @notice Set whether `minter` is approved to mint tokens on behalf of `user`, who has signed a message authorizing
|
||||
* them.
|
||||
*/
|
||||
function setMinterApprovalWithSignature(
|
||||
address minter,
|
||||
bool approval,
|
||||
address user,
|
||||
uint256 deadline,
|
||||
uint8 v,
|
||||
bytes32 r,
|
||||
bytes32 s
|
||||
) external;
|
||||
|
||||
// The below functions are near-duplicates of functions available above.
|
||||
// They are included for ABI compatibility with snake_casing as used in vyper contracts.
|
||||
// solhint-disable func-name-mixedcase
|
||||
|
||||
/**
|
||||
* @notice Whether `minter` is approved to mint tokens for `user`
|
||||
*/
|
||||
function allowed_to_mint_for(address minter, address user) external view returns (bool);
|
||||
|
||||
/**
|
||||
* @notice Mint everything which belongs to `msg.sender` across multiple gauges
|
||||
* @dev This function is not recommended as `mintMany()` is more flexible and gas efficient
|
||||
* @param gauges List of `LiquidityGauge` addresses
|
||||
*/
|
||||
function mint_many(address[8] calldata gauges) external;
|
||||
|
||||
/**
|
||||
* @notice Mint tokens for `user`
|
||||
* @dev Only possible when `msg.sender` has been approved by `user` to mint on their behalf
|
||||
* @param gauge `LiquidityGauge` address to get mintable amount from
|
||||
* @param user Address to mint to
|
||||
*/
|
||||
function mint_for(address gauge, address user) external;
|
||||
|
||||
/**
|
||||
* @notice Toggle whether `minter` is approved to mint tokens for `user`
|
||||
*/
|
||||
function toggle_approve_mint(address minter) external;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
import "../solidity-utils/openzeppelin/IERC20.sol";
|
||||
|
||||
interface IBalancerToken is IERC20 {
|
||||
function mint(address to, uint256 amount) external;
|
||||
|
||||
function getRoleMemberCount(bytes32 role) external view returns (uint256);
|
||||
|
||||
function getRoleMember(bytes32 role, uint256 index) external view returns (address);
|
||||
|
||||
function hasRole(bytes32 role, address account) external view returns (bool);
|
||||
|
||||
function getRoleAdmin(bytes32 role) external view returns (bytes32);
|
||||
|
||||
function grantRole(bytes32 role, address account) external;
|
||||
|
||||
function revokeRole(bytes32 role, address account) external;
|
||||
|
||||
// solhint-disable-next-line func-name-mixedcase
|
||||
function DEFAULT_ADMIN_ROLE() external view returns (bytes32);
|
||||
|
||||
// solhint-disable-next-line func-name-mixedcase
|
||||
function MINTER_ROLE() external view returns (bytes32);
|
||||
|
||||
// solhint-disable-next-line func-name-mixedcase
|
||||
function SNAPSHOT_ROLE() external view returns (bytes32);
|
||||
|
||||
function snapshot() external;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
import "../solidity-utils/helpers/IAuthentication.sol";
|
||||
|
||||
import "./IBalancerToken.sol";
|
||||
|
||||
interface IBalancerTokenAdmin is IAuthentication {
|
||||
// solhint-disable func-name-mixedcase
|
||||
function INITIAL_RATE() external view returns (uint256);
|
||||
|
||||
function RATE_REDUCTION_TIME() external view returns (uint256);
|
||||
|
||||
function RATE_REDUCTION_COEFFICIENT() external view returns (uint256);
|
||||
|
||||
function RATE_DENOMINATOR() external view returns (uint256);
|
||||
|
||||
// solhint-enable func-name-mixedcase
|
||||
|
||||
/**
|
||||
* @notice Returns the address of the Balancer Governance Token
|
||||
*/
|
||||
function getBalancerToken() external view returns (IBalancerToken);
|
||||
|
||||
function activate() external;
|
||||
|
||||
function rate() external view returns (uint256);
|
||||
|
||||
function startEpochTimeWrite() external returns (uint256);
|
||||
|
||||
function mint(address to, uint256 amount) external;
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
import "../pool-utils/IVersion.sol";
|
||||
import "./ILiquidityGaugeFactory.sol";
|
||||
|
||||
// For compatibility, we're keeping the same function names as in the original Curve code, including the mixed-case
|
||||
// naming convention.
|
||||
// solhint-disable func-name-mixedcase
|
||||
// solhint-disable func-param-name-mixedcase
|
||||
|
||||
interface IChildChainGauge is IVersion {
|
||||
/**
|
||||
* @notice Proxy constructor.
|
||||
* @param lpToken Pool allowed to stake in this gauge.
|
||||
* @param version Gauge version string identifier.
|
||||
*/
|
||||
function initialize(address lpToken, string memory version) external;
|
||||
|
||||
/**
|
||||
* @notice Returns BAL liquidity emissions calculated during checkpoints for the given user.
|
||||
* @param user User address.
|
||||
* @return uint256 BAL amount to issue for the address.
|
||||
*/
|
||||
function integrate_fraction(address user) external view returns (uint256);
|
||||
|
||||
/**
|
||||
* @notice Records a checkpoint for a given user.
|
||||
* @param user User address.
|
||||
* @return bool Always true.
|
||||
*/
|
||||
function user_checkpoint(address user) external returns (bool);
|
||||
|
||||
/**
|
||||
* @notice Returns gauge factory address.
|
||||
*/
|
||||
function factory() external view returns (ILiquidityGaugeFactory);
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
pragma solidity >=0.7.0 <0.9.0;
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
import "./IChildChainStreamer.sol";
|
||||
import "./ILiquidityGauge.sol";
|
||||
import "./ILiquidityGaugeFactory.sol";
|
||||
import "./IRewardsOnlyGauge.sol";
|
||||
|
||||
interface IChildChainLiquidityGaugeFactory is ILiquidityGaugeFactory {
|
||||
event RewardsOnlyGaugeCreated(address indexed gauge, address indexed pool, address streamer);
|
||||
|
||||
/**
|
||||
* @notice Returns the address of the implementation used for gauge deployments.
|
||||
*/
|
||||
function getGaugeImplementation() external view returns (ILiquidityGauge);
|
||||
|
||||
/**
|
||||
* @notice Returns the address of the implementation used for streamer deployments.
|
||||
*/
|
||||
function getChildChainStreamerImplementation() external view returns (IChildChainStreamer);
|
||||
|
||||
/**
|
||||
* @notice Returns the address of the gauge belonging to `pool`.
|
||||
*/
|
||||
function getPoolGauge(address pool) external view returns (ILiquidityGauge);
|
||||
|
||||
/**
|
||||
* @notice Returns the address of the streamer belonging to `gauge`.
|
||||
*/
|
||||
function getGaugeStreamer(address gauge) external view returns (address);
|
||||
|
||||
/**
|
||||
* @notice Returns true if `streamer` was created by this factory.
|
||||
*/
|
||||
function isStreamerFromFactory(address streamer) external view returns (bool);
|
||||
|
||||
/**
|
||||
* @notice Returns the address of the pool which `gauge` belongs.
|
||||
*/
|
||||
function getGaugePool(address gauge) external view returns (IERC20);
|
||||
|
||||
/**
|
||||
* @notice Returns the address of the streamer belonging to `pool`'s gauge.
|
||||
*/
|
||||
function getPoolStreamer(address pool) external view returns (address);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
import "../solidity-utils/openzeppelin/IERC20.sol";
|
||||
|
||||
// For compatibility, we're keeping the same function names as in the original Curve code, including the mixed-case
|
||||
// naming convention.
|
||||
// solhint-disable func-name-mixedcase
|
||||
|
||||
interface IChildChainStreamer {
|
||||
function initialize(address gauge) external;
|
||||
|
||||
function get_reward() external;
|
||||
|
||||
function reward_tokens(uint256 index) external view returns (IERC20);
|
||||
|
||||
function add_reward(
|
||||
IERC20 rewardToken,
|
||||
address distributor,
|
||||
uint256 duration
|
||||
) external;
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
pragma solidity >=0.7.0 <0.9.0;
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
import "../solidity-utils/openzeppelin/IERC20.sol";
|
||||
|
||||
import "./IVotingEscrow.sol";
|
||||
|
||||
/**
|
||||
* @title Fee Distributor
|
||||
* @notice Distributes any tokens transferred to the contract (e.g. Protocol fees and any BAL emissions) among veBAL
|
||||
* holders proportionally based on a snapshot of the week at which the tokens are sent to the FeeDistributor contract.
|
||||
* @dev Supports distributing arbitrarily many different tokens. In order to start distributing a new token to veBAL
|
||||
* holders simply transfer the tokens to the `FeeDistributor` contract and then call `checkpointToken`.
|
||||
*/
|
||||
interface IFeeDistributor {
|
||||
event TokenCheckpointed(IERC20 token, uint256 amount, uint256 lastCheckpointTimestamp);
|
||||
event TokensClaimed(address user, IERC20 token, uint256 amount, uint256 userTokenTimeCursor);
|
||||
|
||||
/**
|
||||
* @notice Returns the VotingEscrow (veBAL) token contract
|
||||
*/
|
||||
function getVotingEscrow() external view returns (IVotingEscrow);
|
||||
|
||||
/**
|
||||
* @notice Returns the global time cursor representing the most earliest uncheckpointed week.
|
||||
*/
|
||||
function getTimeCursor() external view returns (uint256);
|
||||
|
||||
/**
|
||||
* @notice Returns the user-level time cursor representing the most earliest uncheckpointed week.
|
||||
* @param user - The address of the user to query.
|
||||
*/
|
||||
function getUserTimeCursor(address user) external view returns (uint256);
|
||||
|
||||
/**
|
||||
* @notice Returns the token-level time cursor storing the timestamp at up to which tokens have been distributed.
|
||||
* @param token - The ERC20 token address to query.
|
||||
*/
|
||||
function getTokenTimeCursor(IERC20 token) external view returns (uint256);
|
||||
|
||||
/**
|
||||
* @notice Returns the user-level time cursor storing the timestamp of the latest token distribution claimed.
|
||||
* @param user - The address of the user to query.
|
||||
* @param token - The ERC20 token address to query.
|
||||
*/
|
||||
function getUserTokenTimeCursor(address user, IERC20 token) external view returns (uint256);
|
||||
|
||||
/**
|
||||
* @notice Returns the user's cached balance of veBAL as of the provided timestamp.
|
||||
* @dev Only timestamps which fall on Thursdays 00:00:00 UTC will return correct values.
|
||||
* This function requires `user` to have been checkpointed past `timestamp` so that their balance is cached.
|
||||
* @param user - The address of the user of which to read the cached balance of.
|
||||
* @param timestamp - The timestamp at which to read the `user`'s cached balance at.
|
||||
*/
|
||||
function getUserBalanceAtTimestamp(address user, uint256 timestamp) external view returns (uint256);
|
||||
|
||||
/**
|
||||
* @notice Returns the cached total supply of veBAL as of the provided timestamp.
|
||||
* @dev Only timestamps which fall on Thursdays 00:00:00 UTC will return correct values.
|
||||
* This function requires the contract to have been checkpointed past `timestamp` so that the supply is cached.
|
||||
* @param timestamp - The timestamp at which to read the cached total supply at.
|
||||
*/
|
||||
function getTotalSupplyAtTimestamp(uint256 timestamp) external view returns (uint256);
|
||||
|
||||
/**
|
||||
* @notice Returns the FeeDistributor's cached balance of `token`.
|
||||
*/
|
||||
function getTokenLastBalance(IERC20 token) external view returns (uint256);
|
||||
|
||||
/**
|
||||
* @notice Returns the amount of `token` which the FeeDistributor received in the week beginning at `timestamp`.
|
||||
* @param token - The ERC20 token address to query.
|
||||
* @param timestamp - The timestamp corresponding to the beginning of the week of interest.
|
||||
*/
|
||||
function getTokensDistributedInWeek(IERC20 token, uint256 timestamp) external view returns (uint256);
|
||||
|
||||
// Depositing
|
||||
|
||||
/**
|
||||
* @notice Deposits tokens to be distributed in the current week.
|
||||
* @dev Sending tokens directly to the FeeDistributor instead of using `depositTokens` may result in tokens being
|
||||
* retroactively distributed to past weeks, or for the distribution to carry over to future weeks.
|
||||
*
|
||||
* If for some reason `depositTokens` cannot be called, in order to ensure that all tokens are correctly distributed
|
||||
* manually call `checkpointToken` before and after the token transfer.
|
||||
* @param token - The ERC20 token address to distribute.
|
||||
* @param amount - The amount of tokens to deposit.
|
||||
*/
|
||||
function depositToken(IERC20 token, uint256 amount) external;
|
||||
|
||||
/**
|
||||
* @notice Deposits tokens to be distributed in the current week.
|
||||
* @dev A version of `depositToken` which supports depositing multiple `tokens` at once.
|
||||
* See `depositToken` for more details.
|
||||
* @param tokens - An array of ERC20 token addresses to distribute.
|
||||
* @param amounts - An array of token amounts to deposit.
|
||||
*/
|
||||
function depositTokens(IERC20[] calldata tokens, uint256[] calldata amounts) external;
|
||||
|
||||
// Checkpointing
|
||||
|
||||
/**
|
||||
* @notice Caches the total supply of veBAL at the beginning of each week.
|
||||
* This function will be called automatically before claiming tokens to ensure the contract is properly updated.
|
||||
*/
|
||||
function checkpoint() external;
|
||||
|
||||
/**
|
||||
* @notice Caches the user's balance of veBAL at the beginning of each week.
|
||||
* This function will be called automatically before claiming tokens to ensure the contract is properly updated.
|
||||
* @param user - The address of the user to be checkpointed.
|
||||
*/
|
||||
function checkpointUser(address user) external;
|
||||
|
||||
/**
|
||||
* @notice Assigns any newly-received tokens held by the FeeDistributor to weekly distributions.
|
||||
* @dev Any `token` balance held by the FeeDistributor above that which is returned by `getTokenLastBalance`
|
||||
* will be distributed evenly across the time period since `token` was last checkpointed.
|
||||
*
|
||||
* This function will be called automatically before claiming tokens to ensure the contract is properly updated.
|
||||
* @param token - The ERC20 token address to be checkpointed.
|
||||
*/
|
||||
function checkpointToken(IERC20 token) external;
|
||||
|
||||
/**
|
||||
* @notice Assigns any newly-received tokens held by the FeeDistributor to weekly distributions.
|
||||
* @dev A version of `checkpointToken` which supports checkpointing multiple tokens.
|
||||
* See `checkpointToken` for more details.
|
||||
* @param tokens - An array of ERC20 token addresses to be checkpointed.
|
||||
*/
|
||||
function checkpointTokens(IERC20[] calldata tokens) external;
|
||||
|
||||
// Claiming
|
||||
|
||||
/**
|
||||
* @notice Claims all pending distributions of the provided token for a user.
|
||||
* @dev It's not necessary to explicitly checkpoint before calling this function, it will ensure the FeeDistributor
|
||||
* is up to date before calculating the amount of tokens to be claimed.
|
||||
* @param user - The user on behalf of which to claim.
|
||||
* @param token - The ERC20 token address to be claimed.
|
||||
* @return The amount of `token` sent to `user` as a result of claiming.
|
||||
*/
|
||||
function claimToken(address user, IERC20 token) external returns (uint256);
|
||||
|
||||
/**
|
||||
* @notice Claims a number of tokens on behalf of a user.
|
||||
* @dev A version of `claimToken` which supports claiming multiple `tokens` on behalf of `user`.
|
||||
* See `claimToken` for more details.
|
||||
* @param user - The user on behalf of which to claim.
|
||||
* @param tokens - An array of ERC20 token addresses to be claimed.
|
||||
* @return An array of the amounts of each token in `tokens` sent to `user` as a result of claiming.
|
||||
*/
|
||||
function claimTokens(address user, IERC20[] calldata tokens) external returns (uint256[] memory);
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
import "./IAuthorizerAdaptorEntrypoint.sol";
|
||||
import "./IGaugeController.sol";
|
||||
import "./ILiquidityGauge.sol";
|
||||
import "./ILiquidityGaugeFactory.sol";
|
||||
import "./IStakingLiquidityGauge.sol";
|
||||
|
||||
interface IGaugeAdder is IAuthentication {
|
||||
enum GaugeType { LiquidityMiningCommittee, veBAL, Ethereum, Polygon, Arbitrum, Optimism, Gnosis, ZKSync }
|
||||
|
||||
event GaugeFactoryAdded(GaugeType indexed gaugeType, ILiquidityGaugeFactory gaugeFactory);
|
||||
|
||||
/**
|
||||
* @notice Returns the address of the Authorizer adaptor entrypoint contract.
|
||||
*/
|
||||
function getAuthorizerAdaptorEntrypoint() external view returns (IAuthorizerAdaptorEntrypoint);
|
||||
|
||||
/**
|
||||
* @notice Returns the address of the Gauge Controller
|
||||
*/
|
||||
function getGaugeController() external view returns (IGaugeController);
|
||||
|
||||
/**
|
||||
* @notice Returns the `index`'th factory for gauge type `gaugeType`
|
||||
*/
|
||||
function getFactoryForGaugeType(GaugeType gaugeType, uint256 index) external view returns (address);
|
||||
|
||||
/**
|
||||
* @notice Returns the number of factories for gauge type `gaugeType`
|
||||
*/
|
||||
function getFactoryForGaugeTypeCount(GaugeType gaugeType) external view returns (uint256);
|
||||
|
||||
/**
|
||||
* @notice Returns whether `gauge` has been deployed by one of the listed factories for the gauge type `gaugeType`
|
||||
*/
|
||||
function isGaugeFromValidFactory(address gauge, GaugeType gaugeType) external view returns (bool);
|
||||
|
||||
/**
|
||||
* @notice Adds a new gauge to the GaugeController for the "Ethereum" type.
|
||||
*/
|
||||
function addEthereumGauge(IStakingLiquidityGauge gauge) external;
|
||||
|
||||
/**
|
||||
* @notice Adds a new gauge to the GaugeController for the "Polygon" type.
|
||||
* This function must be called with the address of the *root* gauge which is deployed on Ethereum mainnet.
|
||||
* It should not be called with the address of the gauge which is deployed on Polygon
|
||||
*/
|
||||
function addPolygonGauge(address rootGauge) external;
|
||||
|
||||
/**
|
||||
* @notice Adds a new gauge to the GaugeController for the "Arbitrum" type.
|
||||
* This function must be called with the address of the *root* gauge which is deployed on Ethereum mainnet.
|
||||
* It should not be called with the address of the gauge which is deployed on Arbitrum
|
||||
*/
|
||||
function addArbitrumGauge(address rootGauge) external;
|
||||
|
||||
/**
|
||||
* @notice Adds a new gauge to the GaugeController for the "Optimism" type.
|
||||
* This function must be called with the address of the *root* gauge which is deployed on Ethereum mainnet.
|
||||
* It should not be called with the address of the gauge which is deployed on Optimism.
|
||||
*/
|
||||
function addOptimismGauge(address rootGauge) external;
|
||||
|
||||
/**
|
||||
* @notice Adds a new gauge to the GaugeController for the "Gnosis" type.
|
||||
* This function must be called with the address of the *root* gauge which is deployed on Ethereum mainnet.
|
||||
* It should not be called with the address of the gauge which is deployed on Gnosis Chain.
|
||||
*/
|
||||
function addGnosisGauge(address rootGauge) external;
|
||||
|
||||
/**
|
||||
* @notice Adds a new gauge to the GaugeController for the "ZKSync" type.
|
||||
* This function must be called with the address of the *root* gauge which is deployed on Ethereum mainnet.
|
||||
* It should not be called with the address of the gauge which is deployed on ZKSync.
|
||||
*/
|
||||
function addZKSyncGauge(address rootGauge) external;
|
||||
|
||||
/**
|
||||
* @notice Adds `factory` as an allowlisted factory contract for gauges with type `gaugeType`.
|
||||
*/
|
||||
function addGaugeFactory(ILiquidityGaugeFactory factory, GaugeType gaugeType) external;
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
import "../solidity-utils/openzeppelin/IERC20.sol";
|
||||
|
||||
import "./IAuthorizerAdaptor.sol";
|
||||
import "./IVotingEscrow.sol";
|
||||
|
||||
// For compatibility, we're keeping the same function names as in the original Curve code, including the mixed-case
|
||||
// naming convention.
|
||||
// solhint-disable func-name-mixedcase
|
||||
|
||||
interface IGaugeController {
|
||||
function checkpoint_gauge(address gauge) external;
|
||||
|
||||
function gauge_relative_weight(address gauge, uint256 time) external view returns (uint256);
|
||||
|
||||
function voting_escrow() external view returns (IVotingEscrow);
|
||||
|
||||
function token() external view returns (IERC20);
|
||||
|
||||
function add_type(string calldata name, uint256 weight) external;
|
||||
|
||||
function change_type_weight(int128 typeId, uint256 weight) external;
|
||||
|
||||
function add_gauge(address gauge, int128 gaugeType) external;
|
||||
|
||||
function n_gauge_types() external view returns (int128);
|
||||
|
||||
function gauge_types(address gauge) external view returns (int128);
|
||||
|
||||
function admin() external view returns (IAuthorizerAdaptor);
|
||||
|
||||
function gauge_exists(address gauge) external view returns (bool);
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
pragma solidity ^0.7.0;
|
||||
|
||||
import "./IGaugeAdder.sol";
|
||||
import "./IStakelessGauge.sol";
|
||||
|
||||
/**
|
||||
* @title L2 Gauge Checkpointer interface
|
||||
* @notice Manages checkpoints for L2 gauges, allowing to perform mutiple checkpoints in a single call.
|
||||
* @dev Supports Polygon, Arbitrum, Optimism, Gnosis and ZKSync stakeless root gauges. Gauges to be checkpointed need
|
||||
* to be added to the controller beforehand.
|
||||
*/
|
||||
interface IL2GaugeCheckpointer {
|
||||
/**
|
||||
* @dev Emitted when a gauge is added to the checkpointer.
|
||||
*/
|
||||
event GaugeAdded(IGaugeAdder.GaugeType indexed gaugeType, IStakelessGauge indexed gauge);
|
||||
|
||||
/**
|
||||
* @dev Emitted when a gauge is removed from the checkpointer.
|
||||
*/
|
||||
event GaugeRemoved(IGaugeAdder.GaugeType indexed gaugeType, IStakelessGauge indexed gauge);
|
||||
|
||||
/**
|
||||
* @dev Adds an array of gauges from the given type.
|
||||
* Gauges added will be considered when performing checkpoints.
|
||||
* The gauges to add should meet the following preconditions:
|
||||
* - They must have been created in a valid GaugeFactory, according to GaugeAdder#isGaugeFromValidFactory.
|
||||
* - They must exist in the GaugeController, according to GaugeController#gauge_exists.
|
||||
* - They must not be killed.
|
||||
* - They must not have been previously added to the checkpointer.
|
||||
* @param gaugeType - Type of the gauge.
|
||||
* @param gauges - Gauges to add.
|
||||
*/
|
||||
function addGauges(IGaugeAdder.GaugeType gaugeType, IStakelessGauge[] calldata gauges) external;
|
||||
|
||||
/**
|
||||
* @dev Removes an array of gauges from the given type.
|
||||
* Removed gauges will not be considered when performing checkpoints. To remove gauges:
|
||||
* - They must be killed.
|
||||
* - They must have been previously added to the checkpointer.
|
||||
* @param gaugeType - Type of the gauge.
|
||||
* @param gauges - Gauges to remove.
|
||||
*/
|
||||
function removeGauges(IGaugeAdder.GaugeType gaugeType, IStakelessGauge[] calldata gauges) external;
|
||||
|
||||
/**
|
||||
* @dev Returns true if the given gauge was added for the given type; false otherwise.
|
||||
* @param gaugeType - Type of the gauge.
|
||||
* @param gauge - Gauge to check.
|
||||
*/
|
||||
function hasGauge(IGaugeAdder.GaugeType gaugeType, IStakelessGauge gauge) external view returns (bool);
|
||||
|
||||
/**
|
||||
* @dev Returns the amount of added gauges for a given type.
|
||||
* @param gaugeType - Type of the gauge.
|
||||
*/
|
||||
function getTotalGauges(IGaugeAdder.GaugeType gaugeType) external view returns (uint256);
|
||||
|
||||
/**
|
||||
* @dev Returns the gauge of a given type at the given index.
|
||||
* Reverts if the index is greater than or equal to the amount of added gauges for the given type.
|
||||
* @param gaugeType - Type of the gauge.
|
||||
* @param index - Index of the added gauge.
|
||||
*/
|
||||
function getGaugeAtIndex(IGaugeAdder.GaugeType gaugeType, uint256 index) external view returns (IStakelessGauge);
|
||||
|
||||
/**
|
||||
* @dev Performs a checkpoint for all added gauges above the given relative weight threshold.
|
||||
* Reverts if the ETH sent in the call is not enough to cover bridge costs.
|
||||
* @param minRelativeWeight - Threshold to filter out gauges below it.
|
||||
*/
|
||||
function checkpointGaugesAboveRelativeWeight(uint256 minRelativeWeight) external payable;
|
||||
|
||||
/**
|
||||
* @dev Performs a checkpoint for all added gauges of a given type above the given relative weight threshold.
|
||||
* Reverts if the ETH sent in the call is not enough to cover bridge costs.
|
||||
* @param gaugeType - Type of the gauge.
|
||||
* @param minRelativeWeight - Threshold to filter out gauges below it.
|
||||
*/
|
||||
function checkpointGaugesOfTypeAboveRelativeWeight(IGaugeAdder.GaugeType gaugeType, uint256 minRelativeWeight)
|
||||
external
|
||||
payable;
|
||||
|
||||
/**
|
||||
* @dev Returns the ETH cost to checkpoint all gauges for a given minimum relative weight.
|
||||
* A lower minimum relative weight might return higher costs, since more gauges could potentially be included
|
||||
* in the checkpoint.
|
||||
*/
|
||||
function getTotalBridgeCost(uint256 minRelativeWeight) external view returns (uint256);
|
||||
|
||||
/**
|
||||
* @dev Returns true if gauge type is Polygon, Arbitrum, Optimism, Gnosis or ZKSync; false otherwise.
|
||||
*/
|
||||
function isSupportedGaugeType(IGaugeAdder.GaugeType gaugeType) external pure returns (bool);
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
import "./IBalancerTokenAdmin.sol";
|
||||
import "./IGaugeController.sol";
|
||||
|
||||
interface ILMGetters {
|
||||
/**
|
||||
* @notice Returns the address of the Balancer Token Admin contract
|
||||
*/
|
||||
function getBalancerTokenAdmin() external view returns (IBalancerTokenAdmin);
|
||||
|
||||
/**
|
||||
* @notice Returns the address of the Gauge Controller
|
||||
*/
|
||||
function getGaugeController() external view returns (IGaugeController);
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
// For compatibility, we're keeping the same function names as in the original Curve code, including the mixed-case
|
||||
// naming convention.
|
||||
// solhint-disable func-name-mixedcase
|
||||
// solhint-disable func-param-name-mixedcase
|
||||
|
||||
interface ILiquidityGauge {
|
||||
// solhint-disable-next-line var-name-mixedcase
|
||||
event RelativeWeightCapChanged(uint256 new_relative_weight_cap);
|
||||
|
||||
/**
|
||||
* @notice Returns BAL liquidity emissions calculated during checkpoints for the given user.
|
||||
* @param user User address.
|
||||
* @return uint256 BAL amount to issue for the address.
|
||||
*/
|
||||
function integrate_fraction(address user) external view returns (uint256);
|
||||
|
||||
/**
|
||||
* @notice Record a checkpoint for a given user.
|
||||
* @param user User address.
|
||||
* @return bool Always true.
|
||||
*/
|
||||
function user_checkpoint(address user) external returns (bool);
|
||||
|
||||
/**
|
||||
* @notice Returns true if gauge is killed; false otherwise.
|
||||
*/
|
||||
function is_killed() external view returns (bool);
|
||||
|
||||
/**
|
||||
* @notice Kills the gauge so it cannot mint BAL.
|
||||
*/
|
||||
function killGauge() external;
|
||||
|
||||
/**
|
||||
* @notice Unkills the gauge so it can mint BAL again.
|
||||
*/
|
||||
function unkillGauge() external;
|
||||
|
||||
/**
|
||||
* @notice Sets a new relative weight cap for the gauge.
|
||||
* The value shall be normalized to 1e18, and not greater than MAX_RELATIVE_WEIGHT_CAP.
|
||||
* @param relativeWeightCap New relative weight cap.
|
||||
*/
|
||||
function setRelativeWeightCap(uint256 relativeWeightCap) external;
|
||||
|
||||
/**
|
||||
* @notice Gets the relative weight cap for the gauge.
|
||||
*/
|
||||
function getRelativeWeightCap() external view returns (uint256);
|
||||
|
||||
/**
|
||||
* @notice Returns the gauge's relative weight for a given time, capped to its relative weight cap attribute.
|
||||
* @param time Timestamp in the past or present.
|
||||
*/
|
||||
function getCappedRelativeWeight(uint256 time) external view returns (uint256);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
pragma solidity >=0.7.0 <0.9.0;
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
import "./ILiquidityGauge.sol";
|
||||
|
||||
interface ILiquidityGaugeFactory {
|
||||
/**
|
||||
* @notice Returns true if `gauge` was created by this factory.
|
||||
*/
|
||||
function isGaugeFromFactory(address gauge) external view returns (bool);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
import "./IBalancerMinter.sol";
|
||||
import "./ILMGetters.sol";
|
||||
|
||||
/**
|
||||
* @dev Full L1 Balancer minter interface with singleton getters.
|
||||
*/
|
||||
interface IMainnetBalancerMinter is IBalancerMinter, ILMGetters {
|
||||
// solhint-disable-previous-line no-empty-blocks
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
interface IOptimismGasLimitProvider {
|
||||
function getOptimismGasLimit() external view returns (uint32 gasLimit);
|
||||
|
||||
function setOptimismGasLimit(uint32 gasLimit) external;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
pragma solidity >=0.7.0 <0.9.0;
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
import "../solidity-utils/openzeppelin/IERC20.sol";
|
||||
|
||||
// For compatibility, we're keeping the same function names as in the original Curve code, including the mixed-case
|
||||
// naming convention.
|
||||
// solhint-disable func-name-mixedcase, var-name-mixedcase
|
||||
|
||||
interface IRewardTokenDistributor {
|
||||
struct Reward {
|
||||
IERC20 token;
|
||||
address distributor;
|
||||
uint256 period_finish;
|
||||
uint256 rate;
|
||||
uint256 last_update;
|
||||
uint256 integral;
|
||||
}
|
||||
|
||||
function reward_tokens(uint256 index) external view returns (IERC20);
|
||||
|
||||
function reward_data(IERC20 token) external view returns (Reward memory);
|
||||
|
||||
function claim_rewards(address user) external;
|
||||
|
||||
function add_reward(IERC20 rewardToken, address distributor) external;
|
||||
|
||||
function set_reward_distributor(IERC20 rewardToken, address distributor) external;
|
||||
|
||||
function deposit_reward_token(IERC20 rewardToken, uint256 amount) external;
|
||||
|
||||
function claimable_reward(address rewardToken, address user) external view returns (uint256);
|
||||
|
||||
function claimable_reward_write(address rewardToken, address user) external returns (uint256);
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
import "./IChildChainStreamer.sol";
|
||||
import "./IRewardTokenDistributor.sol";
|
||||
|
||||
// For compatibility, we're keeping the same function names as in the original Curve code, including the mixed-case
|
||||
// naming convention.
|
||||
// solhint-disable func-name-mixedcase
|
||||
|
||||
interface IRewardsOnlyGauge is IRewardTokenDistributor {
|
||||
function initialize(
|
||||
address pool,
|
||||
address streamer,
|
||||
bytes32 claimSignature
|
||||
) external;
|
||||
|
||||
// solhint-disable-next-line func-name-mixedcase
|
||||
function lp_token() external view returns (IERC20);
|
||||
|
||||
function reward_contract() external view returns (IChildChainStreamer);
|
||||
|
||||
function set_rewards(
|
||||
address childChainStreamer,
|
||||
bytes32 claimSig,
|
||||
address[8] calldata rewardTokens
|
||||
) external;
|
||||
|
||||
function last_claim() external view returns (uint256);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
interface ISmartWalletChecker {
|
||||
function check(address contractAddress) external view returns (bool);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
import "./ILiquidityGauge.sol";
|
||||
|
||||
interface IStakelessGauge is ILiquidityGauge {
|
||||
function checkpoint() external payable returns (bool);
|
||||
|
||||
function getRecipient() external view returns (address);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
pragma solidity >=0.7.0 <0.9.0;
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
import "../solidity-utils/openzeppelin/IERC20.sol";
|
||||
|
||||
import "./ILiquidityGauge.sol";
|
||||
import "./IRewardTokenDistributor.sol";
|
||||
|
||||
// For compatibility, we're keeping the same function names as in the original Curve code, including the mixed-case
|
||||
// naming convention.
|
||||
// solhint-disable func-name-mixedcase, var-name-mixedcase
|
||||
|
||||
interface IStakingLiquidityGauge is IRewardTokenDistributor, ILiquidityGauge, IERC20 {
|
||||
function initialize(address lpToken, uint256 relativeWeightCap) external;
|
||||
|
||||
function lp_token() external view returns (IERC20);
|
||||
|
||||
function deposit(uint256 value, address recipient) external;
|
||||
|
||||
function withdraw(uint256 value) external;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
pragma solidity >=0.7.0 <0.9.0;
|
||||
|
||||
// For compatibility, we're keeping the same function names as in the original Curve code, including the mixed-case
|
||||
// naming convention.
|
||||
// solhint-disable func-name-mixedcase
|
||||
|
||||
interface IVeDelegation {
|
||||
// solhint-disable-next-line func-name-mixedcase
|
||||
function adjusted_balance_of(address user) external view returns (uint256);
|
||||
|
||||
function totalSupply() external view returns (uint256);
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
pragma solidity >=0.7.0 <0.9.0;
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
import "./IAuthorizerAdaptor.sol";
|
||||
|
||||
// For compatibility, we're keeping the same function names as in the original Curve code, including the mixed-case
|
||||
// naming convention.
|
||||
// solhint-disable func-name-mixedcase
|
||||
|
||||
interface IVotingEscrow {
|
||||
struct Point {
|
||||
int128 bias;
|
||||
int128 slope; // - dweight / dt
|
||||
uint256 ts;
|
||||
uint256 blk; // block
|
||||
}
|
||||
|
||||
function epoch() external view returns (uint256);
|
||||
|
||||
function totalSupply(uint256 timestamp) external view returns (uint256);
|
||||
|
||||
function user_point_epoch(address user) external view returns (uint256);
|
||||
|
||||
function point_history(uint256 timestamp) external view returns (Point memory);
|
||||
|
||||
function user_point_history(address user, uint256 timestamp) external view returns (Point memory);
|
||||
|
||||
function checkpoint() external;
|
||||
|
||||
function admin() external view returns (IAuthorizerAdaptor);
|
||||
|
||||
function smart_wallet_checker() external view returns (address);
|
||||
|
||||
function commit_smart_wallet_checker(address newSmartWalletChecker) external;
|
||||
|
||||
function apply_smart_wallet_checker() external;
|
||||
}
|
||||
Reference in New Issue
Block a user