编译器
0.8.21+commit.d9974bed
文件 1 的 13:Address.sol
pragma solidity ^0.8.1;
library Address {
function isContract(address account) internal view returns (bool) {
return account.code.length > 0;
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
文件 2 的 13:Context.sol
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
文件 3 的 13:ERC20.sol
pragma solidity ^0.8.0;
import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function decimals() public view virtual override returns (uint8) {
return 18;
}
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
function transfer(address to, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_approve(owner, spender, amount);
return true;
}
function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, amount);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, allowance(owner, spender) + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = allowance(owner, spender);
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
return true;
}
function _transfer(address from, address to, uint256 amount) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, to, amount);
uint256 fromBalance = _balances[from];
require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[from] = fromBalance - amount;
_balances[to] += amount;
}
emit Transfer(from, to, amount);
_afterTokenTransfer(from, to, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
unchecked {
_balances[account] += amount;
}
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
}
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(owner, spender, currentAllowance - amount);
}
}
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}
function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}
}
文件 4 的 13:IERC20.sol
pragma solidity ^0.8.0;
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}
文件 5 的 13:IERC20Metadata.sol
pragma solidity ^0.8.0;
import "../IERC20.sol";
interface IERC20Metadata is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
文件 6 的 13:IERC20Permit.sol
pragma solidity ^0.8.0;
interface IERC20Permit {
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
function nonces(address owner) external view returns (uint256);
function DOMAIN_SEPARATOR() external view returns (bytes32);
}
文件 7 的 13:IFrax.sol
pragma solidity ^0.8.19;
interface IFrax {
function COLLATERAL_RATIO_PAUSER() external view returns (bytes32);
function DEFAULT_ADMIN_ADDRESS() external view returns (address);
function DEFAULT_ADMIN_ROLE() external view returns (bytes32);
function addPool(address pool_address ) external;
function allowance(address owner, address spender ) external view returns (uint256);
function approve(address spender, uint256 amount ) external returns (bool);
function balanceOf(address account ) external view returns (uint256);
function burn(uint256 amount ) external;
function burnFrom(address account, uint256 amount ) external;
function collateral_ratio_paused() external view returns (bool);
function controller_address() external view returns (address);
function creator_address() external view returns (address);
function decimals() external view returns (uint8);
function decreaseAllowance(address spender, uint256 subtractedValue ) external returns (bool);
function eth_usd_consumer_address() external view returns (address);
function eth_usd_price() external view returns (uint256);
function frax_eth_oracle_address() external view returns (address);
function frax_info() external view returns (uint256, uint256, uint256, uint256, uint256, uint256, uint256, uint256);
function frax_pools(address ) external view returns (bool);
function frax_pools_array(uint256 ) external view returns (address);
function frax_price() external view returns (uint256);
function frax_step() external view returns (uint256);
function fxs_address() external view returns (address);
function fxs_eth_oracle_address() external view returns (address);
function fxs_price() external view returns (uint256);
function genesis_supply() external view returns (uint256);
function getRoleAdmin(bytes32 role ) external view returns (bytes32);
function getRoleMember(bytes32 role, uint256 index ) external view returns (address);
function getRoleMemberCount(bytes32 role ) external view returns (uint256);
function globalCollateralValue() external view returns (uint256);
function global_collateral_ratio() external view returns (uint256);
function grantRole(bytes32 role, address account ) external;
function hasRole(bytes32 role, address account ) external view returns (bool);
function increaseAllowance(address spender, uint256 addedValue ) external returns (bool);
function last_call_time() external view returns (uint256);
function minting_fee() external view returns (uint256);
function name() external view returns (string memory);
function owner_address() external view returns (address);
function pool_burn_from(address b_address, uint256 b_amount ) external;
function pool_mint(address m_address, uint256 m_amount ) external;
function price_band() external view returns (uint256);
function price_target() external view returns (uint256);
function redemption_fee() external view returns (uint256);
function refreshCollateralRatio() external;
function refresh_cooldown() external view returns (uint256);
function removePool(address pool_address ) external;
function renounceRole(bytes32 role, address account ) external;
function revokeRole(bytes32 role, address account ) external;
function setController(address _controller_address ) external;
function setETHUSDOracle(address _eth_usd_consumer_address ) external;
function setFRAXEthOracle(address _frax_oracle_addr, address _weth_address ) external;
function setFXSAddress(address _fxs_address ) external;
function setFXSEthOracle(address _fxs_oracle_addr, address _weth_address ) external;
function setFraxStep(uint256 _new_step ) external;
function setMintingFee(uint256 min_fee ) external;
function setOwner(address _owner_address ) external;
function setPriceBand(uint256 _price_band ) external;
function setPriceTarget(uint256 _new_price_target ) external;
function setRedemptionFee(uint256 red_fee ) external;
function setRefreshCooldown(uint256 _new_cooldown ) external;
function setTimelock(address new_timelock ) external;
function symbol() external view returns (string memory);
function timelock_address() external view returns (address);
function toggleCollateralRatio() external;
function totalSupply() external view returns (uint256);
function transfer(address recipient, uint256 amount ) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount ) external returns (bool);
function weth_address() external view returns (address);
}
文件 8 的 13:IFxs.sol
pragma solidity ^0.8.19;
interface IFxs {
function DEFAULT_ADMIN_ROLE() external view returns(bytes32);
function FRAXStablecoinAdd() external view returns(address);
function FXS_DAO_min() external view returns(uint256);
function allowance(address owner, address spender) external view returns(uint256);
function approve(address spender, uint256 amount) external returns(bool);
function balanceOf(address account) external view returns(uint256);
function burn(uint256 amount) external;
function burnFrom(address account, uint256 amount) external;
function checkpoints(address, uint32) external view returns(uint32 fromBlock, uint96 votes);
function decimals() external view returns(uint8);
function decreaseAllowance(address spender, uint256 subtractedValue) external returns(bool);
function genesis_supply() external view returns(uint256);
function getCurrentVotes(address account) external view returns(uint96);
function getPriorVotes(address account, uint256 blockNumber) external view returns(uint96);
function getRoleAdmin(bytes32 role) external view returns(bytes32);
function getRoleMember(bytes32 role, uint256 index) external view returns(address);
function getRoleMemberCount(bytes32 role) external view returns(uint256);
function grantRole(bytes32 role, address account) external;
function hasRole(bytes32 role, address account) external view returns(bool);
function increaseAllowance(address spender, uint256 addedValue) external returns(bool);
function mint(address to, uint256 amount) external;
function name() external view returns(string memory);
function numCheckpoints(address) external view returns(uint32);
function oracle_address() external view returns(address);
function owner_address() external view returns(address);
function pool_burn_from(address b_address, uint256 b_amount) external;
function pool_mint(address m_address, uint256 m_amount) external;
function renounceRole(bytes32 role, address account) external;
function revokeRole(bytes32 role, address account) external;
function setFRAXAddress(address frax_contract_address) external;
function setFXSMinDAO(uint256 min_FXS) external;
function setOracle(address new_oracle) external;
function setOwner(address _owner_address) external;
function setTimelock(address new_timelock) external;
function symbol() external view returns(string memory);
function timelock_address() external view returns(address);
function toggleVotes() external;
function totalSupply() external view returns(uint256);
function trackingVotes() external view returns(bool);
function transfer(address recipient, uint256 amount) external returns(bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns(bool);
}
文件 9 的 13:IIncentivizationHandler.sol
pragma solidity ^0.8.19;
interface IIncentivizationHandler {
function balanceOfTargetToken(
address poolAddress,
address gaugeAddress,
address targetTokenAddress) external view returns(uint256);
function balanceOfLockedTargetToken(
address poolAddress,
address lpTokenAddress,
address gaugeAddress,
address targetTokenAddress) external view returns(uint256);
function depositTargetToken(
address poolAddress,
address lpTokenAddress,
address gaugeAddress,
address targetTokenAddress,
uint256 amount) external;
function withdrawTargetToken(
address poolAddress,
address lpTokenAddress,
address gaugeAddress,
address targetTokenAddress,
uint256 amount) external;
function incentivizePool(
address poolAddress,
address gaugeAddress,
address incentivePoolAdderss,
address incentiveTokenAddress,
uint256 indexId,
uint256 amount) external;
}
文件 10 的 13:IncentivizerAmoV3.sol
pragma solidity ^0.8.19;
import "./interfaces/IFrax.sol";
import "./interfaces/IFxs.sol";
import "./interfaces/IIncentivizationHandler.sol";
import "./Uniswap/TransferHelper.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract IncentivizerAmoV3 is Ownable {
address public operatorAddress;
address public targetTokenAddress;
address public incentiveTokenAddress;
address[] public poolArray;
struct LiquidityPool {
address poolAddress;
address lpTokenAddress;
address incentivePoolAddress;
address incentivizationHandlerAddress;
address gaugeAddress;
uint256 incentivizationId;
bool isPaused;
uint lastIncentivizationTimestamp;
uint lastIncentivizationAmount;
uint firstIncentivizationTimestamp;
uint poolCycleLength;
}
mapping(address => bool) public poolInitialized;
mapping(address => LiquidityPool) private poolInfo;
mapping(address => bool) public poolHasFixedIncent;
mapping(address => uint256) public poolFixedIncentAmount;
struct IncentiveTier {
uint256 tokenMaxBudgetPerUnit;
uint256 kickstartPeriodLength;
uint256 kickstartPeriodBudget;
}
IncentiveTier[] public tierArray;
mapping(address => uint) public poolTier;
uint256 public minTvl;
uint256 public cycleStart;
uint256 public cycleLength;
string public name;
constructor(
address _operatorAddress,
address _targetTokenAddress,
address _incentiveTokenAddress,
uint256 _minTvl,
uint256 _cycleStart,
uint256 _cycleLength
) Ownable() {
operatorAddress = _operatorAddress;
targetTokenAddress = _targetTokenAddress;
incentiveTokenAddress = _incentiveTokenAddress;
minTvl = _minTvl;
require(_cycleStart < block.timestamp, "Cycle start time error");
cycleStart = _cycleStart;
cycleLength = _cycleLength;
name = string.concat(ERC20(_targetTokenAddress).symbol()," Liquidity Incentivizer");
addTier(0, 0, 0);
emit StartAMO(_operatorAddress, _targetTokenAddress, _incentiveTokenAddress);
}
modifier onlyByOwnerOperator() {
require(msg.sender == operatorAddress || msg.sender == owner(), "Not owner or operator");
_;
}
modifier activePool(address _poolAddress) {
require(poolInitialized[_poolAddress] && !poolInfo[_poolAddress].isPaused, "Pool is not active");
require(showPoolTvl(_poolAddress) > minTvl, "Pool is small");
_;
}
event StartAMO(address _operatorAddress, address _targetTokenAddress, address _incentiveTokenAddress);
event SetOperator(address _oldAddress, address _newAddress);
event AddOrSetPool(
address _poolAddress,
address _lpTokenAddress,
address _gaugeAddress,
address _incentivePoolAddress,
address _incentivizationHandlerAddress,
uint256 _indexId,
uint256 _poolCycleLength
);
event AddOrSetTier(uint256 _tierId,uint256 _tokenMaxBudgetPerUnit,uint256 _kickstartPeriodLength,uint256 _kickstartPeriodBudget);
event ChangePauseStatusPool(address _poolAddress, bool _isPaused);
event SetPoolFixedIncent(address _poolAddress, bool _hasFixedIncent, uint256 _amountPerCycle);
event SetPoolTier(address _poolAddress, uint256 _tierId);
event IncentivizePool(address _poolAddress, uint256 _amount);
function allPoolsLength() public view returns (uint256 _length) {
return poolArray.length;
}
function allTiersLength() public view returns (uint256 _length) {
return tierArray.length;
}
function showActivePoolsTvl() public view returns (uint256) {
uint tvl = 0;
for (uint i = 0; i < poolArray.length; i++) {
if (!poolInfo[poolArray[i]].isPaused) {
tvl += showPoolTvl(poolArray[i]);
}
}
return tvl;
}
function showPoolTvl(address _poolAddress) public view returns (uint256) {
ERC20 targetToken = ERC20(targetTokenAddress);
return targetToken.balanceOf(_poolAddress);
}
function showPoolInfo(
address _poolAddress
)
external
view
returns (
address _gaugeAddress,
address _incentivePoolAddress,
address _incentivizationHandlerAddress,
uint256 _incentivizationId,
uint256 _poolCycleLength
)
{
_incentivePoolAddress = poolInfo[_poolAddress].incentivePoolAddress;
_incentivizationHandlerAddress = poolInfo[_poolAddress].incentivizationHandlerAddress;
_gaugeAddress = poolInfo[_poolAddress].gaugeAddress;
_incentivizationId = poolInfo[_poolAddress].incentivizationId;
_poolCycleLength = poolInfo[_poolAddress].poolCycleLength;
}
function showPoolStatus(
address _poolAddress
)
external
view
returns (
bool _isInitialized,
uint _lastIncentivizationTimestamp,
uint _lastIncentivizationAmount,
bool _isPaused
)
{
_isInitialized = poolInitialized[_poolAddress];
_lastIncentivizationTimestamp = poolInfo[_poolAddress].lastIncentivizationTimestamp;
_lastIncentivizationAmount = poolInfo[_poolAddress].lastIncentivizationAmount;
_isPaused = poolInfo[_poolAddress].isPaused;
}
function showTierInfo(
uint256 _tierId
)
external
view
returns (
uint256 _tokenMaxBudgetPerUnit,
uint256 _kickstartPeriodLength,
uint256 _kickstartPeriodBudget,
uint256 _numberOfPools,
uint256 _poolsTvl
)
{
_tokenMaxBudgetPerUnit = tierArray[_tierId].tokenMaxBudgetPerUnit;
_kickstartPeriodLength = tierArray[_tierId].kickstartPeriodLength;
_kickstartPeriodBudget = tierArray[_tierId].kickstartPeriodBudget;
uint numberOfPools = 0;
uint tvl = 0;
for (uint i = 0; i < poolArray.length; i++) {
if (!poolInfo[poolArray[i]].isPaused) {
if (poolTier[poolArray[i]] == _tierId) {
numberOfPools += 1;
tvl += showPoolTvl(poolArray[i]);
}
}
}
_numberOfPools = numberOfPools;
_poolsTvl = tvl;
}
function isPoolInKickstartPeriod(
address _poolAddress
)
public
view
returns (
bool _isInKickstartPeriod
)
{
if (poolInfo[_poolAddress].firstIncentivizationTimestamp == 0){
_isInKickstartPeriod = true;
} else {
uint256 tier = poolTier[_poolAddress];
uint256 firstIncentiveCycleBegin = cycleStart + (((poolInfo[_poolAddress].firstIncentivizationTimestamp - cycleStart) / cycleLength) * cycleLength);
uint256 delta = (block.timestamp - firstIncentiveCycleBegin);
if (delta > tierArray[tier].kickstartPeriodLength) {
_isInKickstartPeriod = false;
} else {
_isInKickstartPeriod = true;
}
}
}
function isPoolIncentivizedAtCycle(
address _poolAddress
)
public
view
returns (
bool _isIncentivized
)
{
if (poolInfo[_poolAddress].lastIncentivizationTimestamp == 0) {
_isIncentivized = false;
} else {
uint256 currentCycle = ((block.timestamp - cycleStart) / poolInfo[_poolAddress].poolCycleLength) + 1;
uint256 lastIncentiveCycle = ((poolInfo[_poolAddress].lastIncentivizationTimestamp - cycleStart) / poolInfo[_poolAddress].poolCycleLength) + 1;
if (lastIncentiveCycle < currentCycle){
_isIncentivized = false;
} else {
_isIncentivized = true;
}
}
}
function maxBudgetForPoolByTier(address _poolAddress) public view returns (uint256 _amount) {
uint256 _poolTvl = showPoolTvl(_poolAddress);
uint256 _tierId = poolTier[_poolAddress];
uint256 _cycleRatio = (poolInfo[_poolAddress].poolCycleLength * 100_000) / cycleLength ;
uint256 _kickstartPeriodBudget = 0;
uint256 _maxUintBasedBudget = (tierArray[_tierId].tokenMaxBudgetPerUnit * _poolTvl) / (10 ** ERC20(targetTokenAddress).decimals());
if(isPoolInKickstartPeriod(_poolAddress)){
_kickstartPeriodBudget = tierArray[_tierId].kickstartPeriodBudget;
}
if(isPoolIncentivizedAtCycle(_poolAddress)) {
_amount = 0;
} else if(poolInfo[_poolAddress].isPaused) {
_amount = 0;
} else if(showPoolTvl(_poolAddress) < minTvl) {
_amount = 0;
} else if(_kickstartPeriodBudget > _maxUintBasedBudget) {
_amount = _kickstartPeriodBudget * _cycleRatio / 100_000;
} else {
_amount = _maxUintBasedBudget * _cycleRatio / 100_000;
}
}
function maxBudgetForAllPoolsByTier() public view returns (uint256 _totalMaxBudget) {
_totalMaxBudget = 0;
for (uint256 i = 0; i < poolArray.length; i++) {
_totalMaxBudget += maxBudgetForPoolByTier(poolArray[i]);
}
}
function maxBudgetForPoolsByTier(uint256 _tierId) public view returns (uint256 _totalMaxBudget) {
_totalMaxBudget = 0;
for (uint256 i = 0; i < poolArray.length; i++) {
if (poolTier[poolArray[i]] == _tierId) {
_totalMaxBudget += maxBudgetForPoolByTier(poolArray[i]);
}
}
}
function adjustedBudgetForPoolByTier(address _poolAddress, uint256 _totalIncentAmount, uint256 _totalMaxIncentiveAmount, uint256 _priceRatio) public view returns (uint256 _amount) {
uint256 _poolMaxBudget = maxBudgetForPoolByTier(_poolAddress) * _priceRatio / 100_000;
uint256 _totalMaxIncentive = _totalMaxIncentiveAmount * _priceRatio / 100_000;
if (_totalIncentAmount > _totalMaxIncentive) {
_amount = _poolMaxBudget;
} else if (_totalMaxIncentive > 0){
_amount = (_poolMaxBudget * _totalIncentAmount) / _totalMaxIncentive;
} else {
_amount = 0;
}
}
function incentivizePoolByAmount(
address _poolAddress,
uint256 _amount
) public activePool(_poolAddress) onlyByOwnerOperator {
ERC20 _incentiveToken = ERC20(incentiveTokenAddress);
_incentiveToken.approve(poolInfo[_poolAddress].incentivePoolAddress, _amount);
(bool success, ) = poolInfo[_poolAddress].incentivizationHandlerAddress.delegatecall(
abi.encodeWithSignature(
"incentivizePool(address,address,address,address,uint256,uint256)",
_poolAddress,
poolInfo[_poolAddress].gaugeAddress,
poolInfo[_poolAddress].incentivePoolAddress,
incentiveTokenAddress,
poolInfo[_poolAddress].incentivizationId,
_amount
)
);
require(success, "delegatecall failed");
if (poolInfo[_poolAddress].lastIncentivizationTimestamp == 0){
poolInfo[_poolAddress].firstIncentivizationTimestamp = block.timestamp;
}
poolInfo[_poolAddress].lastIncentivizationTimestamp = block.timestamp;
poolInfo[_poolAddress].lastIncentivizationAmount = _amount;
emit IncentivizePool(_poolAddress, _amount);
}
function incentivizePoolByTvl(
address _poolAddress,
uint256 _totalIncentAmount,
uint256 _totalTvl
) public onlyByOwnerOperator {
uint256 _poolTvl = showPoolTvl(_poolAddress);
uint256 _amount = (_totalIncentAmount * _poolTvl) / _totalTvl;
incentivizePoolByAmount(_poolAddress, _amount);
}
function incentivizePoolByUnitBudget(
address _poolAddress,
uint256 _unitIncentAmount
) public onlyByOwnerOperator {
uint256 _poolTvl = showPoolTvl(_poolAddress);
uint256 _amount = (_unitIncentAmount * _poolTvl) / (10 ** ERC20(targetTokenAddress).decimals());
incentivizePoolByAmount(_poolAddress, _amount);
}
function incentivizePoolByFixedIncent(
address _poolAddress
) public onlyByOwnerOperator {
if (poolHasFixedIncent[_poolAddress]){
uint256 _amount = poolFixedIncentAmount[_poolAddress];
incentivizePoolByAmount(_poolAddress, _amount);
}
}
function incentivizeAllPoolsByTvl(uint256 _totalIncentAmount, bool _FixedIncent) public onlyByOwnerOperator {
uint256 _totalTvl = showActivePoolsTvl();
for (uint i = 0; i < poolArray.length; i++) {
if (_FixedIncent && poolHasFixedIncent[poolArray[i]]) {
incentivizePoolByFixedIncent(poolArray[i]);
} else if (!poolInfo[poolArray[i]].isPaused && showPoolTvl(poolArray[i]) > minTvl) {
incentivizePoolByTvl(poolArray[i], _totalIncentAmount, _totalTvl);
}
}
}
function incentivizeAllPoolsByUnitBudget(uint256 _unitIncentAmount, bool _FixedIncent) public onlyByOwnerOperator {
for (uint i = 0; i < poolArray.length; i++) {
if (_FixedIncent && poolHasFixedIncent[poolArray[i]]) {
incentivizePoolByFixedIncent(poolArray[i]);
} else if (!poolInfo[poolArray[i]].isPaused && showPoolTvl(poolArray[i]) > minTvl) {
incentivizePoolByUnitBudget(poolArray[i], _unitIncentAmount);
}
}
}
function addOrSetPool(
address _poolAddress,
address _incentivePoolAddress,
address _incentivizationHandlerAddress,
address _gaugeAddress,
address _lpTokenAddress,
uint256 _incentivizationId,
uint256 _poolCycleLength
) external onlyByOwnerOperator {
if (poolInitialized[_poolAddress]) {
poolInfo[_poolAddress].incentivePoolAddress = _incentivePoolAddress;
poolInfo[_poolAddress].incentivizationHandlerAddress = _incentivizationHandlerAddress;
poolInfo[_poolAddress].gaugeAddress = _gaugeAddress;
poolInfo[_poolAddress].incentivizationId = _incentivizationId;
poolInfo[_poolAddress].lpTokenAddress = _lpTokenAddress;
poolInfo[_poolAddress].poolCycleLength = _poolCycleLength;
} else {
poolInitialized[_poolAddress] = true;
poolArray.push(_poolAddress);
poolInfo[_poolAddress] = LiquidityPool({
poolAddress: _poolAddress,
lpTokenAddress: _lpTokenAddress,
incentivePoolAddress: _incentivePoolAddress,
incentivizationHandlerAddress: _incentivizationHandlerAddress,
gaugeAddress: _gaugeAddress,
lastIncentivizationTimestamp: 0,
lastIncentivizationAmount: 0,
firstIncentivizationTimestamp: 0,
isPaused: false,
incentivizationId: _incentivizationId,
poolCycleLength: _poolCycleLength
});
setPoolTier(_poolAddress, 0);
}
emit AddOrSetPool(
_poolAddress,
_lpTokenAddress,
_gaugeAddress,
_incentivePoolAddress,
_incentivizationHandlerAddress,
_incentivizationId,
_poolCycleLength
);
}
function pausePool(address _poolAddress, bool _isPaused) external onlyByOwnerOperator {
if (poolInitialized[_poolAddress]) {
poolInfo[_poolAddress].isPaused = _isPaused;
emit ChangePauseStatusPool(_poolAddress, _isPaused);
}
}
function setFixedIncent(address _poolAddress, bool _hasFixedIncent, uint256 _amountPerCycle) external onlyByOwnerOperator {
if (poolInitialized[_poolAddress]) {
poolHasFixedIncent[_poolAddress] = _hasFixedIncent;
poolFixedIncentAmount[_poolAddress] = _amountPerCycle;
emit SetPoolFixedIncent(_poolAddress, _hasFixedIncent, _amountPerCycle);
}
}
function addTier(
uint256 _tokenMaxBudgetPerUnit,
uint256 _kickstartPeriodLength,
uint256 _kickstartPeriodBudget
) public onlyByOwnerOperator returns (uint256 _tierId) {
_tierId = allTiersLength();
tierArray.push(IncentiveTier({
tokenMaxBudgetPerUnit: _tokenMaxBudgetPerUnit,
kickstartPeriodLength: _kickstartPeriodLength,
kickstartPeriodBudget: _kickstartPeriodBudget
}));
emit AddOrSetTier(_tierId, _tokenMaxBudgetPerUnit, _kickstartPeriodLength, _kickstartPeriodBudget);
}
function setPoolTier(address _poolAddress, uint256 _tierId) public onlyByOwnerOperator {
if (poolInitialized[_poolAddress] && (_tierId < allTiersLength())) {
poolTier[_poolAddress] = _tierId;
emit SetPoolTier(_poolAddress, _tierId);
}
}
function incentivizeAllPoolsByTier(uint256 _totalIncentAmount, uint256 _priceRatio) public onlyByOwnerOperator {
uint256 _totalMaxIncentiveAmount = maxBudgetForAllPoolsByTier();
for (uint i = 0; i < poolArray.length; i++) {
uint256 _amount = adjustedBudgetForPoolByTier(poolArray[i], _totalIncentAmount, _totalMaxIncentiveAmount, _priceRatio);
if (_amount > 0) {
incentivizePoolByAmount(poolArray[i], _amount);
}
}
}
function incentivizePoolsByTier(uint256 _tierId, uint256 _totalIncentAmount, uint256 _priceRatio) public onlyByOwnerOperator {
uint256 _totalMaxIncentiveAmount = maxBudgetForPoolsByTier(_tierId);
for (uint i = 0; i < poolArray.length; i++) {
if (poolTier[poolArray[i]] == _tierId) {
uint256 _amount = adjustedBudgetForPoolByTier(poolArray[i], _totalIncentAmount, _totalMaxIncentiveAmount, _priceRatio);
if (_amount > 0) {
incentivizePoolByAmount(poolArray[i], _amount);
}
}
}
}
function setOperatorAddress(address _newOperatorAddress) external onlyOwner {
emit SetOperator(operatorAddress, _newOperatorAddress);
operatorAddress = _newOperatorAddress;
}
function setCycleLength(uint256 _cycleLength) external onlyOwner {
cycleLength = _cycleLength;
}
function setMinTvl(uint256 _minTvl) external onlyOwner {
minTvl = _minTvl;
}
function recoverERC20(address tokenAddress, uint256 tokenAmount) external onlyOwner {
TransferHelper.safeTransfer(address(tokenAddress), msg.sender, tokenAmount);
}
function execute(
address _to,
uint256 _value,
bytes calldata _data
) external onlyOwner returns (bool, bytes memory) {
(bool success, bytes memory result) = _to.call{ value: _value }(_data);
return (success, result);
}
}
文件 11 的 13:Ownable.sol
pragma solidity ^0.8.0;
import "../utils/Context.sol";
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
modifier onlyOwner() {
_checkOwner();
_;
}
function owner() public view virtual returns (address) {
return _owner;
}
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
文件 12 的 13:SafeERC20.sol
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/IERC20Permit.sol";
import "../../../utils/Address.sol";
library SafeERC20 {
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
}
}
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
_callOptionalReturn(token, approvalCall);
}
}
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
function _callOptionalReturn(IERC20 token, bytes memory data) private {
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
(bool success, bytes memory returndata) = address(token).call(data);
return
success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
}
}
文件 13 的 13:TransferHelper.sol
pragma solidity >=0.6.11;
library TransferHelper {
function safeApprove(address token, address to, uint value) internal {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED');
}
function safeTransfer(address token, address to, uint value) internal {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED');
}
function safeTransferFrom(address token, address from, address to, uint value) internal {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED');
}
function safeTransferETH(address to, uint value) internal {
(bool success,) = to.call{value:value}(new bytes(0));
require(success, 'TransferHelper: ETH_TRANSFER_FAILED');
}
}
{
"compilationTarget": {
"src/contracts/IncentivizerAmoV3.sol": "IncentivizerAmoV3"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"appendCBOR": false,
"bytecodeHash": "none"
},
"optimizer": {
"enabled": false,
"runs": 2000
},
"remappings": [
":@chainlink/=node_modules/@chainlink/",
":@eth-optimism/=node_modules/@eth-optimism/",
":@openzeppelin/=node_modules/@openzeppelin/",
":ds-test/=node_modules/ds-test/src/",
":forge-std/=node_modules/forge-std/src/",
":frax-standard-solidity/=node_modules/frax-standard-solidity/",
":frax-std/=node_modules/frax-standard-solidity/src/",
":solidity-bytes-utils/=node_modules/solidity-bytes-utils/"
]
}
[{"inputs":[{"internalType":"address","name":"_operatorAddress","type":"address"},{"internalType":"address","name":"_targetTokenAddress","type":"address"},{"internalType":"address","name":"_incentiveTokenAddress","type":"address"},{"internalType":"uint256","name":"_minTvl","type":"uint256"},{"internalType":"uint256","name":"_cycleStart","type":"uint256"},{"internalType":"uint256","name":"_cycleLength","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_poolAddress","type":"address"},{"indexed":false,"internalType":"address","name":"_lpTokenAddress","type":"address"},{"indexed":false,"internalType":"address","name":"_gaugeAddress","type":"address"},{"indexed":false,"internalType":"address","name":"_incentivePoolAddress","type":"address"},{"indexed":false,"internalType":"address","name":"_incentivizationHandlerAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"_indexId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_poolCycleLength","type":"uint256"}],"name":"AddOrSetPool","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_tierId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_tokenMaxBudgetPerUnit","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_kickstartPeriodLength","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_kickstartPeriodBudget","type":"uint256"}],"name":"AddOrSetTier","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_poolAddress","type":"address"},{"indexed":false,"internalType":"bool","name":"_isPaused","type":"bool"}],"name":"ChangePauseStatusPool","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_poolAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"IncentivizePool","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_oldAddress","type":"address"},{"indexed":false,"internalType":"address","name":"_newAddress","type":"address"}],"name":"SetOperator","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_poolAddress","type":"address"},{"indexed":false,"internalType":"bool","name":"_hasFixedIncent","type":"bool"},{"indexed":false,"internalType":"uint256","name":"_amountPerCycle","type":"uint256"}],"name":"SetPoolFixedIncent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_poolAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"_tierId","type":"uint256"}],"name":"SetPoolTier","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_operatorAddress","type":"address"},{"indexed":false,"internalType":"address","name":"_targetTokenAddress","type":"address"},{"indexed":false,"internalType":"address","name":"_incentiveTokenAddress","type":"address"}],"name":"StartAMO","type":"event"},{"inputs":[{"internalType":"address","name":"_poolAddress","type":"address"},{"internalType":"address","name":"_incentivePoolAddress","type":"address"},{"internalType":"address","name":"_incentivizationHandlerAddress","type":"address"},{"internalType":"address","name":"_gaugeAddress","type":"address"},{"internalType":"address","name":"_lpTokenAddress","type":"address"},{"internalType":"uint256","name":"_incentivizationId","type":"uint256"},{"internalType":"uint256","name":"_poolCycleLength","type":"uint256"}],"name":"addOrSetPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenMaxBudgetPerUnit","type":"uint256"},{"internalType":"uint256","name":"_kickstartPeriodLength","type":"uint256"},{"internalType":"uint256","name":"_kickstartPeriodBudget","type":"uint256"}],"name":"addTier","outputs":[{"internalType":"uint256","name":"_tierId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_poolAddress","type":"address"},{"internalType":"uint256","name":"_totalIncentAmount","type":"uint256"},{"internalType":"uint256","name":"_totalMaxIncentiveAmount","type":"uint256"},{"internalType":"uint256","name":"_priceRatio","type":"uint256"}],"name":"adjustedBudgetForPoolByTier","outputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allPoolsLength","outputs":[{"internalType":"uint256","name":"_length","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allTiersLength","outputs":[{"internalType":"uint256","name":"_length","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cycleLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cycleStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"execute","outputs":[{"internalType":"bool","name":"","type":"bool"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"incentiveTokenAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_totalIncentAmount","type":"uint256"},{"internalType":"uint256","name":"_priceRatio","type":"uint256"}],"name":"incentivizeAllPoolsByTier","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_totalIncentAmount","type":"uint256"},{"internalType":"bool","name":"_FixedIncent","type":"bool"}],"name":"incentivizeAllPoolsByTvl","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_unitIncentAmount","type":"uint256"},{"internalType":"bool","name":"_FixedIncent","type":"bool"}],"name":"incentivizeAllPoolsByUnitBudget","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_poolAddress","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"incentivizePoolByAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_poolAddress","type":"address"}],"name":"incentivizePoolByFixedIncent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_poolAddress","type":"address"},{"internalType":"uint256","name":"_totalIncentAmount","type":"uint256"},{"internalType":"uint256","name":"_totalTvl","type":"uint256"}],"name":"incentivizePoolByTvl","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_poolAddress","type":"address"},{"internalType":"uint256","name":"_unitIncentAmount","type":"uint256"}],"name":"incentivizePoolByUnitBudget","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tierId","type":"uint256"},{"internalType":"uint256","name":"_totalIncentAmount","type":"uint256"},{"internalType":"uint256","name":"_priceRatio","type":"uint256"}],"name":"incentivizePoolsByTier","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_poolAddress","type":"address"}],"name":"isPoolInKickstartPeriod","outputs":[{"internalType":"bool","name":"_isInKickstartPeriod","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_poolAddress","type":"address"}],"name":"isPoolIncentivizedAtCycle","outputs":[{"internalType":"bool","name":"_isIncentivized","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxBudgetForAllPoolsByTier","outputs":[{"internalType":"uint256","name":"_totalMaxBudget","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_poolAddress","type":"address"}],"name":"maxBudgetForPoolByTier","outputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tierId","type":"uint256"}],"name":"maxBudgetForPoolsByTier","outputs":[{"internalType":"uint256","name":"_totalMaxBudget","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minTvl","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operatorAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_poolAddress","type":"address"},{"internalType":"bool","name":"_isPaused","type":"bool"}],"name":"pausePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolArray","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"poolFixedIncentAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"poolHasFixedIncent","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"poolInitialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"poolTier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"name":"recoverERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_cycleLength","type":"uint256"}],"name":"setCycleLength","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_poolAddress","type":"address"},{"internalType":"bool","name":"_hasFixedIncent","type":"bool"},{"internalType":"uint256","name":"_amountPerCycle","type":"uint256"}],"name":"setFixedIncent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minTvl","type":"uint256"}],"name":"setMinTvl","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOperatorAddress","type":"address"}],"name":"setOperatorAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_poolAddress","type":"address"},{"internalType":"uint256","name":"_tierId","type":"uint256"}],"name":"setPoolTier","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"showActivePoolsTvl","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_poolAddress","type":"address"}],"name":"showPoolInfo","outputs":[{"internalType":"address","name":"_gaugeAddress","type":"address"},{"internalType":"address","name":"_incentivePoolAddress","type":"address"},{"internalType":"address","name":"_incentivizationHandlerAddress","type":"address"},{"internalType":"uint256","name":"_incentivizationId","type":"uint256"},{"internalType":"uint256","name":"_poolCycleLength","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_poolAddress","type":"address"}],"name":"showPoolStatus","outputs":[{"internalType":"bool","name":"_isInitialized","type":"bool"},{"internalType":"uint256","name":"_lastIncentivizationTimestamp","type":"uint256"},{"internalType":"uint256","name":"_lastIncentivizationAmount","type":"uint256"},{"internalType":"bool","name":"_isPaused","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_poolAddress","type":"address"}],"name":"showPoolTvl","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tierId","type":"uint256"}],"name":"showTierInfo","outputs":[{"internalType":"uint256","name":"_tokenMaxBudgetPerUnit","type":"uint256"},{"internalType":"uint256","name":"_kickstartPeriodLength","type":"uint256"},{"internalType":"uint256","name":"_kickstartPeriodBudget","type":"uint256"},{"internalType":"uint256","name":"_numberOfPools","type":"uint256"},{"internalType":"uint256","name":"_poolsTvl","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"targetTokenAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tierArray","outputs":[{"internalType":"uint256","name":"tokenMaxBudgetPerUnit","type":"uint256"},{"internalType":"uint256","name":"kickstartPeriodLength","type":"uint256"},{"internalType":"uint256","name":"kickstartPeriodBudget","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]