Source Code
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
BalancerHandler
Compiler Version
v0.6.12+commit.27d51765
Contract Source Code (Solidity)
/**
*Submitted for verification at Etherscan.io on 2020-09-10
*/
// File: contracts/libs/SafeMath.sol
// SPDX-License-Identifier: GPL-2.0
pragma solidity ^0.6.8;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
// File: contracts/interfaces/IERC20.sol
pragma solidity ^0.6.8;
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/
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);
}
// File: contracts/libs/SafeERC20.sol
pragma solidity ^0.6.8;
library SafeERC20 {
function transfer(IERC20 _token, address _to, uint256 _val) internal returns (bool) {
(bool success, bytes memory data) = address(_token).call(abi.encodeWithSelector(_token.transfer.selector, _to, _val));
return success && (data.length == 0 || abi.decode(data, (bool)));
}
}
// File: contracts/libs/PineUtils.sol
pragma solidity ^0.6.8;
library PineUtils {
address internal constant ETH_ADDRESS = address(0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee);
/**
* @notice Get the account's balance of token or ETH
* @param _token - Address of the token
* @param _addr - Address of the account
* @return uint256 - Account's balance of token or ETH
*/
function balanceOf(IERC20 _token, address _addr) internal view returns (uint256) {
if (ETH_ADDRESS == address(_token)) {
return _addr.balance;
}
return _token.balanceOf(_addr);
}
/**
* @notice Transfer token or ETH to a destinatary
* @param _token - Address of the token
* @param _to - Address of the recipient
* @param _val - Uint256 of the amount to transfer
* @return bool - Whether the transfer was success or not
*/
function transfer(IERC20 _token, address _to, uint256 _val) internal returns (bool) {
if (ETH_ADDRESS == address(_token)) {
(bool success, ) = _to.call{value:_val}("");
return success;
}
return SafeERC20.transfer(_token, _to, _val);
}
}
// File: contracts/commons/Order.sol
pragma solidity ^0.6.8;
contract Order {
address public constant ETH_ADDRESS = address(0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee);
}
// File: contracts/interfaces/IWETH.sol
pragma solidity ^0.6.8;
interface IWETH is IERC20 {
function deposit() external payable;
function withdraw(uint wad) external;
}
// File: contracts/interfaces/IHandler.sol
pragma solidity ^0.6.8;
interface IHandler {
/// @notice receive ETH
receive() external payable;
/**
* @notice Handle an order execution
* @param _inputToken - Address of the input token
* @param _outputToken - Address of the output token
* @param _inputAmount - uint256 of the input token amount
* @param _minReturn - uint256 of the min return amount of output token
* @param _data - Bytes of arbitrary data
* @return bought - Amount of output token bought
*/
function handle(
IERC20 _inputToken,
IERC20 _outputToken,
uint256 _inputAmount,
uint256 _minReturn,
bytes calldata _data
) external payable returns (uint256 bought);
/**
* @notice Check whether can handle an order execution
* @param _inputToken - Address of the input token
* @param _outputToken - Address of the output token
* @param _inputAmount - uint256 of the input token amount
* @param _minReturn - uint256 of the min return amount of output token
* @param _data - Bytes of arbitrary data
* @return bool - Whether the execution can be handled or not
*/
function canHandle(
IERC20 _inputToken,
IERC20 _outputToken,
uint256 _inputAmount,
uint256 _minReturn,
bytes calldata _data
) external view returns (bool);
}
// File: contracts/handlers/BalancerHandler.sol
pragma solidity ^0.6.8;
/// @notice UniswapV1 Handler used to execute an order
interface PoolInterface {
function swapExactAmountIn(address, uint, address, uint, uint) external returns (uint, uint);
}
contract BalancerHandler is IHandler, Order {
using SafeMath for uint256;
IWETH public immutable WETH;
uint256 private constant never = uint(-1);
/**
* @notice Creates the handler
* @param _weth - Address of WETH contract
*/
constructor(IWETH _weth) public {
WETH = _weth;
}
/// @notice receive ETH
receive() external override payable {
require(msg.sender != tx.origin, "UniswapV1Handler#receive: NO_SEND_ETH_PLEASE");
}
/**
* @notice Handle an order execution
* @param _inputToken - Address of the input token
* @param _outputToken - Address of the output token
* @param _data - Bytes of arbitrary data
* @return bought - Amount of output token bought
*/
function handle(
IERC20 _inputToken,
IERC20 _outputToken,
uint256,
uint256,
bytes calldata _data
) external payable override returns (uint256 bought) {
// Load real initial balance, don't trust provided value
uint256 amount = PineUtils.balanceOf(_inputToken, address(this));
address inputToken = address(_inputToken);
address outputToken = address(_outputToken);
address weth = address(WETH);
(,address payable relayer, uint256 fee, address payable poolA, address payable poolB) =
abi.decode(_data, (address, address, uint256, address, address));
if (inputToken == weth || inputToken == PineUtils.ETH_ADDRESS) {
// Swap WETH -> outputToken
amount = amount.sub(fee);
// Convert from ETH to WETH if necessary
if (inputToken == PineUtils.ETH_ADDRESS) {
WETH.deposit{ value: amount }();
inputToken = weth;
} else {
WETH.withdraw(fee);
}
// Trade
bought = _swap(poolA, inputToken, outputToken, amount, msg.sender);
} else if (outputToken == weth || outputToken == PineUtils.ETH_ADDRESS) {
// Swap inputToken -> WETH
bought = _swap(poolA, inputToken, weth, amount, address(this));
// Convert from WETH to ETH if necessary
if (outputToken == PineUtils.ETH_ADDRESS) {
WETH.withdraw(bought);
} else {
WETH.withdraw(fee);
}
// Transfer amount to sender
bought = bought.sub(fee);
PineUtils.transfer(IERC20(outputToken), msg.sender, bought);
} else {
// Swap inputToken -> WETH -> outputToken
// - inputToken -> WETH
bought = _swap(poolA, inputToken, weth, amount, address(this));
// Withdraw fee
WETH.withdraw(fee);
// - WETH -> outputToken
bought = _swap(poolB, weth, outputToken, bought.sub(fee), msg.sender);
}
// Send fee to relayer
(bool successRelayer,) = relayer.call{value: fee}("");
require(successRelayer, "UniswapV2Handler#handle: TRANSFER_ETH_TO_RELAYER_FAILED");
}
/**
* @notice Check whether can handle an order execution
* @return bool - Whether the execution can be handled or not
*/
function canHandle(
IERC20,
IERC20,
uint256,
uint256,
bytes calldata
) external override view returns (bool) {
return false;
}
/**
* @notice Swap input token to output token
* @param _inputToken - Address of the input token
* @param _outputToken - Address of the output token
* @param _inputAmount - uint256 of the input token amount
* @param _recipient - Address of the recipient
* @return bought - Amount of output token bought
*/
function _swap(
address _pool,
address _inputToken,
address _outputToken,
uint256 _inputAmount,
address _recipient
) internal returns (uint256 bought) {
// Check if previous allowance is enough and approve the pool if not
IERC20 inputToken = IERC20(_inputToken);
uint256 prevAllowance = inputToken.allowance(address(this), _pool);
if (prevAllowance < _inputAmount) {
if (prevAllowance != 0) {
inputToken.approve(_pool, 0);
}
inputToken.approve(_pool, uint(-1));
}
(bought,) = PoolInterface(_pool).swapExactAmountIn(
_inputToken,
_inputAmount,
_outputToken,
0,
never
);
if (_recipient != address(this)) {
PineUtils.transfer(IERC20(_outputToken), _recipient, bought);
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract IWETH","name":"_weth","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ETH_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"contract IWETH","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"","type":"address"},{"internalType":"contract IERC20","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"canHandle","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_inputToken","type":"address"},{"internalType":"contract IERC20","name":"_outputToken","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"handle","outputs":[{"internalType":"uint256","name":"bought","type":"uint256"}],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
60a060405234801561001057600080fd5b506040516113863803806113868339818101604052602081101561003357600080fd5b81019080805190602001909291905050508073ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1660601b815250505060805160601c6112cf6100b76000398061034d528061038c528061053a52806105c3528061073852806107c8528061088952506112cf6000f3fe6080604052600436106100435760003560e01c806334ef68dd146100d4578063a734f06e146101c4578063ad5c464814610205578063e42f5ea514610246576100cf565b366100cf573273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156100cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180611237602c913960400191505060405180910390fd5b005b600080fd5b3480156100e057600080fd5b506101ac600480360360a08110156100f757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019064010000000081111561016857600080fd5b82018360208201111561017a57600080fd5b8035906020019184600183028401116401000000008311171561019c57600080fd5b9091929391929390505050610327565b60405180821515815260200191505060405180910390f35b3480156101d057600080fd5b506101d9610333565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561021157600080fd5b5061021a61034b565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610311600480360360a081101561025c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190803590602001906401000000008111156102cd57600080fd5b8201836020820111156102df57600080fd5b8035906020019184600183028401116401000000008311171561030157600080fd5b909192939192939050505061036f565b6040518082815260200191505060405180910390f35b60009695505050505050565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b7f000000000000000000000000000000000000000000000000000000000000000081565b60008061037c8830610a07565b90506000889050600088905060007f000000000000000000000000000000000000000000000000000000000000000090506000806000808a8a60a08110156103c357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050509450945094509450508473ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff1614806104d6575073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16145b15610661576104ee8389610b1b90919063ffffffff16565b975073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff1614156105c1577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db0896040518263ffffffff1660e01b81526004016000604051808303818588803b1580156105a057600080fd5b505af11580156105b4573d6000803e3d6000fd5b505050505084965061064d565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d846040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561063457600080fd5b505af1158015610648573d6000803e3d6000fd5b505050505b61065a8288888b33610b65565b9850610935565b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614806106da575073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16145b15610878576106ec8288878b30610b65565b985073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156107c6577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d8a6040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156107a957600080fd5b505af11580156107bd573d6000803e3d6000fd5b50505050610852565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d846040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561083957600080fd5b505af115801561084d573d6000803e3d6000fd5b505050505b610865838a610b1b90919063ffffffff16565b985061087286338b610f10565b50610934565b6108858288878b30610b65565b98507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d846040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156108fa57600080fd5b505af115801561090e573d6000803e3d6000fd5b5050505061093181868861092b878e610b1b90919063ffffffff16565b33610b65565b98505b5b60008473ffffffffffffffffffffffffffffffffffffffff168460405180600001905060006040518083038185875af1925050503d8060008114610995576040519150601f19603f3d011682016040523d82523d6000602084013e61099a565b606091505b50509050806109f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260378152602001806112636037913960400191505060405180910390fd5b5050505050505050509695505050505050565b60008273ffffffffffffffffffffffffffffffffffffffff1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff161415610a70578173ffffffffffffffffffffffffffffffffffffffff16319050610b15565b8273ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610ad757600080fd5b505afa158015610aeb573d6000803e3d6000fd5b505050506040513d6020811015610b0157600080fd5b810190808051906020019092919050505090505b92915050565b6000610b5d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fe1565b905092915050565b60008085905060008173ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e308a6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015610bf257600080fd5b505afa158015610c06573d6000803e3d6000fd5b505050506040513d6020811015610c1c57600080fd5b8101908080519060200190929190505050905084811015610dbc5760008114610cee578173ffffffffffffffffffffffffffffffffffffffff1663095ea7b38960006040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610cb157600080fd5b505af1158015610cc5573d6000803e3d6000fd5b505050506040513d6020811015610cdb57600080fd5b8101908080519060200190929190505050505b8173ffffffffffffffffffffffffffffffffffffffff1663095ea7b3897fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610d7f57600080fd5b505af1158015610d93573d6000803e3d6000fd5b505050506040513d6020811015610da957600080fd5b8101908080519060200190929190505050505b8773ffffffffffffffffffffffffffffffffffffffff16638201aa3f88878960007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001955050505050506040805180830381600087803b158015610e7b57600080fd5b505af1158015610e8f573d6000803e3d6000fd5b505050506040513d6040811015610ea557600080fd5b81019080805190602001909291908051906020019092919050505050809350503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614610f0557610f03868585610f10565b505b505095945050505050565b60008373ffffffffffffffffffffffffffffffffffffffff1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff161415610fcc5760008373ffffffffffffffffffffffffffffffffffffffff168360405180600001905060006040518083038185875af1925050503d8060008114610fba576040519150601f19603f3d011682016040523d82523d6000602084013e610fbf565b606091505b5050905080915050610fda565b610fd78484846110a1565b90505b9392505050565b600083831115829061108e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611053578082015181840152602081019050611038565b50505050905090810190601f1680156110805780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008060608573ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b8686604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b602083106111845780518252602082019150602081019050602083039250611161565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146111e6576040519150601f19603f3d011682016040523d82523d6000602084013e6111eb565b606091505b509150915081801561122b575060008151148061122a575080806020019051602081101561121857600080fd5b81019080805190602001909291905050505b5b92505050939250505056fe556e6973776170563148616e646c657223726563656976653a204e4f5f53454e445f4554485f504c45415345556e6973776170563248616e646c65722368616e646c653a205452414e534645525f4554485f544f5f52454c415945525f4641494c4544a2646970667358221220496be7f056bcf32de78811149131f8d72fbb0c1a9591b465ab9c38c3606415cb64736f6c634300060c0033000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Deployed Bytecode
0x6080604052600436106100435760003560e01c806334ef68dd146100d4578063a734f06e146101c4578063ad5c464814610205578063e42f5ea514610246576100cf565b366100cf573273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156100cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180611237602c913960400191505060405180910390fd5b005b600080fd5b3480156100e057600080fd5b506101ac600480360360a08110156100f757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019064010000000081111561016857600080fd5b82018360208201111561017a57600080fd5b8035906020019184600183028401116401000000008311171561019c57600080fd5b9091929391929390505050610327565b60405180821515815260200191505060405180910390f35b3480156101d057600080fd5b506101d9610333565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561021157600080fd5b5061021a61034b565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610311600480360360a081101561025c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190803590602001906401000000008111156102cd57600080fd5b8201836020820111156102df57600080fd5b8035906020019184600183028401116401000000008311171561030157600080fd5b909192939192939050505061036f565b6040518082815260200191505060405180910390f35b60009695505050505050565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b60008061037c8830610a07565b90506000889050600088905060007f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc290506000806000808a8a60a08110156103c357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050509450945094509450508473ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff1614806104d6575073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16145b15610661576104ee8389610b1b90919063ffffffff16565b975073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff1614156105c1577f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff1663d0e30db0896040518263ffffffff1660e01b81526004016000604051808303818588803b1580156105a057600080fd5b505af11580156105b4573d6000803e3d6000fd5b505050505084965061064d565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d846040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561063457600080fd5b505af1158015610648573d6000803e3d6000fd5b505050505b61065a8288888b33610b65565b9850610935565b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614806106da575073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16145b15610878576106ec8288878b30610b65565b985073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156107c6577f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d8a6040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156107a957600080fd5b505af11580156107bd573d6000803e3d6000fd5b50505050610852565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d846040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561083957600080fd5b505af115801561084d573d6000803e3d6000fd5b505050505b610865838a610b1b90919063ffffffff16565b985061087286338b610f10565b50610934565b6108858288878b30610b65565b98507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d846040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156108fa57600080fd5b505af115801561090e573d6000803e3d6000fd5b5050505061093181868861092b878e610b1b90919063ffffffff16565b33610b65565b98505b5b60008473ffffffffffffffffffffffffffffffffffffffff168460405180600001905060006040518083038185875af1925050503d8060008114610995576040519150601f19603f3d011682016040523d82523d6000602084013e61099a565b606091505b50509050806109f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260378152602001806112636037913960400191505060405180910390fd5b5050505050505050509695505050505050565b60008273ffffffffffffffffffffffffffffffffffffffff1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff161415610a70578173ffffffffffffffffffffffffffffffffffffffff16319050610b15565b8273ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610ad757600080fd5b505afa158015610aeb573d6000803e3d6000fd5b505050506040513d6020811015610b0157600080fd5b810190808051906020019092919050505090505b92915050565b6000610b5d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fe1565b905092915050565b60008085905060008173ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e308a6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015610bf257600080fd5b505afa158015610c06573d6000803e3d6000fd5b505050506040513d6020811015610c1c57600080fd5b8101908080519060200190929190505050905084811015610dbc5760008114610cee578173ffffffffffffffffffffffffffffffffffffffff1663095ea7b38960006040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610cb157600080fd5b505af1158015610cc5573d6000803e3d6000fd5b505050506040513d6020811015610cdb57600080fd5b8101908080519060200190929190505050505b8173ffffffffffffffffffffffffffffffffffffffff1663095ea7b3897fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610d7f57600080fd5b505af1158015610d93573d6000803e3d6000fd5b505050506040513d6020811015610da957600080fd5b8101908080519060200190929190505050505b8773ffffffffffffffffffffffffffffffffffffffff16638201aa3f88878960007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001955050505050506040805180830381600087803b158015610e7b57600080fd5b505af1158015610e8f573d6000803e3d6000fd5b505050506040513d6040811015610ea557600080fd5b81019080805190602001909291908051906020019092919050505050809350503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614610f0557610f03868585610f10565b505b505095945050505050565b60008373ffffffffffffffffffffffffffffffffffffffff1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff161415610fcc5760008373ffffffffffffffffffffffffffffffffffffffff168360405180600001905060006040518083038185875af1925050503d8060008114610fba576040519150601f19603f3d011682016040523d82523d6000602084013e610fbf565b606091505b5050905080915050610fda565b610fd78484846110a1565b90505b9392505050565b600083831115829061108e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611053578082015181840152602081019050611038565b50505050905090810190601f1680156110805780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008060608573ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b8686604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b602083106111845780518252602082019150602081019050602083039250611161565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146111e6576040519150601f19603f3d011682016040523d82523d6000602084013e6111eb565b606091505b509150915081801561122b575060008151148061122a575080806020019051602081101561121857600080fd5b81019080805190602001909291905050505b5b92505050939250505056fe556e6973776170563148616e646c657223726563656976653a204e4f5f53454e445f4554485f504c45415345556e6973776170563248616e646c65722368616e646c653a205452414e534645525f4554485f544f5f52454c415945525f4641494c4544a2646970667358221220496be7f056bcf32de78811149131f8d72fbb0c1a9591b465ab9c38c3606415cb64736f6c634300060c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
-----Decoded View---------------
Arg [0] : _weth (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Deployed Bytecode Sourcemap
11992:4813:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12435:9;12421:23;;:10;:23;;;;12413:80;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11992:4813;;;;;15305:189;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;9953:91;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;12078:27;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;12785:2367;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;15305:189;15458:4;15305:189;;;;;;;;:::o;9953:91::-;9999:44;9953:91;:::o;12078:27::-;;;:::o;12785:2367::-;12969:14;13062;13079:47;13099:11;13120:4;13079:19;:47::i;:::-;13062:64;;13137:18;13166:11;13137:41;;13189:19;13219:12;13189:43;;13243:12;13266:4;13243:28;;13286:23;13311:11;13324:21;13347;13396:5;;13385:64;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13284:165;;;;;;;;;13480:4;13466:18;;:10;:18;;;:57;;;;8761:44;13488:35;;:10;:35;;;13466:57;13462:1492;;;13590:15;13601:3;13590:6;:10;;:15;;;;:::i;:::-;13581:24;;8761:44;13680:35;;:10;:35;;;13676:202;;;13736:4;:12;;;13757:6;13736:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13799:4;13786:17;;13676:202;;;13844:4;:13;;;13858:3;13844:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13676:202;13925:57;13931:5;13938:10;13950:11;13963:6;13971:10;13925:5;:57::i;:::-;13916:66;;13462:1492;;;14019:4;14004:19;;:11;:19;;;:59;;;;8761:44;14027:36;;:11;:36;;;14004:59;14000:954;;;14129:53;14135:5;14142:10;14154:4;14160:6;14176:4;14129:5;:53::i;:::-;14120:62;;8761:44;14257:36;;:11;:36;;;14253:157;;;14314:4;:13;;;14328:6;14314:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;14253:157;;;14376:4;:13;;;14390:3;14376:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;14253:157;14477:15;14488:3;14477:6;:10;;:15;;;;:::i;:::-;14468:24;;14507:59;14533:11;14547:10;14559:6;14507:18;:59::i;:::-;;14000:954;;;14701:53;14707:5;14714:10;14726:4;14732:6;14748:4;14701:5;:53::i;:::-;14692:62;;14800:4;:13;;;14814:3;14800:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;14882:60;14888:5;14895:4;14901:11;14914:15;14925:3;14914:6;:10;;:15;;;;:::i;:::-;14931:10;14882:5;:60::i;:::-;14873:69;;14000:954;13462:1492;14999:19;15023:7;:12;;15043:3;15023:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;14998:53;;;15070:14;15062:82;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12785:2367;;;;;;;;;;;;;;;;;:::o;9042:225::-;9114:7;9161:6;9138:30;;8761:44;9138:30;;;9134:83;;;9192:5;:13;;;9185:20;;;;9134:83;9236:6;:16;;;9253:5;9236:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9229:30;;9042:225;;;;;:::o;1394:136::-;1452:7;1479:43;1483:1;1486;1479:43;;;;;;;;;;;;;;;;;:3;:43::i;:::-;1472:50;;1394:136;;;;:::o;15855:947::-;16040:14;16145:17;16172:11;16145:39;;16197:21;16221:10;:20;;;16250:4;16257:5;16221:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;16197:66;;16294:12;16278:13;:28;16274:199;;;16344:1;16327:13;:18;16323:87;;16366:10;:18;;;16385:5;16392:1;16366:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;16323:87;16426:10;:18;;;16445:5;16457:2;16426:35;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;16274:199;16511:5;16497:38;;;16550:11;16576:12;16603;16630:1;12152:2;16497:165;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;16485:177;;;;;16701:4;16679:27;;:10;:27;;;16675:120;;16723:60;16749:12;16764:10;16776:6;16723:18;:60::i;:::-;;16675:120;15855:947;;;;;;;;;:::o;9559:294::-;9637:4;9681:6;9658:30;;8761:44;9658:30;;;9654:135;;;9706:12;9724:3;:8;;9739:4;9724:24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9705:43;;;9770:7;9763:14;;;;;9654:135;9808:37;9827:6;9835:3;9840:4;9808:18;:37::i;:::-;9801:44;;9559:294;;;;;;:::o;1825:192::-;1911:7;1944:1;1939;:6;;1947:12;1931:29;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1971:9;1987:1;1983;:5;1971:17;;2008:1;2001:8;;;1825:192;;;;;:::o;8310:295::-;8388:4;8406:12;8420:17;8449:6;8441:20;;8485:24;;;8511:3;8516:4;8462:59;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8441:81;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8405:117;;;;8540:7;:57;;;;;8567:1;8552:4;:11;:16;:44;;;;8583:4;8572:24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8552:44;8540:57;8533:64;;;;8310:295;;;;;:::o
Swarm Source
ipfs://496be7f056bcf32de78811149131f8d72fbb0c1a9591b465ab9c38c3606415cb
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.