Feature Tip: Add private address tag to any address under My Name Tag !
Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
veBALDeploymentCoordinator
Compiler Version
v0.7.1+commit.f4a555be
Optimization Enabled:
Yes with 9999 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity ^0.7.0;
import "@balancer-labs/v2-solidity-utils/contracts/openzeppelin/ReentrancyGuard.sol";
import "@balancer-labs/v2-vault/contracts/interfaces/IVault.sol";
import "@balancer-labs/v2-liquidity-mining/contracts/interfaces/IAuthorizerAdaptor.sol";
import "@balancer-labs/v2-liquidity-mining/contracts/interfaces/IGaugeAdder.sol";
import "@balancer-labs/v2-liquidity-mining/contracts/interfaces/IGaugeController.sol";
import "@balancer-labs/v2-liquidity-mining/contracts/interfaces/IBalancerMinter.sol";
import "@balancer-labs/v2-liquidity-mining/contracts/interfaces/IBalancerTokenAdmin.sol";
import "@balancer-labs/v2-liquidity-mining/contracts/interfaces/ILiquidityGaugeFactory.sol";
import "@balancer-labs/v2-standalone-utils/contracts/interfaces/IBALTokenHolderFactory.sol";
// solhint-disable not-rely-on-time
/**
* @dev The currently deployed Authorizer has a different interface relative to the Authorizer in the monorepo
* for granting/revoking roles(referred to as permissions in the new Authorizer) and so we require a one-off interface
*/
interface ICurrentAuthorizer is IAuthorizer {
// solhint-disable-next-line func-name-mixedcase
function DEFAULT_ADMIN_ROLE() external view returns (bytes32);
function grantRole(bytes32 role, address account) external;
function revokeRole(bytes32 role, address account) external;
}
// https://vote.balancer.fi/#/proposal/0x9fe19c491cf90ed2e3ed9c15761c43d39fd1fb732a940aba8058ff69787ee90a
// solhint-disable-next-line contract-name-camelcase
contract veBALDeploymentCoordinator is ReentrancyGuard {
IBalancerTokenAdmin private immutable _balancerTokenAdmin;
IVault private immutable _vault;
IAuthorizerAdaptor private immutable _authorizerAdaptor;
IBalancerToken private immutable _balancerToken;
IBalancerMinter private immutable _balancerMinter;
IGaugeController private immutable _gaugeController;
IGaugeAdder private immutable _gaugeAdder;
ILiquidityGaugeFactory private immutable _ethereumGaugeFactory;
ILiquidityGaugeFactory private immutable _singleRecipientGaugeFactory;
IBALTokenHolderFactory private immutable _balTokenHolderFactory;
address public lmCommitteeMultisig = 0xc38c5f97B34E175FFd35407fc91a937300E33860;
// All of veBAL, Polygon and Arbitrum funds are temporarily sent to multisigs which will take care of distribution
// until an automated system is setup.
address public veBALGaugeRecipient = 0xd2EB7Bd802A7CA68d9AcD209bEc4E664A9abDD7b;
address public polygonGaugeRecipient = 0xd2EB7Bd802A7CA68d9AcD209bEc4E664A9abDD7b;
address public arbitrumGaugeRecipient = 0xd2EB7Bd802A7CA68d9AcD209bEc4E664A9abDD7b;
enum DeploymentStage { PENDING, FIRST_STAGE_DONE, SECOND_STAGE_DONE, THIRD_STAGE_DONE }
uint256 public firstStageActivationTime;
uint256 public secondStageActivationTime;
uint256 public thirdStageActivationTime;
DeploymentStage private _currentDeploymentStage;
uint256 private immutable _activationScheduledTime;
uint256 private immutable _thirdStageDelay;
uint256 public constant LM_COMMITTEE_WEIGHT = 10e16; // 10%
uint256 public constant VEBAL_WEIGHT = 10e16; // 10%
uint256 public constant ETHEREUM_WEIGHT = 56e16; // 56%
uint256 public constant POLYGON_WEIGHT = 17e16; // 17%
uint256 public constant ARBITRUM_WEIGHT = 7e16; // 7%
constructor(
IBalancerMinter balancerMinter,
IAuthorizerAdaptor authorizerAdaptor,
IGaugeAdder gaugeAdder,
ILiquidityGaugeFactory ethereumGaugeFactory,
ILiquidityGaugeFactory singleRecipientGaugeFactory,
IBALTokenHolderFactory balTokenHolderFactory,
uint256 activationScheduledTime,
uint256 thirdStageDelay
) {
_currentDeploymentStage = DeploymentStage.PENDING;
IBalancerTokenAdmin balancerTokenAdmin = balancerMinter.getBalancerTokenAdmin();
_balancerTokenAdmin = balancerTokenAdmin;
_vault = balancerTokenAdmin.getVault();
_authorizerAdaptor = authorizerAdaptor;
_balancerToken = balancerTokenAdmin.getBalancerToken();
_balancerMinter = balancerMinter;
_gaugeController = IGaugeController(balancerMinter.getGaugeController());
_gaugeAdder = gaugeAdder;
_ethereumGaugeFactory = ethereumGaugeFactory;
_singleRecipientGaugeFactory = singleRecipientGaugeFactory;
_balTokenHolderFactory = balTokenHolderFactory;
_activationScheduledTime = activationScheduledTime;
_thirdStageDelay = thirdStageDelay;
}
/**
* @notice Returns the Balancer Vault.
*/
function getVault() public view returns (IVault) {
return _vault;
}
/**
* @notice Returns the Balancer Vault's current authorizer.
*/
function getAuthorizer() public view returns (ICurrentAuthorizer) {
return ICurrentAuthorizer(address(getVault().getAuthorizer()));
}
function getAuthorizerAdaptor() public view returns (IAuthorizerAdaptor) {
return _authorizerAdaptor;
}
function getBalancerTokenAdmin() external view returns (IBalancerTokenAdmin) {
return _balancerTokenAdmin;
}
function getBalancerMinter() external view returns (IBalancerMinter) {
return _balancerMinter;
}
/**
* @notice Returns the address of the Gauge Controller
*/
function getGaugeController() external view returns (IGaugeController) {
return _gaugeController;
}
function getCurrentDeploymentStage() external view returns (DeploymentStage) {
return _currentDeploymentStage;
}
function getActivationScheduledTime() external view returns (uint256) {
return _activationScheduledTime;
}
function getThirdStageDelay() external view returns (uint256) {
return _thirdStageDelay;
}
function performFirstStage() external nonReentrant {
// Check internal state
require(block.timestamp >= _activationScheduledTime, "Not ready for activation");
require(_currentDeploymentStage == DeploymentStage.PENDING, "First step already performed");
// Check external state: we need admin permission on both the BAL token and the Authorizer
ICurrentAuthorizer authorizer = getAuthorizer();
require(_balancerToken.hasRole(_balancerToken.DEFAULT_ADMIN_ROLE(), address(this)), "Not BAL admin");
require(authorizer.canPerform(bytes32(0), address(this), address(0)), "Not Authorizer admin");
// Also require that Balancer governance holds all relevant admin rights
IAuthorizerAdaptor authorizerAdaptor = getAuthorizerAdaptor();
require(
_gaugeController.voting_escrow().admin() == authorizerAdaptor,
"VotingEscrow not owned by AuthorizerAdaptor"
);
require(_gaugeController.admin() == authorizerAdaptor, "GaugeController not owned by AuthorizerAdaptor");
// Sanity checks
require(_gaugeController.n_gauge_types() == 0, "Gauge types already set");
// Step 1: trigger BAL token admin migration, locking the BAL emissions forever.
//
// The BalancerTokenAdmin contracts needs admin permission over BAL in order to complete this process, and we
// need to be authorized to make the call.
_balancerToken.grantRole(_balancerToken.DEFAULT_ADMIN_ROLE(), address(_balancerTokenAdmin));
authorizer.grantRole(_balancerTokenAdmin.getActionId(IBalancerTokenAdmin.activate.selector), address(this));
_balancerTokenAdmin.activate();
// Balancer Token Admin activation automatically removes authority over the BAL token from all other accounts,
// so we don't need to renounce this permission.
// Step 2: grant BalancerMinter authority to mint BAL, as part of the Liquidity Mining program.
authorizer.grantRole(
_balancerTokenAdmin.getActionId(IBalancerTokenAdmin.mint.selector),
address(_balancerMinter)
);
// Step 3: setup the Liquidity Mining program by creating the different gauge types on the Gauge Controller.
//
// All gauge types are initially created with a weight of 0, which will allow for gauges to be deployed and LPs
// to vote and stake for them, without yet minting any BAL. This is intended to provide a grace period for LPs
// to migrate to the new system before it is fully activated. The gauge type weights will be set to their actual
// values on the last stage of deployment.
{
// Note that the current Authorizer ignores the 'where' parameter, so we don't need to (cannot) indicate
// that this permission should only be granted on the gauge controller itself.
authorizer.grantRole(authorizerAdaptor.getActionId(IGaugeController.add_type.selector), address(this));
_addGaugeType("Liquidity Mining Committee");
_addGaugeType("veBAL");
_addGaugeType("Ethereum");
_addGaugeType("Polygon");
_addGaugeType("Arbitrum");
authorizer.revokeRole(authorizerAdaptor.getActionId(IGaugeController.add_type.selector), address(this));
}
// Step 4: setup the GaugeAdder contract to be in charge of adding gauges to the Gauge Controller.
//
// The GaugeAdder contract performs checks on addresses being added to the Gauge Controller to ensure
// that they have been deployed by a factory contract which has been associated with the gauge type
// to which the proposed gauge is being added. This is intended to prevent common mistakes when adding gauges.
authorizer.grantRole(authorizerAdaptor.getActionId(IGaugeController.add_gauge.selector), address(_gaugeAdder));
// Step 5: create gauges for the single-recipient gauge types
//
// The LM committee gauge will be remain as a SingleRecipientGauge permanently,
// however the gauges for veBAL, Polygon and Arbitrum types are temporary pending an automated solution.
// These three gauges will in time be retired (killed) and replaced with new gauge implementations
// which automate the distribution of BAL to BPT stakers on other networks and veBAL holders.
{
authorizer.grantRole(authorizerAdaptor.getActionId(IGaugeController.add_gauge.selector), address(this));
// Permanent
_createSingleRecipientGauge(
IGaugeAdder.GaugeType.LiquidityMiningCommittee,
"Liquidity Mining Committee BAL Holder",
lmCommitteeMultisig
);
// Temporary
_createSingleRecipientGauge(
IGaugeAdder.GaugeType.veBAL,
"Temporary veBAL Liquidity Mining BAL Holder",
veBALGaugeRecipient
);
// Temporary
_createSingleRecipientGauge(
IGaugeAdder.GaugeType.Polygon,
"Temporary Polygon Liquidity Mining BAL Holder",
polygonGaugeRecipient
);
// Temporary
_createSingleRecipientGauge(
IGaugeAdder.GaugeType.Arbitrum,
"Temporary Arbitrum Liquidity Mining BAL Holder",
arbitrumGaugeRecipient
);
authorizer.revokeRole(authorizerAdaptor.getActionId(IGaugeController.add_gauge.selector), address(this));
}
// Step 6: grant permission to the LM Committee to add reward tokens to Ethereum gauges and manage their
// distributors
authorizer.grantRole(
authorizerAdaptor.getActionId(IStakingLiquidityGauge.add_reward.selector),
lmCommitteeMultisig
);
authorizer.grantRole(
authorizerAdaptor.getActionId(IStakingLiquidityGauge.set_reward_distributor.selector),
lmCommitteeMultisig
);
firstStageActivationTime = block.timestamp;
_currentDeploymentStage = DeploymentStage.FIRST_STAGE_DONE;
}
function performSecondStage() external nonReentrant {
require(_currentDeploymentStage == DeploymentStage.FIRST_STAGE_DONE, "Not ready for second stage");
ICurrentAuthorizer authorizer = getAuthorizer();
// Create gauges for a preselected list of pools on Ethereum. This is not included in the first stage to reduce
// total required gas for the execution of each stage.
address payable[32] memory initialPools = [
0x06Df3b2bbB68adc8B0e302443692037ED9f91b42,
0x072f14B85ADd63488DDaD88f855Fda4A99d6aC9B,
0x0b09deA16768f0799065C475bE02919503cB2a35,
0x186084fF790C65088BA694Df11758faE4943EE9E,
0x1E19CF2D73a72Ef1332C882F20534B6519Be0276,
0x27C9f71cC31464B906E0006d4FcBC8900F48f15f,
0x32296969Ef14EB0c6d29669C550D4a0449130230,
0x350196326AEAA9b98f1903fb5e8fc2686f85318C,
0x3e5FA9518eA95c3E533EB377C001702A9AaCAA32,
0x4bd6D86dEBdB9F5413e631Ad386c4427DC9D01B2,
0x51735bdFBFE3fC13dEa8DC6502E2E95898942961,
0x5d66FfF62c17D841935b60df5F07f6CF79Bd0F47,
0x5f7FA48d765053F8dD85E052843e12D23e3D7BC5,
0x702605F43471183158938C1a3e5f5A359d7b31ba,
0x7B50775383d3D6f0215A8F290f2C9e2eEBBEceb2,
0x7Edde0CB05ED19e03A9a47CD5E53fC57FDe1c80c,
0x8f4205e1604133d1875a3E771AE7e4F2b0865639,
0x90291319F1D4eA3ad4dB0Dd8fe9E12BAF749E845,
0x96646936b91d6B9D7D0c47C496AfBF3D6ec7B6f8,
0x96bA9025311e2f47B840A1f68ED57A3DF1EA8747,
0xa02E4b3d18D4E6B8d18Ac421fBc3dfFF8933c40a,
0xA6F548DF93de924d73be7D25dC02554c6bD66dB5,
0xBaeEC99c90E3420Ec6c1e7A769d2A856d2898e4D,
0xBF96189Eee9357a95C7719f4F5047F76bdE804E5,
0xe2469f47aB58cf9CF59F9822e3C5De4950a41C49,
0xE99481DC77691d8E2456E5f3F61C1810adFC1503,
0xeC60a5FeF79a92c741Cb74FdD6bfC340C0279B01,
0xEdf085f65b4F6c155e13155502Ef925c9a756003,
0xEFAa1604e82e1B3AF8430b90192c1B9e8197e377,
0xF4C0DD9B82DA36C07605df83c8a416F11724d88b,
0xf5aAf7Ee8C39B651CEBF5f1F50C10631E78e0ef9,
0xFeadd389a5c427952D8fdb8057D6C8ba1156cC56
];
// Allowlist the provided LiquidityGaugeFactory on the GaugeAdder
// so its gauges may be added to the "Ethereum" gauge type.
{
authorizer.grantRole(_gaugeAdder.getActionId(IGaugeAdder.addGaugeFactory.selector), address(this));
_gaugeAdder.addGaugeFactory(_ethereumGaugeFactory, IGaugeAdder.GaugeType.Ethereum);
authorizer.revokeRole(_gaugeAdder.getActionId(IGaugeAdder.addGaugeFactory.selector), address(this));
}
// Deploy initial gauges and add them to the Gauge Controller
{
authorizer.grantRole(_gaugeAdder.getActionId(IGaugeAdder.addEthereumGauge.selector), address(this));
uint256 poolsLength = initialPools.length;
for (uint256 i = 0; i < poolsLength; i++) {
ILiquidityGauge gauge = ILiquidityGauge(_ethereumGaugeFactory.create(initialPools[i]));
_gaugeAdder.addEthereumGauge(IStakingLiquidityGauge(address(gauge)));
}
authorizer.revokeRole(_gaugeAdder.getActionId(IGaugeAdder.addEthereumGauge.selector), address(this));
}
secondStageActivationTime = block.timestamp;
_currentDeploymentStage = DeploymentStage.SECOND_STAGE_DONE;
}
function performThirdStage() external nonReentrant {
// Check delay from second stage
require(_currentDeploymentStage == DeploymentStage.SECOND_STAGE_DONE, "Not ready for third stage");
require(
block.timestamp >= (secondStageActivationTime + _thirdStageDelay),
"Delay from second stage not yet elapsed"
);
// We can now set the actual weights for each gauge type, causing gauges to have non-zero weights once veBAL
// holders vote for them.
// Admin functions on the Gauge Controller have to be called via the the AuthorizerAdaptor, which acts as its
// admin.
IAuthorizerAdaptor authorizerAdaptor = getAuthorizerAdaptor();
// Note that the current Authorizer ignores the 'where' parameter, so we don't need to (cannot) indicate
// that this permission should only be granted on the gauge controller itself.
ICurrentAuthorizer authorizer = getAuthorizer();
authorizer.grantRole(
authorizerAdaptor.getActionId(IGaugeController.change_type_weight.selector),
address(this)
);
_setGaugeTypeWeight(IGaugeAdder.GaugeType.LiquidityMiningCommittee, LM_COMMITTEE_WEIGHT);
_setGaugeTypeWeight(IGaugeAdder.GaugeType.veBAL, VEBAL_WEIGHT);
_setGaugeTypeWeight(IGaugeAdder.GaugeType.Ethereum, ETHEREUM_WEIGHT);
_setGaugeTypeWeight(IGaugeAdder.GaugeType.Polygon, POLYGON_WEIGHT);
_setGaugeTypeWeight(IGaugeAdder.GaugeType.Arbitrum, ARBITRUM_WEIGHT);
authorizer.revokeRole(
authorizerAdaptor.getActionId(IGaugeController.change_type_weight.selector),
address(this)
);
// The entire system is now fully setup, and we can renounce permissions over the Authorizer
authorizer.revokeRole(authorizer.DEFAULT_ADMIN_ROLE(), address(this));
thirdStageActivationTime = block.timestamp;
_currentDeploymentStage = DeploymentStage.THIRD_STAGE_DONE;
}
function _addGauge(ILiquidityGauge gauge, IGaugeAdder.GaugeType gaugeType) private {
getAuthorizerAdaptor().performAction(
address(_gaugeController),
abi.encodeWithSelector(IGaugeController.add_gauge.selector, gauge, gaugeType)
);
}
function _addGaugeType(string memory name) private {
getAuthorizerAdaptor().performAction(
address(_gaugeController),
abi.encodeWithSelector(IGaugeController.add_type.selector, name, 0)
);
}
function _setGaugeTypeWeight(IGaugeAdder.GaugeType typeId, uint256 weight) private {
getAuthorizerAdaptor().performAction(
address(_gaugeController),
abi.encodeWithSelector(IGaugeController.change_type_weight.selector, int128(typeId), weight)
);
}
function _createSingleRecipientGauge(
IGaugeAdder.GaugeType gaugeType,
string memory name,
address recipient
) private {
IBALTokenHolder holder = _balTokenHolderFactory.create(name);
ILiquidityGauge gauge = ILiquidityGauge(_singleRecipientGaugeFactory.create(address(holder)));
_addGauge(gauge, gaugeType);
getAuthorizer().grantRole(holder.getActionId(IBALTokenHolder.withdrawFunds.selector), recipient);
}
}// SPDX-License-Identifier: MIT
// Based on the ReentrancyGuard library from OpenZeppelin Contracts, altered to reduce bytecode size.
// Modifier code is inlined by the compiler, which causes its code to appear multiple times in the codebase. By using
// private functions, we achieve the same end result with slightly higher runtime gas costs, but reduced bytecode size.
pragma solidity ^0.7.0;
import "../helpers/BalancerErrors.sol";
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and make it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_enterNonReentrant();
_;
_exitNonReentrant();
}
function _enterNonReentrant() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
_require(_status != _ENTERED, Errors.REENTRANCY);
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _exitNonReentrant() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma experimental ABIEncoderV2;
import "@balancer-labs/v2-solidity-utils/contracts/openzeppelin/IERC20.sol";
import "@balancer-labs/v2-solidity-utils/contracts/helpers/ISignaturesValidator.sol";
import "@balancer-labs/v2-solidity-utils/contracts/helpers/ITemporarilyPausable.sol";
import "@balancer-labs/v2-solidity-utils/contracts/misc/IWETH.sol";
import "./IAsset.sol";
import "./IAuthorizer.sol";
import "./IFlashLoanRecipient.sol";
import "./IProtocolFeesCollector.sol";
pragma solidity ^0.7.0;
/**
* @dev Full external interface for the Vault core contract - no external or public methods exist in the contract that
* don't override one of these declarations.
*/
interface IVault is ISignaturesValidator, ITemporarilyPausable {
// Generalities about the Vault:
//
// - Whenever documentation refers to 'tokens', it strictly refers to ERC20-compliant token contracts. Tokens are
// transferred out of the Vault by calling the `IERC20.transfer` function, and transferred in by calling
// `IERC20.transferFrom`. In these cases, the sender must have previously allowed the Vault to use their tokens by
// calling `IERC20.approve`. The only deviation from the ERC20 standard that is supported is functions not returning
// a boolean value: in these scenarios, a non-reverting call is assumed to be successful.
//
// - All non-view functions in the Vault are non-reentrant: calling them while another one is mid-execution (e.g.
// while execution control is transferred to a token contract during a swap) will result in a revert. View
// functions can be called in a re-reentrant way, but doing so might cause them to return inconsistent results.
// Contracts calling view functions in the Vault must make sure the Vault has not already been entered.
//
// - View functions revert if referring to either unregistered Pools, or unregistered tokens for registered Pools.
// Authorizer
//
// Some system actions are permissioned, like setting and collecting protocol fees. This permissioning system exists
// outside of the Vault in the Authorizer contract: the Vault simply calls the Authorizer to check if the caller
// can perform a given action.
/**
* @dev Returns the Vault's Authorizer.
*/
function getAuthorizer() external view returns (IAuthorizer);
/**
* @dev Sets a new Authorizer for the Vault. The caller must be allowed by the current Authorizer to do this.
*
* Emits an `AuthorizerChanged` event.
*/
function setAuthorizer(IAuthorizer newAuthorizer) external;
/**
* @dev Emitted when a new authorizer is set by `setAuthorizer`.
*/
event AuthorizerChanged(IAuthorizer indexed newAuthorizer);
// Relayers
//
// Additionally, it is possible for an account to perform certain actions on behalf of another one, using their
// Vault ERC20 allowance and Internal Balance. These accounts are said to be 'relayers' for these Vault functions,
// and are expected to be smart contracts with sound authentication mechanisms. For an account to be able to wield
// this power, two things must occur:
// - The Authorizer must grant the account the permission to be a relayer for the relevant Vault function. This
// means that Balancer governance must approve each individual contract to act as a relayer for the intended
// functions.
// - Each user must approve the relayer to act on their behalf.
// This double protection means users cannot be tricked into approving malicious relayers (because they will not
// have been allowed by the Authorizer via governance), nor can malicious relayers approved by a compromised
// Authorizer or governance drain user funds, since they would also need to be approved by each individual user.
/**
* @dev Returns true if `user` has approved `relayer` to act as a relayer for them.
*/
function hasApprovedRelayer(address user, address relayer) external view returns (bool);
/**
* @dev Allows `relayer` to act as a relayer for `sender` if `approved` is true, and disallows it otherwise.
*
* Emits a `RelayerApprovalChanged` event.
*/
function setRelayerApproval(
address sender,
address relayer,
bool approved
) external;
/**
* @dev Emitted every time a relayer is approved or disapproved by `setRelayerApproval`.
*/
event RelayerApprovalChanged(address indexed relayer, address indexed sender, bool approved);
// Internal Balance
//
// Users can deposit tokens into the Vault, where they are allocated to their Internal Balance, and later
// transferred or withdrawn. It can also be used as a source of tokens when joining Pools, as a destination
// when exiting them, and as either when performing swaps. This usage of Internal Balance results in greatly reduced
// gas costs when compared to relying on plain ERC20 transfers, leading to large savings for frequent users.
//
// Internal Balance management features batching, which means a single contract call can be used to perform multiple
// operations of different kinds, with different senders and recipients, at once.
/**
* @dev Returns `user`'s Internal Balance for a set of tokens.
*/
function getInternalBalance(address user, IERC20[] memory tokens) external view returns (uint256[] memory);
/**
* @dev Performs a set of user balance operations, which involve Internal Balance (deposit, withdraw or transfer)
* and plain ERC20 transfers using the Vault's allowance. This last feature is particularly useful for relayers, as
* it lets integrators reuse a user's Vault allowance.
*
* For each operation, if the caller is not `sender`, it must be an authorized relayer for them.
*/
function manageUserBalance(UserBalanceOp[] memory ops) external payable;
/**
* @dev Data for `manageUserBalance` operations, which include the possibility for ETH to be sent and received
without manual WETH wrapping or unwrapping.
*/
struct UserBalanceOp {
UserBalanceOpKind kind;
IAsset asset;
uint256 amount;
address sender;
address payable recipient;
}
// There are four possible operations in `manageUserBalance`:
//
// - DEPOSIT_INTERNAL
// Increases the Internal Balance of the `recipient` account by transferring tokens from the corresponding
// `sender`. The sender must have allowed the Vault to use their tokens via `IERC20.approve()`.
//
// ETH can be used by passing the ETH sentinel value as the asset and forwarding ETH in the call: it will be wrapped
// and deposited as WETH. Any ETH amount remaining will be sent back to the caller (not the sender, which is
// relevant for relayers).
//
// Emits an `InternalBalanceChanged` event.
//
//
// - WITHDRAW_INTERNAL
// Decreases the Internal Balance of the `sender` account by transferring tokens to the `recipient`.
//
// ETH can be used by passing the ETH sentinel value as the asset. This will deduct WETH instead, unwrap it and send
// it to the recipient as ETH.
//
// Emits an `InternalBalanceChanged` event.
//
//
// - TRANSFER_INTERNAL
// Transfers tokens from the Internal Balance of the `sender` account to the Internal Balance of `recipient`.
//
// Reverts if the ETH sentinel value is passed.
//
// Emits an `InternalBalanceChanged` event.
//
//
// - TRANSFER_EXTERNAL
// Transfers tokens from `sender` to `recipient`, using the Vault's ERC20 allowance. This is typically used by
// relayers, as it lets them reuse a user's Vault allowance.
//
// Reverts if the ETH sentinel value is passed.
//
// Emits an `ExternalBalanceTransfer` event.
enum UserBalanceOpKind { DEPOSIT_INTERNAL, WITHDRAW_INTERNAL, TRANSFER_INTERNAL, TRANSFER_EXTERNAL }
/**
* @dev Emitted when a user's Internal Balance changes, either from calls to `manageUserBalance`, or through
* interacting with Pools using Internal Balance.
*
* Because Internal Balance works exclusively with ERC20 tokens, ETH deposits and withdrawals will use the WETH
* address.
*/
event InternalBalanceChanged(address indexed user, IERC20 indexed token, int256 delta);
/**
* @dev Emitted when a user's Vault ERC20 allowance is used by the Vault to transfer tokens to an external account.
*/
event ExternalBalanceTransfer(IERC20 indexed token, address indexed sender, address recipient, uint256 amount);
// Pools
//
// There are three specialization settings for Pools, which allow for cheaper swaps at the cost of reduced
// functionality:
//
// - General: no specialization, suited for all Pools. IGeneralPool is used for swap request callbacks, passing the
// balance of all tokens in the Pool. These Pools have the largest swap costs (because of the extra storage reads),
// which increase with the number of registered tokens.
//
// - Minimal Swap Info: IMinimalSwapInfoPool is used instead of IGeneralPool, which saves gas by only passing the
// balance of the two tokens involved in the swap. This is suitable for some pricing algorithms, like the weighted
// constant product one popularized by Balancer V1. Swap costs are smaller compared to general Pools, and are
// independent of the number of registered tokens.
//
// - Two Token: only allows two tokens to be registered. This achieves the lowest possible swap gas cost. Like
// minimal swap info Pools, these are called via IMinimalSwapInfoPool.
enum PoolSpecialization { GENERAL, MINIMAL_SWAP_INFO, TWO_TOKEN }
/**
* @dev Registers the caller account as a Pool with a given specialization setting. Returns the Pool's ID, which
* is used in all Pool-related functions. Pools cannot be deregistered, nor can the Pool's specialization be
* changed.
*
* The caller is expected to be a smart contract that implements either `IGeneralPool` or `IMinimalSwapInfoPool`,
* depending on the chosen specialization setting. This contract is known as the Pool's contract.
*
* Note that the same contract may register itself as multiple Pools with unique Pool IDs, or in other words,
* multiple Pools may share the same contract.
*
* Emits a `PoolRegistered` event.
*/
function registerPool(PoolSpecialization specialization) external returns (bytes32);
/**
* @dev Emitted when a Pool is registered by calling `registerPool`.
*/
event PoolRegistered(bytes32 indexed poolId, address indexed poolAddress, PoolSpecialization specialization);
/**
* @dev Returns a Pool's contract address and specialization setting.
*/
function getPool(bytes32 poolId) external view returns (address, PoolSpecialization);
/**
* @dev Registers `tokens` for the `poolId` Pool. Must be called by the Pool's contract.
*
* Pools can only interact with tokens they have registered. Users join a Pool by transferring registered tokens,
* exit by receiving registered tokens, and can only swap registered tokens.
*
* Each token can only be registered once. For Pools with the Two Token specialization, `tokens` must have a length
* of two, that is, both tokens must be registered in the same `registerTokens` call, and they must be sorted in
* ascending order.
*
* The `tokens` and `assetManagers` arrays must have the same length, and each entry in these indicates the Asset
* Manager for the corresponding token. Asset Managers can manage a Pool's tokens via `managePoolBalance`,
* depositing and withdrawing them directly, and can even set their balance to arbitrary amounts. They are therefore
* expected to be highly secured smart contracts with sound design principles, and the decision to register an
* Asset Manager should not be made lightly.
*
* Pools can choose not to assign an Asset Manager to a given token by passing in the zero address. Once an Asset
* Manager is set, it cannot be changed except by deregistering the associated token and registering again with a
* different Asset Manager.
*
* Emits a `TokensRegistered` event.
*/
function registerTokens(
bytes32 poolId,
IERC20[] memory tokens,
address[] memory assetManagers
) external;
/**
* @dev Emitted when a Pool registers tokens by calling `registerTokens`.
*/
event TokensRegistered(bytes32 indexed poolId, IERC20[] tokens, address[] assetManagers);
/**
* @dev Deregisters `tokens` for the `poolId` Pool. Must be called by the Pool's contract.
*
* Only registered tokens (via `registerTokens`) can be deregistered. Additionally, they must have zero total
* balance. For Pools with the Two Token specialization, `tokens` must have a length of two, that is, both tokens
* must be deregistered in the same `deregisterTokens` call.
*
* A deregistered token can be re-registered later on, possibly with a different Asset Manager.
*
* Emits a `TokensDeregistered` event.
*/
function deregisterTokens(bytes32 poolId, IERC20[] memory tokens) external;
/**
* @dev Emitted when a Pool deregisters tokens by calling `deregisterTokens`.
*/
event TokensDeregistered(bytes32 indexed poolId, IERC20[] tokens);
/**
* @dev Returns detailed information for a Pool's registered token.
*
* `cash` is the number of tokens the Vault currently holds for the Pool. `managed` is the number of tokens
* withdrawn and held outside the Vault by the Pool's token Asset Manager. The Pool's total balance for `token`
* equals the sum of `cash` and `managed`.
*
* Internally, `cash` and `managed` are stored using 112 bits. No action can ever cause a Pool's token `cash`,
* `managed` or `total` balance to be greater than 2^112 - 1.
*
* `lastChangeBlock` is the number of the block in which `token`'s total balance was last modified (via either a
* join, exit, swap, or Asset Manager update). This value is useful to avoid so-called 'sandwich attacks', for
* example when developing price oracles. A change of zero (e.g. caused by a swap with amount zero) is considered a
* change for this purpose, and will update `lastChangeBlock`.
*
* `assetManager` is the Pool's token Asset Manager.
*/
function getPoolTokenInfo(bytes32 poolId, IERC20 token)
external
view
returns (
uint256 cash,
uint256 managed,
uint256 lastChangeBlock,
address assetManager
);
/**
* @dev Returns a Pool's registered tokens, the total balance for each, and the latest block when *any* of
* the tokens' `balances` changed.
*
* The order of the `tokens` array is the same order that will be used in `joinPool`, `exitPool`, as well as in all
* Pool hooks (where applicable). Calls to `registerTokens` and `deregisterTokens` may change this order.
*
* If a Pool only registers tokens once, and these are sorted in ascending order, they will be stored in the same
* order as passed to `registerTokens`.
*
* Total balances include both tokens held by the Vault and those withdrawn by the Pool's Asset Managers. These are
* the amounts used by joins, exits and swaps. For a detailed breakdown of token balances, use `getPoolTokenInfo`
* instead.
*/
function getPoolTokens(bytes32 poolId)
external
view
returns (
IERC20[] memory tokens,
uint256[] memory balances,
uint256 lastChangeBlock
);
/**
* @dev Called by users to join a Pool, which transfers tokens from `sender` into the Pool's balance. This will
* trigger custom Pool behavior, which will typically grant something in return to `recipient` - often tokenized
* Pool shares.
*
* If the caller is not `sender`, it must be an authorized relayer for them.
*
* The `assets` and `maxAmountsIn` arrays must have the same length, and each entry indicates the maximum amount
* to send for each asset. The amounts to send are decided by the Pool and not the Vault: it just enforces
* these maximums.
*
* If joining a Pool that holds WETH, it is possible to send ETH directly: the Vault will do the wrapping. To enable
* this mechanism, the IAsset sentinel value (the zero address) must be passed in the `assets` array instead of the
* WETH address. Note that it is not possible to combine ETH and WETH in the same join. Any excess ETH will be sent
* back to the caller (not the sender, which is important for relayers).
*
* `assets` must have the same length and order as the array returned by `getPoolTokens`. This prevents issues when
* interacting with Pools that register and deregister tokens frequently. If sending ETH however, the array must be
* sorted *before* replacing the WETH address with the ETH sentinel value (the zero address), which means the final
* `assets` array might not be sorted. Pools with no registered tokens cannot be joined.
*
* If `fromInternalBalance` is true, the caller's Internal Balance will be preferred: ERC20 transfers will only
* be made for the difference between the requested amount and Internal Balance (if any). Note that ETH cannot be
* withdrawn from Internal Balance: attempting to do so will trigger a revert.
*
* This causes the Vault to call the `IBasePool.onJoinPool` hook on the Pool's contract, where Pools implement
* their own custom logic. This typically requires additional information from the user (such as the expected number
* of Pool shares). This can be encoded in the `userData` argument, which is ignored by the Vault and passed
* directly to the Pool's contract, as is `recipient`.
*
* Emits a `PoolBalanceChanged` event.
*/
function joinPool(
bytes32 poolId,
address sender,
address recipient,
JoinPoolRequest memory request
) external payable;
struct JoinPoolRequest {
IAsset[] assets;
uint256[] maxAmountsIn;
bytes userData;
bool fromInternalBalance;
}
/**
* @dev Called by users to exit a Pool, which transfers tokens from the Pool's balance to `recipient`. This will
* trigger custom Pool behavior, which will typically ask for something in return from `sender` - often tokenized
* Pool shares. The amount of tokens that can be withdrawn is limited by the Pool's `cash` balance (see
* `getPoolTokenInfo`).
*
* If the caller is not `sender`, it must be an authorized relayer for them.
*
* The `tokens` and `minAmountsOut` arrays must have the same length, and each entry in these indicates the minimum
* token amount to receive for each token contract. The amounts to send are decided by the Pool and not the Vault:
* it just enforces these minimums.
*
* If exiting a Pool that holds WETH, it is possible to receive ETH directly: the Vault will do the unwrapping. To
* enable this mechanism, the IAsset sentinel value (the zero address) must be passed in the `assets` array instead
* of the WETH address. Note that it is not possible to combine ETH and WETH in the same exit.
*
* `assets` must have the same length and order as the array returned by `getPoolTokens`. This prevents issues when
* interacting with Pools that register and deregister tokens frequently. If receiving ETH however, the array must
* be sorted *before* replacing the WETH address with the ETH sentinel value (the zero address), which means the
* final `assets` array might not be sorted. Pools with no registered tokens cannot be exited.
*
* If `toInternalBalance` is true, the tokens will be deposited to `recipient`'s Internal Balance. Otherwise,
* an ERC20 transfer will be performed. Note that ETH cannot be deposited to Internal Balance: attempting to
* do so will trigger a revert.
*
* `minAmountsOut` is the minimum amount of tokens the user expects to get out of the Pool, for each token in the
* `tokens` array. This array must match the Pool's registered tokens.
*
* This causes the Vault to call the `IBasePool.onExitPool` hook on the Pool's contract, where Pools implement
* their own custom logic. This typically requires additional information from the user (such as the expected number
* of Pool shares to return). This can be encoded in the `userData` argument, which is ignored by the Vault and
* passed directly to the Pool's contract.
*
* Emits a `PoolBalanceChanged` event.
*/
function exitPool(
bytes32 poolId,
address sender,
address payable recipient,
ExitPoolRequest memory request
) external;
struct ExitPoolRequest {
IAsset[] assets;
uint256[] minAmountsOut;
bytes userData;
bool toInternalBalance;
}
/**
* @dev Emitted when a user joins or exits a Pool by calling `joinPool` or `exitPool`, respectively.
*/
event PoolBalanceChanged(
bytes32 indexed poolId,
address indexed liquidityProvider,
IERC20[] tokens,
int256[] deltas,
uint256[] protocolFeeAmounts
);
enum PoolBalanceChangeKind { JOIN, EXIT }
// Swaps
//
// Users can swap tokens with Pools by calling the `swap` and `batchSwap` functions. To do this,
// they need not trust Pool contracts in any way: all security checks are made by the Vault. They must however be
// aware of the Pools' pricing algorithms in order to estimate the prices Pools will quote.
//
// The `swap` function executes a single swap, while `batchSwap` can perform multiple swaps in sequence.
// In each individual swap, tokens of one kind are sent from the sender to the Pool (this is the 'token in'),
// and tokens of another kind are sent from the Pool to the recipient in exchange (this is the 'token out').
// More complex swaps, such as one token in to multiple tokens out can be achieved by batching together
// individual swaps.
//
// There are two swap kinds:
// - 'given in' swaps, where the amount of tokens in (sent to the Pool) is known, and the Pool determines (via the
// `onSwap` hook) the amount of tokens out (to send to the recipient).
// - 'given out' swaps, where the amount of tokens out (received from the Pool) is known, and the Pool determines
// (via the `onSwap` hook) the amount of tokens in (to receive from the sender).
//
// Additionally, it is possible to chain swaps using a placeholder input amount, which the Vault replaces with
// the calculated output of the previous swap. If the previous swap was 'given in', this will be the calculated
// tokenOut amount. If the previous swap was 'given out', it will use the calculated tokenIn amount. These extended
// swaps are known as 'multihop' swaps, since they 'hop' through a number of intermediate tokens before arriving at
// the final intended token.
//
// In all cases, tokens are only transferred in and out of the Vault (or withdrawn from and deposited into Internal
// Balance) after all individual swaps have been completed, and the net token balance change computed. This makes
// certain swap patterns, such as multihops, or swaps that interact with the same token pair in multiple Pools, cost
// much less gas than they would otherwise.
//
// It also means that under certain conditions it is possible to perform arbitrage by swapping with multiple
// Pools in a way that results in net token movement out of the Vault (profit), with no tokens being sent in (only
// updating the Pool's internal accounting).
//
// To protect users from front-running or the market changing rapidly, they supply a list of 'limits' for each token
// involved in the swap, where either the maximum number of tokens to send (by passing a positive value) or the
// minimum amount of tokens to receive (by passing a negative value) is specified.
//
// Additionally, a 'deadline' timestamp can also be provided, forcing the swap to fail if it occurs after
// this point in time (e.g. if the transaction failed to be included in a block promptly).
//
// If interacting with Pools that hold WETH, it is possible to both send and receive ETH directly: the Vault will do
// the wrapping and unwrapping. To enable this mechanism, the IAsset sentinel value (the zero address) must be
// passed in the `assets` array instead of the WETH address. Note that it is possible to combine ETH and WETH in the
// same swap. Any excess ETH will be sent back to the caller (not the sender, which is relevant for relayers).
//
// Finally, Internal Balance can be used when either sending or receiving tokens.
enum SwapKind { GIVEN_IN, GIVEN_OUT }
/**
* @dev Performs a swap with a single Pool.
*
* If the swap is 'given in' (the number of tokens to send to the Pool is known), it returns the amount of tokens
* taken from the Pool, which must be greater than or equal to `limit`.
*
* If the swap is 'given out' (the number of tokens to take from the Pool is known), it returns the amount of tokens
* sent to the Pool, which must be less than or equal to `limit`.
*
* Internal Balance usage and the recipient are determined by the `funds` struct.
*
* Emits a `Swap` event.
*/
function swap(
SingleSwap memory singleSwap,
FundManagement memory funds,
uint256 limit,
uint256 deadline
) external payable returns (uint256);
/**
* @dev Data for a single swap executed by `swap`. `amount` is either `amountIn` or `amountOut` depending on
* the `kind` value.
*
* `assetIn` and `assetOut` are either token addresses, or the IAsset sentinel value for ETH (the zero address).
* Note that Pools never interact with ETH directly: it will be wrapped to or unwrapped from WETH by the Vault.
*
* The `userData` field is ignored by the Vault, but forwarded to the Pool in the `onSwap` hook, and may be
* used to extend swap behavior.
*/
struct SingleSwap {
bytes32 poolId;
SwapKind kind;
IAsset assetIn;
IAsset assetOut;
uint256 amount;
bytes userData;
}
/**
* @dev Performs a series of swaps with one or multiple Pools. In each individual swap, the caller determines either
* the amount of tokens sent to or received from the Pool, depending on the `kind` value.
*
* Returns an array with the net Vault asset balance deltas. Positive amounts represent tokens (or ETH) sent to the
* Vault, and negative amounts represent tokens (or ETH) sent by the Vault. Each delta corresponds to the asset at
* the same index in the `assets` array.
*
* Swaps are executed sequentially, in the order specified by the `swaps` array. Each array element describes a
* Pool, the token to be sent to this Pool, the token to receive from it, and an amount that is either `amountIn` or
* `amountOut` depending on the swap kind.
*
* Multihop swaps can be executed by passing an `amount` value of zero for a swap. This will cause the amount in/out
* of the previous swap to be used as the amount in for the current one. In a 'given in' swap, 'tokenIn' must equal
* the previous swap's `tokenOut`. For a 'given out' swap, `tokenOut` must equal the previous swap's `tokenIn`.
*
* The `assets` array contains the addresses of all assets involved in the swaps. These are either token addresses,
* or the IAsset sentinel value for ETH (the zero address). Each entry in the `swaps` array specifies tokens in and
* out by referencing an index in `assets`. Note that Pools never interact with ETH directly: it will be wrapped to
* or unwrapped from WETH by the Vault.
*
* Internal Balance usage, sender, and recipient are determined by the `funds` struct. The `limits` array specifies
* the minimum or maximum amount of each token the vault is allowed to transfer.
*
* `batchSwap` can be used to make a single swap, like `swap` does, but doing so requires more gas than the
* equivalent `swap` call.
*
* Emits `Swap` events.
*/
function batchSwap(
SwapKind kind,
BatchSwapStep[] memory swaps,
IAsset[] memory assets,
FundManagement memory funds,
int256[] memory limits,
uint256 deadline
) external payable returns (int256[] memory);
/**
* @dev Data for each individual swap executed by `batchSwap`. The asset in and out fields are indexes into the
* `assets` array passed to that function, and ETH assets are converted to WETH.
*
* If `amount` is zero, the multihop mechanism is used to determine the actual amount based on the amount in/out
* from the previous swap, depending on the swap kind.
*
* The `userData` field is ignored by the Vault, but forwarded to the Pool in the `onSwap` hook, and may be
* used to extend swap behavior.
*/
struct BatchSwapStep {
bytes32 poolId;
uint256 assetInIndex;
uint256 assetOutIndex;
uint256 amount;
bytes userData;
}
/**
* @dev Emitted for each individual swap performed by `swap` or `batchSwap`.
*/
event Swap(
bytes32 indexed poolId,
IERC20 indexed tokenIn,
IERC20 indexed tokenOut,
uint256 amountIn,
uint256 amountOut
);
/**
* @dev All tokens in a swap are either sent from the `sender` account to the Vault, or from the Vault to the
* `recipient` account.
*
* If the caller is not `sender`, it must be an authorized relayer for them.
*
* If `fromInternalBalance` is true, the `sender`'s Internal Balance will be preferred, performing an ERC20
* transfer for the difference between the requested amount and the User's Internal Balance (if any). The `sender`
* must have allowed the Vault to use their tokens via `IERC20.approve()`. This matches the behavior of
* `joinPool`.
*
* If `toInternalBalance` is true, tokens will be deposited to `recipient`'s internal balance instead of
* transferred. This matches the behavior of `exitPool`.
*
* Note that ETH cannot be deposited to or withdrawn from Internal Balance: attempting to do so will trigger a
* revert.
*/
struct FundManagement {
address sender;
bool fromInternalBalance;
address payable recipient;
bool toInternalBalance;
}
/**
* @dev Simulates a call to `batchSwap`, returning an array of Vault asset deltas. Calls to `swap` cannot be
* simulated directly, but an equivalent `batchSwap` call can and will yield the exact same result.
*
* Each element in the array corresponds to the asset at the same index, and indicates the number of tokens (or ETH)
* the Vault would take from the sender (if positive) or send to the recipient (if negative). The arguments it
* receives are the same that an equivalent `batchSwap` call would receive.
*
* Unlike `batchSwap`, this function performs no checks on the sender or recipient field in the `funds` struct.
* This makes it suitable to be called by off-chain applications via eth_call without needing to hold tokens,
* approve them for the Vault, or even know a user's address.
*
* Note that this function is not 'view' (due to implementation details): the client code must explicitly execute
* eth_call instead of eth_sendTransaction.
*/
function queryBatchSwap(
SwapKind kind,
BatchSwapStep[] memory swaps,
IAsset[] memory assets,
FundManagement memory funds
) external returns (int256[] memory assetDeltas);
// Flash Loans
/**
* @dev Performs a 'flash loan', sending tokens to `recipient`, executing the `receiveFlashLoan` hook on it,
* and then reverting unless the tokens plus a proportional protocol fee have been returned.
*
* The `tokens` and `amounts` arrays must have the same length, and each entry in these indicates the loan amount
* for each token contract. `tokens` must be sorted in ascending order.
*
* The 'userData' field is ignored by the Vault, and forwarded as-is to `recipient` as part of the
* `receiveFlashLoan` call.
*
* Emits `FlashLoan` events.
*/
function flashLoan(
IFlashLoanRecipient recipient,
IERC20[] memory tokens,
uint256[] memory amounts,
bytes memory userData
) external;
/**
* @dev Emitted for each individual flash loan performed by `flashLoan`.
*/
event FlashLoan(IFlashLoanRecipient indexed recipient, IERC20 indexed token, uint256 amount, uint256 feeAmount);
// Asset Management
//
// Each token registered for a Pool can be assigned an Asset Manager, which is able to freely withdraw the Pool's
// tokens from the Vault, deposit them, or assign arbitrary values to its `managed` balance (see
// `getPoolTokenInfo`). This makes them extremely powerful and dangerous. Even if an Asset Manager only directly
// controls one of the tokens in a Pool, a malicious manager could set that token's balance to manipulate the
// prices of the other tokens, and then drain the Pool with swaps. The risk of using Asset Managers is therefore
// not constrained to the tokens they are managing, but extends to the entire Pool's holdings.
//
// However, a properly designed Asset Manager smart contract can be safely used for the Pool's benefit,
// for example by lending unused tokens out for interest, or using them to participate in voting protocols.
//
// This concept is unrelated to the IAsset interface.
/**
* @dev Performs a set of Pool balance operations, which may be either withdrawals, deposits or updates.
*
* Pool Balance management features batching, which means a single contract call can be used to perform multiple
* operations of different kinds, with different Pools and tokens, at once.
*
* For each operation, the caller must be registered as the Asset Manager for `token` in `poolId`.
*/
function managePoolBalance(PoolBalanceOp[] memory ops) external;
struct PoolBalanceOp {
PoolBalanceOpKind kind;
bytes32 poolId;
IERC20 token;
uint256 amount;
}
/**
* Withdrawals decrease the Pool's cash, but increase its managed balance, leaving the total balance unchanged.
*
* Deposits increase the Pool's cash, but decrease its managed balance, leaving the total balance unchanged.
*
* Updates don't affect the Pool's cash balance, but because the managed balance changes, it does alter the total.
* The external amount can be either increased or decreased by this call (i.e., reporting a gain or a loss).
*/
enum PoolBalanceOpKind { WITHDRAW, DEPOSIT, UPDATE }
/**
* @dev Emitted when a Pool's token Asset Manager alters its balance via `managePoolBalance`.
*/
event PoolBalanceManaged(
bytes32 indexed poolId,
address indexed assetManager,
IERC20 indexed token,
int256 cashDelta,
int256 managedDelta
);
// Protocol Fees
//
// Some operations cause the Vault to collect tokens in the form of protocol fees, which can then be withdrawn by
// permissioned accounts.
//
// There are two kinds of protocol fees:
//
// - flash loan fees: charged on all flash loans, as a percentage of the amounts lent.
//
// - swap fees: a percentage of the fees charged by Pools when performing swaps. For a number of reasons, including
// swap gas costs and interface simplicity, protocol swap fees are not charged on each individual swap. Rather,
// Pools are expected to keep track of how much they have charged in swap fees, and pay any outstanding debts to the
// Vault when they are joined or exited. This prevents users from joining a Pool with unpaid debt, as well as
// exiting a Pool in debt without first paying their share.
/**
* @dev Returns the current protocol fee module.
*/
function getProtocolFeesCollector() external view returns (IProtocolFeesCollector);
/**
* @dev Safety mechanism to pause most Vault operations in the event of an emergency - typically detection of an
* error in some part of the system.
*
* The Vault can only be paused during an initial time period, after which pausing is forever disabled.
*
* While the contract is paused, the following features are disabled:
* - depositing and transferring internal balance
* - transferring external balance (using the Vault's allowance)
* - swaps
* - joining Pools
* - Asset Manager interactions
*
* Internal Balance can still be withdrawn, and Pools exited.
*/
function setPaused(bool paused) external;
/**
* @dev Returns the Vault's WETH instance.
*/
function WETH() external view returns (IWETH);
// solhint-disable-previous-line func-name-mixedcase
}// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity ^0.7.0;
import "@balancer-labs/v2-vault/contracts/interfaces/IVault.sol";
import "@balancer-labs/v2-solidity-utils/contracts/helpers/IAuthentication.sol";
interface IAuthorizerAdaptor is IAuthentication {
/**
* @notice Returns the Balancer Vault
*/
function getVault() external view returns (IVault);
/**
* @notice Returns the Authorizer
*/
function getAuthorizer() external view returns (IAuthorizer);
/**
* @notice Performs an arbitrary function call on a target contract, provided the caller is authorized to do so.
* @param target - Address of the contract to be called
* @param data - Calldata to be sent to the target contract
* @return The bytes encoded return value from the performed function call
*/
function performAction(address target, bytes calldata data) external payable returns (bytes memory);
}// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity ^0.7.0;
import "@balancer-labs/v2-solidity-utils/contracts/helpers/IAuthentication.sol";
import "./IAuthorizerAdaptor.sol";
import "./IGaugeController.sol";
import "./ILiquidityGauge.sol";
import "./ILiquidityGaugeFactory.sol";
import "./IStakingLiquidityGauge.sol";
interface IGaugeAdder is IAuthentication {
enum GaugeType { LiquidityMiningCommittee, veBAL, Ethereum, Polygon, Arbitrum }
event GaugeFactoryAdded(GaugeType indexed gaugeType, ILiquidityGaugeFactory gaugeFactory);
/**
* @notice Returns the gauge corresponding to a Balancer pool `pool` on Ethereum mainnet.
* Only returns gauges which have been added to the Gauge Controller.
* @dev Gauge Factories also implement a `getPoolGauge` function which maps pools to gauges which it has deployed.
* This function provides global information by using which gauge has been added to the Gauge Controller
* to represent the canonical gauge for a given pool address.
*/
function getPoolGauge(IERC20 pool) external view returns (ILiquidityGauge);
/**
* @notice Returns the `index`'th factory for gauge type `gaugeType`
*/
function getFactoryForGaugeType(GaugeType gaugeType, uint256 index) external view returns (address);
/**
* @notice Returns the number of factories for gauge type `gaugeType`
*/
function getFactoryForGaugeTypeCount(GaugeType gaugeType) external view returns (uint256);
/**
* @notice Returns whether `gauge` has been deployed by one of the listed factories for the gauge type `gaugeType`
*/
function isGaugeFromValidFactory(address gauge, GaugeType gaugeType) external view returns (bool);
/**
* @notice Adds a new gauge to the GaugeController for the "Ethereum" type.
*/
function addEthereumGauge(IStakingLiquidityGauge gauge) external;
/**
* @notice Adds a new gauge to the GaugeController for the "Polygon" type.
* This function must be called with the address of the *root* gauge which is deployed on Ethereum mainnet.
* It should not be called with the address of the gauge which is deployed on Polygon
*/
function addPolygonGauge(address rootGauge) external;
/**
* @notice Adds a new gauge to the GaugeController for the "Arbitrum" type.
* This function must be called with the address of the *root* gauge which is deployed on Ethereum mainnet.
* It should not be called with the address of the gauge which is deployed on Arbitrum
*/
function addArbitrumGauge(address rootGauge) external;
/**
* @notice Adds `factory` as an allowlisted factory contract for gauges with type `gaugeType`.
*/
function addGaugeFactory(ILiquidityGaugeFactory factory, GaugeType gaugeType) external;
}// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity ^0.7.0;
import "@balancer-labs/v2-solidity-utils/contracts/openzeppelin/IERC20.sol";
import "./IAuthorizerAdaptor.sol";
import "./IVotingEscrow.sol";
// For compatibility, we're keeping the same function names as in the original Curve code, including the mixed-case
// naming convention.
// solhint-disable func-name-mixedcase
interface IGaugeController {
function checkpoint_gauge(address gauge) external;
function gauge_relative_weight(address gauge, uint256 time) external returns (uint256);
function voting_escrow() external view returns (IVotingEscrow);
function token() external view returns (IERC20);
function add_type(string calldata name, uint256 weight) external;
function change_type_weight(int128 typeId, uint256 weight) external;
// Gauges are to be added with zero initial weight so the full signature is not required
function add_gauge(address gauge, int128 gaugeType) external;
function n_gauge_types() external view returns (int128);
function gauge_types(address gauge) external view returns (int128);
function admin() external view returns (IAuthorizerAdaptor);
}// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity ^0.7.0;
import "./IBalancerTokenAdmin.sol";
import "./IGaugeController.sol";
interface IBalancerMinter {
event Minted(address indexed recipient, address gauge, uint256 minted);
/**
* @notice Returns the address of the Balancer Governance Token
*/
function getBalancerToken() external view returns (IERC20);
/**
* @notice Returns the address of the Balancer Token Admin contract
*/
function getBalancerTokenAdmin() external view returns (IBalancerTokenAdmin);
/**
* @notice Returns the address of the Gauge Controller
*/
function getGaugeController() external view returns (IGaugeController);
/**
* @notice Mint everything which belongs to `msg.sender` and send to them
* @param gauge `LiquidityGauge` address to get mintable amount from
*/
function mint(address gauge) external returns (uint256);
/**
* @notice Mint everything which belongs to `msg.sender` across multiple gauges
* @param gauges List of `LiquidityGauge` addresses
*/
function mintMany(address[] calldata gauges) external returns (uint256);
/**
* @notice Mint tokens for `user`
* @dev Only possible when `msg.sender` has been approved by `user` to mint on their behalf
* @param gauge `LiquidityGauge` address to get mintable amount from
* @param user Address to mint to
*/
function mintFor(address gauge, address user) external returns (uint256);
/**
* @notice Mint tokens for `user` across multiple gauges
* @dev Only possible when `msg.sender` has been approved by `user` to mint on their behalf
* @param gauges List of `LiquidityGauge` addresses
* @param user Address to mint to
*/
function mintManyFor(address[] calldata gauges, address user) external returns (uint256);
/**
* @notice The total number of tokens minted for `user` from `gauge`
*/
function minted(address user, address gauge) external view returns (uint256);
/**
* @notice Whether `minter` is approved to mint tokens for `user`
*/
function getMinterApproval(address minter, address user) external view returns (bool);
/**
* @notice Set whether `minter` is approved to mint tokens on your behalf
*/
function setMinterApproval(address minter, bool approval) external;
/**
* @notice Set whether `minter` is approved to mint tokens on behalf of `user`, who has signed a message authorizing
* them.
*/
function setMinterApprovalWithSignature(
address minter,
bool approval,
address user,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
// The below functions are near-duplicates of functions available above.
// They are included for ABI compatibility with snake_casing as used in vyper contracts.
// solhint-disable func-name-mixedcase
/**
* @notice Whether `minter` is approved to mint tokens for `user`
*/
function allowed_to_mint_for(address minter, address user) external view returns (bool);
/**
* @notice Mint everything which belongs to `msg.sender` across multiple gauges
* @dev This function is not recommended as `mintMany()` is more flexible and gas efficient
* @param gauges List of `LiquidityGauge` addresses
*/
function mint_many(address[8] calldata gauges) external;
/**
* @notice Mint tokens for `user`
* @dev Only possible when `msg.sender` has been approved by `user` to mint on their behalf
* @param gauge `LiquidityGauge` address to get mintable amount from
* @param user Address to mint to
*/
function mint_for(address gauge, address user) external;
/**
* @notice Toggle whether `minter` is approved to mint tokens for `user`
*/
function toggle_approve_mint(address minter) external;
}// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity ^0.7.0;
import "@balancer-labs/v2-solidity-utils/contracts/helpers/IAuthentication.sol";
import "@balancer-labs/v2-vault/contracts/interfaces/IVault.sol";
import "./IBalancerToken.sol";
interface IBalancerTokenAdmin is IAuthentication {
// solhint-disable func-name-mixedcase
function INITIAL_RATE() external view returns (uint256);
function RATE_REDUCTION_TIME() external view returns (uint256);
function RATE_REDUCTION_COEFFICIENT() external view returns (uint256);
function RATE_DENOMINATOR() external view returns (uint256);
// solhint-enable func-name-mixedcase
/**
* @notice Returns the address of the Balancer Governance Token
*/
function getBalancerToken() external view returns (IBalancerToken);
/**
* @notice Returns the Balancer Vault.
*/
function getVault() external view returns (IVault);
function activate() external;
function rate() external view returns (uint256);
function startEpochTimeWrite() external returns (uint256);
function mint(address to, uint256 amount) external;
}// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
import "./ILiquidityGauge.sol";
interface ILiquidityGaugeFactory {
/**
* @notice Returns true if `gauge` was created by this factory.
*/
function isGaugeFromFactory(address gauge) external view returns (bool);
function create(address pool) external returns (address);
}// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity ^0.7.0;
import "@balancer-labs/v2-vault/contracts/interfaces/IVault.sol";
import "@balancer-labs/v2-liquidity-mining/contracts/interfaces/IBalancerToken.sol";
import "./IBALTokenHolder.sol";
interface IBALTokenHolderFactory {
function getBalancerToken() external view returns (IBalancerToken);
function getVault() external view returns (IVault);
function isHolderFromFactory(address holder) external view returns (bool);
function create(string memory name) external returns (IBALTokenHolder);
}// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity ^0.7.0;
// solhint-disable
/**
* @dev Reverts if `condition` is false, with a revert reason containing `errorCode`. Only codes up to 999 are
* supported.
*/
function _require(bool condition, uint256 errorCode) pure {
if (!condition) _revert(errorCode);
}
/**
* @dev Reverts with a revert reason containing `errorCode`. Only codes up to 999 are supported.
*/
function _revert(uint256 errorCode) pure {
// We're going to dynamically create a revert string based on the error code, with the following format:
// 'BAL#{errorCode}'
// where the code is left-padded with zeroes to three digits (so they range from 000 to 999).
//
// We don't have revert strings embedded in the contract to save bytecode size: it takes much less space to store a
// number (8 to 16 bits) than the individual string characters.
//
// The dynamic string creation algorithm that follows could be implemented in Solidity, but assembly allows for a
// much denser implementation, again saving bytecode size. Given this function unconditionally reverts, this is a
// safe place to rely on it without worrying about how its usage might affect e.g. memory contents.
assembly {
// First, we need to compute the ASCII representation of the error code. We assume that it is in the 0-999
// range, so we only need to convert three digits. To convert the digits to ASCII, we add 0x30, the value for
// the '0' character.
let units := add(mod(errorCode, 10), 0x30)
errorCode := div(errorCode, 10)
let tenths := add(mod(errorCode, 10), 0x30)
errorCode := div(errorCode, 10)
let hundreds := add(mod(errorCode, 10), 0x30)
// With the individual characters, we can now construct the full string. The "BAL#" part is a known constant
// (0x42414c23): we simply shift this by 24 (to provide space for the 3 bytes of the error code), and add the
// characters to it, each shifted by a multiple of 8.
// The revert reason is then shifted left by 200 bits (256 minus the length of the string, 7 characters * 8 bits
// per character = 56) to locate it in the most significant part of the 256 slot (the beginning of a byte
// array).
let revertReason := shl(200, add(0x42414c23000000, add(add(units, shl(8, tenths)), shl(16, hundreds))))
// We can now encode the reason in memory, which can be safely overwritten as we're about to revert. The encoded
// message will have the following layout:
// [ revert reason identifier ] [ string location offset ] [ string length ] [ string contents ]
// The Solidity revert reason identifier is 0x08c739a0, the function selector of the Error(string) function. We
// also write zeroes to the next 28 bytes of memory, but those are about to be overwritten.
mstore(0x0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
// Next is the offset to the location of the string, which will be placed immediately after (20 bytes away).
mstore(0x04, 0x0000000000000000000000000000000000000000000000000000000000000020)
// The string length is fixed: 7 characters.
mstore(0x24, 7)
// Finally, the string itself is stored.
mstore(0x44, revertReason)
// Even if the string is only 7 bytes long, we need to return a full 32 byte slot containing it. The length of
// the encoded message is therefore 4 + 32 + 32 + 32 = 100.
revert(0, 100)
}
}
library Errors {
// Math
uint256 internal constant ADD_OVERFLOW = 0;
uint256 internal constant SUB_OVERFLOW = 1;
uint256 internal constant SUB_UNDERFLOW = 2;
uint256 internal constant MUL_OVERFLOW = 3;
uint256 internal constant ZERO_DIVISION = 4;
uint256 internal constant DIV_INTERNAL = 5;
uint256 internal constant X_OUT_OF_BOUNDS = 6;
uint256 internal constant Y_OUT_OF_BOUNDS = 7;
uint256 internal constant PRODUCT_OUT_OF_BOUNDS = 8;
uint256 internal constant INVALID_EXPONENT = 9;
// Input
uint256 internal constant OUT_OF_BOUNDS = 100;
uint256 internal constant UNSORTED_ARRAY = 101;
uint256 internal constant UNSORTED_TOKENS = 102;
uint256 internal constant INPUT_LENGTH_MISMATCH = 103;
uint256 internal constant ZERO_TOKEN = 104;
// Shared pools
uint256 internal constant MIN_TOKENS = 200;
uint256 internal constant MAX_TOKENS = 201;
uint256 internal constant MAX_SWAP_FEE_PERCENTAGE = 202;
uint256 internal constant MIN_SWAP_FEE_PERCENTAGE = 203;
uint256 internal constant MINIMUM_BPT = 204;
uint256 internal constant CALLER_NOT_VAULT = 205;
uint256 internal constant UNINITIALIZED = 206;
uint256 internal constant BPT_IN_MAX_AMOUNT = 207;
uint256 internal constant BPT_OUT_MIN_AMOUNT = 208;
uint256 internal constant EXPIRED_PERMIT = 209;
uint256 internal constant NOT_TWO_TOKENS = 210;
uint256 internal constant DISABLED = 211;
// Pools
uint256 internal constant MIN_AMP = 300;
uint256 internal constant MAX_AMP = 301;
uint256 internal constant MIN_WEIGHT = 302;
uint256 internal constant MAX_STABLE_TOKENS = 303;
uint256 internal constant MAX_IN_RATIO = 304;
uint256 internal constant MAX_OUT_RATIO = 305;
uint256 internal constant MIN_BPT_IN_FOR_TOKEN_OUT = 306;
uint256 internal constant MAX_OUT_BPT_FOR_TOKEN_IN = 307;
uint256 internal constant NORMALIZED_WEIGHT_INVARIANT = 308;
uint256 internal constant INVALID_TOKEN = 309;
uint256 internal constant UNHANDLED_JOIN_KIND = 310;
uint256 internal constant ZERO_INVARIANT = 311;
uint256 internal constant ORACLE_INVALID_SECONDS_QUERY = 312;
uint256 internal constant ORACLE_NOT_INITIALIZED = 313;
uint256 internal constant ORACLE_QUERY_TOO_OLD = 314;
uint256 internal constant ORACLE_INVALID_INDEX = 315;
uint256 internal constant ORACLE_BAD_SECS = 316;
uint256 internal constant AMP_END_TIME_TOO_CLOSE = 317;
uint256 internal constant AMP_ONGOING_UPDATE = 318;
uint256 internal constant AMP_RATE_TOO_HIGH = 319;
uint256 internal constant AMP_NO_ONGOING_UPDATE = 320;
uint256 internal constant STABLE_INVARIANT_DIDNT_CONVERGE = 321;
uint256 internal constant STABLE_GET_BALANCE_DIDNT_CONVERGE = 322;
uint256 internal constant RELAYER_NOT_CONTRACT = 323;
uint256 internal constant BASE_POOL_RELAYER_NOT_CALLED = 324;
uint256 internal constant REBALANCING_RELAYER_REENTERED = 325;
uint256 internal constant GRADUAL_UPDATE_TIME_TRAVEL = 326;
uint256 internal constant SWAPS_DISABLED = 327;
uint256 internal constant CALLER_IS_NOT_LBP_OWNER = 328;
uint256 internal constant PRICE_RATE_OVERFLOW = 329;
uint256 internal constant INVALID_JOIN_EXIT_KIND_WHILE_SWAPS_DISABLED = 330;
uint256 internal constant WEIGHT_CHANGE_TOO_FAST = 331;
uint256 internal constant LOWER_GREATER_THAN_UPPER_TARGET = 332;
uint256 internal constant UPPER_TARGET_TOO_HIGH = 333;
uint256 internal constant UNHANDLED_BY_LINEAR_POOL = 334;
uint256 internal constant OUT_OF_TARGET_RANGE = 335;
uint256 internal constant UNHANDLED_EXIT_KIND = 336;
uint256 internal constant UNAUTHORIZED_EXIT = 337;
uint256 internal constant MAX_MANAGEMENT_SWAP_FEE_PERCENTAGE = 338;
uint256 internal constant UNHANDLED_BY_MANAGED_POOL = 339;
uint256 internal constant UNHANDLED_BY_PHANTOM_POOL = 340;
uint256 internal constant TOKEN_DOES_NOT_HAVE_RATE_PROVIDER = 341;
uint256 internal constant INVALID_INITIALIZATION = 342;
uint256 internal constant OUT_OF_NEW_TARGET_RANGE = 343;
uint256 internal constant UNAUTHORIZED_OPERATION = 344;
uint256 internal constant UNINITIALIZED_POOL_CONTROLLER = 345;
// Lib
uint256 internal constant REENTRANCY = 400;
uint256 internal constant SENDER_NOT_ALLOWED = 401;
uint256 internal constant PAUSED = 402;
uint256 internal constant PAUSE_WINDOW_EXPIRED = 403;
uint256 internal constant MAX_PAUSE_WINDOW_DURATION = 404;
uint256 internal constant MAX_BUFFER_PERIOD_DURATION = 405;
uint256 internal constant INSUFFICIENT_BALANCE = 406;
uint256 internal constant INSUFFICIENT_ALLOWANCE = 407;
uint256 internal constant ERC20_TRANSFER_FROM_ZERO_ADDRESS = 408;
uint256 internal constant ERC20_TRANSFER_TO_ZERO_ADDRESS = 409;
uint256 internal constant ERC20_MINT_TO_ZERO_ADDRESS = 410;
uint256 internal constant ERC20_BURN_FROM_ZERO_ADDRESS = 411;
uint256 internal constant ERC20_APPROVE_FROM_ZERO_ADDRESS = 412;
uint256 internal constant ERC20_APPROVE_TO_ZERO_ADDRESS = 413;
uint256 internal constant ERC20_TRANSFER_EXCEEDS_ALLOWANCE = 414;
uint256 internal constant ERC20_DECREASED_ALLOWANCE_BELOW_ZERO = 415;
uint256 internal constant ERC20_TRANSFER_EXCEEDS_BALANCE = 416;
uint256 internal constant ERC20_BURN_EXCEEDS_ALLOWANCE = 417;
uint256 internal constant SAFE_ERC20_CALL_FAILED = 418;
uint256 internal constant ADDRESS_INSUFFICIENT_BALANCE = 419;
uint256 internal constant ADDRESS_CANNOT_SEND_VALUE = 420;
uint256 internal constant SAFE_CAST_VALUE_CANT_FIT_INT256 = 421;
uint256 internal constant GRANT_SENDER_NOT_ADMIN = 422;
uint256 internal constant REVOKE_SENDER_NOT_ADMIN = 423;
uint256 internal constant RENOUNCE_SENDER_NOT_ALLOWED = 424;
uint256 internal constant BUFFER_PERIOD_EXPIRED = 425;
uint256 internal constant CALLER_IS_NOT_OWNER = 426;
uint256 internal constant NEW_OWNER_IS_ZERO = 427;
uint256 internal constant CODE_DEPLOYMENT_FAILED = 428;
uint256 internal constant CALL_TO_NON_CONTRACT = 429;
uint256 internal constant LOW_LEVEL_CALL_FAILED = 430;
uint256 internal constant NOT_PAUSED = 431;
uint256 internal constant ADDRESS_ALREADY_ALLOWLISTED = 432;
uint256 internal constant ADDRESS_NOT_ALLOWLISTED = 433;
uint256 internal constant ERC20_BURN_EXCEEDS_BALANCE = 434;
// Vault
uint256 internal constant INVALID_POOL_ID = 500;
uint256 internal constant CALLER_NOT_POOL = 501;
uint256 internal constant SENDER_NOT_ASSET_MANAGER = 502;
uint256 internal constant USER_DOESNT_ALLOW_RELAYER = 503;
uint256 internal constant INVALID_SIGNATURE = 504;
uint256 internal constant EXIT_BELOW_MIN = 505;
uint256 internal constant JOIN_ABOVE_MAX = 506;
uint256 internal constant SWAP_LIMIT = 507;
uint256 internal constant SWAP_DEADLINE = 508;
uint256 internal constant CANNOT_SWAP_SAME_TOKEN = 509;
uint256 internal constant UNKNOWN_AMOUNT_IN_FIRST_SWAP = 510;
uint256 internal constant MALCONSTRUCTED_MULTIHOP_SWAP = 511;
uint256 internal constant INTERNAL_BALANCE_OVERFLOW = 512;
uint256 internal constant INSUFFICIENT_INTERNAL_BALANCE = 513;
uint256 internal constant INVALID_ETH_INTERNAL_BALANCE = 514;
uint256 internal constant INVALID_POST_LOAN_BALANCE = 515;
uint256 internal constant INSUFFICIENT_ETH = 516;
uint256 internal constant UNALLOCATED_ETH = 517;
uint256 internal constant ETH_TRANSFER = 518;
uint256 internal constant CANNOT_USE_ETH_SENTINEL = 519;
uint256 internal constant TOKENS_MISMATCH = 520;
uint256 internal constant TOKEN_NOT_REGISTERED = 521;
uint256 internal constant TOKEN_ALREADY_REGISTERED = 522;
uint256 internal constant TOKENS_ALREADY_SET = 523;
uint256 internal constant TOKENS_LENGTH_MUST_BE_2 = 524;
uint256 internal constant NONZERO_TOKEN_BALANCE = 525;
uint256 internal constant BALANCE_TOTAL_OVERFLOW = 526;
uint256 internal constant POOL_NO_TOKENS = 527;
uint256 internal constant INSUFFICIENT_FLASH_LOAN_BALANCE = 528;
// Fees
uint256 internal constant SWAP_FEE_PERCENTAGE_TOO_HIGH = 600;
uint256 internal constant FLASH_LOAN_FEE_PERCENTAGE_TOO_HIGH = 601;
uint256 internal constant INSUFFICIENT_FLASH_LOAN_FEE_AMOUNT = 602;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @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);
}// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity ^0.7.0;
/**
* @dev Interface for the SignatureValidator helper, used to support meta-transactions.
*/
interface ISignaturesValidator {
/**
* @dev Returns the EIP712 domain separator.
*/
function getDomainSeparator() external view returns (bytes32);
/**
* @dev Returns the next nonce used by an address to sign messages.
*/
function getNextNonce(address user) external view returns (uint256);
}// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity ^0.7.0;
/**
* @dev Interface for the TemporarilyPausable helper.
*/
interface ITemporarilyPausable {
/**
* @dev Emitted every time the pause state changes by `_setPaused`.
*/
event PausedStateChanged(bool paused);
/**
* @dev Returns the current paused state.
*/
function getPausedState()
external
view
returns (
bool paused,
uint256 pauseWindowEndTime,
uint256 bufferPeriodEndTime
);
}// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity ^0.7.0;
import "../openzeppelin/IERC20.sol";
/**
* @dev Interface for WETH9.
* See https://github.com/gnosis/canonical-weth/blob/0dd1ea3e295eef916d0c6223ec63141137d22d67/contracts/WETH9.sol
*/
interface IWETH is IERC20 {
function deposit() external payable;
function withdraw(uint256 amount) external;
}// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity ^0.7.0;
/**
* @dev This is an empty interface used to represent either ERC20-conforming token contracts or ETH (using the zero
* address sentinel value). We're just relying on the fact that `interface` can be used to declare new address-like
* types.
*
* This concept is unrelated to a Pool's Asset Managers.
*/
interface IAsset {
// solhint-disable-previous-line no-empty-blocks
}// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity ^0.7.0;
interface IAuthorizer {
/**
* @dev Returns true if `account` can perform the action described by `actionId` in the contract `where`.
*/
function canPerform(
bytes32 actionId,
address account,
address where
) external view returns (bool);
}// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity ^0.7.0;
// Inspired by Aave Protocol's IFlashLoanReceiver.
import "@balancer-labs/v2-solidity-utils/contracts/openzeppelin/IERC20.sol";
interface IFlashLoanRecipient {
/**
* @dev When `flashLoan` is called on the Vault, it invokes the `receiveFlashLoan` hook on the recipient.
*
* At the time of the call, the Vault will have transferred `amounts` for `tokens` to the recipient. Before this
* call returns, the recipient must have transferred `amounts` plus `feeAmounts` for each token back to the
* Vault, or else the entire flash loan will revert.
*
* `userData` is the same value passed in the `IVault.flashLoan` call.
*/
function receiveFlashLoan(
IERC20[] memory tokens,
uint256[] memory amounts,
uint256[] memory feeAmounts,
bytes memory userData
) external;
}// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
import "@balancer-labs/v2-solidity-utils/contracts/openzeppelin/IERC20.sol";
import "./IVault.sol";
import "./IAuthorizer.sol";
interface IProtocolFeesCollector {
event SwapFeePercentageChanged(uint256 newSwapFeePercentage);
event FlashLoanFeePercentageChanged(uint256 newFlashLoanFeePercentage);
function withdrawCollectedFees(
IERC20[] calldata tokens,
uint256[] calldata amounts,
address recipient
) external;
function setSwapFeePercentage(uint256 newSwapFeePercentage) external;
function setFlashLoanFeePercentage(uint256 newFlashLoanFeePercentage) external;
function getSwapFeePercentage() external view returns (uint256);
function getFlashLoanFeePercentage() external view returns (uint256);
function getCollectedFeeAmounts(IERC20[] memory tokens) external view returns (uint256[] memory feeAmounts);
function getAuthorizer() external view returns (IAuthorizer);
function vault() external view returns (IVault);
}// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity ^0.7.0;
interface IAuthentication {
/**
* @dev Returns the action identifier associated with the external function described by `selector`.
*/
function getActionId(bytes4 selector) external view returns (bytes32);
}// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity ^0.7.0;
// For compatibility, we're keeping the same function names as in the original Curve code, including the mixed-case
// naming convention.
// solhint-disable func-name-mixedcase
interface ILiquidityGauge {
function integrate_fraction(address user) external view returns (uint256);
function user_checkpoint(address user) external returns (bool);
function is_killed() external view returns (bool);
function killGauge() external;
function unkillGauge() external;
}// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity ^0.7.0;
import "@balancer-labs/v2-solidity-utils/contracts/openzeppelin/IERC20.sol";
import "./ILiquidityGauge.sol";
// For compatibility, we're keeping the same function names as in the original Curve code, including the mixed-case
// naming convention.
// solhint-disable func-name-mixedcase
interface IStakingLiquidityGauge is ILiquidityGauge, IERC20 {
function initialize(address lpToken) external;
function lp_token() external view returns (IERC20);
function deposit(uint256 value, address recipient) external;
function withdraw(uint256 value) external;
function claim_rewards(address user) external;
function add_reward(address rewardToken, address distributor) external;
function set_reward_distributor(address rewardToken, address distributor) external;
}// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity ^0.7.0;
import "./IAuthorizerAdaptor.sol";
// For compatibility, we're keeping the same function names as in the original Curve code, including the mixed-case
// naming convention.
// solhint-disable func-name-mixedcase
interface IVotingEscrow {
function admin() external view returns (IAuthorizerAdaptor);
}// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity ^0.7.0;
import "@balancer-labs/v2-solidity-utils/contracts/openzeppelin/IERC20.sol";
interface IBalancerToken is IERC20 {
function mint(address to, uint256 amount) external;
function getRoleMemberCount(bytes32 role) external view returns (uint256);
function getRoleMember(bytes32 role, uint256 index) external view returns (address);
function hasRole(bytes32 role, address account) external view returns (bool);
function getRoleAdmin(bytes32 role) external view returns (bytes32);
function grantRole(bytes32 role, address account) external;
function revokeRole(bytes32 role, address account) external;
// solhint-disable-next-line func-name-mixedcase
function DEFAULT_ADMIN_ROLE() external view returns (bytes32);
// solhint-disable-next-line func-name-mixedcase
function MINTER_ROLE() external view returns (bytes32);
// solhint-disable-next-line func-name-mixedcase
function SNAPSHOT_ROLE() external view returns (bytes32);
function snapshot() external;
}// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity ^0.7.0;
import "@balancer-labs/v2-solidity-utils/contracts/helpers/IAuthentication.sol";
import "@balancer-labs/v2-solidity-utils/contracts/openzeppelin/IERC20.sol";
interface IBALTokenHolder is IAuthentication {
function withdrawFunds(address recipient, uint256 amount) external;
function sweepTokens(
IERC20 token,
address recipient,
uint256 amount
) external;
}{
"optimizer": {
"enabled": true,
"runs": 9999
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract IBalancerMinter","name":"balancerMinter","type":"address"},{"internalType":"contract IAuthorizerAdaptor","name":"authorizerAdaptor","type":"address"},{"internalType":"contract IGaugeAdder","name":"gaugeAdder","type":"address"},{"internalType":"contract ILiquidityGaugeFactory","name":"ethereumGaugeFactory","type":"address"},{"internalType":"contract ILiquidityGaugeFactory","name":"singleRecipientGaugeFactory","type":"address"},{"internalType":"contract IBALTokenHolderFactory","name":"balTokenHolderFactory","type":"address"},{"internalType":"uint256","name":"activationScheduledTime","type":"uint256"},{"internalType":"uint256","name":"thirdStageDelay","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ARBITRUM_WEIGHT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ETHEREUM_WEIGHT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LM_COMMITTEE_WEIGHT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"POLYGON_WEIGHT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VEBAL_WEIGHT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"arbitrumGaugeRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"firstStageActivationTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getActivationScheduledTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAuthorizer","outputs":[{"internalType":"contract ICurrentAuthorizer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAuthorizerAdaptor","outputs":[{"internalType":"contract IAuthorizerAdaptor","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBalancerMinter","outputs":[{"internalType":"contract IBalancerMinter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBalancerTokenAdmin","outputs":[{"internalType":"contract IBalancerTokenAdmin","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentDeploymentStage","outputs":[{"internalType":"enum veBALDeploymentCoordinator.DeploymentStage","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGaugeController","outputs":[{"internalType":"contract IGaugeController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getThirdStageDelay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVault","outputs":[{"internalType":"contract IVault","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lmCommitteeMultisig","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"performFirstStage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"performSecondStage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"performThirdStage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"polygonGaugeRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"secondStageActivationTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"thirdStageActivationTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"veBALGaugeRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
610200604052600180546001600160a01b031990811673c38c5f97b34e175ffd35407fc91a937300e338601790915560028054821673d2eb7bd802a7ca68d9acd209bec4e664a9abdd7b90811790915560038054831682179055600480549092161790553480156200007057600080fd5b5060405162003ad138038062003ad183398181016040526101008110156200009757600080fd5b5080516020808301516040808501516060860151608087015160a088015160c089015160e090990151600160009081556008805460ff19169055865163e6dec36f60e01b81529651999a979995989497939692959394919390926001600160a01b038c169263e6dec36f92600480840193829003018186803b1580156200011d57600080fd5b505afa15801562000132573d6000803e3d6000fd5b505050506040513d60208110156200014957600080fd5b50516001600160601b0319606082901b16608052604080516311b2515f60e31b815290519192506001600160a01b03831691638d928af891600480820192602092909190829003018186803b158015620001a257600080fd5b505afa158015620001b7573d6000803e3d6000fd5b505050506040513d6020811015620001ce57600080fd5b50516001600160601b0319606091821b811660a0529089901b1660c0526040805163c003969960e01b815290516001600160a01b0383169163c0039699916004808301926020929190829003018186803b1580156200022c57600080fd5b505afa15801562000241573d6000803e3d6000fd5b505050506040513d60208110156200025857600080fd5b50516001600160601b0319606091821b811660e052908a901b166101005260408051632c6f4d6f60e11b815290516001600160a01b038b16916358de9ade916004808301926020929190829003018186803b158015620002b757600080fd5b505afa158015620002cc573d6000803e3d6000fd5b505050506040513d6020811015620002e357600080fd5b50516001600160601b0319606091821b81166101205297811b88166101405295861b8716610160525092841b851661018052921b9092166101a0526101c0526101e052505060805160601c60a05160601c60c05160601c60e05160601c6101005160601c6101205160601c6101405160601c6101605160601c6101805160601c6101a05160601c6101c0516101e0516136926200043f600039806103505280611df85250806107ae5280611dc95250806130955250806131c852508061247d52806127ac5250806117be5280612367528061244e528061256a52806126b352806128935280612914525080610b885280610cfd5280610de15280611e285280612b275280612dc252806133a45250806112f45280612a7d5250806108c852806108f75280610ed55280610f04525080612ac5525080611e6a525080610fc65280611087528061116f52806112435280612aa152506136926000f3fe608060405234801561001057600080fd5b50600436106101985760003560e01c8063761c4023116100e3578063b77984e91161008c578063e6dec36f11610066578063e6dec36f1461028e578063e758d36b14610296578063f5c458ab1461029e57610198565b8063b77984e91461025d578063dc8c9ec61461021d578063dce8b0cd1461028657610198565b80639912b3d4116100bd5780639912b3d414610245578063aaabadc51461024d578063b1e70e801461025557610198565b8063761c40231461022d578063844c7750146102355780638d928af81461023d57610198565b8063336d4dfc1161014557806342979adc1161011f57806342979adc14610215578063463d9e931461021d57806358de9ade1461022557610198565b8063336d4dfc146101fd5780633b54e68014610205578063410c2d8e1461020d57610198565b80631cdd07a4116101765780631cdd07a4146101e35780631e390389146101ed5780632bd46566146101f557610198565b80630249e6fa1461019d5780631235f8a3146101b75780631336e8d4146101db575b600080fd5b6101a56102a6565b60408051918252519081900360200190f35b6101bf6102ac565b604080516001600160a01b039092168252519081900360200190f35b6101a56102bb565b6101eb6102c7565b005b6101a561079e565b6101eb6107a4565b6101a5611dbb565b6101a5611dc7565b6101a5611deb565b6101a5611df6565b6101a5611e1a565b6101bf611e26565b6101bf611e4a565b6101bf611e59565b6101bf611e68565b6101a5611e8c565b6101bf611e92565b6101eb611f05565b610265612a72565b6040518082600381111561027557fe5b815260200191505060405180910390f35b6101bf612a7b565b6101bf612a9f565b6101bf612ac3565b6101bf612ae7565b60065481565b6002546001600160a01b031681565b67025bf6196bd1000081565b6102cf612af6565b600260085460ff1660038111156102e257fe5b1461034e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4e6f7420726561647920666f7220746869726420737461676500000000000000604482015290519081900360640190fd5b7f0000000000000000000000000000000000000000000000000000000000000000600654014210156103cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806135826027913960400191505060405180910390fd5b60006103d5612ac3565b905060006103e1611e92565b9050806001600160a01b0316632f2ff15d836001600160a01b031663851c1bb363db1ca26060e01b6040518263ffffffff1660e01b815260040180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060206040518083038186803b15801561045c57600080fd5b505afa158015610470573d6000803e3d6000fd5b505050506040513d602081101561048657600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b168152600481019290925230602483015251604480830192600092919082900301818387803b1580156104e457600080fd5b505af11580156104f8573d6000803e3d6000fd5b5050505061050f600067016345785d8a0000612b0f565b610522600167016345785d8a0000612b0f565b61053560026707c5850872380000612b0f565b610548600367025bf6196bd10000612b0f565b61055a600466f8b0a10e470000612b0f565b806001600160a01b031663d547741f836001600160a01b031663851c1bb363db1ca26060e01b6040518263ffffffff1660e01b815260040180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060206040518083038186803b1580156105d357600080fd5b505afa1580156105e7573d6000803e3d6000fd5b505050506040513d60208110156105fd57600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b168152600481019290925230602483015251604480830192600092919082900301818387803b15801561065b57600080fd5b505af115801561066f573d6000803e3d6000fd5b50505050806001600160a01b031663d547741f826001600160a01b031663a217fddf6040518163ffffffff1660e01b815260040160206040518083038186803b1580156106bb57600080fd5b505afa1580156106cf573d6000803e3d6000fd5b505050506040513d60208110156106e557600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b168152600481019290925230602483015251604480830192600092919082900301818387803b15801561074357600080fd5b505af1158015610757573d6000803e3d6000fd5b505042600755505060088054600391907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001835b0217905550505061079c612da3565b565b60055481565b6107ac612af6565b7f000000000000000000000000000000000000000000000000000000000000000042101561083b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4e6f7420726561647920666f722061637469766174696f6e0000000000000000604482015290519081900360640190fd5b600060085460ff16600381111561084e57fe5b146108ba57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4669727374207374657020616c726561647920706572666f726d656400000000604482015290519081900360640190fd5b60006108c4611e92565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391d148547f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a217fddf6040518163ffffffff1660e01b815260040160206040518083038186803b15801561094e57600080fd5b505afa158015610962573d6000803e3d6000fd5b505050506040513d602081101561097857600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526004810192909252306024830152516044808301926020929190829003018186803b1580156109d557600080fd5b505afa1580156109e9573d6000803e3d6000fd5b505050506040513d60208110156109ff57600080fd5b5051610a6c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f4e6f742042414c2061646d696e00000000000000000000000000000000000000604482015290519081900360640190fd5b604080517f9be2a884000000000000000000000000000000000000000000000000000000008152600060048201819052306024830152604482015290516001600160a01b03831691639be2a884916064808301926020929190829003018186803b158015610ad957600080fd5b505afa158015610aed573d6000803e3d6000fd5b505050506040513d6020811015610b0357600080fd5b5051610b7057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f4e6f7420417574686f72697a65722061646d696e000000000000000000000000604482015290519081900360640190fd5b6000610b7a612ac3565b9050806001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663dfe050316040518163ffffffff1660e01b815260040160206040518083038186803b158015610bdf57600080fd5b505afa158015610bf3573d6000803e3d6000fd5b505050506040513d6020811015610c0957600080fd5b5051604080517ff851a44000000000000000000000000000000000000000000000000000000000815290516001600160a01b039092169163f851a44091600480820192602092909190829003018186803b158015610c6657600080fd5b505afa158015610c7a573d6000803e3d6000fd5b505050506040513d6020811015610c9057600080fd5b50516001600160a01b031614610cf1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b8152602001806135a9602b913960400191505060405180910390fd5b806001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663f851a4406040518163ffffffff1660e01b815260040160206040518083038186803b158015610d5457600080fd5b505afa158015610d68573d6000803e3d6000fd5b505050506040513d6020811015610d7e57600080fd5b50516001600160a01b031614610ddf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001806135d4602e913960400191505060405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316639fba03a16040518163ffffffff1660e01b815260040160206040518083038186803b158015610e3857600080fd5b505afa158015610e4c573d6000803e3d6000fd5b505050506040513d6020811015610e6257600080fd5b5051600f0b15610ed357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f476175676520747970657320616c726561647920736574000000000000000000604482015290519081900360640190fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632f2ff15d7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a217fddf6040518163ffffffff1660e01b815260040160206040518083038186803b158015610f5b57600080fd5b505afa158015610f6f573d6000803e3d6000fd5b505050506040513d6020811015610f8557600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815260048101929092526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016602483015251604480830192600092919082900301818387803b15801561100c57600080fd5b505af1158015611020573d6000803e3d6000fd5b5050604080517f851c1bb30000000000000000000000000000000000000000000000000000000081527f0f15f4c000000000000000000000000000000000000000000000000000000000600482015290516001600160a01b038087169450632f2ff15d93507f0000000000000000000000000000000000000000000000000000000000000000169163851c1bb3916024808301926020929190829003018186803b1580156110cd57600080fd5b505afa1580156110e1573d6000803e3d6000fd5b505050506040513d60208110156110f757600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b168152600481019290925230602483015251604480830192600092919082900301818387803b15801561115557600080fd5b505af1158015611169573d6000803e3d6000fd5b505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316630f15f4c06040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156111c857600080fd5b505af11580156111dc573d6000803e3d6000fd5b5050604080517f851c1bb30000000000000000000000000000000000000000000000000000000081527f40c10f1900000000000000000000000000000000000000000000000000000000600482015290516001600160a01b038087169450632f2ff15d93507f0000000000000000000000000000000000000000000000000000000000000000169163851c1bb3916024808301926020929190829003018186803b15801561128957600080fd5b505afa15801561129d573d6000803e3d6000fd5b505050506040513d60208110156112b357600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815260048101929092526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016602483015251604480830192600092919082900301818387803b15801561133a57600080fd5b505af115801561134e573d6000803e3d6000fd5b5050604080517f851c1bb30000000000000000000000000000000000000000000000000000000081527f92d0d23200000000000000000000000000000000000000000000000000000000600482015290516001600160a01b038087169450632f2ff15d935085169163851c1bb3916024808301926020929190829003018186803b1580156113db57600080fd5b505afa1580156113ef573d6000803e3d6000fd5b505050506040513d602081101561140557600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b168152600481019290925230602483015251604480830192600092919082900301818387803b15801561146357600080fd5b505af1158015611477573d6000803e3d6000fd5b505050506114b96040518060400160405280601a81526020017f4c6971756964697479204d696e696e6720436f6d6d6974746565000000000000815250612daa565b6114f76040518060400160405280600581526020017f766542414c000000000000000000000000000000000000000000000000000000815250612daa565b6115356040518060400160405280600881526020017f457468657265756d000000000000000000000000000000000000000000000000815250612daa565b6115736040518060400160405280600781526020017f506f6c79676f6e00000000000000000000000000000000000000000000000000815250612daa565b6115b16040518060400160405280600881526020017f417262697472756d000000000000000000000000000000000000000000000000815250612daa565b816001600160a01b031663d547741f826001600160a01b031663851c1bb36392d0d23260e01b6040518263ffffffff1660e01b815260040180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060206040518083038186803b15801561162a57600080fd5b505afa15801561163e573d6000803e3d6000fd5b505050506040513d602081101561165457600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b168152600481019290925230602483015251604480830192600092919082900301818387803b1580156116b257600080fd5b505af11580156116c6573d6000803e3d6000fd5b5050604080517f851c1bb30000000000000000000000000000000000000000000000000000000081527f3a04f90000000000000000000000000000000000000000000000000000000000600482015290516001600160a01b038087169450632f2ff15d935085169163851c1bb3916024808301926020929190829003018186803b15801561175357600080fd5b505afa158015611767573d6000803e3d6000fd5b505050506040513d602081101561177d57600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815260048101929092526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016602483015251604480830192600092919082900301818387803b15801561180457600080fd5b505af1158015611818573d6000803e3d6000fd5b5050604080517f851c1bb30000000000000000000000000000000000000000000000000000000081527f3a04f90000000000000000000000000000000000000000000000000000000000600482015290516001600160a01b038087169450632f2ff15d935085169163851c1bb3916024808301926020929190829003018186803b1580156118a557600080fd5b505afa1580156118b9573d6000803e3d6000fd5b505050506040513d60208110156118cf57600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b168152600481019290925230602483015251604480830192600092919082900301818387803b15801561192d57600080fd5b505af1158015611941573d6000803e3d6000fd5b505050506119746000604051806060016040528060258152602001613532602591396001546001600160a01b0316613091565b6119a360016040518060600160405280602b8152602001613557602b91396002546001600160a01b0316613091565b6119d260036040518060600160405280602d8152602001613602602d91396003546001600160a01b0316613091565b611a0160046040518060600160405280602e815260200161362f602e91396004546001600160a01b0316613091565b816001600160a01b031663d547741f826001600160a01b031663851c1bb3633a04f90060e01b6040518263ffffffff1660e01b815260040180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060206040518083038186803b158015611a7a57600080fd5b505afa158015611a8e573d6000803e3d6000fd5b505050506040513d6020811015611aa457600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b168152600481019290925230602483015251604480830192600092919082900301818387803b158015611b0257600080fd5b505af1158015611b16573d6000803e3d6000fd5b5050604080517f851c1bb30000000000000000000000000000000000000000000000000000000081527fe8de0d4d00000000000000000000000000000000000000000000000000000000600482015290516001600160a01b038087169450632f2ff15d935085169163851c1bb3916024808301926020929190829003018186803b158015611ba357600080fd5b505afa158015611bb7573d6000803e3d6000fd5b505050506040513d6020811015611bcd57600080fd5b5051600154604080517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815260048101939093526001600160a01b03909116602483015251604480830192600092919082900301818387803b158015611c3857600080fd5b505af1158015611c4c573d6000803e3d6000fd5b5050604080517f851c1bb30000000000000000000000000000000000000000000000000000000081527f058a3a2400000000000000000000000000000000000000000000000000000000600482015290516001600160a01b038087169450632f2ff15d935085169163851c1bb3916024808301926020929190829003018186803b158015611cd957600080fd5b505afa158015611ced573d6000803e3d6000fd5b505050506040513d6020811015611d0357600080fd5b5051600154604080517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815260048101939093526001600160a01b03909116602483015251604480830192600092919082900301818387803b158015611d6e57600080fd5b505af1158015611d82573d6000803e3d6000fd5b505042600555505060088054600191907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016828061078d565b6707c585087238000081565b7f000000000000000000000000000000000000000000000000000000000000000090565b66f8b0a10e47000081565b7f000000000000000000000000000000000000000000000000000000000000000090565b67016345785d8a000081565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001546001600160a01b031681565b6004546001600160a01b031681565b7f000000000000000000000000000000000000000000000000000000000000000090565b60075481565b6000611e9c611e68565b6001600160a01b031663aaabadc56040518163ffffffff1660e01b815260040160206040518083038186803b158015611ed457600080fd5b505afa158015611ee8573d6000803e3d6000fd5b505050506040513d6020811015611efe57600080fd5b5051905090565b611f0d612af6565b600160085460ff166003811115611f2057fe5b14611f8c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4e6f7420726561647920666f72207365636f6e64207374616765000000000000604482015290519081900360640190fd5b6000611f96611e92565b9050611fa0613512565b5060408051610400810182527306df3b2bbb68adc8b0e302443692037ed9f91b42815273072f14b85add63488ddad88f855fda4a99d6ac9b602080830191909152730b09dea16768f0799065c475be02919503cb2a358284015273186084ff790c65088ba694df11758fae4943ee9e6060830152731e19cf2d73a72ef1332c882f20534b6519be027660808301527327c9f71cc31464b906e0006d4fcbc8900f48f15f60a08301527332296969ef14eb0c6d29669c550d4a044913023060c083015273350196326aeaa9b98f1903fb5e8fc2686f85318c60e0830152733e5fa9518ea95c3e533eb377c001702a9aacaa32610100830152734bd6d86debdb9f5413e631ad386c4427dc9d01b26101208301527351735bdfbfe3fc13dea8dc6502e2e95898942961610140830152735d66fff62c17d841935b60df5f07f6cf79bd0f47610160830152735f7fa48d765053f8dd85e052843e12d23e3d7bc561018083015273702605f43471183158938c1a3e5f5a359d7b31ba6101a0830152737b50775383d3d6f0215a8f290f2c9e2eebbeceb26101c0830152737edde0cb05ed19e03a9a47cd5e53fc57fde1c80c6101e0830152738f4205e1604133d1875a3e771ae7e4f2b08656396102008301527390291319f1d4ea3ad4db0dd8fe9e12baf749e8456102208301527396646936b91d6b9d7d0c47c496afbf3d6ec7b6f86102408301527396ba9025311e2f47b840a1f68ed57a3df1ea874761026083015273a02e4b3d18d4e6b8d18ac421fbc3dfff8933c40a61028083015273a6f548df93de924d73be7d25dc02554c6bd66db56102a083015273baeec99c90e3420ec6c1e7a769d2a856d2898e4d6102c083015273bf96189eee9357a95c7719f4f5047f76bde804e56102e083015273e2469f47ab58cf9cf59f9822e3c5de4950a41c4961030083015273e99481dc77691d8e2456e5f3f61c1810adfc150361032083015273ec60a5fef79a92c741cb74fdd6bfc340c0279b0161034083015273edf085f65b4f6c155e13155502ef925c9a75600361036083015273efaa1604e82e1b3af8430b90192c1b9e8197e37761038083015273f4c0dd9b82da36c07605df83c8a416f11724d88b6103a083015273f5aaf7ee8c39b651cebf5f1f50c10631e78e0ef96103c083015273feadd389a5c427952d8fdb8057d6c8ba1156cc566103e083015282517f851c1bb30000000000000000000000000000000000000000000000000000000081527f6440e973000000000000000000000000000000000000000000000000000000006004820152925191926001600160a01b0385811693632f2ff15d937f00000000000000000000000000000000000000000000000000000000000000009092169263851c1bb3926024808301939192829003018186803b1580156123ac57600080fd5b505afa1580156123c0573d6000803e3d6000fd5b505050506040513d60208110156123d657600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b168152600481019290925230602483015251604480830192600092919082900301818387803b15801561243457600080fd5b505af1158015612448573d6000803e3d6000fd5b505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636440e9737f000000000000000000000000000000000000000000000000000000000000000060026040518363ffffffff1660e01b815260040180836001600160a01b031681526020018260048111156124cc57fe5b815260200192505050600060405180830381600087803b1580156124ef57600080fd5b505af1158015612503573d6000803e3d6000fd5b5050604080517f851c1bb30000000000000000000000000000000000000000000000000000000081527f6440e97300000000000000000000000000000000000000000000000000000000600482015290516001600160a01b03808716945063d547741f93507f0000000000000000000000000000000000000000000000000000000000000000169163851c1bb3916024808301926020929190829003018186803b1580156125b057600080fd5b505afa1580156125c4573d6000803e3d6000fd5b505050506040513d60208110156125da57600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b168152600481019290925230602483015251604480830192600092919082900301818387803b15801561263857600080fd5b505af115801561264c573d6000803e3d6000fd5b5050604080517f851c1bb30000000000000000000000000000000000000000000000000000000081527f5e45a27300000000000000000000000000000000000000000000000000000000600482015290516001600160a01b038087169450632f2ff15d93507f0000000000000000000000000000000000000000000000000000000000000000169163851c1bb3916024808301926020929190829003018186803b1580156126f957600080fd5b505afa15801561270d573d6000803e3d6000fd5b505050506040513d602081101561272357600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b168152600481019290925230602483015251604480830192600092919082900301818387803b15801561278157600080fd5b505af1158015612795573d6000803e3d6000fd5b506020925060009150505b818110156129025760007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316639ed933188584602081106127e557fe5b60200201516040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050602060405180830381600087803b15801561282957600080fd5b505af115801561283d573d6000803e3d6000fd5b505050506040513d602081101561285357600080fd5b5051604080517f5e45a2730000000000000000000000000000000000000000000000000000000081526001600160a01b03808416600483015291519293507f000000000000000000000000000000000000000000000000000000000000000090911691635e45a2739160248082019260009290919082900301818387803b1580156128dd57600080fd5b505af11580156128f1573d6000803e3d6000fd5b5050600190930192506127a0915050565b50826001600160a01b031663d547741f7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663851c1bb3635e45a27360e01b6040518263ffffffff1660e01b815260040180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060206040518083038186803b15801561299c57600080fd5b505afa1580156129b0573d6000803e3d6000fd5b505050506040513d60208110156129c657600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b168152600481019290925230602483015251604480830192600092919082900301818387803b158015612a2457600080fd5b505af1158015612a38573d6000803e3d6000fd5b505042600655505060088054600292507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018361078d565b60085460ff1690565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6003546001600160a01b031681565b612b086002600054141561019061337a565b6002600055565b612b17612ac3565b6001600160a01b0316634036176a7f00000000000000000000000000000000000000000000000000000000000000007fdb1ca26000000000000000000000000000000000000000000000000000000000856004811115612b7357fe5b856040516024018083600f0b815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518363ffffffff1660e01b815260040180836001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612c46578181015183820152602001612c2e565b50505050905090810190601f168015612c735780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b158015612c9357600080fd5b505af1158015612ca7573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526020811015612cee57600080fd5b8101908080516040519392919084640100000000821115612d0e57600080fd5b908301906020820185811115612d2357600080fd5b8251640100000000811182820188101715612d3d57600080fd5b82525081516020918201929091019080838360005b83811015612d6a578181015183820152602001612d52565b50505050905090810190601f168015612d975780820380516001836020036101000a031916815260200191505b50604052505050505050565b6001600055565b612db2612ac3565b6001600160a01b0316634036176a7f00000000000000000000000000000000000000000000000000000000000000006392d0d23260e01b8460006040516024018080602001838152602001828103825284818151815260200191508051906020019080838360005b83811015612e32578181015183820152602001612e1a565b50505050905090810190601f168015612e5f5780820380516001836020036101000a031916815260200191505b50604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000988916178152815160e08b901b90981688526001600160a01b0389166004890190815260248901928352835160448a01528351939890975091955060649091019350915080838360005b83811015612f35578181015183820152602001612f1d565b50505050905090810190601f168015612f625780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b158015612f8257600080fd5b505af1158015612f96573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526020811015612fdd57600080fd5b8101908080516040519392919084640100000000821115612ffd57600080fd5b90830190602082018581111561301257600080fd5b825164010000000081118282018810171561302c57600080fd5b82525081516020918201929091019080838360005b83811015613059578181015183820152602001613041565b50505050905090810190601f1680156130865780820380516001836020036101000a031916815260200191505b506040525050505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b6a46b3b846040518263ffffffff1660e01b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561310f5781810151838201526020016130f7565b50505050905090810190601f16801561313c5780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b15801561315b57600080fd5b505af115801561316f573d6000803e3d6000fd5b505050506040513d602081101561318557600080fd5b5051604080517f9ed933180000000000000000000000000000000000000000000000000000000081526001600160a01b03808416600483015291519293506000927f000000000000000000000000000000000000000000000000000000000000000090921691639ed933189160248082019260209290919082900301818787803b15801561321257600080fd5b505af1158015613226573d6000803e3d6000fd5b505050506040513d602081101561323c57600080fd5b5051905061324a818661338c565b613252611e92565b6001600160a01b0316632f2ff15d836001600160a01b031663851c1bb363c107532960e01b6040518263ffffffff1660e01b815260040180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060206040518083038186803b1580156132ca57600080fd5b505afa1580156132de573d6000803e3d6000fd5b505050506040513d60208110156132f457600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815260048101929092526001600160a01b038716602483015251604480830192600092919082900301818387803b15801561335b57600080fd5b505af115801561336f573d6000803e3d6000fd5b505050505050505050565b8161338857613388816134a5565b5050565b613394612ac3565b6001600160a01b0316634036176a7f0000000000000000000000000000000000000000000000000000000000000000633a04f90060e01b858560405160240180836001600160a01b031681526020018260048111156133ef57fe5b81526040805180830381526020928301825291820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000978816178152815160e08a901b90971687526001600160a01b038816600488019081526024880192835283516044890152835193979096509194506064909101925090808383600083811015612c46578181015183820152602001612c2e565b7f08c379a0000000000000000000000000000000000000000000000000000000006000908152602060045260076024526642414c23000030600a808404818106603090810160081b95839006959095019082900491820690940160101b939093010160c81b604452606490fd5b604051806104000160405280602090602082028036833750919291505056fe4c6971756964697479204d696e696e6720436f6d6d69747465652042414c20486f6c64657254656d706f7261727920766542414c204c6971756964697479204d696e696e672042414c20486f6c64657244656c61792066726f6d207365636f6e64207374616765206e6f742079657420656c6170736564566f74696e67457363726f77206e6f74206f776e656420627920417574686f72697a657241646170746f724761756765436f6e74726f6c6c6572206e6f74206f776e656420627920417574686f72697a657241646170746f7254656d706f7261727920506f6c79676f6e204c6971756964697479204d696e696e672042414c20486f6c64657254656d706f7261727920417262697472756d204c6971756964697479204d696e696e672042414c20486f6c646572a264697066735822122055dfbb84754ed022b2dc54fd6fc2b1dfb2c0a0bbe6b98c622977d867fce1e82964736f6c63430007010033000000000000000000000000239e55f427d44c3cc793f49bfb507ebe76638a2b0000000000000000000000008f42adbba1b16eaae3bb5754915e0d06059add75000000000000000000000000ed5ba579bb5d516263ff6e1c10fcac1040075fe20000000000000000000000004e7bbd911cf1efa442bc1b2e9ea01ffe785412ec00000000000000000000000094f68b54191f62f781fe8298a8a5fa3ed772d227000000000000000000000000b848f50141f3d4255b37ac288c25c109104f2158000000000000000000000000000000000000000000000000000000006241953000000000000000000000000000000000000000000000000000000000000a8c00
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101985760003560e01c8063761c4023116100e3578063b77984e91161008c578063e6dec36f11610066578063e6dec36f1461028e578063e758d36b14610296578063f5c458ab1461029e57610198565b8063b77984e91461025d578063dc8c9ec61461021d578063dce8b0cd1461028657610198565b80639912b3d4116100bd5780639912b3d414610245578063aaabadc51461024d578063b1e70e801461025557610198565b8063761c40231461022d578063844c7750146102355780638d928af81461023d57610198565b8063336d4dfc1161014557806342979adc1161011f57806342979adc14610215578063463d9e931461021d57806358de9ade1461022557610198565b8063336d4dfc146101fd5780633b54e68014610205578063410c2d8e1461020d57610198565b80631cdd07a4116101765780631cdd07a4146101e35780631e390389146101ed5780632bd46566146101f557610198565b80630249e6fa1461019d5780631235f8a3146101b75780631336e8d4146101db575b600080fd5b6101a56102a6565b60408051918252519081900360200190f35b6101bf6102ac565b604080516001600160a01b039092168252519081900360200190f35b6101a56102bb565b6101eb6102c7565b005b6101a561079e565b6101eb6107a4565b6101a5611dbb565b6101a5611dc7565b6101a5611deb565b6101a5611df6565b6101a5611e1a565b6101bf611e26565b6101bf611e4a565b6101bf611e59565b6101bf611e68565b6101a5611e8c565b6101bf611e92565b6101eb611f05565b610265612a72565b6040518082600381111561027557fe5b815260200191505060405180910390f35b6101bf612a7b565b6101bf612a9f565b6101bf612ac3565b6101bf612ae7565b60065481565b6002546001600160a01b031681565b67025bf6196bd1000081565b6102cf612af6565b600260085460ff1660038111156102e257fe5b1461034e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4e6f7420726561647920666f7220746869726420737461676500000000000000604482015290519081900360640190fd5b7f00000000000000000000000000000000000000000000000000000000000a8c00600654014210156103cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806135826027913960400191505060405180910390fd5b60006103d5612ac3565b905060006103e1611e92565b9050806001600160a01b0316632f2ff15d836001600160a01b031663851c1bb363db1ca26060e01b6040518263ffffffff1660e01b815260040180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060206040518083038186803b15801561045c57600080fd5b505afa158015610470573d6000803e3d6000fd5b505050506040513d602081101561048657600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b168152600481019290925230602483015251604480830192600092919082900301818387803b1580156104e457600080fd5b505af11580156104f8573d6000803e3d6000fd5b5050505061050f600067016345785d8a0000612b0f565b610522600167016345785d8a0000612b0f565b61053560026707c5850872380000612b0f565b610548600367025bf6196bd10000612b0f565b61055a600466f8b0a10e470000612b0f565b806001600160a01b031663d547741f836001600160a01b031663851c1bb363db1ca26060e01b6040518263ffffffff1660e01b815260040180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060206040518083038186803b1580156105d357600080fd5b505afa1580156105e7573d6000803e3d6000fd5b505050506040513d60208110156105fd57600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b168152600481019290925230602483015251604480830192600092919082900301818387803b15801561065b57600080fd5b505af115801561066f573d6000803e3d6000fd5b50505050806001600160a01b031663d547741f826001600160a01b031663a217fddf6040518163ffffffff1660e01b815260040160206040518083038186803b1580156106bb57600080fd5b505afa1580156106cf573d6000803e3d6000fd5b505050506040513d60208110156106e557600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b168152600481019290925230602483015251604480830192600092919082900301818387803b15801561074357600080fd5b505af1158015610757573d6000803e3d6000fd5b505042600755505060088054600391907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001835b0217905550505061079c612da3565b565b60055481565b6107ac612af6565b7f000000000000000000000000000000000000000000000000000000006241953042101561083b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4e6f7420726561647920666f722061637469766174696f6e0000000000000000604482015290519081900360640190fd5b600060085460ff16600381111561084e57fe5b146108ba57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4669727374207374657020616c726561647920706572666f726d656400000000604482015290519081900360640190fd5b60006108c4611e92565b90507f000000000000000000000000ba100000625a3754423978a60c9317c58a424e3d6001600160a01b03166391d148547f000000000000000000000000ba100000625a3754423978a60c9317c58a424e3d6001600160a01b031663a217fddf6040518163ffffffff1660e01b815260040160206040518083038186803b15801561094e57600080fd5b505afa158015610962573d6000803e3d6000fd5b505050506040513d602081101561097857600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526004810192909252306024830152516044808301926020929190829003018186803b1580156109d557600080fd5b505afa1580156109e9573d6000803e3d6000fd5b505050506040513d60208110156109ff57600080fd5b5051610a6c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f4e6f742042414c2061646d696e00000000000000000000000000000000000000604482015290519081900360640190fd5b604080517f9be2a884000000000000000000000000000000000000000000000000000000008152600060048201819052306024830152604482015290516001600160a01b03831691639be2a884916064808301926020929190829003018186803b158015610ad957600080fd5b505afa158015610aed573d6000803e3d6000fd5b505050506040513d6020811015610b0357600080fd5b5051610b7057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f4e6f7420417574686f72697a65722061646d696e000000000000000000000000604482015290519081900360640190fd5b6000610b7a612ac3565b9050806001600160a01b03167f000000000000000000000000c128468b7ce63ea702c1f104d55a2566b13d3abd6001600160a01b031663dfe050316040518163ffffffff1660e01b815260040160206040518083038186803b158015610bdf57600080fd5b505afa158015610bf3573d6000803e3d6000fd5b505050506040513d6020811015610c0957600080fd5b5051604080517ff851a44000000000000000000000000000000000000000000000000000000000815290516001600160a01b039092169163f851a44091600480820192602092909190829003018186803b158015610c6657600080fd5b505afa158015610c7a573d6000803e3d6000fd5b505050506040513d6020811015610c9057600080fd5b50516001600160a01b031614610cf1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b8152602001806135a9602b913960400191505060405180910390fd5b806001600160a01b03167f000000000000000000000000c128468b7ce63ea702c1f104d55a2566b13d3abd6001600160a01b031663f851a4406040518163ffffffff1660e01b815260040160206040518083038186803b158015610d5457600080fd5b505afa158015610d68573d6000803e3d6000fd5b505050506040513d6020811015610d7e57600080fd5b50516001600160a01b031614610ddf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001806135d4602e913960400191505060405180910390fd5b7f000000000000000000000000c128468b7ce63ea702c1f104d55a2566b13d3abd6001600160a01b0316639fba03a16040518163ffffffff1660e01b815260040160206040518083038186803b158015610e3857600080fd5b505afa158015610e4c573d6000803e3d6000fd5b505050506040513d6020811015610e6257600080fd5b5051600f0b15610ed357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f476175676520747970657320616c726561647920736574000000000000000000604482015290519081900360640190fd5b7f000000000000000000000000ba100000625a3754423978a60c9317c58a424e3d6001600160a01b0316632f2ff15d7f000000000000000000000000ba100000625a3754423978a60c9317c58a424e3d6001600160a01b031663a217fddf6040518163ffffffff1660e01b815260040160206040518083038186803b158015610f5b57600080fd5b505afa158015610f6f573d6000803e3d6000fd5b505050506040513d6020811015610f8557600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815260048101929092526001600160a01b037f000000000000000000000000f302f9f50958c5593770fdf4d4812309ff77414f16602483015251604480830192600092919082900301818387803b15801561100c57600080fd5b505af1158015611020573d6000803e3d6000fd5b5050604080517f851c1bb30000000000000000000000000000000000000000000000000000000081527f0f15f4c000000000000000000000000000000000000000000000000000000000600482015290516001600160a01b038087169450632f2ff15d93507f000000000000000000000000f302f9f50958c5593770fdf4d4812309ff77414f169163851c1bb3916024808301926020929190829003018186803b1580156110cd57600080fd5b505afa1580156110e1573d6000803e3d6000fd5b505050506040513d60208110156110f757600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b168152600481019290925230602483015251604480830192600092919082900301818387803b15801561115557600080fd5b505af1158015611169573d6000803e3d6000fd5b505050507f000000000000000000000000f302f9f50958c5593770fdf4d4812309ff77414f6001600160a01b0316630f15f4c06040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156111c857600080fd5b505af11580156111dc573d6000803e3d6000fd5b5050604080517f851c1bb30000000000000000000000000000000000000000000000000000000081527f40c10f1900000000000000000000000000000000000000000000000000000000600482015290516001600160a01b038087169450632f2ff15d93507f000000000000000000000000f302f9f50958c5593770fdf4d4812309ff77414f169163851c1bb3916024808301926020929190829003018186803b15801561128957600080fd5b505afa15801561129d573d6000803e3d6000fd5b505050506040513d60208110156112b357600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815260048101929092526001600160a01b037f000000000000000000000000239e55f427d44c3cc793f49bfb507ebe76638a2b16602483015251604480830192600092919082900301818387803b15801561133a57600080fd5b505af115801561134e573d6000803e3d6000fd5b5050604080517f851c1bb30000000000000000000000000000000000000000000000000000000081527f92d0d23200000000000000000000000000000000000000000000000000000000600482015290516001600160a01b038087169450632f2ff15d935085169163851c1bb3916024808301926020929190829003018186803b1580156113db57600080fd5b505afa1580156113ef573d6000803e3d6000fd5b505050506040513d602081101561140557600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b168152600481019290925230602483015251604480830192600092919082900301818387803b15801561146357600080fd5b505af1158015611477573d6000803e3d6000fd5b505050506114b96040518060400160405280601a81526020017f4c6971756964697479204d696e696e6720436f6d6d6974746565000000000000815250612daa565b6114f76040518060400160405280600581526020017f766542414c000000000000000000000000000000000000000000000000000000815250612daa565b6115356040518060400160405280600881526020017f457468657265756d000000000000000000000000000000000000000000000000815250612daa565b6115736040518060400160405280600781526020017f506f6c79676f6e00000000000000000000000000000000000000000000000000815250612daa565b6115b16040518060400160405280600881526020017f417262697472756d000000000000000000000000000000000000000000000000815250612daa565b816001600160a01b031663d547741f826001600160a01b031663851c1bb36392d0d23260e01b6040518263ffffffff1660e01b815260040180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060206040518083038186803b15801561162a57600080fd5b505afa15801561163e573d6000803e3d6000fd5b505050506040513d602081101561165457600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b168152600481019290925230602483015251604480830192600092919082900301818387803b1580156116b257600080fd5b505af11580156116c6573d6000803e3d6000fd5b5050604080517f851c1bb30000000000000000000000000000000000000000000000000000000081527f3a04f90000000000000000000000000000000000000000000000000000000000600482015290516001600160a01b038087169450632f2ff15d935085169163851c1bb3916024808301926020929190829003018186803b15801561175357600080fd5b505afa158015611767573d6000803e3d6000fd5b505050506040513d602081101561177d57600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815260048101929092526001600160a01b037f000000000000000000000000ed5ba579bb5d516263ff6e1c10fcac1040075fe216602483015251604480830192600092919082900301818387803b15801561180457600080fd5b505af1158015611818573d6000803e3d6000fd5b5050604080517f851c1bb30000000000000000000000000000000000000000000000000000000081527f3a04f90000000000000000000000000000000000000000000000000000000000600482015290516001600160a01b038087169450632f2ff15d935085169163851c1bb3916024808301926020929190829003018186803b1580156118a557600080fd5b505afa1580156118b9573d6000803e3d6000fd5b505050506040513d60208110156118cf57600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b168152600481019290925230602483015251604480830192600092919082900301818387803b15801561192d57600080fd5b505af1158015611941573d6000803e3d6000fd5b505050506119746000604051806060016040528060258152602001613532602591396001546001600160a01b0316613091565b6119a360016040518060600160405280602b8152602001613557602b91396002546001600160a01b0316613091565b6119d260036040518060600160405280602d8152602001613602602d91396003546001600160a01b0316613091565b611a0160046040518060600160405280602e815260200161362f602e91396004546001600160a01b0316613091565b816001600160a01b031663d547741f826001600160a01b031663851c1bb3633a04f90060e01b6040518263ffffffff1660e01b815260040180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060206040518083038186803b158015611a7a57600080fd5b505afa158015611a8e573d6000803e3d6000fd5b505050506040513d6020811015611aa457600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b168152600481019290925230602483015251604480830192600092919082900301818387803b158015611b0257600080fd5b505af1158015611b16573d6000803e3d6000fd5b5050604080517f851c1bb30000000000000000000000000000000000000000000000000000000081527fe8de0d4d00000000000000000000000000000000000000000000000000000000600482015290516001600160a01b038087169450632f2ff15d935085169163851c1bb3916024808301926020929190829003018186803b158015611ba357600080fd5b505afa158015611bb7573d6000803e3d6000fd5b505050506040513d6020811015611bcd57600080fd5b5051600154604080517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815260048101939093526001600160a01b03909116602483015251604480830192600092919082900301818387803b158015611c3857600080fd5b505af1158015611c4c573d6000803e3d6000fd5b5050604080517f851c1bb30000000000000000000000000000000000000000000000000000000081527f058a3a2400000000000000000000000000000000000000000000000000000000600482015290516001600160a01b038087169450632f2ff15d935085169163851c1bb3916024808301926020929190829003018186803b158015611cd957600080fd5b505afa158015611ced573d6000803e3d6000fd5b505050506040513d6020811015611d0357600080fd5b5051600154604080517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815260048101939093526001600160a01b03909116602483015251604480830192600092919082900301818387803b158015611d6e57600080fd5b505af1158015611d82573d6000803e3d6000fd5b505042600555505060088054600191907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016828061078d565b6707c585087238000081565b7f000000000000000000000000000000000000000000000000000000006241953090565b66f8b0a10e47000081565b7f00000000000000000000000000000000000000000000000000000000000a8c0090565b67016345785d8a000081565b7f000000000000000000000000c128468b7ce63ea702c1f104d55a2566b13d3abd90565b6001546001600160a01b031681565b6004546001600160a01b031681565b7f000000000000000000000000ba12222222228d8ba445958a75a0704d566bf2c890565b60075481565b6000611e9c611e68565b6001600160a01b031663aaabadc56040518163ffffffff1660e01b815260040160206040518083038186803b158015611ed457600080fd5b505afa158015611ee8573d6000803e3d6000fd5b505050506040513d6020811015611efe57600080fd5b5051905090565b611f0d612af6565b600160085460ff166003811115611f2057fe5b14611f8c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4e6f7420726561647920666f72207365636f6e64207374616765000000000000604482015290519081900360640190fd5b6000611f96611e92565b9050611fa0613512565b5060408051610400810182527306df3b2bbb68adc8b0e302443692037ed9f91b42815273072f14b85add63488ddad88f855fda4a99d6ac9b602080830191909152730b09dea16768f0799065c475be02919503cb2a358284015273186084ff790c65088ba694df11758fae4943ee9e6060830152731e19cf2d73a72ef1332c882f20534b6519be027660808301527327c9f71cc31464b906e0006d4fcbc8900f48f15f60a08301527332296969ef14eb0c6d29669c550d4a044913023060c083015273350196326aeaa9b98f1903fb5e8fc2686f85318c60e0830152733e5fa9518ea95c3e533eb377c001702a9aacaa32610100830152734bd6d86debdb9f5413e631ad386c4427dc9d01b26101208301527351735bdfbfe3fc13dea8dc6502e2e95898942961610140830152735d66fff62c17d841935b60df5f07f6cf79bd0f47610160830152735f7fa48d765053f8dd85e052843e12d23e3d7bc561018083015273702605f43471183158938c1a3e5f5a359d7b31ba6101a0830152737b50775383d3d6f0215a8f290f2c9e2eebbeceb26101c0830152737edde0cb05ed19e03a9a47cd5e53fc57fde1c80c6101e0830152738f4205e1604133d1875a3e771ae7e4f2b08656396102008301527390291319f1d4ea3ad4db0dd8fe9e12baf749e8456102208301527396646936b91d6b9d7d0c47c496afbf3d6ec7b6f86102408301527396ba9025311e2f47b840a1f68ed57a3df1ea874761026083015273a02e4b3d18d4e6b8d18ac421fbc3dfff8933c40a61028083015273a6f548df93de924d73be7d25dc02554c6bd66db56102a083015273baeec99c90e3420ec6c1e7a769d2a856d2898e4d6102c083015273bf96189eee9357a95c7719f4f5047f76bde804e56102e083015273e2469f47ab58cf9cf59f9822e3c5de4950a41c4961030083015273e99481dc77691d8e2456e5f3f61c1810adfc150361032083015273ec60a5fef79a92c741cb74fdd6bfc340c0279b0161034083015273edf085f65b4f6c155e13155502ef925c9a75600361036083015273efaa1604e82e1b3af8430b90192c1b9e8197e37761038083015273f4c0dd9b82da36c07605df83c8a416f11724d88b6103a083015273f5aaf7ee8c39b651cebf5f1f50c10631e78e0ef96103c083015273feadd389a5c427952d8fdb8057d6c8ba1156cc566103e083015282517f851c1bb30000000000000000000000000000000000000000000000000000000081527f6440e973000000000000000000000000000000000000000000000000000000006004820152925191926001600160a01b0385811693632f2ff15d937f000000000000000000000000ed5ba579bb5d516263ff6e1c10fcac1040075fe29092169263851c1bb3926024808301939192829003018186803b1580156123ac57600080fd5b505afa1580156123c0573d6000803e3d6000fd5b505050506040513d60208110156123d657600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b168152600481019290925230602483015251604480830192600092919082900301818387803b15801561243457600080fd5b505af1158015612448573d6000803e3d6000fd5b505050507f000000000000000000000000ed5ba579bb5d516263ff6e1c10fcac1040075fe26001600160a01b0316636440e9737f0000000000000000000000004e7bbd911cf1efa442bc1b2e9ea01ffe785412ec60026040518363ffffffff1660e01b815260040180836001600160a01b031681526020018260048111156124cc57fe5b815260200192505050600060405180830381600087803b1580156124ef57600080fd5b505af1158015612503573d6000803e3d6000fd5b5050604080517f851c1bb30000000000000000000000000000000000000000000000000000000081527f6440e97300000000000000000000000000000000000000000000000000000000600482015290516001600160a01b03808716945063d547741f93507f000000000000000000000000ed5ba579bb5d516263ff6e1c10fcac1040075fe2169163851c1bb3916024808301926020929190829003018186803b1580156125b057600080fd5b505afa1580156125c4573d6000803e3d6000fd5b505050506040513d60208110156125da57600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b168152600481019290925230602483015251604480830192600092919082900301818387803b15801561263857600080fd5b505af115801561264c573d6000803e3d6000fd5b5050604080517f851c1bb30000000000000000000000000000000000000000000000000000000081527f5e45a27300000000000000000000000000000000000000000000000000000000600482015290516001600160a01b038087169450632f2ff15d93507f000000000000000000000000ed5ba579bb5d516263ff6e1c10fcac1040075fe2169163851c1bb3916024808301926020929190829003018186803b1580156126f957600080fd5b505afa15801561270d573d6000803e3d6000fd5b505050506040513d602081101561272357600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b168152600481019290925230602483015251604480830192600092919082900301818387803b15801561278157600080fd5b505af1158015612795573d6000803e3d6000fd5b506020925060009150505b818110156129025760007f0000000000000000000000004e7bbd911cf1efa442bc1b2e9ea01ffe785412ec6001600160a01b0316639ed933188584602081106127e557fe5b60200201516040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050602060405180830381600087803b15801561282957600080fd5b505af115801561283d573d6000803e3d6000fd5b505050506040513d602081101561285357600080fd5b5051604080517f5e45a2730000000000000000000000000000000000000000000000000000000081526001600160a01b03808416600483015291519293507f000000000000000000000000ed5ba579bb5d516263ff6e1c10fcac1040075fe290911691635e45a2739160248082019260009290919082900301818387803b1580156128dd57600080fd5b505af11580156128f1573d6000803e3d6000fd5b5050600190930192506127a0915050565b50826001600160a01b031663d547741f7f000000000000000000000000ed5ba579bb5d516263ff6e1c10fcac1040075fe26001600160a01b031663851c1bb3635e45a27360e01b6040518263ffffffff1660e01b815260040180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060206040518083038186803b15801561299c57600080fd5b505afa1580156129b0573d6000803e3d6000fd5b505050506040513d60208110156129c657600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b168152600481019290925230602483015251604480830192600092919082900301818387803b158015612a2457600080fd5b505af1158015612a38573d6000803e3d6000fd5b505042600655505060088054600292507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018361078d565b60085460ff1690565b7f000000000000000000000000239e55f427d44c3cc793f49bfb507ebe76638a2b90565b7f000000000000000000000000f302f9f50958c5593770fdf4d4812309ff77414f90565b7f0000000000000000000000008f42adbba1b16eaae3bb5754915e0d06059add7590565b6003546001600160a01b031681565b612b086002600054141561019061337a565b6002600055565b612b17612ac3565b6001600160a01b0316634036176a7f000000000000000000000000c128468b7ce63ea702c1f104d55a2566b13d3abd7fdb1ca26000000000000000000000000000000000000000000000000000000000856004811115612b7357fe5b856040516024018083600f0b815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518363ffffffff1660e01b815260040180836001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612c46578181015183820152602001612c2e565b50505050905090810190601f168015612c735780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b158015612c9357600080fd5b505af1158015612ca7573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526020811015612cee57600080fd5b8101908080516040519392919084640100000000821115612d0e57600080fd5b908301906020820185811115612d2357600080fd5b8251640100000000811182820188101715612d3d57600080fd5b82525081516020918201929091019080838360005b83811015612d6a578181015183820152602001612d52565b50505050905090810190601f168015612d975780820380516001836020036101000a031916815260200191505b50604052505050505050565b6001600055565b612db2612ac3565b6001600160a01b0316634036176a7f000000000000000000000000c128468b7ce63ea702c1f104d55a2566b13d3abd6392d0d23260e01b8460006040516024018080602001838152602001828103825284818151815260200191508051906020019080838360005b83811015612e32578181015183820152602001612e1a565b50505050905090810190601f168015612e5f5780820380516001836020036101000a031916815260200191505b50604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000988916178152815160e08b901b90981688526001600160a01b0389166004890190815260248901928352835160448a01528351939890975091955060649091019350915080838360005b83811015612f35578181015183820152602001612f1d565b50505050905090810190601f168015612f625780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b158015612f8257600080fd5b505af1158015612f96573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526020811015612fdd57600080fd5b8101908080516040519392919084640100000000821115612ffd57600080fd5b90830190602082018581111561301257600080fd5b825164010000000081118282018810171561302c57600080fd5b82525081516020918201929091019080838360005b83811015613059578181015183820152602001613041565b50505050905090810190601f1680156130865780820380516001836020036101000a031916815260200191505b506040525050505050565b60007f000000000000000000000000b848f50141f3d4255b37ac288c25c109104f21586001600160a01b031663b6a46b3b846040518263ffffffff1660e01b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561310f5781810151838201526020016130f7565b50505050905090810190601f16801561313c5780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b15801561315b57600080fd5b505af115801561316f573d6000803e3d6000fd5b505050506040513d602081101561318557600080fd5b5051604080517f9ed933180000000000000000000000000000000000000000000000000000000081526001600160a01b03808416600483015291519293506000927f00000000000000000000000094f68b54191f62f781fe8298a8a5fa3ed772d22790921691639ed933189160248082019260209290919082900301818787803b15801561321257600080fd5b505af1158015613226573d6000803e3d6000fd5b505050506040513d602081101561323c57600080fd5b5051905061324a818661338c565b613252611e92565b6001600160a01b0316632f2ff15d836001600160a01b031663851c1bb363c107532960e01b6040518263ffffffff1660e01b815260040180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060206040518083038186803b1580156132ca57600080fd5b505afa1580156132de573d6000803e3d6000fd5b505050506040513d60208110156132f457600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815260048101929092526001600160a01b038716602483015251604480830192600092919082900301818387803b15801561335b57600080fd5b505af115801561336f573d6000803e3d6000fd5b505050505050505050565b8161338857613388816134a5565b5050565b613394612ac3565b6001600160a01b0316634036176a7f000000000000000000000000c128468b7ce63ea702c1f104d55a2566b13d3abd633a04f90060e01b858560405160240180836001600160a01b031681526020018260048111156133ef57fe5b81526040805180830381526020928301825291820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000978816178152815160e08a901b90971687526001600160a01b038816600488019081526024880192835283516044890152835193979096509194506064909101925090808383600083811015612c46578181015183820152602001612c2e565b7f08c379a0000000000000000000000000000000000000000000000000000000006000908152602060045260076024526642414c23000030600a808404818106603090810160081b95839006959095019082900491820690940160101b939093010160c81b604452606490fd5b604051806104000160405280602090602082028036833750919291505056fe4c6971756964697479204d696e696e6720436f6d6d69747465652042414c20486f6c64657254656d706f7261727920766542414c204c6971756964697479204d696e696e672042414c20486f6c64657244656c61792066726f6d207365636f6e64207374616765206e6f742079657420656c6170736564566f74696e67457363726f77206e6f74206f776e656420627920417574686f72697a657241646170746f724761756765436f6e74726f6c6c6572206e6f74206f776e656420627920417574686f72697a657241646170746f7254656d706f7261727920506f6c79676f6e204c6971756964697479204d696e696e672042414c20486f6c64657254656d706f7261727920417262697472756d204c6971756964697479204d696e696e672042414c20486f6c646572a264697066735822122055dfbb84754ed022b2dc54fd6fc2b1dfb2c0a0bbe6b98c622977d867fce1e82964736f6c63430007010033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000239e55f427d44c3cc793f49bfb507ebe76638a2b0000000000000000000000008f42adbba1b16eaae3bb5754915e0d06059add75000000000000000000000000ed5ba579bb5d516263ff6e1c10fcac1040075fe20000000000000000000000004e7bbd911cf1efa442bc1b2e9ea01ffe785412ec00000000000000000000000094f68b54191f62f781fe8298a8a5fa3ed772d227000000000000000000000000b848f50141f3d4255b37ac288c25c109104f2158000000000000000000000000000000000000000000000000000000006241953000000000000000000000000000000000000000000000000000000000000a8c00
-----Decoded View---------------
Arg [0] : balancerMinter (address): 0x239e55F427D44C3cc793f49bFB507ebe76638a2b
Arg [1] : authorizerAdaptor (address): 0x8F42aDBbA1B16EaAE3BB5754915E0D06059aDd75
Arg [2] : gaugeAdder (address): 0xEd5ba579bB5D516263ff6E1C10fcAc1040075Fe2
Arg [3] : ethereumGaugeFactory (address): 0x4E7bBd911cf1EFa442BC1b2e9Ea01ffE785412EC
Arg [4] : singleRecipientGaugeFactory (address): 0x94f68b54191F62f781Fe8298A8A5Fa3ed772d227
Arg [5] : balTokenHolderFactory (address): 0xB848f50141F3D4255b37aC288C25C109104F2158
Arg [6] : activationScheduledTime (uint256): 1648465200
Arg [7] : thirdStageDelay (uint256): 691200
-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 000000000000000000000000239e55f427d44c3cc793f49bfb507ebe76638a2b
Arg [1] : 0000000000000000000000008f42adbba1b16eaae3bb5754915e0d06059add75
Arg [2] : 000000000000000000000000ed5ba579bb5d516263ff6e1c10fcac1040075fe2
Arg [3] : 0000000000000000000000004e7bbd911cf1efa442bc1b2e9ea01ffe785412ec
Arg [4] : 00000000000000000000000094f68b54191f62f781fe8298a8a5fa3ed772d227
Arg [5] : 000000000000000000000000b848f50141f3d4255b37ac288c25c109104f2158
Arg [6] : 0000000000000000000000000000000000000000000000000000000062419530
Arg [7] : 00000000000000000000000000000000000000000000000000000000000a8c00
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.