More Info
Private Name Tags
ContractCreator
Latest 5 from a total of 5 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Transfer Ownersh... | 16224806 | 798 days ago | IN | 0 ETH | 0.00034456 | ||||
Add Reward Token | 16224787 | 798 days ago | IN | 0 ETH | 0.00088636 | ||||
Add Reward Token | 16224785 | 798 days ago | IN | 0 ETH | 0.00088636 | ||||
Add Reward Token | 16224784 | 798 days ago | IN | 0 ETH | 0.0008496 | ||||
Set Approvals | 16224775 | 798 days ago | IN | 0 ETH | 0.00228264 |
Advanced mode: Intended for advanced users or developers and will display all Internal Transactions including zero value transfers. Name tag integration is not available in advanced view.
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
||||
---|---|---|---|---|---|---|---|
21634995 | 40 days ago | 0 ETH | |||||
21634995 | 40 days ago | 0 ETH | |||||
21634995 | 40 days ago | 0 ETH | |||||
21634995 | 40 days ago | 0 ETH | |||||
21634995 | 40 days ago | 0 ETH | |||||
21542749 | 53 days ago | 0 ETH | |||||
21542749 | 53 days ago | 0 ETH | |||||
21542749 | 53 days ago | 0 ETH | |||||
21542749 | 53 days ago | 0 ETH | |||||
21542749 | 53 days ago | 0 ETH | |||||
21540609 | 54 days ago | 0 ETH | |||||
21540609 | 54 days ago | 0 ETH | |||||
21540609 | 54 days ago | 0 ETH | |||||
21540609 | 54 days ago | 0 ETH | |||||
21540609 | 54 days ago | 0 ETH | |||||
21507528 | 58 days ago | 0 ETH | |||||
21507528 | 58 days ago | 0 ETH | |||||
21507528 | 58 days ago | 0 ETH | |||||
21507528 | 58 days ago | 0 ETH | |||||
21507528 | 58 days ago | 0 ETH | |||||
21495716 | 60 days ago | 0 ETH | |||||
21495716 | 60 days ago | 0 ETH | |||||
21495716 | 60 days ago | 0 ETH | |||||
21495716 | 60 days ago | 0 ETH | |||||
21495716 | 60 days ago | 0 ETH |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
AuraBalStrategy
Compiler Version
v0.8.9+commit.e5eed63a
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "Ownable.sol"; import "SafeERC20.sol"; import "ERC20.sol"; import "IGenericVault.sol"; import "IStrategy.sol"; import "IRewards.sol"; import "IRewardHandler.sol"; import "StrategyBase.sol"; contract AuraBalStrategy is Ownable, AuraBalStrategyBase { using SafeERC20 for IERC20; address public immutable vault; address[] public rewardTokens; mapping(address => address) public rewardHandlers; uint256 public constant FEE_DENOMINATOR = 10000; constructor(address _vault) { vault = _vault; } /// @notice Set approvals for the contracts used when swapping & staking function setApprovals() external { IERC20(AURABAL_TOKEN).safeApprove(AURABAL_STAKING, 0); IERC20(AURABAL_TOKEN).safeApprove(AURABAL_STAKING, type(uint256).max); IERC20(BAL_TOKEN).safeApprove(BAL_VAULT, 0); IERC20(BAL_TOKEN).safeApprove(BAL_VAULT, type(uint256).max); IERC20(WETH_TOKEN).safeApprove(BAL_VAULT, 0); IERC20(WETH_TOKEN).safeApprove(BAL_VAULT, type(uint256).max); IERC20(BAL_ETH_POOL_TOKEN).safeApprove(AURABAL_PT_DEPOSIT, 0); IERC20(BAL_ETH_POOL_TOKEN).safeApprove( AURABAL_PT_DEPOSIT, type(uint256).max ); IERC20(BAL_ETH_POOL_TOKEN).safeApprove(BAL_VAULT, 0); IERC20(BAL_ETH_POOL_TOKEN).safeApprove(BAL_VAULT, type(uint256).max); } /// @notice update the token to handler mapping function _updateRewardToken(address _token, address _handler) internal { rewardHandlers[_token] = _handler; } /// @notice Add a reward token and its handler /// @dev For tokens that should not be swapped (i.e. BAL rewards) /// use address as zero handler /// @param _token the reward token to add /// @param _handler address of the contract that will sell for BAL or ETH function addRewardToken(address _token, address _handler) external onlyOwner { rewardTokens.push(_token); _updateRewardToken(_token, _handler); } /// @notice Update the handler of a reward token /// @dev Used to update a handler or retire a token (set handler to address 0) /// @param _token the reward token to add /// @param _handler address of the contract that will sell for BAL or ETH function updateRewardToken(address _token, address _handler) external onlyOwner { _updateRewardToken(_token, _handler); } /// @notice returns the number of reward tokens /// @return the number of reward tokens function totalRewardTokens() external view returns (uint256) { return rewardTokens.length; } /// @notice Query the amount currently staked /// @return total - the total amount of tokens staked function totalUnderlying() public view returns (uint256 total) { return auraBalStaking.balanceOf(address(this)); } /// @notice Deposits underlying tokens in the staking contract function stake(uint256 _amount) public onlyVault { auraBalStaking.stake(_amount); } /// @notice Withdraw a certain amount from the staking contract /// @param _amount - the amount to withdraw /// @dev Can only be called by the vault function withdraw(uint256 _amount) external onlyVault { auraBalStaking.withdraw(_amount, false); IERC20(AURABAL_TOKEN).safeTransfer(vault, _amount); } /// @notice Lock or swap 20WETH-80BAL LP tokens for auraBal /// @param _lock - whether to lock or swap /// @param _minAmountOut - minimum expected amount of auraBal /// @return the amount of auraBal obtained from lock or swap function _lockOrSwap(bool _lock, uint256 _minAmountOut) internal returns (uint256) { uint256 _bptBalance = IERC20(BAL_ETH_POOL_TOKEN).balanceOf( address(this) ); if (_lock) { // if we lost to much too slippage, revert if (_bptBalance < _minAmountOut) { revert("slippage"); } // lock without staking to receive auraBAL bptDepositor.deposit(_bptBalance, true, address(0)); // the mint is 1:1 return _bptBalance; } else { // if not locking we'll swap on the pool return _swapBptToAuraBal(_bptBalance, _minAmountOut); } } function _levyFees(uint256 _auraBalBalance, address _caller) internal returns (uint256) { uint256 platformFee = IGenericVault(vault).platformFee(); uint256 callIncentive = IGenericVault(vault).callIncentive(); uint256 _stakingAmount = _auraBalBalance; // if this is the last call, no fees if (IGenericVault(vault).totalSupply() != 0) { // Deduce and pay out incentive to caller (not needed for final exit) if (callIncentive > 0) { uint256 incentiveAmount = (_auraBalBalance * callIncentive) / FEE_DENOMINATOR; IERC20(AURABAL_TOKEN).safeTransfer(_caller, incentiveAmount); _stakingAmount = _stakingAmount - incentiveAmount; } // Deduce and pay platform fee if (platformFee > 0) { uint256 feeAmount = (_auraBalBalance * platformFee) / FEE_DENOMINATOR; IERC20(AURABAL_TOKEN).safeTransfer( IGenericVault(vault).platform(), feeAmount ); _stakingAmount = _stakingAmount - feeAmount; } } return _stakingAmount; } /// @notice Claim rewards and swaps them to FXS for restaking /// @dev Can be called by the vault only /// @param _caller - the address calling the harvest on the vault /// @param _minAmountOut - min amount of LP tokens to receive w/o revert /// @param _lock - whether to lock or swap /// @return harvested - the amount harvested function harvest( address _caller, uint256 _minAmountOut, bool _lock ) public onlyVault returns (uint256 harvested) { // claim rewards auraBalStaking.getReward(); // process rewards address[] memory _rewardTokens = rewardTokens; for (uint256 i; i < _rewardTokens.length; ++i) { address _tokenHandler = rewardHandlers[_rewardTokens[i]]; if (_tokenHandler == address(0)) { continue; } uint256 _tokenBalance = IERC20(_rewardTokens[i]).balanceOf( address(this) ); if (_tokenBalance > 0) { IERC20(_rewardTokens[i]).safeTransfer( _tokenHandler, _tokenBalance ); IRewardHandler(_tokenHandler).sell(); } } uint256 _wethBalance = IERC20(WETH_TOKEN).balanceOf(address(this)); uint256 _balBalance = IERC20(BAL_TOKEN).balanceOf(address(this)); if (_wethBalance + _balBalance == 0) { return 0; } // Deposit to BLP _depositToBalEthPool(_balBalance, _wethBalance, 0); // lock or swap the LP tokens for aura BAL uint256 _auraBalBalance = _lockOrSwap(_lock, _minAmountOut); if (_auraBalBalance > 0) { uint256 _stakingAmount = _levyFees(_auraBalBalance, _caller); // stake what is left after fees stake(_stakingAmount); return _stakingAmount; } return 0; } modifier onlyVault() { require(vault == msg.sender, "Vault calls only"); _; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "IERC20.sol"; import "Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.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: MIT pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "IERC20.sol"; import "IERC20Metadata.sol"; import "Context.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The defaut value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor (string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _approve(sender, _msgSender(), currentAllowance - amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - subtractedValue); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = senderBalance - amount; _balances[recipient] += amount; emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); _balances[account] = accountBalance - amount; _totalSupply -= amount; emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; interface IGenericVault { function withdraw(address _to, uint256 _shares) external returns (uint256 withdrawn); function withdrawAll(address _to) external returns (uint256 withdrawn); function depositAll(address _to) external returns (uint256 _shares); function deposit(address _to, uint256 _amount) external returns (uint256 _shares); function harvest() external; function balanceOfUnderlying(address user) external view returns (uint256 amount); function totalUnderlying() external view returns (uint256 total); function totalSupply() external view returns (uint256 total); function underlying() external view returns (address); function strategy() external view returns (address); function platform() external view returns (address); function setPlatform(address _platform) external; function setPlatformFee(uint256 _fee) external; function setCallIncentive(uint256 _incentive) external; function setWithdrawalPenalty(uint256 _penalty) external; function setApprovals() external; function callIncentive() external view returns (uint256); function platformFee() external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; interface IStrategy { function harvest(address _caller) external returns (uint256 harvested); function harvest(address _caller, uint256 _minAmountOut) external returns (uint256 harvested); function totalUnderlying() external view returns (uint256 total); function stake(uint256 _amount) external; function withdraw(uint256 _amount) external; function setApprovals() external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; interface IRewards { function balanceOf(address) external view returns (uint256); function stake(address, uint256) external; function stakeFor(address, uint256) external; function withdraw(address, uint256) external; function exit(address) external; function getReward(address) external; function queueNewRewards(uint256) external; function notifyRewardAmount(uint256) external; function addExtraReward(address) external; function stakingToken() external view returns (address); function rewardToken() external view returns (address); function earned(address account) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; interface IRewardHandler { function sell() external; function setPendingOwner(address _po) external; function applyPendingOwner() external; function rescueToken(address _token, address _to) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "IBasicRewards.sol"; import "IBalancer.sol"; import "IAsset.sol"; import "IBalPtDeposit.sol"; contract AuraBalStrategyBase { address public constant AURABAL_PT_DEPOSIT = 0xeAd792B55340Aa20181A80d6a16db6A0ECd1b827; address public constant AURABAL_STAKING = 0x00A7BA8Ae7bca0B10A32Ea1f8e2a1Da980c6CAd2; address public constant BAL_VAULT = 0xBA12222222228d8Ba445958a75a0704d566BF2C8; address public constant BBUSD_TOKEN = 0x7B50775383d3D6f0215A8F290f2C9e2eEBBEceb2; address public constant AURA_TOKEN = 0xC0c293ce456fF0ED870ADd98a0828Dd4d2903DBF; address public constant AURABAL_TOKEN = 0x616e8BfA43F920657B3497DBf40D6b1A02D4608d; address public constant WETH_TOKEN = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; address public constant BAL_TOKEN = 0xba100000625a3754423978a60c9317c58a424e3D; address public constant BAL_ETH_POOL_TOKEN = 0x5c6Ee304399DBdB9C8Ef030aB642B10820DB8F56; bytes32 private constant AURABAL_BAL_ETH_BPT_POOL_ID = 0x3dd0843a028c86e0b760b1a76929d1c5ef93a2dd000200000000000000000249; bytes32 private constant BAL_ETH_POOL_ID = 0x5c6ee304399dbdb9c8ef030ab642b10820db8f56000200000000000000000014; IBasicRewards public auraBalStaking = IBasicRewards(AURABAL_STAKING); IBalancerVault public balVault = IBalancerVault(BAL_VAULT); IBalPtDeposit public bptDepositor = IBalPtDeposit(AURABAL_PT_DEPOSIT); /// @notice Deposit BAL and WETH to the BAL-ETH pool /// @param _wethAmount - amount of wETH to deposit /// @param _balAmount - amount of BAL to deposit /// @param _minAmountOut - min amount of BPT expected function _depositToBalEthPool( uint256 _balAmount, uint256 _wethAmount, uint256 _minAmountOut ) internal { IAsset[] memory _assets = new IAsset[](2); _assets[0] = IAsset(BAL_TOKEN); _assets[1] = IAsset(WETH_TOKEN); uint256[] memory _amountsIn = new uint256[](2); _amountsIn[0] = _balAmount; _amountsIn[1] = _wethAmount; balVault.joinPool( BAL_ETH_POOL_ID, address(this), address(this), IBalancerVault.JoinPoolRequest( _assets, _amountsIn, abi.encode( JoinKind.EXACT_TOKENS_IN_FOR_BPT_OUT, _amountsIn, _minAmountOut ), false ) ); } function _swapBptToAuraBal(uint256 _amount, uint256 _minAmountOut) internal returns (uint256) { IBalancerVault.SingleSwap memory _auraSwapParams = IBalancerVault .SingleSwap({ poolId: AURABAL_BAL_ETH_BPT_POOL_ID, kind: IBalancerVault.SwapKind.GIVEN_IN, assetIn: IAsset(BAL_ETH_POOL_TOKEN), assetOut: IAsset(AURABAL_TOKEN), amount: _amount, userData: new bytes(0) }); return balVault.swap( _auraSwapParams, _createSwapFunds(), _minAmountOut, block.timestamp + 1 ); } /// @notice Returns a FundManagement struct used for BAL swaps function _createSwapFunds() internal returns (IBalancerVault.FundManagement memory) { return IBalancerVault.FundManagement({ sender: address(this), fromInternalBalance: false, recipient: payable(address(this)), toInternalBalance: false }); } receive() external payable {} }
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.9; interface IBasicRewards { function stakeFor(address, uint256) external returns (bool); function balanceOf(address) external view returns (uint256); function earned(address) external view returns (uint256); function withdrawAll(bool) external returns (bool); function withdraw(uint256, bool) external returns (bool); function withdrawAndUnwrap(uint256 amount, bool claim) external returns (bool); function getReward() external returns (bool); function stake(uint256) external returns (bool); function extraRewards(uint256) external view returns (address); function exit() external returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import {IAsset} from "IAsset.sol"; enum ExitKind { EXACT_BPT_IN_FOR_ONE_TOKEN_OUT, EXACT_BPT_IN_FOR_TOKENS_OUT, BPT_IN_FOR_EXACT_TOKENS_OUT } enum JoinKind { INIT, EXACT_TOKENS_IN_FOR_BPT_OUT, TOKEN_IN_FOR_EXACT_BPT_OUT, ALL_TOKENS_IN_FOR_EXACT_BPT_OUT, ADD_TOKEN // for Managed Pool } interface IBalancerVault { /** * @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; } // 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 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); /** * @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 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; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; /** * @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: MIT pragma solidity 0.8.9; interface IBalPtDeposit { function deposit( uint256 _amount, bool _lock, address _stakeAddress ) external; }
{ "evmVersion": "istanbul", "optimizer": { "enabled": true, "runs": 200 }, "libraries": { "Strategy.sol": {} }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_vault","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"AURABAL_PT_DEPOSIT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"AURABAL_STAKING","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"AURABAL_TOKEN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"AURA_TOKEN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BAL_ETH_POOL_TOKEN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BAL_TOKEN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BAL_VAULT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BBUSD_TOKEN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEE_DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WETH_TOKEN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_handler","type":"address"}],"name":"addRewardToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"auraBalStaking","outputs":[{"internalType":"contract IBasicRewards","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"balVault","outputs":[{"internalType":"contract IBalancerVault","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bptDepositor","outputs":[{"internalType":"contract IBalPtDeposit","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_caller","type":"address"},{"internalType":"uint256","name":"_minAmountOut","type":"uint256"},{"internalType":"bool","name":"_lock","type":"bool"}],"name":"harvest","outputs":[{"internalType":"uint256","name":"harvested","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewardHandlers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rewardTokens","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"setApprovals","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalRewardTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalUnderlying","outputs":[{"internalType":"uint256","name":"total","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_handler","type":"address"}],"name":"updateRewardToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vault","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60a0604052600180546001600160a01b031990811672a7ba8ae7bca0b10a32ea1f8e2a1da980c6cad21790915560028054821673ba12222222228d8ba445958a75a0704d566bf2c81790556003805490911673ead792b55340aa20181a80d6a16db6a0ecd1b82717905534801561007557600080fd5b50604051620022a7380380620022a7833981016040819052610096916100e8565b600080546001600160a01b031916339081178255604051909182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3506001600160a01b0316608052610118565b6000602082840312156100fa57600080fd5b81516001600160a01b038116811461011157600080fd5b9392505050565b60805161213b6200016c6000396000818161054c015281816105fc015281816106e2015281816109b701528181610a7f01528181611567015281816115fc01528181611694015261179c015261213b6000f3fe6080604052600436106101a05760003560e01c80638a5a167e116100ec578063ce0744ed1161008a578063ded2379b11610064578063ded2379b146104c4578063ede202a8146104e4578063f2fde38b1461051a578063fbfa77cf1461053a57600080fd5b8063ce0744ed1461045e578063d1e1a86714610486578063d73792a9146104ae57600080fd5b8063a694fc3a116100c6578063a694fc3a146103e1578063bab7028f14610401578063c584d40e14610421578063c70920bc1461044957600080fd5b80638a5a167e146103745780638da5cb5b1461039c5780639ccd9e9d146103ba57600080fd5b80634128f86e1161015957806377aba2131161013357806377aba213146102f75780637bb7bed1146103175780637c6b513f146103375780638757b15b1461035f57600080fd5b80634128f86e146102a2578063715018a6146102c2578063749ef752146102d757600080fd5b80630762a3dd146101ac5780631b0875a6146101f157806323cb2390146102105780632abc2a99146102325780632e1a7d4d1461025a57806337d277d41461027a57600080fd5b366101a757005b600080fd5b3480156101b857600080fd5b506101d4735c6ee304399dbdb9c8ef030ab642b10820db8f5681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156101fd57600080fd5b506004545b6040519081526020016101e8565b34801561021c57600080fd5b5061023061022b366004611c0e565b61056e565b005b34801561023e57600080fd5b506101d473ba100000625a3754423978a60c9317c58a424e3d81565b34801561026657600080fd5b50610230610275366004611c47565b6105fa565b34801561028657600080fd5b506101d473c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b3480156102ae57600080fd5b506001546101d4906001600160a01b031681565b3480156102ce57600080fd5b5061023061070a565b3480156102e357600080fd5b506003546101d4906001600160a01b031681565b34801561030357600080fd5b506002546101d4906001600160a01b031681565b34801561032357600080fd5b506101d4610332366004611c47565b61077e565b34801561034357600080fd5b506101d4737b50775383d3d6f0215a8f290f2c9e2eebbeceb281565b34801561036b57600080fd5b506102306107a8565b34801561038057600080fd5b506101d473616e8bfa43f920657b3497dbf40d6b1a02d4608d81565b3480156103a857600080fd5b506000546001600160a01b03166101d4565b3480156103c657600080fd5b506101d472a7ba8ae7bca0b10a32ea1f8e2a1da980c6cad281565b3480156103ed57600080fd5b506102306103fc366004611c47565b6109b5565b34801561040d57600080fd5b5061020261041c366004611c6e565b610a7b565b34801561042d57600080fd5b506101d473ba12222222228d8ba445958a75a0704d566bf2c881565b34801561045557600080fd5b50610202610ec0565b34801561046a57600080fd5b506101d473ead792b55340aa20181a80d6a16db6a0ecd1b82781565b34801561049257600080fd5b506101d473c0c293ce456ff0ed870add98a0828dd4d2903dbf81565b3480156104ba57600080fd5b5061020261271081565b3480156104d057600080fd5b506102306104df366004611c0e565b610f41565b3480156104f057600080fd5b506101d46104ff366004611cb0565b6005602052600090815260409020546001600160a01b031681565b34801561052657600080fd5b50610230610535366004611cb0565b610f75565b34801561054657600080fd5b506101d47f000000000000000000000000000000000000000000000000000000000000000081565b6000546001600160a01b031633146105a15760405162461bcd60e51b815260040161059890611ccd565b60405180910390fd5b600480546001810182556000919091527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180546001600160a01b0319166001600160a01b0384161790556105f6828261105f565b5050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633146106425760405162461bcd60e51b815260040161059890611d02565b600154604051631c683a1b60e11b815260048101839052600060248201526001600160a01b03909116906338d0743690604401602060405180830381600087803b15801561068f57600080fd5b505af11580156106a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c79190611d2c565b5061070773616e8bfa43f920657b3497dbf40d6b1a02d4608d7f00000000000000000000000000000000000000000000000000000000000000008361108d565b50565b6000546001600160a01b031633146107345760405162461bcd60e51b815260040161059890611ccd565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6004818154811061078e57600080fd5b6000918252602090912001546001600160a01b0316905081565b6107db73616e8bfa43f920657b3497dbf40d6b1a02d4608d72a7ba8ae7bca0b10a32ea1f8e2a1da980c6cad260006110f5565b61080f73616e8bfa43f920657b3497dbf40d6b1a02d4608d72a7ba8ae7bca0b10a32ea1f8e2a1da980c6cad26000196110f5565b61084373ba100000625a3754423978a60c9317c58a424e3d73ba12222222228d8ba445958a75a0704d566bf2c860006110f5565b61087873ba100000625a3754423978a60c9317c58a424e3d73ba12222222228d8ba445958a75a0704d566bf2c86000196110f5565b6108ac73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ba12222222228d8ba445958a75a0704d566bf2c860006110f5565b6108e173c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ba12222222228d8ba445958a75a0704d566bf2c86000196110f5565b610915735c6ee304399dbdb9c8ef030ab642b10820db8f5673ead792b55340aa20181a80d6a16db6a0ecd1b82760006110f5565b61094a735c6ee304399dbdb9c8ef030ab642b10820db8f5673ead792b55340aa20181a80d6a16db6a0ecd1b8276000196110f5565b61097e735c6ee304399dbdb9c8ef030ab642b10820db8f5673ba12222222228d8ba445958a75a0704d566bf2c860006110f5565b6109b3735c6ee304399dbdb9c8ef030ab642b10820db8f5673ba12222222228d8ba445958a75a0704d566bf2c86000196110f5565b565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633146109fd5760405162461bcd60e51b815260040161059890611d02565b60015460405163534a7e1d60e11b8152600481018390526001600160a01b039091169063a694fc3a90602401602060405180830381600087803b158015610a4357600080fd5b505af1158015610a57573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f69190611d2c565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163314610ac55760405162461bcd60e51b815260040161059890611d02565b600160009054906101000a90046001600160a01b03166001600160a01b0316633d18b9126040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610b1557600080fd5b505af1158015610b29573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b4d9190611d2c565b5060006004805480602002602001604051908101604052809291908181526020018280548015610ba657602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b88575b5050505050905060005b8151811015610d4357600060056000848481518110610bd157610bd1611d49565b6020908102919091018101516001600160a01b039081168352908201929092526040016000205416905080610c065750610d33565b6000838381518110610c1a57610c1a611d49565b60209081029190910101516040516370a0823160e01b81523060048201526001600160a01b03909116906370a082319060240160206040518083038186803b158015610c6557600080fd5b505afa158015610c79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c9d9190611d5f565b90508015610d3057610cdc8282868681518110610cbc57610cbc611d49565b60200260200101516001600160a01b031661108d9092919063ffffffff16565b816001600160a01b031663457100746040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610d1757600080fd5b505af1158015610d2b573d6000803e3d6000fd5b505050505b50505b610d3c81611d8e565b9050610bb0565b506040516370a0823160e01b815230600482015260009073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2906370a082319060240160206040518083038186803b158015610d9157600080fd5b505afa158015610da5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc99190611d5f565b6040516370a0823160e01b815230600482015290915060009073ba100000625a3754423978a60c9317c58a424e3d906370a082319060240160206040518083038186803b158015610e1957600080fd5b505afa158015610e2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e519190611d5f565b9050610e5d8183611da9565b610e6d5760009350505050610eb9565b610e7981836000611219565b6000610e85868861140f565b90508015610eb0576000610e99828a611562565b9050610ea4816109b5565b9450610eb99350505050565b60009450505050505b9392505050565b6001546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b158015610f0457600080fd5b505afa158015610f18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3c9190611d5f565b905090565b6000546001600160a01b03163314610f6b5760405162461bcd60e51b815260040161059890611ccd565b6105f6828261105f565b6000546001600160a01b03163314610f9f5760405162461bcd60e51b815260040161059890611ccd565b6001600160a01b0381166110045760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610598565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03918216600090815260056020526040902080546001600160a01b03191691909216179055565b6040516001600160a01b0383166024820152604481018290526110f090849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261185e565b505050565b80158061117e5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561114457600080fd5b505afa158015611158573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117c9190611d5f565b155b6111e95760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610598565b6040516001600160a01b0383166024820152604481018290526110f090849063095ea7b360e01b906064016110b9565b60408051600280825260608201835260009260208301908036833701905050905073ba100000625a3754423978a60c9317c58a424e3d8160008151811061126257611262611d49565b60200260200101906001600160a01b031690816001600160a01b03168152505073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2816001815181106112aa576112aa611d49565b6001600160a01b0392909216602092830291909101820152604080516002808252606082018352600093919290918301908036833701905050905084816000815181106112f9576112f9611d49565b602002602001018181525050838160018151811061131957611319611d49565b602002602001018181525050600260009054906101000a90046001600160a01b03166001600160a01b031663b95cac287f5c6ee304399dbdb9c8ef030ab642b10820db8f5600020000000000000000001460001b303060405180608001604052808881526020018781526020016001888b60405160200161139c93929190611dd7565b6040516020818303038152906040528152602001600015158152506040518563ffffffff1660e01b81526004016113d69493929190611ed5565b600060405180830381600087803b1580156113f057600080fd5b505af1158015611404573d6000803e3d6000fd5b505050505050505050565b6040516370a0823160e01b81523060048201526000908190735c6ee304399dbdb9c8ef030ab642b10820db8f56906370a082319060240160206040518083038186803b15801561145e57600080fd5b505afa158015611472573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114969190611d5f565b9050831561154e57828110156114d95760405162461bcd60e51b8152602060048201526008602482015267736c69707061676560c01b6044820152606401610598565b60035460405163203b5c7960e21b81526004810183905260016024820152600060448201526001600160a01b03909116906380ed71e490606401600060405180830381600087803b15801561152d57600080fd5b505af1158015611541573d6000803e3d6000fd5b505050508091505061155c565b6115588184611930565b9150505b92915050565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166326232a2e6040518163ffffffff1660e01b815260040160206040518083038186803b1580156115be57600080fd5b505afa1580156115d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115f69190611d5f565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663cb22356b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561165357600080fd5b505afa158015611667573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061168b9190611d5f565b905060008590507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156116eb57600080fd5b505afa1580156116ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117239190611d5f565b1561185557811561177657600061271061173d8489611f9f565b6117479190611fbe565b905061176873616e8bfa43f920657b3497dbf40d6b1a02d4608d878361108d565b6117728183611fe0565b9150505b821561185557600061271061178b8589611f9f565b6117959190611fbe565b90506118477f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634bde38c86040518163ffffffff1660e01b815260040160206040518083038186803b1580156117f357600080fd5b505afa158015611807573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061182b9190611ff7565b73616e8bfa43f920657b3497dbf40d6b1a02d4608d908361108d565b6118518183611fe0565b9150505b95945050505050565b60006118b3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611a819092919063ffffffff16565b8051909150156110f057808060200190518101906118d19190611d2c565b6110f05760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610598565b6040805160c0810182527f3dd0843a028c86e0b760b1a76929d1c5ef93a2dd000200000000000000000249815260006020808301829052735c6ee304399dbdb9c8ef030ab642b10820db8f568385015273616e8bfa43f920657b3497dbf40d6b1a02d4608d60608085019190915260808085018890528551848152808401875260a0860152600254865180830188528581528085018690528088018690528301859052865191820187523080835293820185905295810192909252810182905290926001600160a01b0316906352bbbe2990839086611a10426001611da9565b6040518563ffffffff1660e01b8152600401611a2f9493929190612014565b602060405180830381600087803b158015611a4957600080fd5b505af1158015611a5d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115589190611d5f565b6060611a908484600085611a98565b949350505050565b606082471015611af95760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610598565b843b611b475760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610598565b600080866001600160a01b03168587604051611b6391906120d6565b60006040518083038185875af1925050503d8060008114611ba0576040519150601f19603f3d011682016040523d82523d6000602084013e611ba5565b606091505b5091509150611bb5828286611bc0565b979650505050505050565b60608315611bcf575081610eb9565b825115611bdf5782518084602001fd5b8160405162461bcd60e51b815260040161059891906120f2565b6001600160a01b038116811461070757600080fd5b60008060408385031215611c2157600080fd5b8235611c2c81611bf9565b91506020830135611c3c81611bf9565b809150509250929050565b600060208284031215611c5957600080fd5b5035919050565b801515811461070757600080fd5b600080600060608486031215611c8357600080fd5b8335611c8e81611bf9565b9250602084013591506040840135611ca581611c60565b809150509250925092565b600060208284031215611cc257600080fd5b8135610eb981611bf9565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526010908201526f5661756c742063616c6c73206f6e6c7960801b604082015260600190565b600060208284031215611d3e57600080fd5b8151610eb981611c60565b634e487b7160e01b600052603260045260246000fd5b600060208284031215611d7157600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000600019821415611da257611da2611d78565b5060010190565b60008219821115611dbc57611dbc611d78565b500190565b634e487b7160e01b600052602160045260246000fd5b60006060820160058610611ded57611ded611dc1565b8583526020606081850152818651808452608086019150828801935060005b81811015611e2857845183529383019391830191600101611e0c565b5050809350505050826040830152949350505050565b600081518084526020808501945080840160005b83811015611e6e57815187529582019590820190600101611e52565b509495945050505050565b60005b83811015611e94578181015183820152602001611e7c565b83811115611ea3576000848401525b50505050565b60008151808452611ec1816020860160208601611e79565b601f01601f19169290920160200192915050565b8481526000602060018060a01b038087168285015280861660408501526080606085015261010084018551608080870152818151808452610120880191508583019350600092505b80831015611f3f57835185168252928501926001929092019190850190611f1d565b50848801519450607f199350838782030160a0880152611f5f8186611e3e565b94505050506040850151818584030160c0860152611f7d8382611ea9565b925050506060840151611f9460e085018215159052565b509695505050505050565b6000816000190483118215151615611fb957611fb9611d78565b500290565b600082611fdb57634e487b7160e01b600052601260045260246000fd5b500490565b600082821015611ff257611ff2611d78565b500390565b60006020828403121561200957600080fd5b8151610eb981611bf9565b60e08152845160e0820152600060208601516002811061203657612036611dc1565b61010083015260408601516001600160a01b03908116610120840152606087015116610140830152608086015161016083015260a086015160c06101808401526120846101a0840182611ea9565b9150506120c4602083018680516001600160a01b039081168352602080830151151590840152604080830151909116908301526060908101511515910152565b60a082019390935260c0015292915050565b600082516120e8818460208701611e79565b9190910192915050565b602081526000610eb96020830184611ea956fea264697066735822122068aeec130a77265735f5386c857c347ca3e4ca3b5889cfabc0e623afb4d277a364736f6c634300080900330000000000000000000000008c4eb0fc6805ee7337ac126f89a807271a88dd67
Deployed Bytecode
0x6080604052600436106101a05760003560e01c80638a5a167e116100ec578063ce0744ed1161008a578063ded2379b11610064578063ded2379b146104c4578063ede202a8146104e4578063f2fde38b1461051a578063fbfa77cf1461053a57600080fd5b8063ce0744ed1461045e578063d1e1a86714610486578063d73792a9146104ae57600080fd5b8063a694fc3a116100c6578063a694fc3a146103e1578063bab7028f14610401578063c584d40e14610421578063c70920bc1461044957600080fd5b80638a5a167e146103745780638da5cb5b1461039c5780639ccd9e9d146103ba57600080fd5b80634128f86e1161015957806377aba2131161013357806377aba213146102f75780637bb7bed1146103175780637c6b513f146103375780638757b15b1461035f57600080fd5b80634128f86e146102a2578063715018a6146102c2578063749ef752146102d757600080fd5b80630762a3dd146101ac5780631b0875a6146101f157806323cb2390146102105780632abc2a99146102325780632e1a7d4d1461025a57806337d277d41461027a57600080fd5b366101a757005b600080fd5b3480156101b857600080fd5b506101d4735c6ee304399dbdb9c8ef030ab642b10820db8f5681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156101fd57600080fd5b506004545b6040519081526020016101e8565b34801561021c57600080fd5b5061023061022b366004611c0e565b61056e565b005b34801561023e57600080fd5b506101d473ba100000625a3754423978a60c9317c58a424e3d81565b34801561026657600080fd5b50610230610275366004611c47565b6105fa565b34801561028657600080fd5b506101d473c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b3480156102ae57600080fd5b506001546101d4906001600160a01b031681565b3480156102ce57600080fd5b5061023061070a565b3480156102e357600080fd5b506003546101d4906001600160a01b031681565b34801561030357600080fd5b506002546101d4906001600160a01b031681565b34801561032357600080fd5b506101d4610332366004611c47565b61077e565b34801561034357600080fd5b506101d4737b50775383d3d6f0215a8f290f2c9e2eebbeceb281565b34801561036b57600080fd5b506102306107a8565b34801561038057600080fd5b506101d473616e8bfa43f920657b3497dbf40d6b1a02d4608d81565b3480156103a857600080fd5b506000546001600160a01b03166101d4565b3480156103c657600080fd5b506101d472a7ba8ae7bca0b10a32ea1f8e2a1da980c6cad281565b3480156103ed57600080fd5b506102306103fc366004611c47565b6109b5565b34801561040d57600080fd5b5061020261041c366004611c6e565b610a7b565b34801561042d57600080fd5b506101d473ba12222222228d8ba445958a75a0704d566bf2c881565b34801561045557600080fd5b50610202610ec0565b34801561046a57600080fd5b506101d473ead792b55340aa20181a80d6a16db6a0ecd1b82781565b34801561049257600080fd5b506101d473c0c293ce456ff0ed870add98a0828dd4d2903dbf81565b3480156104ba57600080fd5b5061020261271081565b3480156104d057600080fd5b506102306104df366004611c0e565b610f41565b3480156104f057600080fd5b506101d46104ff366004611cb0565b6005602052600090815260409020546001600160a01b031681565b34801561052657600080fd5b50610230610535366004611cb0565b610f75565b34801561054657600080fd5b506101d47f0000000000000000000000008c4eb0fc6805ee7337ac126f89a807271a88dd6781565b6000546001600160a01b031633146105a15760405162461bcd60e51b815260040161059890611ccd565b60405180910390fd5b600480546001810182556000919091527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180546001600160a01b0319166001600160a01b0384161790556105f6828261105f565b5050565b7f0000000000000000000000008c4eb0fc6805ee7337ac126f89a807271a88dd676001600160a01b031633146106425760405162461bcd60e51b815260040161059890611d02565b600154604051631c683a1b60e11b815260048101839052600060248201526001600160a01b03909116906338d0743690604401602060405180830381600087803b15801561068f57600080fd5b505af11580156106a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c79190611d2c565b5061070773616e8bfa43f920657b3497dbf40d6b1a02d4608d7f0000000000000000000000008c4eb0fc6805ee7337ac126f89a807271a88dd678361108d565b50565b6000546001600160a01b031633146107345760405162461bcd60e51b815260040161059890611ccd565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6004818154811061078e57600080fd5b6000918252602090912001546001600160a01b0316905081565b6107db73616e8bfa43f920657b3497dbf40d6b1a02d4608d72a7ba8ae7bca0b10a32ea1f8e2a1da980c6cad260006110f5565b61080f73616e8bfa43f920657b3497dbf40d6b1a02d4608d72a7ba8ae7bca0b10a32ea1f8e2a1da980c6cad26000196110f5565b61084373ba100000625a3754423978a60c9317c58a424e3d73ba12222222228d8ba445958a75a0704d566bf2c860006110f5565b61087873ba100000625a3754423978a60c9317c58a424e3d73ba12222222228d8ba445958a75a0704d566bf2c86000196110f5565b6108ac73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ba12222222228d8ba445958a75a0704d566bf2c860006110f5565b6108e173c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ba12222222228d8ba445958a75a0704d566bf2c86000196110f5565b610915735c6ee304399dbdb9c8ef030ab642b10820db8f5673ead792b55340aa20181a80d6a16db6a0ecd1b82760006110f5565b61094a735c6ee304399dbdb9c8ef030ab642b10820db8f5673ead792b55340aa20181a80d6a16db6a0ecd1b8276000196110f5565b61097e735c6ee304399dbdb9c8ef030ab642b10820db8f5673ba12222222228d8ba445958a75a0704d566bf2c860006110f5565b6109b3735c6ee304399dbdb9c8ef030ab642b10820db8f5673ba12222222228d8ba445958a75a0704d566bf2c86000196110f5565b565b7f0000000000000000000000008c4eb0fc6805ee7337ac126f89a807271a88dd676001600160a01b031633146109fd5760405162461bcd60e51b815260040161059890611d02565b60015460405163534a7e1d60e11b8152600481018390526001600160a01b039091169063a694fc3a90602401602060405180830381600087803b158015610a4357600080fd5b505af1158015610a57573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f69190611d2c565b60007f0000000000000000000000008c4eb0fc6805ee7337ac126f89a807271a88dd676001600160a01b03163314610ac55760405162461bcd60e51b815260040161059890611d02565b600160009054906101000a90046001600160a01b03166001600160a01b0316633d18b9126040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610b1557600080fd5b505af1158015610b29573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b4d9190611d2c565b5060006004805480602002602001604051908101604052809291908181526020018280548015610ba657602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b88575b5050505050905060005b8151811015610d4357600060056000848481518110610bd157610bd1611d49565b6020908102919091018101516001600160a01b039081168352908201929092526040016000205416905080610c065750610d33565b6000838381518110610c1a57610c1a611d49565b60209081029190910101516040516370a0823160e01b81523060048201526001600160a01b03909116906370a082319060240160206040518083038186803b158015610c6557600080fd5b505afa158015610c79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c9d9190611d5f565b90508015610d3057610cdc8282868681518110610cbc57610cbc611d49565b60200260200101516001600160a01b031661108d9092919063ffffffff16565b816001600160a01b031663457100746040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610d1757600080fd5b505af1158015610d2b573d6000803e3d6000fd5b505050505b50505b610d3c81611d8e565b9050610bb0565b506040516370a0823160e01b815230600482015260009073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2906370a082319060240160206040518083038186803b158015610d9157600080fd5b505afa158015610da5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc99190611d5f565b6040516370a0823160e01b815230600482015290915060009073ba100000625a3754423978a60c9317c58a424e3d906370a082319060240160206040518083038186803b158015610e1957600080fd5b505afa158015610e2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e519190611d5f565b9050610e5d8183611da9565b610e6d5760009350505050610eb9565b610e7981836000611219565b6000610e85868861140f565b90508015610eb0576000610e99828a611562565b9050610ea4816109b5565b9450610eb99350505050565b60009450505050505b9392505050565b6001546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b158015610f0457600080fd5b505afa158015610f18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3c9190611d5f565b905090565b6000546001600160a01b03163314610f6b5760405162461bcd60e51b815260040161059890611ccd565b6105f6828261105f565b6000546001600160a01b03163314610f9f5760405162461bcd60e51b815260040161059890611ccd565b6001600160a01b0381166110045760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610598565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03918216600090815260056020526040902080546001600160a01b03191691909216179055565b6040516001600160a01b0383166024820152604481018290526110f090849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261185e565b505050565b80158061117e5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561114457600080fd5b505afa158015611158573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117c9190611d5f565b155b6111e95760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610598565b6040516001600160a01b0383166024820152604481018290526110f090849063095ea7b360e01b906064016110b9565b60408051600280825260608201835260009260208301908036833701905050905073ba100000625a3754423978a60c9317c58a424e3d8160008151811061126257611262611d49565b60200260200101906001600160a01b031690816001600160a01b03168152505073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2816001815181106112aa576112aa611d49565b6001600160a01b0392909216602092830291909101820152604080516002808252606082018352600093919290918301908036833701905050905084816000815181106112f9576112f9611d49565b602002602001018181525050838160018151811061131957611319611d49565b602002602001018181525050600260009054906101000a90046001600160a01b03166001600160a01b031663b95cac287f5c6ee304399dbdb9c8ef030ab642b10820db8f5600020000000000000000001460001b303060405180608001604052808881526020018781526020016001888b60405160200161139c93929190611dd7565b6040516020818303038152906040528152602001600015158152506040518563ffffffff1660e01b81526004016113d69493929190611ed5565b600060405180830381600087803b1580156113f057600080fd5b505af1158015611404573d6000803e3d6000fd5b505050505050505050565b6040516370a0823160e01b81523060048201526000908190735c6ee304399dbdb9c8ef030ab642b10820db8f56906370a082319060240160206040518083038186803b15801561145e57600080fd5b505afa158015611472573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114969190611d5f565b9050831561154e57828110156114d95760405162461bcd60e51b8152602060048201526008602482015267736c69707061676560c01b6044820152606401610598565b60035460405163203b5c7960e21b81526004810183905260016024820152600060448201526001600160a01b03909116906380ed71e490606401600060405180830381600087803b15801561152d57600080fd5b505af1158015611541573d6000803e3d6000fd5b505050508091505061155c565b6115588184611930565b9150505b92915050565b6000807f0000000000000000000000008c4eb0fc6805ee7337ac126f89a807271a88dd676001600160a01b03166326232a2e6040518163ffffffff1660e01b815260040160206040518083038186803b1580156115be57600080fd5b505afa1580156115d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115f69190611d5f565b905060007f0000000000000000000000008c4eb0fc6805ee7337ac126f89a807271a88dd676001600160a01b031663cb22356b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561165357600080fd5b505afa158015611667573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061168b9190611d5f565b905060008590507f0000000000000000000000008c4eb0fc6805ee7337ac126f89a807271a88dd676001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156116eb57600080fd5b505afa1580156116ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117239190611d5f565b1561185557811561177657600061271061173d8489611f9f565b6117479190611fbe565b905061176873616e8bfa43f920657b3497dbf40d6b1a02d4608d878361108d565b6117728183611fe0565b9150505b821561185557600061271061178b8589611f9f565b6117959190611fbe565b90506118477f0000000000000000000000008c4eb0fc6805ee7337ac126f89a807271a88dd676001600160a01b0316634bde38c86040518163ffffffff1660e01b815260040160206040518083038186803b1580156117f357600080fd5b505afa158015611807573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061182b9190611ff7565b73616e8bfa43f920657b3497dbf40d6b1a02d4608d908361108d565b6118518183611fe0565b9150505b95945050505050565b60006118b3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611a819092919063ffffffff16565b8051909150156110f057808060200190518101906118d19190611d2c565b6110f05760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610598565b6040805160c0810182527f3dd0843a028c86e0b760b1a76929d1c5ef93a2dd000200000000000000000249815260006020808301829052735c6ee304399dbdb9c8ef030ab642b10820db8f568385015273616e8bfa43f920657b3497dbf40d6b1a02d4608d60608085019190915260808085018890528551848152808401875260a0860152600254865180830188528581528085018690528088018690528301859052865191820187523080835293820185905295810192909252810182905290926001600160a01b0316906352bbbe2990839086611a10426001611da9565b6040518563ffffffff1660e01b8152600401611a2f9493929190612014565b602060405180830381600087803b158015611a4957600080fd5b505af1158015611a5d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115589190611d5f565b6060611a908484600085611a98565b949350505050565b606082471015611af95760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610598565b843b611b475760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610598565b600080866001600160a01b03168587604051611b6391906120d6565b60006040518083038185875af1925050503d8060008114611ba0576040519150601f19603f3d011682016040523d82523d6000602084013e611ba5565b606091505b5091509150611bb5828286611bc0565b979650505050505050565b60608315611bcf575081610eb9565b825115611bdf5782518084602001fd5b8160405162461bcd60e51b815260040161059891906120f2565b6001600160a01b038116811461070757600080fd5b60008060408385031215611c2157600080fd5b8235611c2c81611bf9565b91506020830135611c3c81611bf9565b809150509250929050565b600060208284031215611c5957600080fd5b5035919050565b801515811461070757600080fd5b600080600060608486031215611c8357600080fd5b8335611c8e81611bf9565b9250602084013591506040840135611ca581611c60565b809150509250925092565b600060208284031215611cc257600080fd5b8135610eb981611bf9565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526010908201526f5661756c742063616c6c73206f6e6c7960801b604082015260600190565b600060208284031215611d3e57600080fd5b8151610eb981611c60565b634e487b7160e01b600052603260045260246000fd5b600060208284031215611d7157600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000600019821415611da257611da2611d78565b5060010190565b60008219821115611dbc57611dbc611d78565b500190565b634e487b7160e01b600052602160045260246000fd5b60006060820160058610611ded57611ded611dc1565b8583526020606081850152818651808452608086019150828801935060005b81811015611e2857845183529383019391830191600101611e0c565b5050809350505050826040830152949350505050565b600081518084526020808501945080840160005b83811015611e6e57815187529582019590820190600101611e52565b509495945050505050565b60005b83811015611e94578181015183820152602001611e7c565b83811115611ea3576000848401525b50505050565b60008151808452611ec1816020860160208601611e79565b601f01601f19169290920160200192915050565b8481526000602060018060a01b038087168285015280861660408501526080606085015261010084018551608080870152818151808452610120880191508583019350600092505b80831015611f3f57835185168252928501926001929092019190850190611f1d565b50848801519450607f199350838782030160a0880152611f5f8186611e3e565b94505050506040850151818584030160c0860152611f7d8382611ea9565b925050506060840151611f9460e085018215159052565b509695505050505050565b6000816000190483118215151615611fb957611fb9611d78565b500290565b600082611fdb57634e487b7160e01b600052601260045260246000fd5b500490565b600082821015611ff257611ff2611d78565b500390565b60006020828403121561200957600080fd5b8151610eb981611bf9565b60e08152845160e0820152600060208601516002811061203657612036611dc1565b61010083015260408601516001600160a01b03908116610120840152606087015116610140830152608086015161016083015260a086015160c06101808401526120846101a0840182611ea9565b9150506120c4602083018680516001600160a01b039081168352602080830151151590840152604080830151909116908301526060908101511515910152565b60a082019390935260c0015292915050565b600082516120e8818460208701611e79565b9190910192915050565b602081526000610eb96020830184611ea956fea264697066735822122068aeec130a77265735f5386c857c347ca3e4ca3b5889cfabc0e623afb4d277a364736f6c63430008090033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000008c4eb0fc6805ee7337ac126f89a807271a88dd67
-----Decoded View---------------
Arg [0] : _vault (address): 0x8c4EB0Fc6805Ee7337AC126f89a807271A88DD67
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000008c4eb0fc6805ee7337ac126f89a807271a88dd67
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.