Overview
S Balance
0 S
S Value
-More Info
Private Name Tags
ContractCreator
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0xB8ca18B4...7733Df175 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
AccessHub
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
Yes with 200000 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.26; import {AccessControlEnumerable} from "@openzeppelin/contracts/access/extensions/AccessControlEnumerable.sol"; import {IMinter} from "./interfaces/IMinter.sol"; import {IVoter} from "./interfaces/IVoter.sol"; import {IPairFactory} from "./interfaces/IPairFactory.sol"; import {IFeeRecipientFactory} from "./interfaces/IFeeRecipientFactory.sol"; import {IRamsesV3Factory} from "./CL/core/interfaces/IRamsesV3Factory.sol"; import {IRamsesV3Pool} from "./CL/core/interfaces/IRamsesV3Pool.sol"; import {IFeeCollector} from "./CL/gauge/interfaces/IFeeCollector.sol"; import {IVoteModule} from "./interfaces/IVoteModule.sol"; import {IXShadow} from "./interfaces/IXShadow.sol"; import {ILauncherPlugin} from "./interfaces/ILauncherPlugin.sol"; import {IAccessHub} from "./interfaces/IAccessHub.sol"; contract AccessHub is IAccessHub, AccessControlEnumerable { /// @notice role that can call changing fee splits and swap fees bytes32 public constant SWAP_FEE_SETTER = keccak256("SWAP_FEE_SETTER"); /// @notice operator role bytes32 public constant PROTOCOL_OPERATOR = keccak256("PROTOCOL_OPERATOR"); /// @dev temp setter address for initializing address public setter; /// @notice protocol timelock address address public timelock; /// @notice protocol treasury address address public treasury; /// @notice central voter contract IVoter public voter; /// @notice weekly emissions minter IMinter public minter; /// @notice launchpad plugin for augmenting feeshare ILauncherPlugin public launcherPlugin; /// @notice xShadow contract IXShadow public xShadow; /// @notice CL V3 factory IRamsesV3Factory public ramsesV3PoolFactory; /// @notice legacy pair factory IPairFactory public poolFactory; /// @notice legacy fees holder contract IFeeRecipientFactory public feeRecipientFactory; /// @notice fee collector contract IFeeCollector public feeCollector; /// @notice voteModule contract IVoteModule public voteModule; /** "nice-to-have" addresses for quickly finding contracts within the system */ /// @notice CL V3 gauge factory address public clGaugeFactory; address public gaugeFactory; address public feeDistributorFactory; error SAME_ADDRESS(); error NOT_TIMELOCK(address); error MANUAL_EXECUTION_FAILURE(); modifier timelocked() { require(msg.sender == timelock, NOT_TIMELOCK(msg.sender)); _; } /// @dev 2-step init process, construction then setting constructor(address _timelock, address _treasury) { setter = msg.sender; (timelock, treasury) = (_timelock, _treasury); } /// @inheritdoc IAccessHub function set( address _voter, address _minter, address _launcherPlugin, address _xShadow, address _ramsesV3PoolFactory, address _poolFactory, address _clGaugeFactory, address _gaugeFactory, address _feeRecipientFactory, address _feeDistributorFactory, address _feeCollector, address _voteModule ) external { /// @dev check that the setter is not the zero address yet require(setter != address(0) || msg.sender == timelock); /// @dev ensure it doesn't get initialized prematurely require( msg.sender == setter || msg.sender == treasury || msg.sender == timelock, IVoter.NOT_AUTHORIZED(msg.sender) ); /// @dev set to the zero address so initialization is not possible again setter = address(0); /// @dev initialize all external interfaces voter = IVoter(_voter); minter = IMinter(_minter); launcherPlugin = ILauncherPlugin(_launcherPlugin); xShadow = IXShadow(_xShadow); ramsesV3PoolFactory = IRamsesV3Factory(_ramsesV3PoolFactory); poolFactory = IPairFactory(_poolFactory); feeRecipientFactory = IFeeRecipientFactory(_feeRecipientFactory); feeCollector = IFeeCollector(_feeCollector); voteModule = IVoteModule(_voteModule); /// @dev reference addresses clGaugeFactory = _clGaugeFactory; gaugeFactory = _gaugeFactory; feeDistributorFactory = _feeDistributorFactory; /// @dev fee setter role given to treasury _grantRole(SWAP_FEE_SETTER, treasury); /// @dev operator role given to treasury _grantRole(PROTOCOL_OPERATOR, treasury); /// @dev initially give admin role to treasury _grantRole(DEFAULT_ADMIN_ROLE, treasury); /// @dev give timelock the admin role _grantRole(DEFAULT_ADMIN_ROLE, timelock); } /** Fee Setting Logic */ /// @inheritdoc IAccessHub function setSwapFees( address[] calldata _pools, uint24[] calldata _swapFees, bool[] calldata _concentrated ) external onlyRole(SWAP_FEE_SETTER) { /// @dev ensure continuity of length require( _pools.length == _swapFees.length && _swapFees.length == _concentrated.length, IVoter.LENGTH_MISMATCH() ); for (uint256 i; i < _pools.length; ++i) { /// @dev we check if the pool is v3 or legacy and set their fees accordingly if (_concentrated[i]) { ramsesV3PoolFactory.setFee(_pools[i], _swapFees[i]); } else { poolFactory.setPairFee(_pools[i], _swapFees[i]); } } } /// @inheritdoc IAccessHub function setFeeSplit( address[] calldata _pools, uint8[] calldata _feeSplits, bool[] calldata _concentrated ) external onlyRole(SWAP_FEE_SETTER) { /// @dev ensure continuity of length require( _pools.length == _feeSplits.length && _feeSplits.length == _concentrated.length, IVoter.LENGTH_MISMATCH() ); for (uint256 i; i < _pools.length; ++i) { /// @dev we check if the pool is v3 or legacy and set their feeSplit accordingly if (_concentrated[i]) { ramsesV3PoolFactory.setPoolFeeProtocol( _pools[i], _feeSplits[i] ); } else { poolFactory.setPairFeeSplit(_pools[i], _feeSplits[i]); } } } /** Voter governance */ /// @inheritdoc IAccessHub function setNewGovernorInVoter( address _newGovernor ) external onlyRole(PROTOCOL_OPERATOR) { /// @dev no checks are needed as the voter handles this already voter.setGovernor(_newGovernor); } /// @inheritdoc IAccessHub function governanceWhitelist( address[] calldata _token, bool[] calldata _whitelisted ) external onlyRole(PROTOCOL_OPERATOR) { /// @dev ensure continuity of length require(_token.length == _whitelisted.length, IVoter.LENGTH_MISMATCH()); for (uint256 i; i < _token.length; ++i) { /// @dev if adding to the whitelist if (_whitelisted[i]) { /// @dev call the voter's whitelist function voter.whitelist(_token[i]); } /// @dev remove the token's whitelist else { voter.revokeWhitelist(_token[i]); } } } /// @inheritdoc IAccessHub function transferWhitelistInXShadow( address[] calldata _who, bool[] calldata _whitelisted ) external onlyRole(PROTOCOL_OPERATOR) { /// @dev ensure continuity of length require(_who.length == _whitelisted.length, IVoter.LENGTH_MISMATCH()); xShadow.setExemption(_who, _whitelisted); } /// @inheritdoc IAccessHub function killGauge( address[] calldata _pairs ) external onlyRole(PROTOCOL_OPERATOR) { for (uint256 i; i < _pairs.length; ++i) { /// @dev store pair address pair = _pairs[i]; /// @dev collect fees from the pair feeCollector.collectProtocolFees(IRamsesV3Pool(pair)); /// @dev kill the gauge voter.killGauge(voter.gaugeForPool(pair)); /// @dev set the new fees in the pair to 95/5 ramsesV3PoolFactory.setPoolFeeProtocol(pair, 5); } } /// @inheritdoc IAccessHub function reviveGauge( address[] calldata _pairs ) external onlyRole(PROTOCOL_OPERATOR) { for (uint256 i; i < _pairs.length; ++i) { address pair = _pairs[i]; /// @dev collect fees from the pair feeCollector.collectProtocolFees(IRamsesV3Pool(pair)); /// @dev revive the pair voter.reviveGauge(voter.gaugeForPool(pair)); /// @dev set fee to the factory default ramsesV3PoolFactory.setPoolFeeProtocol( pair, ramsesV3PoolFactory.feeProtocol() ); } } /// @inheritdoc IAccessHub function setEmissionsRatioInVoter( uint256 _pct ) external onlyRole(PROTOCOL_OPERATOR) { voter.setGlobalRatio(_pct); } /** Minter Functions */ /// @inheritdoc IAccessHub function setEmissionsMultiplierInMinter( uint256 _multiplier ) external onlyRole(PROTOCOL_OPERATOR) { minter.updateEmissionsMultiplier(_multiplier); } /** Reward List Functions */ /// @inheritdoc IAccessHub function augmentGaugeRewardsForPair( address[] calldata _pools, address[] calldata _rewards, bool[] calldata _addReward ) external onlyRole(PROTOCOL_OPERATOR) { /// @dev length continuity check require( _pools.length == _rewards.length && _rewards.length == _addReward.length, IVoter.LENGTH_MISMATCH() ); /// @dev loop through all entries for (uint256 i; i < _pools.length; ++i) { /// @dev fetch the gauge address address gauge = voter.gaugeForPool(_pools[i]); /// @dev if true (add rewards) if (_addReward[i]) { voter.whitelistGaugeRewards(gauge, _rewards[i]); } /// @dev if false remove the rewards else { voter.removeGaugeRewardWhitelist(gauge, _rewards[i]); } } } /// @inheritdoc IAccessHub function removeFeeDistributorRewards( address[] calldata _pools, address[] calldata _rewards ) external onlyRole(PROTOCOL_OPERATOR) { require(_pools.length == _rewards.length, IVoter.LENGTH_MISMATCH()); for (uint256 i; i < _pools.length; ++i) { voter.removeFeeDistributorReward( voter.feeDistributorForGauge(voter.gaugeForPool(_pools[i])), _rewards[i] ); } } /** LauncherPlugin specific functions */ /// @inheritdoc IAccessHub function migratePoolInLauncherPlugin( address _oldPool, address _newPool ) external onlyRole(PROTOCOL_OPERATOR) { launcherPlugin.migratePool(_oldPool, _newPool); } /// @inheritdoc IAccessHub function setConfigsInLauncherPlugin( address _pool, uint256 _take, address _recipient ) external onlyRole(PROTOCOL_OPERATOR) { launcherPlugin.setConfigs(_pool, _take, _recipient); } /// @inheritdoc IAccessHub function enablePoolInLauncherPlugin( address _pool ) external onlyRole(PROTOCOL_OPERATOR) { launcherPlugin.enablePool(_pool); } /// @inheritdoc IAccessHub function disablePoolInLauncherPlugin( address _pool ) external onlyRole(PROTOCOL_OPERATOR) { launcherPlugin.disablePool(_pool); } /// @inheritdoc IAccessHub function setOperatorInLauncherPlugin( address _newOperator ) external onlyRole(PROTOCOL_OPERATOR) { launcherPlugin.setOperator(_newOperator); } /// @inheritdoc IAccessHub function grantAuthorityInLauncherPlugin( address _newAuthority, string calldata _label ) external onlyRole(PROTOCOL_OPERATOR) { launcherPlugin.grantAuthority(_newAuthority, _label); } /// @inheritdoc IAccessHub function revokeAuthorityInLauncherPlugin( address _oldAuthority ) external onlyRole(PROTOCOL_OPERATOR) { launcherPlugin.revokeAuthority(_oldAuthority); } /** FeeCollector functions */ /// @inheritdoc IAccessHub function setTreasuryInFeeCollector( address newTreasury ) external onlyRole(PROTOCOL_OPERATOR) { feeCollector.setTreasury(newTreasury); } /// @inheritdoc IAccessHub function setTreasuryFeesInFeeCollector( uint256 _treasuryFees ) external onlyRole(PROTOCOL_OPERATOR) { feeCollector.setTreasuryFees(_treasuryFees); } /** FeeRecipientFactory functions */ /// @inheritdoc IAccessHub function setFeeToTreasuryInFeeRecipientFactory( uint256 _feeToTreasury ) external onlyRole(PROTOCOL_OPERATOR) { feeRecipientFactory.setFeeToTreasury(_feeToTreasury); } /// @inheritdoc IAccessHub function setTreasuryInFeeRecipientFactory( address _treasury ) external onlyRole(PROTOCOL_OPERATOR) { feeRecipientFactory.setTreasury(_treasury); } /** CL Pool Factory functions */ /// @inheritdoc IAccessHub function enableTickSpacing( int24 tickSpacing, uint24 initialFee ) external onlyRole(PROTOCOL_OPERATOR) { ramsesV3PoolFactory.enableTickSpacing(tickSpacing, initialFee); } /// @notice sets the address of the voter in the v3 factory for gauge fee setting function setVoterAddressInFactoryV3(address _voter) external timelocked { ramsesV3PoolFactory.setVoter(_voter); } /** VoteModule Functions*/ /// @inheritdoc IAccessHub function setCooldownExemption( address[] calldata _candidates, bool[] calldata _exempt ) external timelocked { for (uint256 i; i < _candidates.length; ++i) { voteModule.setCooldownExemption(_candidates[i], _exempt[i]); } } /// @inheritdoc IAccessHub function setNewRebaseStreamingDuration( uint256 _newDuration ) external timelocked { voteModule.setNewDuration(_newDuration); } /// @inheritdoc IAccessHub function setNewVoteModuleCooldown( uint256 _newCooldown ) external timelocked { voteModule.setNewCooldown(_newCooldown); } /** Timelock gated functions */ /// @inheritdoc IAccessHub function execute( address _target, bytes calldata _payload ) external timelocked { (bool success, ) = _target.call(_payload); require(success, MANUAL_EXECUTION_FAILURE()); } /// @inheritdoc IAccessHub function setNewTimelock(address _timelock) external timelocked { require(timelock != _timelock, SAME_ADDRESS()); timelock = _timelock; } /// @inheritdoc IAccessHub function initializeVoter( address _emissionsToken, address _legacyFactory, address _gauges, address _feeDistributorFactory, address _minter, address _msig, address _xShadow, address _clFactory, address _clGaugeFactory, address _nfpManager, address _feeRecipientFactory, address _voteModule, address _launcherPlugin ) external timelocked { voter.initialize( _emissionsToken, _legacyFactory, _gauges, _feeDistributorFactory, _minter, _msig, _xShadow, _clFactory, _clGaugeFactory, _nfpManager, _feeRecipientFactory, _voteModule, _launcherPlugin ); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (access/extensions/AccessControlEnumerable.sol) pragma solidity ^0.8.20; import {IAccessControlEnumerable} from "./IAccessControlEnumerable.sol"; import {AccessControl} from "../AccessControl.sol"; import {EnumerableSet} from "../../utils/structs/EnumerableSet.sol"; /** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */ abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl { using EnumerableSet for EnumerableSet.AddressSet; mapping(bytes32 role => EnumerableSet.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view virtual returns (address) { return _roleMembers[role].at(index); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view virtual returns (uint256) { return _roleMembers[role].length(); } /** * @dev Return all accounts that have `role` * * 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 getRoleMembers(bytes32 role) public view virtual returns (address[] memory) { return _roleMembers[role].values(); } /** * @dev Overload {AccessControl-_grantRole} to track enumerable memberships */ function _grantRole(bytes32 role, address account) internal virtual override returns (bool) { bool granted = super._grantRole(role, account); if (granted) { _roleMembers[role].add(account); } return granted; } /** * @dev Overload {AccessControl-_revokeRole} to track enumerable memberships */ function _revokeRole(bytes32 role, address account) internal virtual override returns (bool) { bool revoked = super._revokeRole(role, account); if (revoked) { _roleMembers[role].remove(account); } return revoked; } }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; interface IMinter { /// @dev error for if epoch 0 has already started error STARTED(); /// @dev error for if update_period is attempted to be called before startEmissions error EMISSIONS_NOT_STARTED(); /// @dev deviation too high error TOO_HIGH(); /// @dev no change in values error NO_CHANGE(); /// @dev when attempting to update emissions more than once per period error SAME_PERIOD(); /// @dev error for if a contract is not set correctly error INVALID_CONTRACT(); event SetVeDist(address _value); event SetVoter(address _value); event Mint(address indexed sender, uint256 weekly); event RebaseUnsuccessful(uint256 _current, uint256 _currentPeriod); event EmissionsMultiplierUpdated(uint256 _emissionsMultiplier); /// @notice decay or inflation scaled to 10_000 = 100% /// @return _multiplier the emissions multiplier function emissionsMultiplier() external view returns (uint256 _multiplier); /// @notice unix timestamp of current epoch's start /// @return _activePeriod the active period function activePeriod() external view returns (uint256 _activePeriod); /// @notice update the epoch (period) -- callable once a week at >= Thursday 0 UTC /// @return period the new period function updatePeriod() external returns (uint256 period); /// @notice start emissions for epoch 0 function startEmissions() external; /// @notice updates the decay or inflation scaled to 10_000 = 100% /// @param _emissionsMultiplier multiplier for emissions each week function updateEmissionsMultiplier(uint256 _emissionsMultiplier) external; /// @notice calculates the emissions to be sent to the voter /// @return _weeklyEmissions the amount of emissions for the week function calculateWeeklyEmissions() external view returns (uint256 _weeklyEmissions); /// @notice kicks off the initial minting and variable declarations function kickoff( address _emissionsToken, address _voter, uint256 _initialWeeklyEmissions, uint256 _initialMultiplier, address _xShadow ) external; /// @notice returns (block.timestamp / 1 week) for gauge use /// @return period period number function getPeriod() external view returns (uint256 period); /// @notice returns the numerical value of the current epoch /// @return _epoch epoch number function getEpoch() external view returns (uint256 _epoch); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.26; pragma abicoder v2; interface IVoter { error ACTIVE_GAUGE(address gauge); error GAUGE_INACTIVE(address gauge); error ALREADY_WHITELISTED(); error NOT_AUTHORIZED(address caller); error NOT_WHITELISTED(); error NOT_POOL(); error FORBIDDEN(); error NOT_INIT(); error LENGTH_MISMATCH(); error NO_GAUGE(); error ALREADY_DISTRIBUTED(address gauge, uint256 period); error ZERO_VOTE(address pool); error RATIO_TOO_HIGH(); error NOT_GT_ZERO(); error VOTE_UNSUCCESSFUL(); error UNAUTHORIZED(); event GaugeCreated( address indexed gauge, address creator, address feeDistributor, address indexed pool ); event GaugeKilled(address indexed gauge); event GaugeRevived(address indexed gauge); event Voted(address indexed owner, uint256 weight, address indexed pool); event Abstained(address indexed owner, uint256 weight); event Deposit( address indexed lp, address indexed gauge, address indexed owner, uint256 amount ); event Withdraw( address indexed lp, address indexed gauge, address indexed owner, uint256 amount ); event NotifyReward( address indexed sender, address indexed reward, uint256 amount ); event DistributeReward( address indexed sender, address indexed gauge, uint256 amount ); event EmissionsRatio( address indexed caller, uint256 oldRatio, uint256 newRatio ); event NewGovernor(address indexed sender, address indexed governor); event Whitelisted(address indexed whitelister, address indexed token); event WhitelistRevoked( address indexed forbidder, address indexed token, bool status ); event CustomGaugeCreated( address indexed gauge, address creator, address indexed token ); event MainTickSpacingChanged( address indexed token0, address indexed token1, int24 indexed newMainTickSpacing ); function initialize( address _emissionsToken, address _legacyFactory, address _gauges, address _feeDistributorFactory, address _minter, address _msig, address _xShadow, address _clFactory, address _clGaugeFactory, address _nfpManager, address _feeRecipientFactory, address _voteModule, address _launcherPlugin ) external; /// @notice denominator basis function BASIS() external view returns (uint256); /// @notice ratio of xShadow emissions globally function xRatio() external view returns (uint256); /// @notice xShadow contract address function xShadow() external view returns (address); /// @notice legacy factory address (uni-v2/stableswap) function legacyFactory() external view returns (address); /// @notice concentrated liquidity factory function clFactory() external view returns (address); /// @notice gauge factory for CL function clGaugeFactory() external view returns (address); /// @notice legacy fee recipient factory function feeRecipientFactory() external view returns (address); /// @notice peripheral NFPManager contract function nfpManager() external view returns (address); /// @notice returns the address of the current governor /// @return _governor address of the governor function governor() external view returns (address _governor); /// @notice the address of the vote module /// @return _voteModule the vote module contract address function voteModule() external view returns (address _voteModule); /// @notice address of the central access Hub function accessHub() external view returns (address); /// @notice the address of the shadow launcher plugin to enable third party launchers /// @return _launcherPlugin the address of the plugin function launcherPlugin() external view returns (address _launcherPlugin); /// @notice distributes emissions from the minter to the voter /// @param amount the amount of tokens to notify function notifyRewardAmount(uint256 amount) external; /// @notice distributes the emissions for a specific gauge /// @param _gauge the gauge address function distribute(address _gauge) external; /// @notice returns the address of the gauge factory /// @param _gaugeFactory gauge factory address function gaugeFactory() external view returns (address _gaugeFactory); /// @notice returns the address of the feeDistributor factory /// @return _feeDistributorFactory feeDist factory address function feeDistributorFactory() external view returns (address _feeDistributorFactory); /// @notice returns the address of the minter contract /// @return _minter address of the minter function minter() external view returns (address _minter); /// @notice check if the gauge is active for governance use /// @param _gauge address of the gauge /// @return _trueOrFalse if the gauge is alive function isAlive(address _gauge) external view returns (bool _trueOrFalse); /// @notice allows the token to be paired with other whitelisted assets to participate in governance /// @param _token the address of the token function whitelist(address _token) external; /// @notice effectively disqualifies a token from governance /// @param _token the address of the token function revokeWhitelist(address _token) external; /// @notice returns if the address is a gauge /// @param gauge address of the gauge /// @return _trueOrFalse boolean if the address is a gauge function isGauge(address gauge) external view returns (bool _trueOrFalse); /// @notice disable a gauge from governance /// @param _gauge address of the gauge function killGauge(address _gauge) external; /// @notice re-activate a dead gauge /// @param _gauge address of the gauge function reviveGauge(address _gauge) external; /// @notice re-cast a tokenID's votes /// @param owner address of the owner function poke(address owner) external; /// @notice sets the main tickspacing of a token pairing /// @param tokenA address of tokenA /// @param tokenB address of tokenB /// @param tickSpacing the main tickspacing to set to function setMainTickSpacing( address tokenA, address tokenB, int24 tickSpacing ) external; /// @notice create a legacy-type gauge for an arbitrary token /// @param _token 'token' to be used /// @return _arbitraryGauge the address of the new custom gauge function createArbitraryGauge( address _token ) external returns (address _arbitraryGauge); /// @notice returns if the address is a fee distributor /// @param _feeDistributor address of the feeDist /// @return _trueOrFalse if the address is a fee distributor function isFeeDistributor( address _feeDistributor ) external view returns (bool _trueOrFalse); /// @notice returns the address of the emission's token /// @return _emissionsToken emissions token contract address function emissionsToken() external view returns (address _emissionsToken); /// @notice returns the address of the pool's gauge, if any /// @param _pool pool address /// @return _gauge gauge address function gaugeForPool(address _pool) external view returns (address _gauge); /// @notice returns the address of the pool's feeDistributor, if any /// @param _gauge address of the gauge /// @return _feeDistributor address of the pool's feedist function feeDistributorForGauge( address _gauge ) external view returns (address _feeDistributor); /// @notice returns the new toPool that was redirected fromPool /// @param fromPool address of the original pool /// @return toPool the address of the redirected pool function poolRedirect( address fromPool ) external view returns (address toPool); /// @notice returns the gauge address of a CL pool /// @param tokenA address of token A in the pair /// @param tokenB address of token B in the pair /// @param tickSpacing tickspacing of the pool /// @return gauge address of the gauge function gaugeForClPool( address tokenA, address tokenB, int24 tickSpacing ) external view returns (address gauge); /// @notice returns the array of all tickspacings for the tokenA/tokenB combination /// @param tokenA address of token A in the pair /// @param tokenB address of token B in the pair /// @return _ts array of all the tickspacings function tickSpacingsForPair( address tokenA, address tokenB ) external view returns (int24[] memory _ts); /// @notice returns the main tickspacing used in the gauge/governance process /// @param tokenA address of token A in the pair /// @param tokenB address of token B in the pair /// @return _ts the main tickspacing function mainTickSpacingForPair( address tokenA, address tokenB ) external view returns (int24 _ts); /// @notice returns the block.timestamp divided by 1 week in seconds /// @return period the period used for gauges function getPeriod() external view returns (uint256 period); /// @notice cast a vote to direct emissions to gauges and earn incentives /// @param owner address of the owner /// @param _pools the list of pools to vote on /// @param _weights an arbitrary weight per pool which will be normalized to 100% regardless of numerical inputs function vote( address owner, address[] calldata _pools, uint256[] calldata _weights ) external; /// @notice reset the vote of an address /// @param owner address of the owner function reset(address owner) external; /// @notice set the governor address /// @param _governor the new governor address function setGovernor(address _governor) external; /// @notice recover stuck emissions /// @param _gauge the gauge address /// @param _period the period function stuckEmissionsRecovery(address _gauge, uint256 _period) external; /// @notice whitelists extra rewards for a gauge /// @param _gauge the gauge to whitelist rewards to /// @param _reward the reward to whitelist function whitelistGaugeRewards(address _gauge, address _reward) external; /// @notice removes a reward from the gauge whitelist /// @param _gauge the gauge to remove the whitelist from /// @param _reward the reward to remove from the whitelist function removeGaugeRewardWhitelist( address _gauge, address _reward ) external; /// @notice creates a legacy gauge for the pool /// @param _pool pool's address /// @return _gauge address of the new gauge function createGauge(address _pool) external returns (address _gauge); /// @notice create a concentrated liquidity gauge /// @param tokenA the address of tokenA /// @param tokenB the address of tokenB /// @param tickSpacing the tickspacing of the pool /// @return _clGauge address of the new gauge function createCLGauge( address tokenA, address tokenB, int24 tickSpacing ) external returns (address _clGauge); /// @notice claim concentrated liquidity gauge rewards for specific NFP token ids /// @param _gauges array of gauges /// @param _tokens two dimensional array for the tokens to claim /// @param _nfpTokenIds two dimensional array for the NFPs function claimClGaugeRewards( address[] calldata _gauges, address[][] calldata _tokens, uint256[][] calldata _nfpTokenIds ) external; /// @notice claim arbitrary rewards from specific feeDists /// @param owner address of the owner /// @param _feeDistributors address of the feeDists /// @param _tokens two dimensional array for the tokens to claim function claimIncentives( address owner, address[] calldata _feeDistributors, address[][] calldata _tokens ) external; /// @notice claim arbitrary rewards from specific gauges /// @param _gauges address of the gauges /// @param _tokens two dimensional array for the tokens to claim function claimRewards( address[] calldata _gauges, address[][] calldata _tokens ) external; /// @notice distribute emissions to a gauge for a specific period /// @param _gauge address of the gauge /// @param _period value of the period function distributeForPeriod(address _gauge, uint256 _period) external; /// @notice attempt distribution of emissions to all gauges function distributeAll() external; /// @notice distribute emissions to gauges by index /// @param startIndex start of the loop /// @param endIndex end of the loop function batchDistributeByIndex( uint256 startIndex, uint256 endIndex ) external; /// @notice returns the votes cast for a tokenID /// @param owner address of the owner /// @return votes an array of votes casted /// @return weights an array of the weights casted per pool function getVotes( address owner, uint256 period ) external view returns (address[] memory votes, uint256[] memory weights); /// @notice returns an array of all the gauges /// @return _gauges the array of gauges function getAllGauges() external view returns (address[] memory _gauges); /// @notice returns an array of all the feeDists /// @return _feeDistributors the array of feeDists function getAllFeeDistributors() external view returns (address[] memory _feeDistributors); /// @notice sets the xShadowRatio default function setGlobalRatio(uint256 _xRatio) external; /// @notice returns the array of all custom/arbitrary pools function getAllCustomPools() external view returns (address[] memory _customPools); /// @notice whether the token is whitelisted in governance function isWhitelisted(address _token) external view returns (bool _tf); /// @notice function for removing malicious or stuffed tokens function removeFeeDistributorReward( address _feeDist, address _token ) external; }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.26; interface IPairFactory { error FEE_TOO_HIGH(); error ZERO_FEE(); /// @dev invalid assortment error IA(); /// @dev zero address error ZA(); /// @dev pair exists error PE(); error NOT_AUTHORIZED(); error INVALID_FEE_SPLIT(); event PairCreated( address indexed token0, address indexed token1, address pair, uint256 ); event SetFee(uint256 indexed fee); event SetPairFee(address indexed pair, uint256 indexed fee); event SetFeeSplit(uint256 indexed _feeSplit); event SetPairFeeSplit(address indexed pair, uint256 indexed _feeSplit); event SkimStatus(address indexed _pair, bool indexed _status); event NewTreasury(address indexed _caller, address indexed _newTreasury); event FeeSplitWhenNoGauge(address indexed _caller, bool indexed _status); event SetFeeRecipient(address indexed pair, address indexed feeRecipient); /// @notice returns the total length of legacy pairs /// @return _length the length function allPairsLength() external view returns (uint256 _length); /// @notice calculates if the address is a legacy pair /// @param pair the address to check /// @return _boolean the bool return function isPair(address pair) external view returns (bool _boolean); /// @notice calculates the pairCodeHash /// @return _hash the pair code hash function pairCodeHash() external view returns (bytes32 _hash); /// @param tokenA address of tokenA /// @param tokenB address of tokenB /// @param stable whether it uses the stable curve /// @return _pair the address of the pair function getPair( address tokenA, address tokenB, bool stable ) external view returns (address _pair); /// @notice creates a new legacy pair /// @param tokenA address of tokenA /// @param tokenB address of tokenB /// @param stable whether it uses the stable curve /// @return pair the address of the created pair function createPair( address tokenA, address tokenB, bool stable ) external returns (address pair); /// @notice the address of the voter /// @return _voter the address of the voter function voter() external view returns (address _voter); /// @notice returns the address of a pair based on the index /// @param _index the index to check for a pair /// @return _pair the address of the pair at the index function allPairs(uint256 _index) external view returns (address _pair); /// @notice the swap fee of a pair /// @param _pair the address of the pair /// @return _fee the fee function pairFee(address _pair) external view returns (uint256 _fee); /// @notice the split of fees /// @return _split the feeSplit function feeSplit() external view returns (uint256 _split); /// @notice sets the swap fee for a pair /// @param _pair the address of the pair /// @param _fee the fee for the pair function setPairFee(address _pair, uint256 _fee) external; /// @notice set the swap fees of the pair /// @param _fee the fee, scaled to MAX 10% of 100_000 function setFee(uint256 _fee) external; /// @notice the address for the treasury /// @return _treasury address of the treasury function treasury() external view returns (address _treasury); /// @notice sets the pairFees contract /// @param _pair the address of the pair /// @param _pairFees the address of the new Pair Fees function setFeeRecipient(address _pair, address _pairFees) external; /// @notice sets the feeSplit for a pair /// @param _pair the address of the pair /// @param _feeSplit the feeSplit function setPairFeeSplit(address _pair, uint256 _feeSplit) external; /// @notice whether there is feeSplit when there's no gauge /// @return _boolean whether there is a feesplit when no gauge function feeSplitWhenNoGauge() external view returns (bool _boolean); /// @notice whether a pair can be skimmed /// @param _pair the pair address /// @return _boolean whether skim is enabled function skimEnabled(address _pair) external view returns (bool _boolean); /// @notice set whether skim is enabled for a specific pair function setSkimEnabled(address _pair, bool _status) external; /// @notice sets a new treasury address /// @param _treasury the new treasury address function setTreasury(address _treasury) external; /// @notice set whether there should be a feesplit without gauges /// @param status whether enabled or not function setFeeSplitWhenNoGauge(bool status) external; /// @notice sets the feesSplit globally /// @param _feeSplit the fee split function setFeeSplit(uint256 _feeSplit) external; }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.26; interface IFeeRecipientFactory { error INVALID_TREASURY_FEE(); error NOT_AUTHORIZED(); /// @notice the pair fees for a specific pair /// @param pair the pair to check /// @return feeRecipient the feeRecipient contract address for the pair function feeRecipientForPair( address pair ) external view returns (address feeRecipient); /// @notice the last feeRecipient address created /// @return _feeRecipient the address of the last pair fees contract function lastFeeRecipient() external view returns (address _feeRecipient); /// @notice create the pair fees for a pair /// @param pair the address of the pair /// @return _feeRecipient the address of the newly created feeRecipient function createFeeRecipient( address pair ) external returns (address _feeRecipient); /// @notice the fee % going to the treasury /// @return _feeToTreasury the fee % function feeToTreasury() external view returns (uint256 _feeToTreasury); /// @notice get the treasury address /// @return _treasury address of the treasury function treasury() external view returns (address _treasury); /// @notice set the fee % to be sent to the treasury /// @param _feeToTreasury the fee % to be sent to the treasury function setFeeToTreasury(uint256 _feeToTreasury) external; /// @notice set a new treasury address /// @param _treasury the new address function setTreasury(address _treasury) external; }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title The interface for the Ramses V3 Factory /// @notice The Ramses V3 Factory facilitates creation of Ramses V3 pools and control over the protocol fees interface IRamsesV3Factory { error IT(); /// @dev Fee Too Large error FTL(); error A0(); error F0(); error PE(); /// @notice Emitted when a pool is created /// @param token0 The first token of the pool by address sort order /// @param token1 The second token of the pool by address sort order /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip /// @param tickSpacing The minimum number of ticks between initialized ticks /// @param pool The address of the created pool event PoolCreated( address indexed token0, address indexed token1, uint24 indexed fee, int24 tickSpacing, address pool ); /// @notice Emitted when a new tickspacing amount is enabled for pool creation via the factory /// @dev unlike UniswapV3, we map via the tickSpacing rather than the fee tier /// @param tickSpacing The minimum number of ticks between initialized ticks /// @param fee The fee, denominated in hundredths of a bip event TickSpacingEnabled(int24 indexed tickSpacing, uint24 indexed fee); /// @notice Emitted when the protocol fee is changed /// @param feeProtocolOld The previous value of the protocol fee /// @param feeProtocolNew The updated value of the protocol fee event SetFeeProtocol(uint8 feeProtocolOld, uint8 feeProtocolNew); /// @notice Emitted when the protocol fee is changed /// @param pool The pool address /// @param feeProtocolOld The previous value of the protocol fee /// @param feeProtocolNew The updated value of the protocol fee event SetPoolFeeProtocol(address pool, uint8 feeProtocolOld, uint8 feeProtocolNew); /// @notice Emitted when a pool's fee is changed /// @param pool The pool address /// @param newFee The updated value of the protocol fee event FeeAdjustment(address pool, uint24 newFee); /// @notice Emitted when the fee collector is changed /// @param oldFeeCollector The previous implementation /// @param newFeeCollector The new implementation event FeeCollectorChanged(address indexed oldFeeCollector, address indexed newFeeCollector); /// @notice Returns the PoolDeployer address /// @return The address of the PoolDeployer contract function ramsesV3PoolDeployer() external returns (address); /// @notice Returns the fee amount for a given tickSpacing, if enabled, or 0 if not enabled /// @dev A tickSpacing can never be removed, so this value should be hard coded or cached in the calling context /// @dev unlike UniswapV3, we map via the tickSpacing rather than the fee tier /// @param tickSpacing The enabled tickSpacing. Returns 0 in case of unenabled tickSpacing /// @return initialFee The initial fee function tickSpacingInitialFee(int24 tickSpacing) external view returns (uint24 initialFee); /// @notice Returns the pool address for a given pair of tokens and a tickSpacing, or address 0 if it does not exist /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order /// @dev unlike UniswapV3, we map via the tickSpacing rather than the fee tier /// @param tokenA The contract address of either token0 or token1 /// @param tokenB The contract address of the other token /// @param tickSpacing The tickSpacing of the pool /// @return pool The pool address function getPool(address tokenA, address tokenB, int24 tickSpacing) external view returns (address pool); /// @notice Creates a pool for the given two tokens and fee /// @dev unlike UniswapV3, we map via the tickSpacing rather than the fee tier /// @param tokenA One of the two tokens in the desired pool /// @param tokenB The other of the two tokens in the desired pool /// @param tickSpacing The desired tickSpacing for the pool /// @param sqrtPriceX96 initial sqrtPriceX96 of the pool /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. /// @dev The call will revert if the pool already exists, the tickSpacing is invalid, or the token arguments are invalid. /// @return pool The address of the newly created pool function createPool( address tokenA, address tokenB, int24 tickSpacing, uint160 sqrtPriceX96 ) external returns (address pool); /// @notice Enables a tickSpacing with the given initialFee amount /// @dev unlike UniswapV3, we map via the tickSpacing rather than the fee tier /// @dev tickSpacings may never be removed once enabled /// @param tickSpacing The spacing between ticks to be enforced for all pools created /// @param initialFee The initial fee amount, denominated in hundredths of a bip (i.e. 1e-6) function enableTickSpacing(int24 tickSpacing, uint24 initialFee) external; /// @notice returns the default protocol fee. /// @return _feeProtocol the default feeProtocol function feeProtocol() external view returns (uint8 _feeProtocol); /// @notice returns the % of fees directed to governance /// @dev if the fee is 0, or the pool is uninitialized this will return the Factory's default feeProtocol /// @param pool the address of the pool /// @return _feeProtocol the feeProtocol for the pool function poolFeeProtocol(address pool) external view returns (uint8 _feeProtocol); /// @notice Sets the default protocol's % share of the fees /// @param _feeProtocol new default protocol fee for token0 and token1 function setFeeProtocol(uint8 _feeProtocol) external; /// @notice Get the parameters to be used in constructing the pool, set transiently during pool creation. /// @dev Called by the pool constructor to fetch the parameters of the pool /// @return factory The factory address /// @return token0 The first token of the pool by address sort order /// @return token1 The second token of the pool by address sort order /// @return fee The initialized feetier of the pool, denominated in hundredths of a bip /// @return tickSpacing The minimum number of ticks between initialized ticks function parameters() external view returns (address factory, address token0, address token1, uint24 fee, int24 tickSpacing); /// @notice Sets the fee collector address /// @param _feeCollector the fee collector address function setFeeCollector(address _feeCollector) external; /// @notice sets the swap fee for a specific pool /// @param _pool address of the pool /// @param _fee the fee to be assigned to the pool, scaled to 1_000_000 = 100% function setFee(address _pool, uint24 _fee) external; /// @notice Returns the address of the fee collector contract /// @dev Fee collector decides where the protocol fees go (fee distributor, treasury, etc.) function feeCollector() external view returns (address); /// @notice sets the feeProtocol of a specific pool /// @param pool address of the pool /// @param _feeProtocol the fee protocol to assign function setPoolFeeProtocol(address pool, uint8 _feeProtocol) external; /// @notice sets the feeProtocol upon a gauge's creation /// @param pool address of the pool function gaugeFeeSplitEnable(address pool) external; /// @notice sets the the voter address /// @param _voter the address of the voter function setVoter(address _voter) external; function initialize(address poolDeployer) external; }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; import {IRamsesV3PoolImmutables} from './pool/IRamsesV3PoolImmutables.sol'; import {IRamsesV3PoolState} from './pool/IRamsesV3PoolState.sol'; import {IRamsesV3PoolDerivedState} from './pool/IRamsesV3PoolDerivedState.sol'; import {IRamsesV3PoolActions} from './pool/IRamsesV3PoolActions.sol'; import {IRamsesV3PoolOwnerActions} from './pool/IRamsesV3PoolOwnerActions.sol'; import {IRamsesV3PoolErrors} from './pool/IRamsesV3PoolErrors.sol'; import {IRamsesV3PoolEvents} from './pool/IRamsesV3PoolEvents.sol'; /// @title The interface for a Ramses V3 Pool /// @notice A Ramses pool facilitates swapping and automated market making between any two assets that strictly conform /// to the ERC20 specification /// @dev The pool interface is broken up into many smaller pieces interface IRamsesV3Pool is IRamsesV3PoolImmutables, IRamsesV3PoolState, IRamsesV3PoolDerivedState, IRamsesV3PoolActions, IRamsesV3PoolOwnerActions, IRamsesV3PoolErrors, IRamsesV3PoolEvents { /// @notice if a new period, advance on interaction function _advancePeriod() external; }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.26; import {IRamsesV3Pool} from "../../core/interfaces/IRamsesV3Pool.sol"; interface IFeeCollector { error NOT_AUTHORIZED(); error FTL(); /// @notice Emitted when the treasury address is changed. /// @param oldTreasury The previous treasury address. /// @param newTreasury The new treasury address. event TreasuryChanged(address oldTreasury, address newTreasury); /// @notice Emitted when the treasury fees value is changed. /// @param oldTreasuryFees The previous value of the treasury fees. /// @param newTreasuryFees The new value of the treasury fees. event TreasuryFeesChanged(uint256 oldTreasuryFees, uint256 newTreasuryFees); /// @notice Emitted when protocol fees are collected from a pool and distributed to the fee distributor and treasury. /// @param pool The address of the pool from which the fees were collected. /// @param feeDistAmount0 The amount of fee tokens (token 0) distributed to the fee distributor. /// @param feeDistAmount1 The amount of fee tokens (token 1) distributed to the fee distributor. /// @param treasuryAmount0 The amount of fee tokens (token 0) allocated to the treasury. /// @param treasuryAmount1 The amount of fee tokens (token 1) allocated to the treasury. event FeesCollected( address pool, uint256 feeDistAmount0, uint256 feeDistAmount1, uint256 treasuryAmount0, uint256 treasuryAmount1 ); /// @notice Returns the treasury address. function treasury() external returns (address); /// @notice Sets the treasury address to a new value. /// @param newTreasury The new address to set as the treasury. function setTreasury(address newTreasury) external; /// @notice Sets the value of treasury fees to a new amount. /// @param _treasuryFees The new amount of treasury fees to be set. function setTreasuryFees(uint256 _treasuryFees) external; /// @notice Collects protocol fees from a specified pool and distributes them to the fee distributor and treasury. /// @param pool The pool from which to collect the protocol fees. function collectProtocolFees(IRamsesV3Pool pool) external; }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.26; interface IVoteModule { /** Custom Errors */ /// @dev == 0 error ZERO_AMOUNT(); /// @dev if address is not xShadow error NOT_XSHADOW(); /// @dev error for when the cooldown period has not been passed yet error COOLDOWN_ACTIVE(); /// @dev error for when you try to deposit or withdraw for someone who isn't the msg.sender error NOT_VOTEMODULE(); /// @dev error for when the caller is not authorized error UNAUTHORIZED(); /// @dev error for accessHub gated functions error NOT_ACCESSHUB(); /// @dev error for when there is no change of state error NO_CHANGE(); /// @dev error for when address is invalid error INVALID_ADDRESS(); /** Events */ event Deposit(address indexed from, uint256 amount); event Withdraw(address indexed from, uint256 amount); event NotifyReward(address indexed from, uint256 amount); event ClaimRewards(address indexed from, uint256 amount); event ExemptedFromCooldown(address indexed candidate, bool status); event NewDuration(uint256 oldDuration, uint256 newDuration); event NewCooldown(uint256 oldCooldown, uint256 newCooldown); event Delegate( address indexed delegator, address indexed delegatee, bool indexed isAdded ); event SetAdmin( address indexed owner, address indexed operator, bool indexed isAdded ); /** Functions */ function delegates(address) external view returns (address); /// @notice mapping for admins for a specific address /// @param owner the owner to check against /// @return operator the address that is designated as an admin/operator function admins(address owner) external view returns (address operator); function accessHub() external view returns(address); /// @notice returns the last time the reward was modified or periodFinish if the reward has ended function lastTimeRewardApplicable() external view returns (uint256 _ltra); function earned(address account) external view returns (uint256 _reward); /// @notice the time which users can deposit and withdraw function unlockTime() external view returns (uint256 _timestamp); /// @notice the accumulated dust in the contract from precision rollover function dust() external view returns (uint256 _dust); /// @notice claims pending rebase rewards function getReward() external; function rewardPerToken() external view returns (uint256 _rewardPerToken); /// @notice deposits all xShadow in the caller's wallet function depositAll() external; /// @notice deposit a specified amount of xShadow function deposit(uint256 amount) external; /// @notice withdraw all xShadow function withdrawAll() external; /// @notice withdraw a specified amount of xShadow function withdraw(uint256 amount) external; /// @notice check for admin perms /// @param operator the address to check /// @param owner the owner to check against for permissions function isAdminFor( address operator, address owner ) external view returns (bool approved); /// @notice check for delegations /// @param delegate the address to check /// @param owner the owner to check against for permissions function isDelegateFor( address delegate, address owner ) external view returns (bool approved); /// @notice rewards pending to be distributed for the reward period /// @return _left rewards remaining in the period function left() external view returns (uint256 _left); /// @notice used by the xShadow contract to notify pending rebases /// @param amount the amount of Shadow to be notified from exit penalties function notifyRewardAmount(uint256 amount) external; /// @notice the address of the xShadow token (staking/voting token) /// @return _xShadow the address function xShadow() external view returns (address _xShadow); /// @notice address of the voter contract /// @return _voter the voter contract address function voter() external view returns (address _voter); /// @notice returns the total voting power (equal to total supply in the VoteModule) /// @return _totalSupply the total voting power function totalSupply() external view returns (uint256 _totalSupply); /// @notice last time the rewards system was updated function lastUpdateTime() external view returns (uint256 _lastUpdateTime); /// @notice rewards per xShadow /// @return _rewardPerToken the amount of rewards per xShadow function rewardPerTokenStored() external view returns (uint256 _rewardPerToken); /// @notice when the 1800 seconds after notifying are up function periodFinish() external view returns (uint256 _periodFinish); /// @notice calculates the rewards per second /// @return _rewardRate the rewards distributed per second function rewardRate() external view returns (uint256 _rewardRate); /// @notice voting power /// @param user the address to check /// @return amount the staked balance function balanceOf(address user) external view returns (uint256 amount); /// @notice rewards per amount of xShadow's staked function userRewardPerTokenStored( address user ) external view returns (uint256 rewardPerToken); /// @notice the amount of rewards claimable for the user /// @param user the address of the user to check /// @return rewards the stored rewards function storedRewardsPerUser( address user ) external view returns (uint256 rewards); /// @notice delegate voting perms to another address /// @param delegatee who you delegate to /// @dev set address(0) to revoke function delegate(address delegatee) external; /// @notice give admin permissions to a another address /// @param operator the address to give administrative perms to /// @dev set address(0) to revoke function setAdmin(address operator) external; function cooldownExempt(address) external view returns (bool); function setCooldownExemption(address, bool) external; function setNewDuration(uint) external; function setNewCooldown(uint) external; }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.24; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {IVoter} from "./IVoter.sol"; interface IXShadow is IERC20 { struct VestPosition { /// @dev amount of xShadow uint256 amount; /// @dev start unix timestamp uint256 start; /// @dev start + MAX_VEST (end timestamp) uint256 maxEnd; /// @dev vest identifier (starting from 0) uint256 vestID; } error NOT_WHITELISTED(address); error NOT_MINTER(); error ZERO(); error NO_VEST(); error ALREADY_EXEMPT(); error NOT_EXEMPT(); error CANT_RESCUE(); error NO_CHANGE(); error ARRAY_LENGTHS(); error TOO_HIGH(); error VEST_OVERLAP(); event CancelVesting( address indexed user, uint256 indexed vestId, uint256 amount ); event ExitVesting( address indexed user, uint256 indexed vestId, uint256 amount ); event InstantExit(address indexed user, uint256); event NewSlashingPenalty(uint256 penalty); event NewVest( address indexed user, uint256 indexed vestId, uint256 indexed amount ); event NewVestingTimes(uint256 min, uint256 max); event Converted(address indexed user, uint256); event Exemption(address indexed candidate, bool status, bool success); event XShadowRedeemed(address indexed user, uint256); event NewOperator(address indexed o, address indexed n); event Rebase(address indexed caller, uint256 amount); /// @notice returns info on a user's vests function vestInfo( address user, uint256 ) external view returns (uint256 amount, uint256 start, uint256 maxEnd, uint256 vestID); /// @notice address of the emissionsToken function SHADOW() external view returns (IERC20); /// @notice address of the voter function VOTER() external view returns (IVoter); function MINTER() external view returns (address); function ACCESS_HUB() external view returns (address); /// @notice address of the operator function operator() external view returns (address); /// @notice address of the VoteModule function VOTE_MODULE() external view returns (address); /// @notice max slashing amount function SLASHING_PENALTY() external view returns (uint256); /// @notice the minimum vesting length function MIN_VEST() external view returns (uint256); /// @notice the maximum vesting length function MAX_VEST() external view returns (uint256); function emissionsToken() external view returns (address); /// @notice the last period rebases were distributed function lastDistributedPeriod() external view returns (uint256); /// @notice amount of pvp rebase penalties accumulated pending to be distributed function pendingRebase() external view returns (uint256); /// @notice pauses the contract function pause() external; /// @notice unpauses the contract function unpause() external; /*****************************************************************/ // General use functions /*****************************************************************/ /// @dev mints xShadows for each emissionsToken. function convertEmissionsToken(uint256 _amount) external; /// @notice function called by the minter to send the rebases once a week function rebase() external; /** * @dev exit instantly with a penalty * @param _amount amount of xShadows to exit */ function exit(uint256 _amount) external; /// @dev vesting xShadows --> emissionToken functionality function createVest(uint256 _amount) external; /// @dev handles all situations regarding exiting vests function exitVest(uint256 _vestID) external; /*****************************************************************/ // Permissioned functions, timelock/operator gated /*****************************************************************/ /// @dev allows the operator to redeem collected xShadows function operatorRedeem(uint256 _amount) external; /// @dev allows rescue of any non-stake token function rescueTrappedTokens( address[] calldata _tokens, uint256[] calldata _amounts ) external; /// @notice migrates the operator to another contract function migrateOperator(address _operator) external; /// @notice set exemption status for an address function setExemption( address[] calldata _exemptee, bool[] calldata _exempt ) external; /*****************************************************************/ // Getter functions /*****************************************************************/ /// @notice returns the amount of SHADOW within the contract function getBalanceResiding() external view returns (uint256); /// @notice returns the total number of individual vests the user has function usersTotalVests( address _who ) external view returns (uint256 _numOfVests); /// @notice whether the address is exempt /// @param _who who to check /// @return _exempt whether it's exempt function isExempt(address _who) external view returns (bool _exempt); /// @notice returns the vest info for a user /// @param _who who to check /// @param _vestID vest ID to check /// @return VestPosition vest info function getVestInfo(address _who, uint256 _vestID) external view returns (VestPosition memory); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.24; interface ILauncherPlugin { error NOT_AUTHORITY(); error ALREADY_AUTHORITY(); error NOT_OPERATOR(); error ALREADY_OPERATOR(); error NOT_ENABLED(); error ENABLED(); error INVALID_TAKE(); /// @dev struct that holds the configurations of each specific pool struct LauncherConfigs { uint256 launcherTake; address takeRecipient; } event NewOperator(address indexed _old, address indexed _new); event NewAuthority(address indexed _newAuthority); event RemovedAuthority(address indexed _previousAuthority); event EnabledPool(address indexed pool, string indexed _name); event DisabledPool(address indexed pool); event MigratedPool(address indexed oldPool, address indexed newPool); event Configured( address indexed pool, uint256 take, address indexed recipient ); event Labeled(address indexed authority, string indexed label); /// @notice address of the accessHub function accessHub() external view returns (address _accessHub); /// @notice protocol operator address function operator() external view returns (address _operator); /// @notice the denominator constant function DENOM() external view returns (uint256 _denominator); /// @notice whether configs are enabled for a pool /// @param _pool address of the pool /// @return bool function launcherPluginEnabled(address _pool) external view returns (bool); /// @notice maps whether an address is an authority or not /// @param _who the address to check /// @return _is true or false function authorityMap(address _who) external view returns (bool _is); /// @notice allows migrating the parameters from one pool to the other /// @param _oldPool the current address of the pair /// @param _newPool the new pool's address function migratePool(address _oldPool, address _newPool) external; /// @notice fetch the launcher configs if any /// @param _pool address of the pool /// @return LauncherConfigs the configs function poolConfigs( address _pool ) external view returns (uint256, address); /// @notice view functionality to see who is an authority function nameOfAuthority(address) external view returns (string memory); /// @notice returns the pool address for a feeDist /// @param _feeDist address of the feeDist /// @return _pool the pool address from the mapping function feeDistToPool( address _feeDist ) external view returns (address _pool); /// @notice set launcher configurations for a pool /// @param _pool address of the pool /// @param _take the fee that goes to the designated recipient /// @param _recipient the address that receives the fees function setConfigs( address _pool, uint256 _take, address _recipient ) external; /// @notice enables the pool for LauncherConfigs /// @param _pool address of the pool function enablePool(address _pool) external; /// @notice disables the pool for LauncherConfigs /// @dev clears mappings /// @param _pool address of the pool function disablePool(address _pool) external; /// @notice sets a new operator address /// @param _newOperator new operator address function setOperator(address _newOperator) external; /// @notice gives authority to a new contract/address /// @param _newAuthority the suggested new authority function grantAuthority(address _newAuthority, string calldata) external; /// @notice removes authority from a contract/address /// @param _oldAuthority the to-be-removed authority function revokeAuthority(address _oldAuthority) external; /// @notice labels an authority function label(address, string calldata) external; /// @notice returns the values for the launcherConfig of the specific feeDist /// @param _feeDist the address of the feeDist /// @return _launcherTake fee amount taken /// @return _recipient address that receives the fees function values( address _feeDist ) external view returns (uint256 _launcherTake, address _recipient); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.26; interface IAccessHub { function timelock() external view returns (address timelock); function set( address _voter, address _minter, address _launcherPlugin, address _xShadow, address _ramsesV3PoolFactory, address _poolFactory, address _clGaugeFactory, address _gaugeFactory, address _feeRecipientFactory, address _feeDistributorFactory, address _feeCollector, address _voteModule ) external; /// @notice sets the swap fees for multiple pairs function setSwapFees( address[] calldata _pools, uint24[] calldata _swapFees, bool[] calldata _concentrated ) external; /// @notice sets the split of fees between LPs and voters function setFeeSplit( address[] calldata _pools, uint8[] calldata _feeSplits, bool[] calldata _concentrated ) external; /** Voter governance */ function setNewGovernorInVoter(address _newGovernor) external; function governanceWhitelist( address[] calldata _token, bool[] calldata _whitelisted ) external; /// @notice whitelists an address to be able to transfer xShadow function transferWhitelistInXShadow( address[] calldata _who, bool[] calldata _whitelisted ) external; /// @notice kills active gauges, removing them from earning further emissions, and claims their fees prior function killGauge(address[] calldata _pairs) external; /// @notice revives inactive/killed gauges function reviveGauge(address[] calldata _pairs) external; /// @notice sets the ratio of xShadow/Shadow awarded globally to LPs function setEmissionsRatioInVoter(uint256 _pct) external; /** Minter Functions */ /// @notice sets the inflation multiplier /// @param _multiplier the multiplier function setEmissionsMultiplierInMinter(uint256 _multiplier) external; /** Reward List Functions */ /// @notice function for adding or removing rewards for pools function augmentGaugeRewardsForPair( address[] calldata _pools, address[] calldata _rewards, bool[] calldata _addReward ) external; /// @notice function for removing rewards for feeDistributors function removeFeeDistributorRewards( address[] calldata _pools, address[] calldata _rewards ) external; /** LauncherPlugin specific functions */ /// @notice allows migrating the parameters from one pool to the other /// @param _oldPool the current address of the pair /// @param _newPool the new pool's address function migratePoolInLauncherPlugin( address _oldPool, address _newPool ) external; /// @notice set launcher configurations for a pool /// @param _pool address of the pool /// @param _take the fee that goes to the designated recipient /// @param _recipient the address that receives the fees function setConfigsInLauncherPlugin( address _pool, uint256 _take, address _recipient ) external; /// @notice enables the pool for LauncherConfigs /// @param _pool address of the pool function enablePoolInLauncherPlugin(address _pool) external; /// @notice disables the pool for LauncherConfigs /// @dev clears mappings /// @param _pool address of the pool function disablePoolInLauncherPlugin(address _pool) external; /// @notice sets a new operator address /// @param _newOperator new operator address function setOperatorInLauncherPlugin(address _newOperator) external; /// @notice gives authority to a new contract/address /// @param _newAuthority the suggested new authority function grantAuthorityInLauncherPlugin( address _newAuthority, string calldata _label ) external; /// @notice removes authority from a contract/address /// @param _oldAuthority the to-be-removed authority function revokeAuthorityInLauncherPlugin(address _oldAuthority) external; /** FeeCollector functions */ /// @notice Sets the treasury address to a new value. /// @param newTreasury The new address to set as the treasury. function setTreasuryInFeeCollector(address newTreasury) external; /// @notice Sets the value of treasury fees to a new amount. /// @param _treasuryFees The new amount of treasury fees to be set. function setTreasuryFeesInFeeCollector(uint256 _treasuryFees) external; /** FeeRecipientFactory functions */ /// @notice set the fee % to be sent to the treasury /// @param _feeToTreasury the fee % to be sent to the treasury function setFeeToTreasuryInFeeRecipientFactory( uint256 _feeToTreasury ) external; /// @notice set a new treasury address /// @param _treasury the new address function setTreasuryInFeeRecipientFactory(address _treasury) external; /** CL Pool Factory functions */ /// @notice enables a tickSpacing with the given initialFee amount /// @dev unlike UniswapV3, we map via the tickSpacing rather than the fee tier /// @dev tickSpacings may never be removed once enabled /// @param tickSpacing The spacing between ticks to be enforced for all pools created /// @param initialFee The initial fee amount, denominated in hundredths of a bip (i.e. 1e-6) function enableTickSpacing(int24 tickSpacing, uint24 initialFee) external; /// @notice sets the address of the voter in the v3 factory for gauge fee setting function setVoterAddressInFactoryV3(address _voter) external; /** VoteModule Functions*/ /// @notice sets addresses as exempt or removes their exemption function setCooldownExemption( address[] calldata _candidates, bool[] calldata _exempt ) external; /// @notice function to alter the duration that rebases are streamed in the voteModule function setNewRebaseStreamingDuration(uint256 _newDuration) external; /// @notice function to change the cooldown in the voteModule function setNewVoteModuleCooldown(uint256 _newCooldown) external; /** Timelock gated functions */ /// @notice timelock gated payload execution in case tokens get stuck or other unexpected behaviors function execute(address _target, bytes calldata _payload) external; /// @notice timelock gated function to change the timelock function setNewTimelock(address _timelock) external; /// @notice function for initializing the voter contract with its dependencies function initializeVoter( address _emissionsToken, address _legacyFactory, address _gauges, address _feeDistributorFactory, address _minter, address _msig, address _xShadow, address _clFactory, address _clGaugeFactory, address _nfpManager, address _feeRecipientFactory, address _voteModule, address _launcherPlugin ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (access/extensions/IAccessControlEnumerable.sol) pragma solidity ^0.8.20; import {IAccessControl} from "../IAccessControl.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC-165 detection. */ interface IAccessControlEnumerable is IAccessControl { /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) external view returns (address); /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol) pragma solidity ^0.8.20; import {IAccessControl} from "./IAccessControl.sol"; import {Context} from "../utils/Context.sol"; import {ERC165} from "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ```solidity * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ```solidity * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules} * to enforce additional security measures for this role. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address account => bool) hasRole; bytes32 adminRole; } mapping(bytes32 role => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with an {AccessControlUnauthorizedAccount} error including the required role. */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual returns (bool) { return _roles[role].hasRole[account]; } /** * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()` * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier. */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account` * is missing `role`. */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert AccessControlUnauthorizedAccount(account, role); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `callerConfirmation`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address callerConfirmation) public virtual { if (callerConfirmation != _msgSender()) { revert AccessControlBadConfirmation(); } _revokeRole(role, callerConfirmation); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual returns (bool) { if (!hasRole(role, account)) { _roles[role].hasRole[account] = true; emit RoleGranted(role, account, _msgSender()); return true; } else { return false; } } /** * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual returns (bool) { if (hasRole(role, account)) { _roles[role].hasRole[account] = false; emit RoleRevoked(role, account, _msgSender()); return true; } else { return false; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/EnumerableSet.sol) // This file was procedurally generated from scripts/generate/templates/EnumerableSet.js. pragma solidity ^0.8.20; /** * @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 is the index of the value in the `values` array plus 1. // Position 0 is used to mean a value is not in the set. mapping(bytes32 value => uint256) _positions; } /** * @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._positions[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 cache the value's position to prevent multiple reads from the same storage slot uint256 position = set._positions[value]; if (position != 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 valueIndex = position - 1; uint256 lastIndex = set._values.length - 1; if (valueIndex != lastIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the lastValue to the index where the value to delete is set._values[valueIndex] = lastValue; // Update the tracked position of the lastValue (that was just moved) set._positions[lastValue] = position; } // Delete the slot where the moved value was stored set._values.pop(); // Delete the tracked position for the deleted slot delete set._positions[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._positions[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; assembly ("memory-safe") { 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; assembly ("memory-safe") { 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; assembly ("memory-safe") { result := store } return result; } }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Pool state that never changes /// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values interface IRamsesV3PoolImmutables { /// @notice The contract that deployed the pool, which must adhere to the IRamsesV3Factory interface /// @return The contract address function factory() external view returns (address); /// @notice The first of the two tokens of the pool, sorted by address /// @return The token contract address function token0() external view returns (address); /// @notice The second of the two tokens of the pool, sorted by address /// @return The token contract address function token1() external view returns (address); /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6 /// @return The fee function fee() external view returns (uint24); /// @notice The pool tick spacing /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ... /// This value is an int24 to avoid casting even though it is always positive. /// @return The tick spacing function tickSpacing() external view returns (int24); /// @notice The maximum amount of position liquidity that can use any tick in the range /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool /// @return The max amount of liquidity per tick function maxLiquidityPerTick() external view returns (uint128); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Pool state that can change /// @notice These methods compose the pool's state, and can change with any frequency including multiple times /// per transaction interface IRamsesV3PoolState { /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas /// when accessed externally. /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value /// @return tick The current tick of the pool, i.e. according to the last tick transition that was run. /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick /// boundary. /// @return observationIndex The index of the last oracle observation that was written, /// @return observationCardinality The current maximum number of observations stored in the pool, /// @return observationCardinalityNext The next maximum number of observations, to be updated when the observation. /// @return feeProtocol The protocol fee for both tokens of the pool. /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0 /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee. /// unlocked Whether the pool is currently locked to reentrancy function slot0() external view returns ( uint160 sqrtPriceX96, int24 tick, uint16 observationIndex, uint16 observationCardinality, uint16 observationCardinalityNext, uint8 feeProtocol, bool unlocked ); /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool /// @dev This value can overflow the uint256 function feeGrowthGlobal0X128() external view returns (uint256); /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool /// @dev This value can overflow the uint256 function feeGrowthGlobal1X128() external view returns (uint256); /// @notice The amounts of token0 and token1 that are owed to the protocol /// @dev Protocol fees will never exceed uint128 max in either token function protocolFees() external view returns (uint128 token0, uint128 token1); /// @notice The currently in range liquidity available to the pool /// @dev This value has no relationship to the total liquidity across all ticks /// @return The liquidity at the current price of the pool function liquidity() external view returns (uint128); /// @notice Look up information about a specific tick in the pool /// @param tick The tick to look up /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or /// tick upper /// @return liquidityNet how much liquidity changes when the pool price crosses the tick, /// @return feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0, /// @return feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1, /// @return tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick /// @return secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick, /// @return secondsOutside the seconds spent on the other side of the tick from the current tick, /// @return initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false. /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0. /// In addition, these values are only relative and must be used only in comparison to previous snapshots for /// a specific position. function ticks( int24 tick ) external view returns ( uint128 liquidityGross, int128 liquidityNet, uint256 feeGrowthOutside0X128, uint256 feeGrowthOutside1X128, int56 tickCumulativeOutside, uint160 secondsPerLiquidityOutsideX128, uint32 secondsOutside, bool initialized ); /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information function tickBitmap(int16 wordPosition) external view returns (uint256); /// @notice Returns the information about a position by the position's key /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper /// @return liquidity The amount of liquidity in the position, /// @return feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke, /// @return feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke, /// @return tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke, /// @return tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke function positions( bytes32 key ) external view returns ( uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1 ); /// @notice Returns data about a specific observation index /// @param index The element of the observations array to fetch /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time /// ago, rather than at a specific index in the array. /// @return blockTimestamp The timestamp of the observation, /// @return tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp, /// @return secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp, /// @return initialized whether the observation has been initialized and the values are safe to use function observations( uint256 index ) external view returns ( uint32 blockTimestamp, int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128, bool initialized ); /// @notice get the period seconds in range of a specific position /// @param period the period number /// @param owner owner address /// @param index position index /// @param tickLower lower bound of range /// @param tickUpper upper bound of range /// @return periodSecondsInsideX96 seconds the position was not in range for the period function positionPeriodSecondsInRange( uint256 period, address owner, uint256 index, int24 tickLower, int24 tickUpper ) external view returns (uint256 periodSecondsInsideX96); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Pool state that is not stored /// @notice Contains view functions to provide information about the pool that is computed rather than stored on the /// blockchain. The functions here may have variable gas costs. interface IRamsesV3PoolDerivedState { /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick, /// you must call it with secondsAgos = [3600, 0]. /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio. /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block /// timestamp function observe( uint32[] calldata secondsAgos ) external view returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s); /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed. /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first /// snapshot is taken and the second snapshot is taken. /// @param tickLower The lower tick of the range /// @param tickUpper The upper tick of the range /// @return tickCumulativeInside The snapshot of the tick accumulator for the range /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range /// @return secondsInside The snapshot of seconds per liquidity for the range function snapshotCumulativesInside( int24 tickLower, int24 tickUpper ) external view returns (int56 tickCumulativeInside, uint160 secondsPerLiquidityInsideX128, uint32 secondsInside); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Permissionless pool actions /// @notice Contains pool methods that can be called by anyone interface IRamsesV3PoolActions { /// @notice Sets the initial price for the pool /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96 function initialize(uint160 sqrtPriceX96) external; /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends /// on tickLower, tickUpper, the amount of liquidity, and the current price. /// @param recipient The address for which the liquidity will be created /// @param index The index for which the liquidity will be created /// @param tickLower The lower tick of the position in which to add liquidity /// @param tickUpper The upper tick of the position in which to add liquidity /// @param amount The amount of liquidity to mint /// @param data Any data that should be passed through to the callback /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback function mint( address recipient, uint256 index, int24 tickLower, int24 tickUpper, uint128 amount, bytes calldata data ) external returns (uint256 amount0, uint256 amount1); /// @notice Collects tokens owed to a position /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity. /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity. /// @param recipient The address which should receive the fees collected /// @param index The index of the position to be collected /// @param tickLower The lower tick of the position for which to collect fees /// @param tickUpper The upper tick of the position for which to collect fees /// @param amount0Requested How much token0 should be withdrawn from the fees owed /// @param amount1Requested How much token1 should be withdrawn from the fees owed /// @return amount0 The amount of fees collected in token0 /// @return amount1 The amount of fees collected in token1 function collect( address recipient, uint256 index, int24 tickLower, int24 tickUpper, uint128 amount0Requested, uint128 amount1Requested ) external returns (uint128 amount0, uint128 amount1); /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0 /// @dev Fees must be collected separately via a call to #collect /// @param index The index for which the liquidity will be burned /// @param tickLower The lower tick of the position for which to burn liquidity /// @param tickUpper The upper tick of the position for which to burn liquidity /// @param amount How much liquidity to burn /// @return amount0 The amount of token0 sent to the recipient /// @return amount1 The amount of token1 sent to the recipient function burn( uint256 index, int24 tickLower, int24 tickUpper, uint128 amount ) external returns (uint256 amount0, uint256 amount1); /// @notice Swap token0 for token1, or token1 for token0 /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback /// @param recipient The address to receive the output of the swap /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0 /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative) /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this /// value after the swap. If one for zero, the price cannot be greater than this value after the swap /// @param data Any data to be passed through to the callback /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive function swap( address recipient, bool zeroForOne, int256 amountSpecified, uint160 sqrtPriceLimitX96, bytes calldata data ) external returns (int256 amount0, int256 amount1); /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling /// with 0 amount{0,1} and sending the donation amount(s) from the callback /// @param recipient The address which will receive the token0 and token1 amounts /// @param amount0 The amount of token0 to send /// @param amount1 The amount of token1 to send /// @param data Any data to be passed through to the callback function flash( address recipient, uint256 amount0, uint256 amount1, bytes calldata data ) external; /// @notice Increase the maximum number of price and liquidity observations that this pool will store /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to /// the input observationCardinalityNext. /// @param observationCardinalityNext The desired minimum number of observations for the pool to store function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external; }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Permissioned pool actions /// @notice Contains pool methods that may only be called by the factory owner interface IRamsesV3PoolOwnerActions { /// @notice Set the denominator of the protocol's % share of the fees function setFeeProtocol() external; /// @notice Collect the protocol fee accrued to the pool /// @param recipient The address to which collected protocol fees should be sent /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1 /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0 /// @return amount0 The protocol fee collected in token0 /// @return amount1 The protocol fee collected in token1 function collectProtocol( address recipient, uint128 amount0Requested, uint128 amount1Requested ) external returns (uint128 amount0, uint128 amount1); function setFee(uint24 _fee) external; }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Errors emitted by a pool /// @notice Contains all events emitted by the pool interface IRamsesV3PoolErrors { error LOK(); error TLU(); error TLM(); error TUM(); error AI(); error M0(); error M1(); error AS(); error IIA(); error L(); error F0(); error F1(); error SPL(); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Events emitted by a pool /// @notice Contains all events emitted by the pool interface IRamsesV3PoolEvents { /// @notice Emitted exactly once by a pool when #initialize is first called on the pool /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96 /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool event Initialize(uint160 sqrtPriceX96, int24 tick); /// @notice Emitted when liquidity is minted for a given position /// @param sender The address that minted the liquidity /// @param owner The owner of the position and recipient of any minted liquidity /// @param tickLower The lower tick of the position /// @param tickUpper The upper tick of the position /// @param amount The amount of liquidity minted to the position range /// @param amount0 How much token0 was required for the minted liquidity /// @param amount1 How much token1 was required for the minted liquidity event Mint( address sender, address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1 ); /// @notice Emitted when fees are collected by the owner of a position /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees /// @param owner The owner of the position for which fees are collected /// @param tickLower The lower tick of the position /// @param tickUpper The upper tick of the position /// @param amount0 The amount of token0 fees collected /// @param amount1 The amount of token1 fees collected event Collect( address indexed owner, address recipient, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount0, uint128 amount1 ); /// @notice Emitted when a position's liquidity is removed /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect /// @param owner The owner of the position for which liquidity is removed /// @param tickLower The lower tick of the position /// @param tickUpper The upper tick of the position /// @param amount The amount of liquidity to remove /// @param amount0 The amount of token0 withdrawn /// @param amount1 The amount of token1 withdrawn event Burn( address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1 ); /// @notice Emitted by the pool for any swaps between token0 and token1 /// @param sender The address that initiated the swap call, and that received the callback /// @param recipient The address that received the output of the swap /// @param amount0 The delta of the token0 balance of the pool /// @param amount1 The delta of the token1 balance of the pool /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96 /// @param liquidity The liquidity of the pool after the swap /// @param tick The log base 1.0001 of price of the pool after the swap event Swap( address indexed sender, address indexed recipient, int256 amount0, int256 amount1, uint160 sqrtPriceX96, uint128 liquidity, int24 tick ); /// @notice Emitted by the pool for any flashes of token0/token1 /// @param sender The address that initiated the swap call, and that received the callback /// @param recipient The address that received the tokens from flash /// @param amount0 The amount of token0 that was flashed /// @param amount1 The amount of token1 that was flashed /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee event Flash( address indexed sender, address indexed recipient, uint256 amount0, uint256 amount1, uint256 paid0, uint256 paid1 ); /// @notice Emitted by the pool for increases to the number of observations that can be stored /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index /// just before a mint/swap/burn. /// @param observationCardinalityNextOld The previous value of the next observation cardinality /// @param observationCardinalityNextNew The updated value of the next observation cardinality event IncreaseObservationCardinalityNext( uint16 observationCardinalityNextOld, uint16 observationCardinalityNextNew ); /// @notice Emitted when the protocol fee is changed by the pool /// @param feeProtocol0Old The previous value of the token0 protocol fee /// @param feeProtocol1Old The previous value of the token1 protocol fee /// @param feeProtocol0New The updated value of the token0 protocol fee /// @param feeProtocol1New The updated value of the token1 protocol fee event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New); /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner /// @param sender The address that collects the protocol fees /// @param recipient The address that receives the collected protocol fees /// @param amount0 The amount of token0 protocol fees that is withdrawn /// @param amount0 The amount of token1 protocol fees that is withdrawn event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC-20 standard as defined in the ERC. */ 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 value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` 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 value) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (access/IAccessControl.sol) pragma solidity ^0.8.20; /** * @dev External interface of AccessControl declared to support ERC-165 detection. */ interface IAccessControl { /** * @dev The `account` is missing a role. */ error AccessControlUnauthorizedAccount(address account, bytes32 neededRole); /** * @dev The caller of a function is not the expected one. * * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}. */ error AccessControlBadConfirmation(); /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call. This account bears the admin role (for the granted role). * Expected in cases where the role was granted using the internal {AccessControl-_grantRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `callerConfirmation`. */ function renounceRole(bytes32 role, address callerConfirmation) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @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; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC-165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[ERC]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
{ "remappings": [ "@openzeppelin-contracts-upgradeable-5.1.0/=dependencies/@openzeppelin-contracts-upgradeable-5.1.0/", "@openzeppelin/contracts/=dependencies/@openzeppelin-contracts-5.1.0/", "forge-std/=dependencies/forge-std-1.9.4/src/", "permit2/=lib/permit2/", "@openzeppelin-3.4.2/=node_modules/@openzeppelin-3.4.2/", "@openzeppelin-contracts-5.1.0/=dependencies/@openzeppelin-contracts-5.1.0/", "@uniswap/=node_modules/@uniswap/", "base64-sol/=node_modules/base64-sol/", "eth-gas-reporter/=node_modules/eth-gas-reporter/", "forge-std-1.9.4/=dependencies/forge-std-1.9.4/src/", "hardhat/=node_modules/hardhat/", "solmate/=node_modules/solmate/" ], "optimizer": { "enabled": true, "runs": 200000 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "cancun", "viaIR": true, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_timelock","type":"address"},{"internalType":"address","name":"_treasury","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[],"name":"LENGTH_MISMATCH","type":"error"},{"inputs":[],"name":"MANUAL_EXECUTION_FAILURE","type":"error"},{"inputs":[{"internalType":"address","name":"caller","type":"address"}],"name":"NOT_AUTHORIZED","type":"error"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"NOT_TIMELOCK","type":"error"},{"inputs":[],"name":"SAME_ADDRESS","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PROTOCOL_OPERATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SWAP_FEE_SETTER","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_pools","type":"address[]"},{"internalType":"address[]","name":"_rewards","type":"address[]"},{"internalType":"bool[]","name":"_addReward","type":"bool[]"}],"name":"augmentGaugeRewardsForPair","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"clGaugeFactory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_pool","type":"address"}],"name":"disablePoolInLauncherPlugin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_pool","type":"address"}],"name":"enablePoolInLauncherPlugin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"int24","name":"tickSpacing","type":"int24"},{"internalType":"uint24","name":"initialFee","type":"uint24"}],"name":"enableTickSpacing","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_target","type":"address"},{"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"execute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeCollector","outputs":[{"internalType":"contract IFeeCollector","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeDistributorFactory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeRecipientFactory","outputs":[{"internalType":"contract IFeeRecipientFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gaugeFactory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMembers","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_token","type":"address[]"},{"internalType":"bool[]","name":"_whitelisted","type":"bool[]"}],"name":"governanceWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newAuthority","type":"address"},{"internalType":"string","name":"_label","type":"string"}],"name":"grantAuthorityInLauncherPlugin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_emissionsToken","type":"address"},{"internalType":"address","name":"_legacyFactory","type":"address"},{"internalType":"address","name":"_gauges","type":"address"},{"internalType":"address","name":"_feeDistributorFactory","type":"address"},{"internalType":"address","name":"_minter","type":"address"},{"internalType":"address","name":"_msig","type":"address"},{"internalType":"address","name":"_xShadow","type":"address"},{"internalType":"address","name":"_clFactory","type":"address"},{"internalType":"address","name":"_clGaugeFactory","type":"address"},{"internalType":"address","name":"_nfpManager","type":"address"},{"internalType":"address","name":"_feeRecipientFactory","type":"address"},{"internalType":"address","name":"_voteModule","type":"address"},{"internalType":"address","name":"_launcherPlugin","type":"address"}],"name":"initializeVoter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_pairs","type":"address[]"}],"name":"killGauge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"launcherPlugin","outputs":[{"internalType":"contract ILauncherPlugin","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_oldPool","type":"address"},{"internalType":"address","name":"_newPool","type":"address"}],"name":"migratePoolInLauncherPlugin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minter","outputs":[{"internalType":"contract IMinter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolFactory","outputs":[{"internalType":"contract IPairFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ramsesV3PoolFactory","outputs":[{"internalType":"contract IRamsesV3Factory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_pools","type":"address[]"},{"internalType":"address[]","name":"_rewards","type":"address[]"}],"name":"removeFeeDistributorRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_pairs","type":"address[]"}],"name":"reviveGauge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_oldAuthority","type":"address"}],"name":"revokeAuthorityInLauncherPlugin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_voter","type":"address"},{"internalType":"address","name":"_minter","type":"address"},{"internalType":"address","name":"_launcherPlugin","type":"address"},{"internalType":"address","name":"_xShadow","type":"address"},{"internalType":"address","name":"_ramsesV3PoolFactory","type":"address"},{"internalType":"address","name":"_poolFactory","type":"address"},{"internalType":"address","name":"_clGaugeFactory","type":"address"},{"internalType":"address","name":"_gaugeFactory","type":"address"},{"internalType":"address","name":"_feeRecipientFactory","type":"address"},{"internalType":"address","name":"_feeDistributorFactory","type":"address"},{"internalType":"address","name":"_feeCollector","type":"address"},{"internalType":"address","name":"_voteModule","type":"address"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_pool","type":"address"},{"internalType":"uint256","name":"_take","type":"uint256"},{"internalType":"address","name":"_recipient","type":"address"}],"name":"setConfigsInLauncherPlugin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_candidates","type":"address[]"},{"internalType":"bool[]","name":"_exempt","type":"bool[]"}],"name":"setCooldownExemption","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_multiplier","type":"uint256"}],"name":"setEmissionsMultiplierInMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pct","type":"uint256"}],"name":"setEmissionsRatioInVoter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_pools","type":"address[]"},{"internalType":"uint8[]","name":"_feeSplits","type":"uint8[]"},{"internalType":"bool[]","name":"_concentrated","type":"bool[]"}],"name":"setFeeSplit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_feeToTreasury","type":"uint256"}],"name":"setFeeToTreasuryInFeeRecipientFactory","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newGovernor","type":"address"}],"name":"setNewGovernorInVoter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newDuration","type":"uint256"}],"name":"setNewRebaseStreamingDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_timelock","type":"address"}],"name":"setNewTimelock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newCooldown","type":"uint256"}],"name":"setNewVoteModuleCooldown","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOperator","type":"address"}],"name":"setOperatorInLauncherPlugin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_pools","type":"address[]"},{"internalType":"uint24[]","name":"_swapFees","type":"uint24[]"},{"internalType":"bool[]","name":"_concentrated","type":"bool[]"}],"name":"setSwapFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_treasuryFees","type":"uint256"}],"name":"setTreasuryFeesInFeeCollector","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newTreasury","type":"address"}],"name":"setTreasuryInFeeCollector","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"setTreasuryInFeeRecipientFactory","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_voter","type":"address"}],"name":"setVoterAddressInFactoryV3","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"timelock","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_who","type":"address[]"},{"internalType":"bool[]","name":"_whitelisted","type":"bool[]"}],"name":"transferWhitelistInXShadow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"voteModule","outputs":[{"internalType":"contract IVoteModule","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"voter","outputs":[{"internalType":"contract IVoter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"xShadow","outputs":[{"internalType":"contract IXShadow","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Deployed Bytecode
0x6080806040526004361015610012575f80fd5b5f905f3560e01c90816301ffc9a7146135205750806302be9a901461342f57806307546172146133dd57806307a8d4ef1461314a57806309651f7d14612f665780630d52333c14612f145780631635880614612e585780631cff79cd14612d55578063248a9ca314612d045780632a59c80614612c655780632eb6479514612baa5780632f2ff15d14612b4e57806336568abe14612ac55780633abdbf2a14612a0c5780633eadd56e1461296d5780633f3108f71461291b5780634219dc40146128c95780634256f5e714612877578063429fa214146126945780634339efbd1461218f57806346c96aac1461213d57806349fe8228146120815780634b9880c114611fc657806352e0970f14611f0a57806361d027b314611eb857806369e0bc0514611cd557806378b1a8c714611c7c5780637bebe38114611c2a57806380a1ebbb14611b2757806382169aec1461196957806385caf28b146119175780638cb422f0146118be5780639010d07c1461184e57806390bcc5a21461152357806391742be0146113a157806391d148541461132c57806393208a2b146112da5780639647d141146112885780639987e757146111cc578063a217fddf14611192578063a3246ad3146110b7578063a71504ad14611018578063ab0e019214610f5c578063ac33ef8514610f0a578063ba01351014610e6b578063be02ec3814610bcb578063c1463c1514610af6578063c415b95c14610aa4578063ca15c87314610a5c578063ca1699e8146107b1578063d32af6c11461075f578063d33219b41461070d578063d547741f146106a8578063dbb466df146105d8578063e6dca2b21461051c578063e95245fd14610460578063eee0fdb4146103975763f7553c521461029c575f80fd5b3461038557806102ab3661387b565b91906102b5613b6b565b73ffffffffffffffffffffffffffffffffffffffff60075416803b156103935773ffffffffffffffffffffffffffffffffffffffff85606481957fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f896040519a8b998a9889967f2cd21e00000000000000000000000000000000000000000000000000000000008852166004870152604060248701528160448701528686013785858286010152011681010301925af18015610388576103745750f35b8161037e916139c0565b6103855780f35b80fd5b6040513d84823e3d90fd5b8480fd5b50346103855760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261038557806004358060020b80910361045d576024359062ffffff821680920361045b576103ef613b6b565b73ffffffffffffffffffffffffffffffffffffffff6009541691823b1561045957604484928360405195869485937feee0fdb4000000000000000000000000000000000000000000000000000000008552600485015260248401525af18015610388576103745750f35b505b505b50fd5b50346103855760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610385578061049961360f565b6104a1613b6b565b73ffffffffffffffffffffffffffffffffffffffff6007541690813b1561045b5773ffffffffffffffffffffffffffffffffffffffff602484928360405195869485937fb3ab15fb0000000000000000000000000000000000000000000000000000000085521660048401525af18015610388576103745750f35b50346103855760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610385578061055561360f565b61055d613b6b565b73ffffffffffffffffffffffffffffffffffffffff6007541690813b1561045b5773ffffffffffffffffffffffffffffffffffffffff602484928360405195869485937fdcaaa61b0000000000000000000000000000000000000000000000000000000085521660048401525af18015610388576103745750f35b50346103855760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610385578061061161360f565b610619613632565b90610622613b6b565b73ffffffffffffffffffffffffffffffffffffffff6007541691823b15610459576040517f772b7e9700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9283166004820152911660248201529082908290604490829084905af18015610388576103745750f35b50346103855760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610385576107096004356106e6613632565b906107046106ff825f525f602052600160405f20015490565b613bf3565b613c9e565b5080f35b503461038557807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261038557602073ffffffffffffffffffffffffffffffffffffffff60035416604051908152f35b503461038557807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261038557602073ffffffffffffffffffffffffffffffffffffffff600b5416604051908152f35b5034610385576107c0366137e8565b919093946107cc613b6b565b81861480610a53575b15610a2b579086939291845b8781106107ec578580f35b73ffffffffffffffffffffffffffffffffffffffff60055416610818610813838b86613a2e565b613a78565b9073ffffffffffffffffffffffffffffffffffffffff604051927f2045be90000000000000000000000000000000000000000000000000000000008452166004830152602082602481845afa918215610a205788926109f0575b5061088661088184888c613a2e565b613a6b565b15610955575073ffffffffffffffffffffffffffffffffffffffff60055416906108b461081384878a613a2e565b823b15610951576040517fd36f072800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9283166004820152911660248201529087908290604490829084905af190811561094657879161092d575b50506001905b016107e1565b81610937916139c0565b61094257855f610921565b8580fd5b6040513d89823e3d90fd5b8880fd5b9061096461081384878a613a2e565b823b15610951576040517fffc0a01e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9283166004820152911660248201529087908290604490829084905af19081156109465787916109db575b5050600190610927565b816109e5916139c0565b61094257855f6109d1565b610a1291925060203d8111610a19575b610a0a81836139c0565b810190613ab7565b905f610872565b503d610a00565b6040513d8a823e3d90fd5b6004877f899ef10d000000000000000000000000000000000000000000000000000000008152fd5b508282146107d5565b50346103855760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103855760406020916004358152600183522054604051908152f35b503461038557807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261038557602073ffffffffffffffffffffffffffffffffffffffff600c5416604051908152f35b50346103855760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103855780610b2f61360f565b610b37613655565b90610b40613b6b565b73ffffffffffffffffffffffffffffffffffffffff6007541690813b1561045957606473ffffffffffffffffffffffffffffffffffffffff918580948460405197889687957fd309dbc600000000000000000000000000000000000000000000000000000000875216600486015260243560248601521660448401525af18015610388576103745750f35b50346103855760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610385578060043567ffffffffffffffff811161045d57610c1c9036906004016137b7565b9190610c26613b6b565b815b838110610c33578280f35b610c41610813828685613a2e565b73ffffffffffffffffffffffffffffffffffffffff80600c5416911690803b15610393578480916024604051809481937f2a54db010000000000000000000000000000000000000000000000000000000083528760048401525af1908115610e22578591610e56575b505073ffffffffffffffffffffffffffffffffffffffff600554166040517f2045be90000000000000000000000000000000000000000000000000000000008152826004820152602081602481855afa908115610e4b578691610e2d575b50813b156109425773ffffffffffffffffffffffffffffffffffffffff602487928360405195869485937f992a79330000000000000000000000000000000000000000000000000000000085521660048401525af1908115610e22578591610e09575b505073ffffffffffffffffffffffffffffffffffffffff6009541690813b156103935784916044839260405194859384927f76734e3e0000000000000000000000000000000000000000000000000000000084526004840152600560248401525af1908115610dfe578491610de5575b5050600101610c28565b81610def916139c0565b610dfa57825f610ddb565b8280fd5b6040513d86823e3d90fd5b81610e13916139c0565b610e1e57835f610d6b565b8380fd5b6040513d87823e3d90fd5b610e45915060203d8111610a1957610a0a81836139c0565b5f610d08565b6040513d88823e3d90fd5b81610e60916139c0565b610e1e57835f610caa565b50346103855760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261038557610ea3613b6b565b8073ffffffffffffffffffffffffffffffffffffffff60055416803b1561045d578180916024604051809481937f0f14763200000000000000000000000000000000000000000000000000000000835260043560048401525af18015610388576103745750f35b503461038557807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261038557602073ffffffffffffffffffffffffffffffffffffffff60095416604051908152f35b50346103855760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103855780610f9561360f565b610f9d613b6b565b73ffffffffffffffffffffffffffffffffffffffff600b541690813b1561045b5773ffffffffffffffffffffffffffffffffffffffff602484928360405195869485937ff0f442600000000000000000000000000000000000000000000000000000000085521660048401525af18015610388576103745750f35b50346103855760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261038557611050613b6b565b8073ffffffffffffffffffffffffffffffffffffffff600b5416803b1561045d578180916024604051809481937f019494b300000000000000000000000000000000000000000000000000000000835260043560048401525af18015610388576103745750f35b50346103855760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610385576004358152600160205260408120604051908160208254918281520190819285526020852090855b81811061117c57505050826111259103836139c0565b604051928392602084019060208552518091526040840192915b81811061114d575050500390f35b825173ffffffffffffffffffffffffffffffffffffffff1684528594506020938401939092019160010161113f565b825484526020909301926001928301920161110f565b503461038557807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261038557602090604051908152f35b50346103855760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610385578061120561360f565b61120d613b6b565b73ffffffffffffffffffffffffffffffffffffffff6007541690813b1561045b5773ffffffffffffffffffffffffffffffffffffffff602484928360405195869485937f595aeb500000000000000000000000000000000000000000000000000000000085521660048401525af18015610388576103745750f35b503461038557807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261038557602073ffffffffffffffffffffffffffffffffffffffff60105416604051908152f35b503461038557807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261038557602073ffffffffffffffffffffffffffffffffffffffff60075416604051908152f35b50346103855760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103855773ffffffffffffffffffffffffffffffffffffffff604061137b613632565b926004358152806020522091165f52602052602060ff60405f2054166040519015158152f35b5034610385576113b03661390a565b6113bb949394613b6b565b8083036114fb5773ffffffffffffffffffffffffffffffffffffffff6008541694853b156103935792604051937f94126bb10000000000000000000000000000000000000000000000000000000085528160448601604060048801525260648501909186905b8082106114a95750508481037ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc01602486015282815260200192918591505b80821061148357505050818394818581819503925af18015610388576103745750f35b90919283358015158091036114a5578152602090810193019160010190611460565b8680fd5b909183359073ffffffffffffffffffffffffffffffffffffffff821682036114f75773ffffffffffffffffffffffffffffffffffffffff919091168152602093840193019160010190611421565b5f80fd5b6004847f899ef10d000000000000000000000000000000000000000000000000000000008152fd5b50346103855760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103855760043567ffffffffffffffff811161180c576115739036906004016137b7565b9061157c613b6b565b825b828110611589578380f35b83611598610813838686613a2e565b73ffffffffffffffffffffffffffffffffffffffff600c541673ffffffffffffffffffffffffffffffffffffffff821690803b15610e1e578380916024604051809481937f2a54db010000000000000000000000000000000000000000000000000000000083528760048401525af1908115610dfe578491611839575b505073ffffffffffffffffffffffffffffffffffffffff6005541690604051907f2045be900000000000000000000000000000000000000000000000000000000082526004820152602081602481855afa908115610dfe57849161181b575b50813b15610e1e5773ffffffffffffffffffffffffffffffffffffffff602485928360405195869485937f9f06247b0000000000000000000000000000000000000000000000000000000085521660048401525af19081156118105783916117f7575b505073ffffffffffffffffffffffffffffffffffffffff60095416906040517f527eb4bc000000000000000000000000000000000000000000000000000000008152602081600481865afa908115610dfe5784916117bc575b50823b15610e1e576040517f76734e3e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff92909216600483015260ff1660248201529082908290604490829084905af18015610388576117a7575b505060010161157e565b816117b1916139c0565b610e1e57835f61179d565b90506020813d82116117ef575b816117d6602093836139c0565b81010312610e1e575160ff81168103610e1e575f611730565b3d91506117c9565b81611801916139c0565b61180c57815f6116d7565b5080fd5b6040513d85823e3d90fd5b611833915060203d8111610a1957610a0a81836139c0565b5f611674565b81611843916139c0565b610dfa57825f611615565b50346103855760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103855773ffffffffffffffffffffffffffffffffffffffff6118ae60209260043581526001845260406024359120614168565b90549060031b1c16604051908152f35b503461038557807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103855760206040517f0cee480c05aeabaa18fb824cd297ccabddb1b1a9a83b28d3f07e85c0cd25c4598152f35b503461038557807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261038557602073ffffffffffffffffffffffffffffffffffffffff600d5416604051908152f35b5034610385576119783661390a565b909291611983613b6b565b818103611aff57908491825b81811061199a578380f35b6119a8610881828589613a2e565b15611a575773ffffffffffffffffffffffffffffffffffffffff600554166119d4610813838589613a2e565b813b156109425773ffffffffffffffffffffffffffffffffffffffff602487928360405195869485937f9b19251a0000000000000000000000000000000000000000000000000000000085521660048401525af1908115610e22578591611a42575b50506001905b0161198f565b81611a4c916139c0565b610e1e57835f611a36565b73ffffffffffffffffffffffffffffffffffffffff60055416611a7e610813838589613a2e565b813b156109425773ffffffffffffffffffffffffffffffffffffffff602487928360405195869485937f9c7f33150000000000000000000000000000000000000000000000000000000085521660048401525af1908115610e22578591611aea575b5050600190611a3c565b81611af4916139c0565b610e1e57835f611ae0565b6004857f899ef10d000000000000000000000000000000000000000000000000000000008152fd5b50346103855780611b373661390a565b9391611b5d3373ffffffffffffffffffffffffffffffffffffffff600354163314613976565b825b818110611b6a578380f35b73ffffffffffffffffffffffffffffffffffffffff600d5416611b91610813838589613a2e565b90611ba0610881848a88613a2e565b91813b156114a557604473ffffffffffffffffffffffffffffffffffffffff9188809460405196879586947fc717374a000000000000000000000000000000000000000000000000000000008652166004850152151560248401525af1908115610e22578591611c15575b5050600101611b5f565b81611c1f916139c0565b610e1e57835f611c0b565b503461038557807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261038557602073ffffffffffffffffffffffffffffffffffffffff600e5416604051908152f35b503461038557807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103855760206040517fb3072e349cf62590698516830b9ea81d68c974027ccbf3c77e3d2a88743208e58152f35b503461038557611ce43661390a565b611cf093919293613b6b565b808403611aff57908491825b858110611d07578380f35b73ffffffffffffffffffffffffffffffffffffffff60055416611d2e610813838987613a2e565b73ffffffffffffffffffffffffffffffffffffffff604051917f2045be90000000000000000000000000000000000000000000000000000000008352166004820152602081602481855afa908115610e4b578691611e9a575b5073ffffffffffffffffffffffffffffffffffffffff604051917ff55858b0000000000000000000000000000000000000000000000000000000008352166004820152602081602481855afa908115610e4b578691611e7c575b50611df061081384868a613a2e565b823b156114a5576040517f234823d700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9283166004820152911660248201529085908290604490829084905af1908115610e22578591611e67575b5050600101611cfc565b81611e71916139c0565b610e1e57835f611e5d565b611e94915060203d8111610a1957610a0a81836139c0565b5f611de1565b611eb2915060203d8111610a1957610a0a81836139c0565b5f611d87565b503461038557807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261038557602073ffffffffffffffffffffffffffffffffffffffff60045416604051908152f35b50346103855760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103855780611f4361360f565b611f4b613b6b565b73ffffffffffffffffffffffffffffffffffffffff600c541690813b1561045b5773ffffffffffffffffffffffffffffffffffffffff602484928360405195869485937ff0f442600000000000000000000000000000000000000000000000000000000085521660048401525af18015610388576103745750f35b50346103855760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103855761201a3373ffffffffffffffffffffffffffffffffffffffff600354163314613976565b8073ffffffffffffffffffffffffffffffffffffffff600d5416803b1561045d578180916024604051809481937ff8f1c1ea00000000000000000000000000000000000000000000000000000000835260043560048401525af18015610388576103745750f35b50346103855760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261038557806120ba61360f565b6120c2613b6b565b73ffffffffffffffffffffffffffffffffffffffff6005541690813b1561045b5773ffffffffffffffffffffffffffffffffffffffff602484928360405195869485937fc42cf5350000000000000000000000000000000000000000000000000000000085521660048401525af18015610388576103745750f35b503461038557807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261038557602073ffffffffffffffffffffffffffffffffffffffff60055416604051908152f35b5034610385576101807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610385576121c861360f565b906121d1613632565b6121d9613655565b906121e2613678565b936121eb61369b565b916121f46136be565b956121fd6136e1565b96612206613704565b9461220f613727565b9261221861374b565b9761222161376f565b9561222a613793565b9760025473ffffffffffffffffffffffffffffffffffffffff81168015801590612673575b1561266f573314801561264e575b801561262d575b15612601579673ffffffffffffffffffffffffffffffffffffffff8e9781809e9d9b959881809e9981809e9a81809e81809e9c7fffffffffffffffffffffffff0000000000000000000000000000000000000000829e16600255167fffffffffffffffffffffffff00000000000000000000000000000000000000006005541617600555167fffffffffffffffffffffffff00000000000000000000000000000000000000006006541617600655167fffffffffffffffffffffffff00000000000000000000000000000000000000006007541617600755167fffffffffffffffffffffffff00000000000000000000000000000000000000006008541617600855167fffffffffffffffffffffffff00000000000000000000000000000000000000006009541617600955167fffffffffffffffffffffffff0000000000000000000000000000000000000000600a541617600a55167fffffffffffffffffffffffff0000000000000000000000000000000000000000600b541617600b55167fffffffffffffffffffffffff0000000000000000000000000000000000000000600c541617600c55167fffffffffffffffffffffffff0000000000000000000000000000000000000000600d541617600d55167fffffffffffffffffffffffff0000000000000000000000000000000000000000600e541617600e55167fffffffffffffffffffffffff0000000000000000000000000000000000000000600f541617600f55167fffffffffffffffffffffffff0000000000000000000000000000000000000000601054161760105573ffffffffffffffffffffffffffffffffffffffff600454166124d881613cdf565b6125c5575b5073ffffffffffffffffffffffffffffffffffffffff6004541661250081613de8565b612589575b5073ffffffffffffffffffffffffffffffffffffffff6004541661252881613eec565b61256d575b5073ffffffffffffffffffffffffffffffffffffffff6003541661255081613eec565b612558575080f35b6107099082805260016020526040832061417d565b6125829082805260016020526040832061417d565b508161252d565b6125be907fb3072e349cf62590698516830b9ea81d68c974027ccbf3c77e3d2a88743208e5835260016020526040832061417d565b5081612505565b6125fa907f0cee480c05aeabaa18fb824cd297ccabddb1b1a9a83b28d3f07e85c0cd25c459835260016020526040832061417d565b50816124dd565b60248d7f2bc10c3300000000000000000000000000000000000000000000000000000000815233600452fd5b5073ffffffffffffffffffffffffffffffffffffffff600354163314612264565b5073ffffffffffffffffffffffffffffffffffffffff60045416331461225d565b8d80fd5b5073ffffffffffffffffffffffffffffffffffffffff60035416331461224f565b5034610385576126a3366137e8565b91909492936126b0613ae3565b8181148061286e575b15610a2b579086939291845b8181106126d0578580f35b6126de61088182868b613a2e565b156127ad5773ffffffffffffffffffffffffffffffffffffffff6009541661270a610813838589613a2e565b61271d61271884878c613a2e565b613aa9565b823b15610951576040517f76734e3e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff92909216600483015260ff1660248201529087908290604490829084905af1908115610946578791612798575b50506001905b016126c5565b816127a2916139c0565b61094257855f61278c565b73ffffffffffffffffffffffffffffffffffffffff600a54166127d4610813838589613a2e565b906127e361271884878c613a2e565b91813b1561095157604473ffffffffffffffffffffffffffffffffffffffff918a809460ff60405197889687957f407c301e0000000000000000000000000000000000000000000000000000000087521660048601521660248401525af1908115610946578791612859575b5050600190612792565b81612863916139c0565b61094257855f61284f565b508282146126b9565b503461038557807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261038557602073ffffffffffffffffffffffffffffffffffffffff60085416604051908152f35b503461038557807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261038557602073ffffffffffffffffffffffffffffffffffffffff600a5416604051908152f35b503461038557807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261038557602073ffffffffffffffffffffffffffffffffffffffff60025416604051908152f35b50346103855760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610385576129a5613b6b565b8073ffffffffffffffffffffffffffffffffffffffff60065416803b1561045d578180916024604051809481937fd47ffef100000000000000000000000000000000000000000000000000000000835260043560048401525af18015610388576103745750f35b50346103855760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261038557612a4461360f565b60035473ffffffffffffffffffffffffffffffffffffffff80821692612a6c33853314613976565b16809214612a9d577fffffffffffffffffffffffff0000000000000000000000000000000000000000161760035580f35b6004837fcb105135000000000000000000000000000000000000000000000000000000008152fd5b50346103855760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261038557612afd613632565b3373ffffffffffffffffffffffffffffffffffffffff821603612b265761070990600435613c9e565b6004827f6697b232000000000000000000000000000000000000000000000000000000008152fd5b50346103855760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261038557610709600435612b8c613632565b90612ba56106ff825f525f602052600160405f20015490565b613c59565b50346103855760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261038557612bfe3373ffffffffffffffffffffffffffffffffffffffff600354163314613976565b8073ffffffffffffffffffffffffffffffffffffffff600d5416803b1561045d578180916024604051809481937fd8e2d8f300000000000000000000000000000000000000000000000000000000835260043560048401525af18015610388576103745750f35b50346103855760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261038557612c9d613b6b565b8073ffffffffffffffffffffffffffffffffffffffff600c5416803b1561045d578180916024604051809481937fd8e0d20c00000000000000000000000000000000000000000000000000000000835260043560048401525af18015610388576103745750f35b50346103855760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610385576020612d4d6004355f525f602052600160405f20015490565b604051908152f35b503461038557808080612d673661387b565b919290612d8e3373ffffffffffffffffffffffffffffffffffffffff600354163314613976565b826040519384928337810182815203925af13d15612e53573d67ffffffffffffffff8111612e265760405190612dec60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601836139c0565b81528260203d92013e5b15612dfe5780f35b807ff8b39d500000000000000000000000000000000000000000000000000000000060049252fd5b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526041600452fd5b612df6565b50346103855760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103855780612e9161360f565b612e99613b6b565b73ffffffffffffffffffffffffffffffffffffffff6007541690813b1561045b5773ffffffffffffffffffffffffffffffffffffffff602484928360405195869485937f2aeb8f220000000000000000000000000000000000000000000000000000000085521660048401525af18015610388576103745750f35b503461038557807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261038557602073ffffffffffffffffffffffffffffffffffffffff600f5416604051908152f35b503461038557612f75366137e8565b91909493612f81613ae3565b81811480613141575b15610a2b579086939291845b818110612fa1578580f35b612faf61088182868b613a2e565b1561307e5773ffffffffffffffffffffffffffffffffffffffff60095416612fdb61081383858b613a2e565b90612fef612fea84878a613a2e565b613a99565b91813b1561095157604473ffffffffffffffffffffffffffffffffffffffff918a809462ffffff60405197889687957fba364c3d0000000000000000000000000000000000000000000000000000000087521660048601521660248401525af1908115610946578791613069575b50506001905b01612f96565b81613073916139c0565b61094257855f61305d565b73ffffffffffffffffffffffffffffffffffffffff600a54166130a561081383858b613a2e565b906130b4612fea84878a613a2e565b91813b1561095157604473ffffffffffffffffffffffffffffffffffffffff918a809462ffffff60405197889687957fa93a897d0000000000000000000000000000000000000000000000000000000087521660048601521660248401525af190811561094657879161312c575b5050600190613063565b81613136916139c0565b61094257855f613122565b50828214612f8a565b5034610385576101a07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610385578061318461360f565b61318c613632565b613194613655565b9061319d613678565b6131a561369b565b6131ad6136be565b6131b56136e1565b6131bd613704565b6131c5613727565b6131cd61374b565b916131d661376f565b936131df613793565b95610184359773ffffffffffffffffffffffffffffffffffffffff891680990361266f576132273373ffffffffffffffffffffffffffffffffffffffff600354163314613976565b73ffffffffffffffffffffffffffffffffffffffff60055416998a3b156133d9578e9c6040519e8f9d8e917f2fdd983d00000000000000000000000000000000000000000000000000000000835273ffffffffffffffffffffffffffffffffffffffff16600483015273ffffffffffffffffffffffffffffffffffffffff16906024015273ffffffffffffffffffffffffffffffffffffffff1660448d015273ffffffffffffffffffffffffffffffffffffffff1660648c015273ffffffffffffffffffffffffffffffffffffffff1660848b015273ffffffffffffffffffffffffffffffffffffffff1660a48a015273ffffffffffffffffffffffffffffffffffffffff1660c489015273ffffffffffffffffffffffffffffffffffffffff1660e488015273ffffffffffffffffffffffffffffffffffffffff1661010487015273ffffffffffffffffffffffffffffffffffffffff1661012486015273ffffffffffffffffffffffffffffffffffffffff1661014485015273ffffffffffffffffffffffffffffffffffffffff1661016484015261018483015281835a926101a493f18015610388576103745750f35b8e80fd5b503461038557807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261038557602073ffffffffffffffffffffffffffffffffffffffff60065416604051908152f35b50346114f75760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126114f75761346761360f565b61348b3373ffffffffffffffffffffffffffffffffffffffff600354163314613976565b73ffffffffffffffffffffffffffffffffffffffff6009541690813b156114f75773ffffffffffffffffffffffffffffffffffffffff60245f928360405195869485937f4bc2a6570000000000000000000000000000000000000000000000000000000085521660048401525af1801561351557613507575080f35b61351391505f906139c0565b005b6040513d5f823e3d90fd5b346114f75760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126114f757600435907fffffffff0000000000000000000000000000000000000000000000000000000082168092036114f757817f5a05180f00000000000000000000000000000000000000000000000000000000602093149081156135b2575b5015158152f35b7f7965db0b000000000000000000000000000000000000000000000000000000008114915081156135e5575b50836135ab565b7f01ffc9a700000000000000000000000000000000000000000000000000000000915014836135de565b6004359073ffffffffffffffffffffffffffffffffffffffff821682036114f757565b6024359073ffffffffffffffffffffffffffffffffffffffff821682036114f757565b6044359073ffffffffffffffffffffffffffffffffffffffff821682036114f757565b6064359073ffffffffffffffffffffffffffffffffffffffff821682036114f757565b6084359073ffffffffffffffffffffffffffffffffffffffff821682036114f757565b60a4359073ffffffffffffffffffffffffffffffffffffffff821682036114f757565b60c4359073ffffffffffffffffffffffffffffffffffffffff821682036114f757565b60e4359073ffffffffffffffffffffffffffffffffffffffff821682036114f757565b610104359073ffffffffffffffffffffffffffffffffffffffff821682036114f757565b610124359073ffffffffffffffffffffffffffffffffffffffff821682036114f757565b610144359073ffffffffffffffffffffffffffffffffffffffff821682036114f757565b610164359073ffffffffffffffffffffffffffffffffffffffff821682036114f757565b9181601f840112156114f75782359167ffffffffffffffff83116114f7576020808501948460051b0101116114f757565b60607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8201126114f75760043567ffffffffffffffff81116114f75781613831916004016137b7565b9290929160243567ffffffffffffffff81116114f75781613854916004016137b7565b929092916044359067ffffffffffffffff82116114f757613877916004016137b7565b9091565b60407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8201126114f75760043573ffffffffffffffffffffffffffffffffffffffff811681036114f7579160243567ffffffffffffffff81116114f75760040182601f820112156114f75780359267ffffffffffffffff84116114f757602084818401930101116114f7579190565b60407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8201126114f75760043567ffffffffffffffff81116114f75781613953916004016137b7565b929092916024359067ffffffffffffffff82116114f757613877916004016137b7565b1561397e5750565b73ffffffffffffffffffffffffffffffffffffffff907fc483b14a000000000000000000000000000000000000000000000000000000005f521660045260245ffd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff821117613a0157604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b9190811015613a3e5760051b0190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b3580151581036114f75790565b3573ffffffffffffffffffffffffffffffffffffffff811681036114f75790565b3562ffffff811681036114f75790565b3560ff811681036114f75790565b908160209103126114f7575173ffffffffffffffffffffffffffffffffffffffff811681036114f75790565b335f9081527f15dbb209f83f1c435625f527e9d46d7392c6ba0fa0679f623124e47ec762f1d9602052604090205460ff1615613b1b57565b7fe2517d3f000000000000000000000000000000000000000000000000000000005f52336004527f0cee480c05aeabaa18fb824cd297ccabddb1b1a9a83b28d3f07e85c0cd25c45960245260445ffd5b335f9081527f6af94e2096bd5b8c4290a89b6490024a124f136817bf56898a556ae1ce6c413f602052604090205460ff1615613ba357565b7fe2517d3f000000000000000000000000000000000000000000000000000000005f52336004527fb3072e349cf62590698516830b9ea81d68c974027ccbf3c77e3d2a88743208e560245260445ffd5b805f525f60205260405f2073ffffffffffffffffffffffffffffffffffffffff33165f5260205260ff60405f20541615613c2a5750565b7fe2517d3f000000000000000000000000000000000000000000000000000000005f523360045260245260445ffd5b613c638282613fce565b9182613c6e57505090565b613c9a915f52600160205273ffffffffffffffffffffffffffffffffffffffff60405f2091169061417d565b5090565b613ca882826140a0565b9182613cb357505090565b613c9a915f52600160205273ffffffffffffffffffffffffffffffffffffffff60405f2091169061420b565b73ffffffffffffffffffffffffffffffffffffffff81165f9081527f15dbb209f83f1c435625f527e9d46d7392c6ba0fa0679f623124e47ec762f1d9602052604090205460ff16613de35773ffffffffffffffffffffffffffffffffffffffff165f8181527f15dbb209f83f1c435625f527e9d46d7392c6ba0fa0679f623124e47ec762f1d96020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790553391907f0cee480c05aeabaa18fb824cd297ccabddb1b1a9a83b28d3f07e85c0cd25c459907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b505f90565b73ffffffffffffffffffffffffffffffffffffffff81165f9081527f6af94e2096bd5b8c4290a89b6490024a124f136817bf56898a556ae1ce6c413f602052604090205460ff16613de35773ffffffffffffffffffffffffffffffffffffffff165f8181527f6af94e2096bd5b8c4290a89b6490024a124f136817bf56898a556ae1ce6c413f6020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790553391907fb3072e349cf62590698516830b9ea81d68c974027ccbf3c77e3d2a88743208e5907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b73ffffffffffffffffffffffffffffffffffffffff81165f9081527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5602052604090205460ff16613de35773ffffffffffffffffffffffffffffffffffffffff165f8181527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb56020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790553391907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8180a4600190565b805f525f60205260405f2073ffffffffffffffffffffffffffffffffffffffff83165f5260205260ff60405f205416155f1461409a57805f525f60205260405f2073ffffffffffffffffffffffffffffffffffffffff83165f5260205260405f2060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541617905573ffffffffffffffffffffffffffffffffffffffff339216907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d5f80a4600190565b50505f90565b805f525f60205260405f2073ffffffffffffffffffffffffffffffffffffffff83165f5260205260ff60405f2054165f1461409a57805f525f60205260405f2073ffffffffffffffffffffffffffffffffffffffff83165f5260205260405f207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00815416905573ffffffffffffffffffffffffffffffffffffffff339216907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b5f80a4600190565b8054821015613a3e575f5260205f2001905f90565b6001810190825f528160205260405f2054155f1461420457805468010000000000000000811015613a01576141f16141bc826001879401855584614168565b81939154907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9060031b92831b921b19161790565b905554915f5260205260405f2055600190565b5050505f90565b906001820191815f528260205260405f20548015155f14614389577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810181811161435c578254907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820191821161435c57818103614327575b505050805480156142fa577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01906142bd8282614168565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82549160031b1b19169055555f526020525f6040812055600190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603160045260245ffd5b6143476143376141bc9386614168565b90549060031b1c92839286614168565b90555f528360205260405f20555f8080614285565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b505050505f9056fea2646970667358221220cc8ffc19d7f9bd642784c90008354f5afe78f06e6003bf2d6a52d93c09a65c2264736f6c634300081c0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.