Overview
ETH Balance
0 ETH
ETH Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 5 from a total of 5 transactions
Loading...
Loading
Contract Name:
PoolsConfig
Compiler Version
v0.8.22+commit.4fc1097e
Optimization Enabled:
Yes with 10000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; import "openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol"; import "openzeppelin-contracts/contracts/access/Ownable.sol"; import "./interfaces/IPoolsConfig.sol"; import "./PoolUtils.sol"; // Contract owned by the DAO and only modifiable by the DAO contract PoolsConfig is IPoolsConfig, Ownable { event PoolWhitelisted(address indexed tokenA, address indexed tokenB); event PoolUnwhitelisted(address indexed tokenA, address indexed tokenB); event MaximumWhitelistedPoolsChanged(uint256 newMaxPools); struct TokenPair { // Note that these will be ordered in underlyingPoolTokens as specified in whitelistPool() - rather than ordered such that address(tokenA) < address(tokenB) as with the reserves in Pools.sol IERC20 tokenA; IERC20 tokenB; } using EnumerableSet for EnumerableSet.Bytes32Set; // Keeps track of what poolIDs have been whitelisted EnumerableSet.Bytes32Set private _whitelist; // A mapping from poolIDs to the underlying TokenPair mapping(bytes32=>TokenPair) public underlyingPoolTokens; // The maximum number of pools that can be whitelisted at any one time. // If the maximum number of pools is reached, some tokens will need to be delisted before new ones can be whitelisted // Range: 20 to 100 with an adjustment of 10 uint256 public maximumWhitelistedPools = 50; // Whitelist a given pair of tokens function whitelistPool( IERC20 tokenA, IERC20 tokenB ) external onlyOwner { require( _whitelist.length() < maximumWhitelistedPools, "Maximum number of whitelisted pools already reached" ); require(tokenA != tokenB, "tokenA and tokenB cannot be the same token"); bytes32 poolID = PoolUtils._poolID(tokenA, tokenB); // Add to the whitelist and remember the underlying tokens for the pool _whitelist.add(poolID); underlyingPoolTokens[poolID] = TokenPair(tokenA, tokenB); emit PoolWhitelisted(address(tokenA), address(tokenB)); } function unwhitelistPool( IERC20 tokenA, IERC20 tokenB ) external onlyOwner { bytes32 poolID = PoolUtils._poolID(tokenA,tokenB); _whitelist.remove(poolID); delete underlyingPoolTokens[poolID]; emit PoolUnwhitelisted(address(tokenA), address(tokenB)); } function changeMaximumWhitelistedPools(bool increase) external onlyOwner { if (increase) { if (maximumWhitelistedPools < 100) maximumWhitelistedPools += 10; } else { if (maximumWhitelistedPools > 20) maximumWhitelistedPools -= 10; } emit MaximumWhitelistedPoolsChanged(maximumWhitelistedPools); } // === VIEWS === function numberOfWhitelistedPools() external view returns (uint256) { return _whitelist.length(); } function isWhitelisted( bytes32 poolID ) public view returns (bool) { // The staked ZERO pool is always considered whitelisted return ( poolID == PoolUtils.STAKED_ZERO ) || _whitelist.contains( poolID ); } // Return an array of the currently whitelisted poolIDs function whitelistedPools() external view returns (bytes32[] memory) { return _whitelist.values(); } function underlyingTokenPair( bytes32 poolID ) external view returns (IERC20 tokenA, IERC20 tokenB) { TokenPair memory pair = underlyingPoolTokens[poolID]; require(address(pair.tokenA) != address(0) && address(pair.tokenB) != address(0), "This poolID does not exist"); return (pair.tokenA, pair.tokenB); } // Returns true if the token has been whitelisted (meaning it has been pooled with either WETH and ZERO) function tokenHasBeenWhitelisted( IERC20 token, IERC20 weth, IERC20 zero ) external view returns (bool) { // See if the token has been whitelisted with either WETH or ZERO, as all whitelisted tokens are pooled with both WETH and ZERO bytes32 poolID1 = PoolUtils._poolID( token, weth ); if ( isWhitelisted(poolID1) ) return true; bytes32 poolID2 = PoolUtils._poolID( token, zero ); if ( isWhitelisted(poolID2) ) return true; return false; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol) // This file was procedurally generated from scripts/generate/templates/EnumerableSet.js. pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ```solidity * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure * unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an * array of EnumerableSet. * ==== */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastValue; // Update the index for the moved value set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { bytes32[] memory store = _values(set._inner); bytes32[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values in the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; import "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; import "./IPools.sol"; interface IPoolsConfig { function whitelistPool( IERC20 tokenA, IERC20 tokenB ) external; // onlyOwner function unwhitelistPool( IERC20 tokenA, IERC20 tokenB ) external; // onlyOwner function changeMaximumWhitelistedPools(bool increase) external; // onlyOwner // Views function maximumWhitelistedPools() external view returns (uint256); function numberOfWhitelistedPools() external view returns (uint256); function isWhitelisted( bytes32 poolID ) external view returns (bool); function whitelistedPools() external view returns (bytes32[] calldata); function underlyingTokenPair( bytes32 poolID ) external view returns (IERC20 tokenA, IERC20 tokenB); // Returns true if the token has been whitelisted (meaning it has been pooled with either WETH and ZERO) function tokenHasBeenWhitelisted( IERC20 token, IERC20 weth, IERC20 zero ) external view returns (bool); }
pragma solidity =0.8.22; import "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; library PoolUtils { // Token reserves less than dust are treated as if they don't exist at all. // With the 18 decimals that are used for most tokens, DUST has a value of 0.0000000000000001 uint256 constant public DUST = 100; // A special pool that represents staked ZERO tokens that are not associated with any actual liquidity pool. bytes32 constant public STAKED_ZERO = bytes32(0); // Return the unique poolID for the given two tokens. // Tokens are sorted before being hashed to make reversed pairs equivalent. function _poolID( IERC20 tokenA, IERC20 tokenB ) internal pure returns (bytes32 poolID) { // See if the token orders are flipped if ( uint160(address(tokenB)) < uint160(address(tokenA)) ) return keccak256(abi.encodePacked(address(tokenB), address(tokenA))); return keccak256(abi.encodePacked(address(tokenA), address(tokenB))); } // Return the unique poolID and whether or not it is flipped function _poolIDAndFlipped( IERC20 tokenA, IERC20 tokenB ) internal pure returns (bytes32 poolID, bool flipped) { // See if the token orders are flipped if ( uint160(address(tokenB)) < uint160(address(tokenA)) ) return (keccak256(abi.encodePacked(address(tokenB), address(tokenA))), true); return (keccak256(abi.encodePacked(address(tokenA), address(tokenB))), false); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; import "../../staking/interfaces/ILiquidity.sol"; import "../../dao/interfaces/IDAO.sol"; import "./IPoolStats.sol"; interface IPools is IPoolStats { function startExchangeApproved() external; function setContracts( IDAO _dao, ILiquidity _liquidity ) external; // onlyOwner function addLiquidity( IERC20 tokenA, IERC20 tokenB, uint256 maxAmountA, uint256 maxAmountB, uint256 minAddedAmountA, uint256 minAddedAmountB, uint256 totalLiquidity ) external returns (uint256 addedAmountA, uint256 addedAmountB, uint256 addedLiquidity); function removeLiquidity( IERC20 tokenA, IERC20 tokenB, uint256 liquidityToRemove, uint256 minReclaimedA, uint256 minReclaimedB, uint256 totalLiquidity ) external returns (uint256 reclaimedA, uint256 reclaimedB); function deposit( IERC20 token, uint256 amount ) external; function withdraw( IERC20 token, uint256 amount ) external; function swap( IERC20 swapTokenIn, IERC20 swapTokenOut, uint256 swapAmountIn, uint256 minAmountOut, uint256 deadline ) external returns (uint256 swapAmountOut); function depositSwapWithdraw(IERC20 swapTokenIn, IERC20 swapTokenOut, uint256 swapAmountIn, uint256 minAmountOut, uint256 deadline ) external returns (uint256 swapAmountOut); function depositDoubleSwapWithdraw( IERC20 swapTokenIn, IERC20 swapTokenMiddle, IERC20 swapTokenOut, uint256 swapAmountIn, uint256 minAmountOut, uint256 deadline ) external returns (uint256 swapAmountOut); function depositZapSwapWithdraw(IERC20 swapTokenIn, IERC20 swapTokenOut, uint256 swapAmountIn ) external returns (uint256 swapAmountOut); // Views function exchangeIsLive() external view returns (bool); function getPoolReserves(IERC20 tokenA, IERC20 tokenB) external view returns (uint256 reserveA, uint256 reserveB); function depositedUserBalance(address user, IERC20 token) external view returns (uint256); }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; import "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; import "./IStakingRewards.sol"; interface ILiquidity is IStakingRewards { function depositLiquidityAndIncreaseShare( IERC20 tokenA, IERC20 tokenB, uint256 maxAmountA, uint256 maxAmountB, uint256 minAddedAmountA, uint256 minAddedAmountB, uint256 minAddedLiquidity, uint256 deadline, bool useZapping ) external returns (uint256 addedLiquidity); function withdrawLiquidityAndClaim( IERC20 tokenA, IERC20 tokenB, uint256 liquidityToWithdraw, uint256 minReclaimedA, uint256 minReclaimedB, uint256 deadline ) external returns (uint256 reclaimedA, uint256 reclaimedB); }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; import "../../rewards/interfaces/IZeroRewards.sol"; import "../../pools/interfaces/IPools.sol"; import "../../interfaces/IZero.sol"; interface IDAO { function finalizeBallot( uint256 ballotID ) external; function manuallyRemoveBallot( uint256 ballotID ) external; function withdrawFromDAO( IERC20 token ) external returns (uint256 withdrawnAmount); // Views function pools() external view returns (IPools); function websiteURL() external view returns (string memory); function countryIsExcluded( string calldata country ) external view returns (bool); }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; interface IPoolStats { // These are the indicies (in terms of a poolIDs location in the current whitelistedPoolIDs array) of pools involved in an arbitrage path struct ArbitrageIndicies { uint64 index1; uint64 index2; uint64 index3; } function clearProfitsForPools() external; function updateArbitrageIndicies() external; // Views function profitsForWhitelistedPools() external view returns (uint256[] memory _calculatedProfits); function arbitrageIndicies(bytes32 poolID) external view returns (ArbitrageIndicies memory); }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; struct AddedReward { bytes32 poolID; // The pool to add rewards to uint256 amountToAdd; // The amount of rewards (as ZERO) to add } struct UserShareInfo { uint256 userShare; // A user's share for a given poolID uint256 virtualRewards; // The amount of rewards that were added to maintain proper rewards/share ratio - and will be deducted from a user's pending rewards. uint256 cooldownExpiration; // The timestamp when the user can modify their share } interface IStakingRewards { function claimAllRewards( bytes32[] calldata poolIDs ) external returns (uint256 rewardsAmount); function addZERORewards( AddedReward[] calldata addedRewards ) external; // Views function totalShares(bytes32 poolID) external view returns (uint256); function totalSharesForPools( bytes32[] calldata poolIDs ) external view returns (uint256[] calldata shares); function totalRewardsForPools( bytes32[] calldata poolIDs ) external view returns (uint256[] calldata rewards); function userRewardForPool( address wallet, bytes32 poolID ) external view returns (uint256); function userShareForPool( address wallet, bytes32 poolID ) external view returns (uint256); function userVirtualRewardsForPool( address wallet, bytes32 poolID ) external view returns (uint256); function userRewardsForPools( address wallet, bytes32[] calldata poolIDs ) external view returns (uint256[] calldata rewards); function userShareForPools( address wallet, bytes32[] calldata poolIDs ) external view returns (uint256[] calldata shares); function userCooldowns( address wallet, bytes32[] calldata poolIDs ) external view returns (uint256[] calldata cooldowns); }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; import "./IRewardsEmitter.sol"; interface IZeroRewards { function sendInitialZERORewards( uint256 liquidityBootstrapAmount, bytes32[] calldata poolIDs ) external; function performUpkeep( bytes32[] calldata poolIDs, uint256[] calldata profitsForPools ) external; // Views function stakingRewardsEmitter() external view returns (IRewardsEmitter); function liquidityRewardsEmitter() external view returns (IRewardsEmitter); }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; import "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; interface IZero is IERC20 { function burnTokensInContract() external; // Views function totalBurned() external view returns (uint256); }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; import "../../staking/interfaces/IStakingRewards.sol"; interface IRewardsEmitter { function addZERORewards( AddedReward[] calldata addedRewards ) external; function performUpkeep( uint256 timeSinceLastUpkeep ) external; // Views function pendingRewardsForPools( bytes32[] calldata pools ) external view returns (uint256[] calldata); }
{ "remappings": [ "chainlink/=lib/chainlink/", "ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/", "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/", "forge-std/=lib/openzeppelin-contracts/lib/forge-std/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "openzeppelin/=lib/openzeppelin-contracts/contracts/", "v3-core/=lib/v3-core/contracts/" ], "optimizer": { "enabled": true, "runs": 10000 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newMaxPools","type":"uint256"}],"name":"MaximumWhitelistedPoolsChanged","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":true,"internalType":"address","name":"tokenA","type":"address"},{"indexed":true,"internalType":"address","name":"tokenB","type":"address"}],"name":"PoolUnwhitelisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenA","type":"address"},{"indexed":true,"internalType":"address","name":"tokenB","type":"address"}],"name":"PoolWhitelisted","type":"event"},{"inputs":[{"internalType":"bool","name":"increase","type":"bool"}],"name":"changeMaximumWhitelistedPools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poolID","type":"bytes32"}],"name":"isWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maximumWhitelistedPools","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"numberOfWhitelistedPools","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"contract IERC20","name":"weth","type":"address"},{"internalType":"contract IERC20","name":"zero","type":"address"}],"name":"tokenHasBeenWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"underlyingPoolTokens","outputs":[{"internalType":"contract IERC20","name":"tokenA","type":"address"},{"internalType":"contract IERC20","name":"tokenB","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poolID","type":"bytes32"}],"name":"underlyingTokenPair","outputs":[{"internalType":"contract IERC20","name":"tokenA","type":"address"},{"internalType":"contract IERC20","name":"tokenB","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"tokenA","type":"address"},{"internalType":"contract IERC20","name":"tokenB","type":"address"}],"name":"unwhitelistPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"tokenA","type":"address"},{"internalType":"contract IERC20","name":"tokenB","type":"address"}],"name":"whitelistPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"whitelistedPools","outputs":[{"internalType":"bytes32[]","name":"","type":"bytes32[]"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
6080604052603260045534801561001557600080fd5b5061001f33610024565b610074565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610de2806100836000396000f3fe608060405234801561001057600080fd5b50600436106100df5760003560e01c80638da5cb5b1161008c578063bf18543e11610066578063bf18543e14610206578063c2fb9aac14610219578063ce7e4ba21461022c578063f2fde38b1461023f57600080fd5b80638da5cb5b146101c257806390e439bc146101ea5780639d4f6d90146101fd57600080fd5b80634a03895b116100bd5780634a03895b1461018f5780635fe92574146101a5578063715018a6146101ba57600080fd5b806301a5e3fe146100e45780630e1c21a61461010c578063434798851461017a575b600080fd5b6100f76100f2366004610bb7565b610252565b60405190151581526020015b60405180910390f35b61014d61011a366004610bb7565b6003602052600090815260409020805460019091015473ffffffffffffffffffffffffffffffffffffffff918216911682565b6040805173ffffffffffffffffffffffffffffffffffffffff938416815292909116602083015201610103565b610182610274565b6040516101039190610bd0565b610197610285565b604051908152602001610103565b6101b86101b3366004610c36565b610291565b005b6101b861033d565b60005460405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610103565b6100f76101f8366004610c6f565b610351565b61019760045481565b6101b8610214366004610c36565b6103ad565b61014d610227366004610bb7565b6105d6565b6101b861023a366004610cba565b6106bb565b6101b861024d366004610cdc565b610754565b600081158061026e575060008281526002602052604090205415155b92915050565b6060610280600161080b565b905090565b60006102806001610818565b610299610822565b60006102a583836108a3565b90506102b260018261098c565b5060008181526003602052604080822080547fffffffffffffffffffffffff000000000000000000000000000000000000000090811682556001909101805490911690555173ffffffffffffffffffffffffffffffffffffffff84811692908616917fc8d067652a234ec40b98d82003c1a24164cbe759c4b19cd39c8d9dca8bd68cec9190a3505050565b610345610822565b61034f6000610998565b565b60008061035e85856108a3565b905061036981610252565b156103785760019150506103a6565b600061038486856108a3565b905061038f81610252565b1561039f576001925050506103a6565b6000925050505b9392505050565b6103b5610822565b6004546103c26001610818565b10610454576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f4d6178696d756d206e756d626572206f662077686974656c697374656420706f60448201527f6f6c7320616c726561647920726561636865640000000000000000000000000060648201526084015b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361050f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f746f6b656e4120616e6420746f6b656e422063616e6e6f74206265207468652060448201527f73616d6520746f6b656e00000000000000000000000000000000000000000000606482015260840161044b565b600061051b83836108a3565b9050610528600182610a0d565b5060408051808201825273ffffffffffffffffffffffffffffffffffffffff808616808352858216602080850182815260008881526003909252868220955186549086167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161787559051600190960180549690951695169490941790925592519092917f4b4f12aec4d473e2c825e22e416d739e782f6af363f89b953171a750167f85d291a3505050565b60008181526003602090815260408083208151808301909252805473ffffffffffffffffffffffffffffffffffffffff90811680845260019092015416928201929092528291158015906106435750602081015173ffffffffffffffffffffffffffffffffffffffff1615155b6106a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f5468697320706f6f6c494420646f6573206e6f74206578697374000000000000604482015260640161044b565b80516020909101519094909350915050565b6106c3610822565b80156106f257606460045410156106ed57600a600460008282546106e79190610d28565b90915550505b610716565b6014600454111561071657600a600460008282546107109190610d3b565b90915550505b7f76adbf819c50bf2c509f640c9e0e36b355b73e2c701d44dca2435512b043051860045460405161074991815260200190565b60405180910390a150565b61075c610822565b73ffffffffffffffffffffffffffffffffffffffff81166107ff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161044b565b61080881610998565b50565b606060006103a683610a19565b600061026e825490565b60005473ffffffffffffffffffffffffffffffffffffffff16331461034f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161044b565b60008273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161015610932576040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606084811b8216602084015285901b16603482015260480160405160208183030381529060405280519060200120905061026e565b6040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606085811b8216602084015284901b16603482015260480160405160208183030381529060405280519060200120905092915050565b60006103a68383610a75565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006103a68383610b68565b606081600001805480602002602001604051908101604052809291908181526020018280548015610a6957602002820191906000526020600020905b815481526020019060010190808311610a55575b50505050509050919050565b60008181526001830160205260408120548015610b5e576000610a99600183610d3b565b8554909150600090610aad90600190610d3b565b9050818114610b12576000866000018281548110610acd57610acd610d4e565b9060005260206000200154905080876000018481548110610af057610af0610d4e565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610b2357610b23610d7d565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061026e565b600091505061026e565b6000818152600183016020526040812054610baf5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561026e565b50600061026e565b600060208284031215610bc957600080fd5b5035919050565b6020808252825182820181905260009190848201906040850190845b81811015610c0857835183529284019291840191600101610bec565b50909695505050505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461080857600080fd5b60008060408385031215610c4957600080fd5b8235610c5481610c14565b91506020830135610c6481610c14565b809150509250929050565b600080600060608486031215610c8457600080fd5b8335610c8f81610c14565b92506020840135610c9f81610c14565b91506040840135610caf81610c14565b809150509250925092565b600060208284031215610ccc57600080fd5b813580151581146103a657600080fd5b600060208284031215610cee57600080fd5b81356103a681610c14565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561026e5761026e610cf9565b8181038181111561026e5761026e610cf9565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea2646970667358221220bdb33a1bd37e4f606e3534c05aa2c687ad8d9c94f2fd0bbb4f6938795ab39e8c64736f6c63430008160033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100df5760003560e01c80638da5cb5b1161008c578063bf18543e11610066578063bf18543e14610206578063c2fb9aac14610219578063ce7e4ba21461022c578063f2fde38b1461023f57600080fd5b80638da5cb5b146101c257806390e439bc146101ea5780639d4f6d90146101fd57600080fd5b80634a03895b116100bd5780634a03895b1461018f5780635fe92574146101a5578063715018a6146101ba57600080fd5b806301a5e3fe146100e45780630e1c21a61461010c578063434798851461017a575b600080fd5b6100f76100f2366004610bb7565b610252565b60405190151581526020015b60405180910390f35b61014d61011a366004610bb7565b6003602052600090815260409020805460019091015473ffffffffffffffffffffffffffffffffffffffff918216911682565b6040805173ffffffffffffffffffffffffffffffffffffffff938416815292909116602083015201610103565b610182610274565b6040516101039190610bd0565b610197610285565b604051908152602001610103565b6101b86101b3366004610c36565b610291565b005b6101b861033d565b60005460405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610103565b6100f76101f8366004610c6f565b610351565b61019760045481565b6101b8610214366004610c36565b6103ad565b61014d610227366004610bb7565b6105d6565b6101b861023a366004610cba565b6106bb565b6101b861024d366004610cdc565b610754565b600081158061026e575060008281526002602052604090205415155b92915050565b6060610280600161080b565b905090565b60006102806001610818565b610299610822565b60006102a583836108a3565b90506102b260018261098c565b5060008181526003602052604080822080547fffffffffffffffffffffffff000000000000000000000000000000000000000090811682556001909101805490911690555173ffffffffffffffffffffffffffffffffffffffff84811692908616917fc8d067652a234ec40b98d82003c1a24164cbe759c4b19cd39c8d9dca8bd68cec9190a3505050565b610345610822565b61034f6000610998565b565b60008061035e85856108a3565b905061036981610252565b156103785760019150506103a6565b600061038486856108a3565b905061038f81610252565b1561039f576001925050506103a6565b6000925050505b9392505050565b6103b5610822565b6004546103c26001610818565b10610454576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f4d6178696d756d206e756d626572206f662077686974656c697374656420706f60448201527f6f6c7320616c726561647920726561636865640000000000000000000000000060648201526084015b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361050f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f746f6b656e4120616e6420746f6b656e422063616e6e6f74206265207468652060448201527f73616d6520746f6b656e00000000000000000000000000000000000000000000606482015260840161044b565b600061051b83836108a3565b9050610528600182610a0d565b5060408051808201825273ffffffffffffffffffffffffffffffffffffffff808616808352858216602080850182815260008881526003909252868220955186549086167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161787559051600190960180549690951695169490941790925592519092917f4b4f12aec4d473e2c825e22e416d739e782f6af363f89b953171a750167f85d291a3505050565b60008181526003602090815260408083208151808301909252805473ffffffffffffffffffffffffffffffffffffffff90811680845260019092015416928201929092528291158015906106435750602081015173ffffffffffffffffffffffffffffffffffffffff1615155b6106a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f5468697320706f6f6c494420646f6573206e6f74206578697374000000000000604482015260640161044b565b80516020909101519094909350915050565b6106c3610822565b80156106f257606460045410156106ed57600a600460008282546106e79190610d28565b90915550505b610716565b6014600454111561071657600a600460008282546107109190610d3b565b90915550505b7f76adbf819c50bf2c509f640c9e0e36b355b73e2c701d44dca2435512b043051860045460405161074991815260200190565b60405180910390a150565b61075c610822565b73ffffffffffffffffffffffffffffffffffffffff81166107ff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161044b565b61080881610998565b50565b606060006103a683610a19565b600061026e825490565b60005473ffffffffffffffffffffffffffffffffffffffff16331461034f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161044b565b60008273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161015610932576040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606084811b8216602084015285901b16603482015260480160405160208183030381529060405280519060200120905061026e565b6040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606085811b8216602084015284901b16603482015260480160405160208183030381529060405280519060200120905092915050565b60006103a68383610a75565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006103a68383610b68565b606081600001805480602002602001604051908101604052809291908181526020018280548015610a6957602002820191906000526020600020905b815481526020019060010190808311610a55575b50505050509050919050565b60008181526001830160205260408120548015610b5e576000610a99600183610d3b565b8554909150600090610aad90600190610d3b565b9050818114610b12576000866000018281548110610acd57610acd610d4e565b9060005260206000200154905080876000018481548110610af057610af0610d4e565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610b2357610b23610d7d565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061026e565b600091505061026e565b6000818152600183016020526040812054610baf5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561026e565b50600061026e565b600060208284031215610bc957600080fd5b5035919050565b6020808252825182820181905260009190848201906040850190845b81811015610c0857835183529284019291840191600101610bec565b50909695505050505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461080857600080fd5b60008060408385031215610c4957600080fd5b8235610c5481610c14565b91506020830135610c6481610c14565b809150509250929050565b600080600060608486031215610c8457600080fd5b8335610c8f81610c14565b92506020840135610c9f81610c14565b91506040840135610caf81610c14565b809150509250925092565b600060208284031215610ccc57600080fd5b813580151581146103a657600080fd5b600060208284031215610cee57600080fd5b81356103a681610c14565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561026e5761026e610cf9565b8181038181111561026e5761026e610cf9565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea2646970667358221220bdb33a1bd37e4f606e3534c05aa2c687ad8d9c94f2fd0bbb4f6938795ab39e8c64736f6c63430008160033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 27 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.