Source Code
Latest 25 from a total of 227 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Unstake | 11616299 | 1882 days ago | IN | 0 ETH | 0.03994378 | ||||
| Unstake | 11613246 | 1882 days ago | IN | 0 ETH | 0.02337182 | ||||
| Unstake | 11611103 | 1883 days ago | IN | 0 ETH | 0.01009494 | ||||
| Unstake | 11606317 | 1883 days ago | IN | 0 ETH | 0.02521696 | ||||
| Unstake | 11582742 | 1887 days ago | IN | 0 ETH | 0.1796715 | ||||
| Unstake | 11580458 | 1887 days ago | IN | 0 ETH | 0.02503245 | ||||
| Unstake | 11575704 | 1888 days ago | IN | 0 ETH | 0.05440619 | ||||
| Unstake | 11567426 | 1889 days ago | IN | 0 ETH | 0.01706758 | ||||
| Unstake | 11563595 | 1890 days ago | IN | 0 ETH | 0.02029658 | ||||
| Unstake | 11561140 | 1890 days ago | IN | 0 ETH | 0.0329343 | ||||
| Unstake | 11557956 | 1891 days ago | IN | 0 ETH | 0.02479269 | ||||
| Unstake | 11557252 | 1891 days ago | IN | 0 ETH | 0.03638347 | ||||
| Unstake | 11551410 | 1892 days ago | IN | 0 ETH | 0.01976058 | ||||
| Unstake | 11548459 | 1892 days ago | IN | 0 ETH | 0.02730984 | ||||
| Unstake | 11544925 | 1893 days ago | IN | 0 ETH | 0.01839017 | ||||
| Unstake | 11540091 | 1894 days ago | IN | 0 ETH | 0.0184432 | ||||
| Unstake | 11539996 | 1894 days ago | IN | 0 ETH | 0.01646715 | ||||
| Unstake | 11538257 | 1894 days ago | IN | 0 ETH | 0.02735469 | ||||
| Unstake | 11537752 | 1894 days ago | IN | 0 ETH | 0.0206041 | ||||
| Unstake | 11537343 | 1894 days ago | IN | 0 ETH | 0.02483309 | ||||
| Unstake | 11537245 | 1894 days ago | IN | 0 ETH | 0.01745517 | ||||
| Unstake | 11537113 | 1894 days ago | IN | 0 ETH | 0.02272911 | ||||
| Unstake | 11536234 | 1894 days ago | IN | 0 ETH | 0.00420414 | ||||
| Unstake | 11536234 | 1894 days ago | IN | 0 ETH | 0.02644624 | ||||
| Unstake | 11536164 | 1894 days ago | IN | 0 ETH | 0.02275677 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
RewardedWbtcPbtcUniV2Pair
Compiler Version
v0.5.16+commit.9c3226ce
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/**
*Submitted for verification at Etherscan.io on 2020-09-25
*/
pragma solidity ^0.5.0;
/**
* @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.
*
* _Available since v2.4.0._
*/
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.
*
* _Available since v2.4.0._
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
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.
*
* _Available since v2.4.0._
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* This test is non-exhaustive, and there may be false-negatives: during the
* execution of a contract's constructor, its address will be reported as
* not containing 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.
*/
function isContract(address account) internal view returns (bool) {
// This method relies in extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != 0x0 && codehash != accountHash);
}
/**
* @dev Converts an `address` into `address payable`. Note that this is
* simply a type cast: the actual underlying value is not changed.
*
* _Available since v2.4.0._
*/
function toPayable(address account) internal pure returns (address payable) {
return address(uint160(account));
}
/**
* @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].
*
* _Available since v2.4.0._
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-call-value
(bool success, ) = recipient.call.value(amount)("");
require(success, "Address: unable to send value, recipient may have reverted");
}
}
/**
* @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);
}
/**
* @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 ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
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));
}
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).add(value);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
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.
// A Solidity high level call has three parts:
// 1. The target address is checked to verify it contains contract code
// 2. The call itself is made, and success asserted
// 3. The return value is decoded, which in turn checks the size of the returned data.
// solhint-disable-next-line max-line-length
require(address(token).isContract(), "SafeERC20: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "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");
}
}
}
/*
* @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 GSN 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.
*/
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
function _msgData() internal view returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
/**
* @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.
*
* 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.
*/
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 () internal {
_owner = _msgSender();
emit OwnershipTransferred(address(0), _owner);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(isOwner(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Returns true if the caller is the current owner.
*/
function isOwner() public view returns (bool) {
return _msgSender() == _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 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 onlyOwner {
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
*/
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
/**
* @dev Interface of the global ERC1820 Registry, as defined in the
* https://eips.ethereum.org/EIPS/eip-1820[EIP]. Accounts may register
* implementers for interfaces in this registry, as well as query support.
*
* Implementers may be shared by multiple accounts, and can also implement more
* than a single interface for each account. Contracts can implement interfaces
* for themselves, but externally-owned accounts (EOA) must delegate this to a
* contract.
*
* {IERC165} interfaces can also be queried via the registry.
*
* For an in-depth explanation and source code analysis, see the EIP text.
*/
interface IERC1820Registry {
/**
* @dev Sets `newManager` as the manager for `account`. A manager of an
* account is able to set interface implementers for it.
*
* By default, each account is its own manager. Passing a value of `0x0` in
* `newManager` will reset the manager to this initial state.
*
* Emits a {ManagerChanged} event.
*
* Requirements:
*
* - the caller must be the current manager for `account`.
*/
function setManager(address account, address newManager) external;
/**
* @dev Returns the manager for `account`.
*
* See {setManager}.
*/
function getManager(address account) external view returns (address);
/**
* @dev Sets the `implementer` contract as `account`'s implementer for
* `interfaceHash`.
*
* `account` being the zero address is an alias for the caller's address.
* The zero address can also be used in `implementer` to remove an old one.
*
* See {interfaceHash} to learn how these are created.
*
* Emits an {InterfaceImplementerSet} event.
*
* Requirements:
*
* - the caller must be the current manager for `account`.
* - `interfaceHash` must not be an {IERC165} interface id (i.e. it must not
* end in 28 zeroes).
* - `implementer` must implement {IERC1820Implementer} and return true when
* queried for support, unless `implementer` is the caller. See
* {IERC1820Implementer-canImplementInterfaceForAddress}.
*/
function setInterfaceImplementer(address account, bytes32 interfaceHash, address implementer) external;
/**
* @dev Returns the implementer of `interfaceHash` for `account`. If no such
* implementer is registered, returns the zero address.
*
* If `interfaceHash` is an {IERC165} interface id (i.e. it ends with 28
* zeroes), `account` will be queried for support of it.
*
* `account` being the zero address is an alias for the caller's address.
*/
function getInterfaceImplementer(address account, bytes32 interfaceHash) external view returns (address);
/**
* @dev Returns the interface hash for an `interfaceName`, as defined in the
* corresponding
* https://eips.ethereum.org/EIPS/eip-1820#interface-name[section of the EIP].
*/
function interfaceHash(string calldata interfaceName) external pure returns (bytes32);
/**
* @notice Updates the cache with whether the contract implements an ERC165 interface or not.
* @param account Address of the contract for which to update the cache.
* @param interfaceId ERC165 interface for which to update the cache.
*/
function updateERC165Cache(address account, bytes4 interfaceId) external;
/**
* @notice Checks whether a contract implements an ERC165 interface or not.
* If the result is not cached a direct lookup on the contract address is performed.
* If the result is not cached or the cached value is out-of-date, the cache MUST be updated manually by calling
* {updateERC165Cache} with the contract address.
* @param account Address of the contract to check.
* @param interfaceId ERC165 interface to check.
* @return True if `account` implements `interfaceId`, false otherwise.
*/
function implementsERC165Interface(address account, bytes4 interfaceId) external view returns (bool);
/**
* @notice Checks whether a contract implements an ERC165 interface or not without using nor updating the cache.
* @param account Address of the contract to check.
* @param interfaceId ERC165 interface to check.
* @return True if `account` implements `interfaceId`, false otherwise.
*/
function implementsERC165InterfaceNoCache(address account, bytes4 interfaceId) external view returns (bool);
event InterfaceImplementerSet(address indexed account, bytes32 indexed interfaceHash, address indexed implementer);
event ManagerChanged(address indexed account, address indexed newManager);
}
/**
* @dev Interface of the ERC777TokensRecipient standard as defined in the EIP.
*
* Accounts can be notified of {IERC777} tokens being sent to them by having a
* contract implement this interface (contract holders can be their own
* implementer) and registering it on the
* https://eips.ethereum.org/EIPS/eip-1820[ERC1820 global registry].
*
* See {IERC1820Registry} and {ERC1820Implementer}.
*/
interface IERC777Recipient {
/**
* @dev Called by an {IERC777} token contract whenever tokens are being
* moved or created into a registered account (`to`). The type of operation
* is conveyed by `from` being the zero address or not.
*
* This call occurs _after_ the token contract's state is updated, so
* {IERC777-balanceOf}, etc., can be used to query the post-operation state.
*
* This function may revert to prevent the operation from being executed.
*/
function tokensReceived(
address operator,
address from,
address to,
uint256 amount,
bytes calldata userData,
bytes calldata operatorData
) external;
}
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
// taken from here: https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts/libraries/UniswapV2Library.sol
library UniswapV2Library {
using SafeMath for uint256;
// given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
function getAmountOut(
uint256 amountIn,
uint256 reserveIn,
uint256 reserveOut
) internal pure returns (uint256 amountOut) {
require(amountIn > 0, "UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT");
require(reserveIn > 0 && reserveOut > 0, "UniswapV2Library: INSUFFICIENT_LIQUIDITY");
uint256 amountInWithFee = amountIn.mul(997);
uint256 numerator = amountInWithFee.mul(reserveOut);
uint256 denominator = reserveIn.mul(1000).add(amountInWithFee);
amountOut = numerator / denominator;
}
/**
* @author allemanfredi
* @notice given an input amount, returns the output
* amount with slippage and with fees. This fx is
* to check approximately onchain the slippage
* during a swap
*/
function calculateSlippageAmountWithFees(
uint256 _amountIn,
uint256 _allowedSlippage,
uint256 _rateIn,
uint256 _rateOut
) internal pure returns (uint256) {
require(_amountIn > 0, "UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT");
uint256 slippageAmount = _amountIn
.mul(_rateOut)
.div(_rateIn)
.mul(10000 - _allowedSlippage)
.div(10000);
// NOTE: remove fees
return slippageAmount.mul(997).div(1000);
}
/**
* @author allemanfredi
* @notice given 2 inputs amount, it returns the
* rate percentage between the 2 amounts
*/
function calculateRate(uint256 _amountIn, uint256 _amountOut) internal pure returns (uint256) {
require(_amountIn > 0, "UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT");
require(_amountOut > 0, "UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT");
return
_amountIn > _amountOut
? (10000 * _amountIn).sub(10000 * _amountOut).div(_amountIn)
: (10000 * _amountOut).sub(10000 * _amountIn).div(_amountOut);
}
}
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow, so we distribute
return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
}
}
contract IRewardDistributionRecipient is Ownable {
address public rewardDistribution;
function notifyRewardAmount(uint256 reward) external;
modifier onlyRewardDistribution() {
require(_msgSender() == rewardDistribution, "Caller is not reward distribution");
_;
}
function setRewardDistribution(address _rewardDistribution) external onlyOwner {
rewardDistribution = _rewardDistribution;
}
}
contract LPTokenWrapper {
using SafeMath for uint256;
using SafeERC20 for IERC20;
IERC20 public uniV2;
uint256 private _totalSupply;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
event Approval(address indexed owner, address indexed spender, uint256 value);
constructor(address _uniV2) public {
uniV2 = IERC20(_uniV2);
}
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
function stakeFor(address _user, uint256 _amount) public {
_stake(_user, _amount);
}
function stake(uint256 _amount) public {
_stake(msg.sender, _amount);
}
function approve(address _user, uint256 _amount) public {
_approve(msg.sender, _user, _amount);
}
function withdraw(uint256 _amount) public {
_withdraw(msg.sender, _amount);
}
function withdrawFrom(address _user, uint256 _amount) public {
_withdraw(_user, _amount);
_approve(
_user,
msg.sender,
_allowances[_user][msg.sender].sub(
_amount,
"LPTokenWrapper: transfer amount exceeds allowance"
)
);
}
function allowance(address _owner, address _spender) public view returns (uint256) {
return _allowances[_owner][_spender];
}
function _stake(address _user, uint256 _amount) internal {
_totalSupply = _totalSupply.add(_amount);
_balances[_user] = _balances[_user].add(_amount);
uniV2.safeTransferFrom(msg.sender, address(this), _amount);
}
function _withdraw(address _owner, uint256 _amount) internal {
_totalSupply = _totalSupply.sub(_amount);
_balances[_owner] = _balances[_owner].sub(_amount);
IERC20(uniV2).safeTransfer(msg.sender, _amount);
}
function _approve(
address _owner,
address _user,
uint256 _amount
) internal returns (bool) {
require(_user != address(0), "LPTokenWrapper: approve to the zero address");
_allowances[_owner][_user] = _amount;
emit Approval(_owner, _user, _amount);
return true;
}
}
contract ModifiedUnipool is LPTokenWrapper, IRewardDistributionRecipient {
address public rewardToken;
uint256 public constant DURATION = 7 days;
uint256 public periodFinish = 0;
uint256 public rewardRate = 0;
uint256 public lastUpdateTime;
uint256 public rewardPerTokenStored;
mapping(address => uint256) public userRewardPerTokenPaid;
mapping(address => uint256) public rewards;
event RewardAdded(uint256 reward);
event Staked(address indexed user, uint256 amount);
event Withdrawn(address indexed user, uint256 amount);
event RewardPaid(address indexed user, uint256 reward);
modifier updateReward(address account) {
rewardPerTokenStored = rewardPerToken();
lastUpdateTime = lastTimeRewardApplicable();
if (account != address(0)) {
rewards[account] = earned(account);
userRewardPerTokenPaid[account] = rewardPerTokenStored;
}
_;
}
constructor(address _rewardToken, address _uniV2) public LPTokenWrapper(_uniV2) {
rewardToken = _rewardToken;
}
function notifyRewardAmount(uint256 reward)
external
onlyRewardDistribution
updateReward(address(0))
{
if (block.timestamp >= periodFinish) {
rewardRate = reward.div(DURATION);
} else {
uint256 remaining = periodFinish.sub(block.timestamp);
uint256 leftover = remaining.mul(rewardRate);
rewardRate = reward.add(leftover).div(DURATION);
}
lastUpdateTime = block.timestamp;
periodFinish = block.timestamp.add(DURATION);
emit RewardAdded(reward);
}
function exit() external {
withdraw(balanceOf(msg.sender));
getReward(msg.sender);
}
function lastTimeRewardApplicable() public view returns (uint256) {
return Math.min(block.timestamp, periodFinish);
}
function rewardPerToken() public view returns (uint256) {
if (totalSupply() == 0) {
return rewardPerTokenStored;
}
return
rewardPerTokenStored.add(
lastTimeRewardApplicable().sub(lastUpdateTime).mul(rewardRate).mul(1e18).div(
totalSupply()
)
);
}
function earned(address account) public view returns (uint256) {
return
balanceOf(account)
.mul(rewardPerToken().sub(userRewardPerTokenPaid[account]))
.div(1e18)
.add(rewards[account]);
}
function stake(uint256 amount) public updateReward(msg.sender) {
require(amount > 0, "Cannot stake 0");
super.stake(amount);
emit Staked(msg.sender, amount);
}
function stakeFor(address _user, uint256 _amount) public updateReward(_user) {
require(_amount > 0, "Cannot stake 0");
super.stakeFor(_user, _amount);
emit Staked(_user, _amount);
}
function withdraw(uint256 amount) public updateReward(msg.sender) {
require(amount > 0, "Cannot withdraw 0");
super.withdraw(amount);
emit Withdrawn(msg.sender, amount);
}
function withdrawFrom(address _user, uint256 amount) public updateReward(_user) {
require(amount > 0, "Cannot withdraw 0");
super.withdrawFrom(_user, amount);
emit Withdrawn(_user, amount);
}
function getReward() public {
_getReward(msg.sender);
}
function getReward(address _user) public {
_getReward(_user);
}
function _getReward(address _user) internal updateReward(_user) {
uint256 reward = earned(_user);
if (reward > 0) {
rewards[_user] = 0;
IERC20(rewardToken).safeTransfer(_user, reward);
emit RewardPaid(_user, reward);
}
}
}
contract RewardedWbtcPbtcUniV2Pair is IERC777Recipient, Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// prettier-ignore
IERC1820Registry private _erc1820 = IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24);
bytes32 private constant TOKENS_RECIPIENT_INTERFACE_HASH = keccak256("ERC777TokensRecipient");
IERC20 public wbtc;
IERC20 public pbtc;
IUniswapV2Pair public uniV2;
ModifiedUnipool public modifiedUnipool;
uint256 public allowedSlippage;
uint256 public allowedRate;
event Staked(address indexed user, uint256 amount);
event Unstaked(address indexed user, uint256 amount);
event AllowedSlippageChanged(uint256 slippage);
event AllowedRateChanged(uint256 allowedRate);
/**
* @param _uniV2 UniV2Pair address
* @param _modifiedUnipool ModifiedUnipool address
*/
constructor(address _uniV2, address _modifiedUnipool) public {
require(Address.isContract(_uniV2), "RewardedWbtcPbtcUniV2Pair: _uniV2 not a contract");
uniV2 = IUniswapV2Pair(_uniV2);
modifiedUnipool = ModifiedUnipool(_modifiedUnipool);
wbtc = IERC20(uniV2.token0());
pbtc = IERC20(uniV2.token1());
_erc1820.setInterfaceImplementer(
address(this),
TOKENS_RECIPIENT_INTERFACE_HASH,
address(this)
);
}
/**
* @param _allowedSlippage new max allowed in percentage
*/
function setAllowedSlippage(uint256 _allowedSlippage) external onlyOwner {
allowedSlippage = _allowedSlippage;
emit AllowedSlippageChanged(_allowedSlippage);
}
/**
* @param _allowedRate new allowedRate in percentage
*/
function setAllowedRate(uint256 _allowedRate) external onlyOwner {
allowedRate = _allowedRate;
emit AllowedRateChanged(_allowedRate);
}
/**
* @notice ERC777 hook invoked when this contract receives a token.
*/
function tokensReceived(
address _operator,
address _from,
address _to,
uint256 _amount,
bytes calldata _userData,
bytes calldata _operatorData
) external {
// NOTE: avoid tx fail during uniV2.burn(address(this))
if (_from == address(uniV2)) return;
require(msg.sender == address(pbtc), "RewardedWbtcPbtcUniV2Pair: Invalid token");
require(_amount > 0, "RewardedWbtcPbtcUniV2Pair: amount must be greater than 0");
_stakeFor(_from, _amount);
}
/**
* @notice Burn all user's UniV2 staked in the ModifiedUnipool,
* swap the corresponding amount of WBTC into PBTC, collect
* rewards matured from the UniV2 staking and sent it to msg.sender.
* User must approve this contract to to withdraw the corresponing
* amount of his UniV2 balance in behalf of him.
*/
function unstake() public returns (bool) {
uint256 uniV2SenderBalance = modifiedUnipool.balanceOf(msg.sender);
require(
modifiedUnipool.allowance(msg.sender, address(this)) >= uniV2SenderBalance,
"RewardedWbtcPbtcUniV2Pair: amount not approved"
);
modifiedUnipool.withdrawFrom(msg.sender, uniV2SenderBalance);
modifiedUnipool.getReward(msg.sender);
uniV2.transfer(address(uniV2), uniV2SenderBalance);
(uint256 wbtcAmount, uint256 pbtcAmount) = uniV2.burn(address(this));
(uint256 wbtcReserve, uint256 pbtcReserve, ) = uniV2.getReserves();
uint256 pbtcAmountOut = UniswapV2Library.getAmountOut(wbtcAmount, wbtcReserve, pbtcReserve);
wbtc.safeTransfer(address(uniV2), wbtcAmount);
uniV2.swap(0, pbtcAmountOut, address(this), "");
uint256 pbtcTotalAmount = pbtcAmount + pbtcAmountOut;
pbtc.safeTransfer(msg.sender, pbtcTotalAmount);
emit Unstaked(msg.sender, pbtcTotalAmount);
return true;
}
/**
* @notice Swap _amount / 2 pBTC sent to this contract
* into WBTC and put them into a pBTC/WBTC Uniswap pool.
* The amount of UniV2 token will be sent to ModifiedUnipool
* in order to mature reward.
* @param _user address of the user who will have UniV2 tokens in ModifiedUnipool
* @param _amount amount of pbtc to use to perform this operation
*/
function _stakeFor(address _user, uint256 _amount) internal {
uint256 pbtcAmountIn = _amount / 2;
(uint256 wbtcReserve, uint256 pbtcReserve, ) = uniV2.getReserves();
uint256 wbtcAmountOut = UniswapV2Library.getAmountOut(
pbtcAmountIn,
pbtcReserve,
wbtcReserve
);
require(
UniswapV2Library.calculateRate(
pbtcAmountIn,
wbtcAmountOut.mul(10**10) // 10^18 / 10^8
) <= allowedRate,
"RewardedWbtcPbtcUniV2Pair: rate too high"
);
require(
wbtcAmountOut >=
UniswapV2Library.calculateSlippageAmountWithFees(
pbtcAmountIn,
allowedSlippage,
10**18,
10**8
),
"RewardedWbtcPbtcUniV2Pair: too much slippage"
);
pbtc.safeTransfer(address(uniV2), pbtcAmountIn);
uniV2.swap(wbtcAmountOut, 0, address(this), "");
pbtc.safeTransfer(address(uniV2), pbtcAmountIn);
wbtc.safeTransfer(address(uniV2), wbtcAmountOut);
uint256 liquidity = uniV2.mint(address(this));
uniV2.approve(address(modifiedUnipool), liquidity);
modifiedUnipool.stakeFor(_user, liquidity);
emit Staked(_user, _amount);
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_uniV2","type":"address"},{"internalType":"address","name":"_modifiedUnipool","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"allowedRate","type":"uint256"}],"name":"AllowedRateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"slippage","type":"uint256"}],"name":"AllowedSlippageChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Unstaked","type":"event"},{"constant":true,"inputs":[],"name":"allowedRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"allowedSlippage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"modifiedUnipool","outputs":[{"internalType":"contract ModifiedUnipool","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"pbtc","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_allowedRate","type":"uint256"}],"name":"setAllowedRate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_allowedSlippage","type":"uint256"}],"name":"setAllowedSlippage","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes","name":"_userData","type":"bytes"},{"internalType":"bytes","name":"_operatorData","type":"bytes"}],"name":"tokensReceived","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"uniV2","outputs":[{"internalType":"contract IUniswapV2Pair","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"unstake","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"wbtc","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"}]Contract Creation Code
6080604052600180546001600160a01b031916731820a4b7618bde71dce8cdc73aab6c95905fad241790553480156200003757600080fd5b5060405162001ba238038062001ba2833981810160405260408110156200005d57600080fd5b508051602090910151620000796001600160e01b03620002f216565b600080546001600160a01b0319166001600160a01b03928316178082556040519216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3620000d782620002f660201b620014d01760201c565b620001145760405162461bcd60e51b815260040180806020018281038252603081526020018062001b726030913960400191505060405180910390fd5b600480546001600160a01b038085166001600160a01b0319928316178084556005805486841694169390931790925560408051630dfe168160e01b815290519290911692630dfe1681928282019260209290829003018186803b1580156200017b57600080fd5b505afa15801562000190573d6000803e3d6000fd5b505050506040513d6020811015620001a757600080fd5b5051600280546001600160a01b0319166001600160a01b03928316179055600480546040805163d21220a760e01b81529051919093169263d21220a79281810192602092909190829003018186803b1580156200020357600080fd5b505afa15801562000218573d6000803e3d6000fd5b505050506040513d60208110156200022f57600080fd5b5051600380546001600160a01b039283166001600160a01b0319909116179055600154604080517f455243373737546f6b656e73526563697069656e740000000000000000000000815281519081900360150181206329965a1d60e01b8252306004830181905260248301919091526044820152905191909216916329965a1d91606480830192600092919082900301818387803b158015620002d157600080fd5b505af1158015620002e6573d6000803e3d6000fd5b50505050505062000333565b3390565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081158015906200032b5750808214155b949350505050565b61182f80620003436000396000f3fe608060405234801561001057600080fd5b50600436106100e95760003560e01c8063715018a61161008c578063a033fe9911610066578063a033fe991461028e578063f2fde38b14610296578063f5361946146102bc578063ffae4049146102c4576100e9565b8063715018a6146102765780638da5cb5b1461027e5780638f32d59b14610286576100e9565b80633cdc5389116100c85780633cdc538914610213578063431f2445146102375780635f3dd17b146102515780636406b6d01461026e576100e9565b806223de29146100ee5780632365faea146101da5780632def6620146101f7575b600080fd5b6101d8600480360360c081101561010457600080fd5b6001600160a01b03823581169260208101358216926040820135909216916060820135919081019060a08101608082013564010000000081111561014757600080fd5b82018360208201111561015957600080fd5b8035906020019184600183028401116401000000008311171561017b57600080fd5b91939092909160208101903564010000000081111561019957600080fd5b8201836020820111156101ab57600080fd5b803590602001918460018302840111640100000000831117156101cd57600080fd5b5090925090506102cc565b005b6101d8600480360360208110156101f057600080fd5b5035610383565b6101ff610405565b604080519115158252519081900360200190f35b61021b6108b4565b604080516001600160a01b039092168252519081900360200190f35b61023f6108c3565b60408051918252519081900360200190f35b6101d86004803603602081101561026757600080fd5b50356108c9565b61021b61094b565b6101d861095a565b61021b6109eb565b6101ff6109fa565b61023f610a1e565b6101d8600480360360208110156102ac57600080fd5b50356001600160a01b0316610a24565b61021b610a77565b61021b610a86565b6004546001600160a01b03888116911614156102e757610379565b6003546001600160a01b031633146103305760405162461bcd60e51b81526004018080602001828103825260288152602001806117246028913960400191505060405180910390fd5b6000851161036f5760405162461bcd60e51b81526004018080602001828103825260388152602001806116cc6038913960400191505060405180910390fd5b6103798786610a95565b5050505050505050565b61038b6109fa565b6103ca576040805162461bcd60e51b81526020600482018190526024820152600080516020611704833981519152604482015290519081900360640190fd5b60068190556040805182815290517f44f3ebcd53cc7caaa403093ba74b57dd97ab53ba634db0463e5ed5ef359015949181900360200190a150565b600554604080516370a0823160e01b8152336004820152905160009283926001600160a01b03909116916370a0823191602480820192602092909190829003018186803b15801561045557600080fd5b505afa158015610469573d6000803e3d6000fd5b505050506040513d602081101561047f57600080fd5b505160055460408051636eb1769f60e11b8152336004820152306024820152905192935083926001600160a01b039092169163dd62ed3e91604480820192602092909190829003018186803b1580156104d757600080fd5b505afa1580156104eb573d6000803e3d6000fd5b505050506040513d602081101561050157600080fd5b505110156105405760405162461bcd60e51b815260040180806020018281038252602e8152602001806117cd602e913960400191505060405180910390fd5b60055460408051639470b0bd60e01b81523360048201526024810184905290516001600160a01b0390921691639470b0bd9160448082019260009290919082900301818387803b15801561059357600080fd5b505af11580156105a7573d6000803e3d6000fd5b505060055460408051630c00007b60e41b815233600482015290516001600160a01b03909216935063c00007b0925060248082019260009290919082900301818387803b1580156105f757600080fd5b505af115801561060b573d6000803e3d6000fd5b5050600480546040805163a9059cbb60e01b81526001600160a01b03909216928201839052602482018690525191935063a9059cbb92506044808201926020929091908290030181600087803b15801561066457600080fd5b505af1158015610678573d6000803e3d6000fd5b505050506040513d602081101561068e57600080fd5b5050600480546040805163226bf2d160e21b81523093810193909352805160009384936001600160a01b0316926389afcb449260248084019382900301818787803b1580156106dc57600080fd5b505af11580156106f0573d6000803e3d6000fd5b505050506040513d604081101561070657600080fd5b5080516020909101516004805460408051630240bc6b60e21b8152905194965092945060009384936001600160a01b0390921692630902f1ac92808201926060929091829003018186803b15801561075d57600080fd5b505afa158015610771573d6000803e3d6000fd5b505050506040513d606081101561078757600080fd5b5080516020909101516001600160701b03918216935016905060006107ad858484610e8a565b6004546002549192506107d3916001600160a01b0390811691168763ffffffff610f7a16565b600480546040805163022c0d9f60e01b8152600093810184905260248101859052306044820152608060648201526084810184905290516001600160a01b039092169263022c0d9f9260c48084019382900301818387803b15801561083757600080fd5b505af115801561084b573d6000803e3d6000fd5b5050600354868401925061087091506001600160a01b0316338363ffffffff610f7a16565b60408051828152905133917f0f5bb82176feb1b5e747e28471aa92156a04d9f3ab9f45f28e2d704232b93f75919081900360200190a2600197505050505050505090565b6002546001600160a01b031681565b60065481565b6108d16109fa565b610910576040805162461bcd60e51b81526020600482018190526024820152600080516020611704833981519152604482015290519081900360640190fd5b60078190556040805182815290517f078e652549da3e15b969845fe97b8ac18df2d95c7cf6a42a16363de347b500469181900360200190a150565b6005546001600160a01b031681565b6109626109fa565b6109a1576040805162461bcd60e51b81526020600482018190526024820152600080516020611704833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b600080546001600160a01b0316610a0f610fd1565b6001600160a01b031614905090565b60075481565b610a2c6109fa565b610a6b576040805162461bcd60e51b81526020600482018190526024820152600080516020611704833981519152604482015290519081900360640190fd5b610a7481610fd5565b50565b6003546001600160a01b031681565b6004546001600160a01b031681565b6004805460408051630240bc6b60e21b81529051600285049360009384936001600160a01b0390911692630902f1ac92828101926060929190829003018186803b158015610ae257600080fd5b505afa158015610af6573d6000803e3d6000fd5b505050506040513d6060811015610b0c57600080fd5b5080516020909101516001600160701b0391821693501690506000610b32848385610e8a565b600754909150610b5685610b51846402540be40063ffffffff61107516565b6110d7565b1115610b935760405162461bcd60e51b815260040180806020018281038252602881526020018061165b6028913960400191505060405180910390fd5b610bad84600654670de0b6b3a76400006305f5e1006111a4565b811015610beb5760405162461bcd60e51b815260040180806020018281038252602c8152602001806117a1602c913960400191505060405180910390fd5b600454600354610c0e916001600160a01b0391821691168663ffffffff610f7a16565b600480546040805163022c0d9f60e01b8152928301849052600060248401819052306044850152608060648501526084840181905290516001600160a01b039092169263022c0d9f9260c4808301939282900301818387803b158015610c7357600080fd5b505af1158015610c87573d6000803e3d6000fd5b5050600454600354610cae93506001600160a01b039081169250168663ffffffff610f7a16565b600454600254610cd1916001600160a01b0391821691168363ffffffff610f7a16565b60048054604080516335313c2160e11b81523093810193909352516000926001600160a01b0390921691636a62784291602480830192602092919082900301818787803b158015610d2157600080fd5b505af1158015610d35573d6000803e3d6000fd5b505050506040513d6020811015610d4b57600080fd5b5051600480546005546040805163095ea7b360e01b81526001600160a01b03928316948101949094526024840185905251939450169163095ea7b3916044808201926020929091908290030181600087803b158015610da957600080fd5b505af1158015610dbd573d6000803e3d6000fd5b505050506040513d6020811015610dd357600080fd5b5050600554604080516305dc812160e31b81526001600160a01b038a811660048301526024820185905291519190921691632ee4090891604480830192600092919082900301818387803b158015610e2a57600080fd5b505af1158015610e3e573d6000803e3d6000fd5b50506040805189815290516001600160a01b038b1693507f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d92509081900360200190a250505050505050565b6000808411610eca5760405162461bcd60e51b815260040180806020018281038252602b815260200180611776602b913960400191505060405180910390fd5b600083118015610eda5750600082115b610f155760405162461bcd60e51b81526004018080602001828103825260288152602001806116836028913960400191505060405180910390fd5b6000610f29856103e563ffffffff61107516565b90506000610f3d828563ffffffff61107516565b90506000610f6383610f57886103e863ffffffff61107516565b9063ffffffff61123416565b9050808281610f6e57fe5b04979650505050505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610fcc90849061128e565b505050565b3390565b6001600160a01b03811661101a5760405162461bcd60e51b81526004018080602001828103825260268152602001806116096026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600082611084575060006110d1565b8282028284828161109157fe5b04146110ce5760405162461bcd60e51b81526004018080602001828103825260218152602001806116ab6021913960400191505060405180910390fd5b90505b92915050565b60008083116111175760405162461bcd60e51b815260040180806020018281038252602b815260200180611776602b913960400191505060405180910390fd5b600082116111565760405162461bcd60e51b815260040180806020018281038252602c81526020018061162f602c913960400191505060405180910390fd5b818311611189576111848261117861271080830290870263ffffffff61144c16565b9063ffffffff61148e16565b6110ce565b6110ce8361117861271080830290860263ffffffff61144c16565b60008085116111e45760405162461bcd60e51b815260040180806020018281038252602b815260200180611776602b913960400191505060405180910390fd5b600061121061271061117887820361120488838c8a63ffffffff61107516565b9063ffffffff61107516565b905061122a6103e8611178836103e563ffffffff61107516565b9695505050505050565b6000828201838110156110ce576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6112a0826001600160a01b03166114d0565b6112f1576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b6020831061132f5780518252601f199092019160209182019101611310565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611391576040519150601f19603f3d011682016040523d82523d6000602084013e611396565b606091505b5091509150816113ed576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b8051156114465780806020019051602081101561140957600080fd5b50516114465760405162461bcd60e51b815260040180806020018281038252602a81526020018061174c602a913960400191505060405180910390fd5b50505050565b60006110ce83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061150c565b60006110ce83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506115a3565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081158015906115045750808214155b949350505050565b6000818484111561159b5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611560578181015183820152602001611548565b50505050905090810190601f16801561158d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836115f25760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611560578181015183820152602001611548565b5060008385816115fe57fe5b049594505050505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373556e697377617056324c6962726172793a20494e53554646494349454e545f4f55545055545f414d4f554e5452657761726465645762746350627463556e695632506169723a207261746520746f6f2068696768556e697377617056324c6962726172793a20494e53554646494349454e545f4c4951554944495459536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7752657761726465645762746350627463556e695632506169723a20616d6f756e74206d7573742062652067726561746572207468616e20304f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657252657761726465645762746350627463556e695632506169723a20496e76616c696420746f6b656e5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564556e697377617056324c6962726172793a20494e53554646494349454e545f494e5055545f414d4f554e5452657761726465645762746350627463556e695632506169723a20746f6f206d75636820736c69707061676552657761726465645762746350627463556e695632506169723a20616d6f756e74206e6f7420617070726f766564a265627a7a72315820179a1f38b4604a6adf619cfc6dbdf5cee1f753367d90eb95b4be5c33d1e1b9e364736f6c6343000510003252657761726465645762746350627463556e695632506169723a205f756e695632206e6f74206120636f6e74726163740000000000000000000000009f8d8df26d5ab71b492ddce9799f432e36c289df0000000000000000000000007c43ea3bb6921e9b1ac53ba06f196efd296b3fa8
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100e95760003560e01c8063715018a61161008c578063a033fe9911610066578063a033fe991461028e578063f2fde38b14610296578063f5361946146102bc578063ffae4049146102c4576100e9565b8063715018a6146102765780638da5cb5b1461027e5780638f32d59b14610286576100e9565b80633cdc5389116100c85780633cdc538914610213578063431f2445146102375780635f3dd17b146102515780636406b6d01461026e576100e9565b806223de29146100ee5780632365faea146101da5780632def6620146101f7575b600080fd5b6101d8600480360360c081101561010457600080fd5b6001600160a01b03823581169260208101358216926040820135909216916060820135919081019060a08101608082013564010000000081111561014757600080fd5b82018360208201111561015957600080fd5b8035906020019184600183028401116401000000008311171561017b57600080fd5b91939092909160208101903564010000000081111561019957600080fd5b8201836020820111156101ab57600080fd5b803590602001918460018302840111640100000000831117156101cd57600080fd5b5090925090506102cc565b005b6101d8600480360360208110156101f057600080fd5b5035610383565b6101ff610405565b604080519115158252519081900360200190f35b61021b6108b4565b604080516001600160a01b039092168252519081900360200190f35b61023f6108c3565b60408051918252519081900360200190f35b6101d86004803603602081101561026757600080fd5b50356108c9565b61021b61094b565b6101d861095a565b61021b6109eb565b6101ff6109fa565b61023f610a1e565b6101d8600480360360208110156102ac57600080fd5b50356001600160a01b0316610a24565b61021b610a77565b61021b610a86565b6004546001600160a01b03888116911614156102e757610379565b6003546001600160a01b031633146103305760405162461bcd60e51b81526004018080602001828103825260288152602001806117246028913960400191505060405180910390fd5b6000851161036f5760405162461bcd60e51b81526004018080602001828103825260388152602001806116cc6038913960400191505060405180910390fd5b6103798786610a95565b5050505050505050565b61038b6109fa565b6103ca576040805162461bcd60e51b81526020600482018190526024820152600080516020611704833981519152604482015290519081900360640190fd5b60068190556040805182815290517f44f3ebcd53cc7caaa403093ba74b57dd97ab53ba634db0463e5ed5ef359015949181900360200190a150565b600554604080516370a0823160e01b8152336004820152905160009283926001600160a01b03909116916370a0823191602480820192602092909190829003018186803b15801561045557600080fd5b505afa158015610469573d6000803e3d6000fd5b505050506040513d602081101561047f57600080fd5b505160055460408051636eb1769f60e11b8152336004820152306024820152905192935083926001600160a01b039092169163dd62ed3e91604480820192602092909190829003018186803b1580156104d757600080fd5b505afa1580156104eb573d6000803e3d6000fd5b505050506040513d602081101561050157600080fd5b505110156105405760405162461bcd60e51b815260040180806020018281038252602e8152602001806117cd602e913960400191505060405180910390fd5b60055460408051639470b0bd60e01b81523360048201526024810184905290516001600160a01b0390921691639470b0bd9160448082019260009290919082900301818387803b15801561059357600080fd5b505af11580156105a7573d6000803e3d6000fd5b505060055460408051630c00007b60e41b815233600482015290516001600160a01b03909216935063c00007b0925060248082019260009290919082900301818387803b1580156105f757600080fd5b505af115801561060b573d6000803e3d6000fd5b5050600480546040805163a9059cbb60e01b81526001600160a01b03909216928201839052602482018690525191935063a9059cbb92506044808201926020929091908290030181600087803b15801561066457600080fd5b505af1158015610678573d6000803e3d6000fd5b505050506040513d602081101561068e57600080fd5b5050600480546040805163226bf2d160e21b81523093810193909352805160009384936001600160a01b0316926389afcb449260248084019382900301818787803b1580156106dc57600080fd5b505af11580156106f0573d6000803e3d6000fd5b505050506040513d604081101561070657600080fd5b5080516020909101516004805460408051630240bc6b60e21b8152905194965092945060009384936001600160a01b0390921692630902f1ac92808201926060929091829003018186803b15801561075d57600080fd5b505afa158015610771573d6000803e3d6000fd5b505050506040513d606081101561078757600080fd5b5080516020909101516001600160701b03918216935016905060006107ad858484610e8a565b6004546002549192506107d3916001600160a01b0390811691168763ffffffff610f7a16565b600480546040805163022c0d9f60e01b8152600093810184905260248101859052306044820152608060648201526084810184905290516001600160a01b039092169263022c0d9f9260c48084019382900301818387803b15801561083757600080fd5b505af115801561084b573d6000803e3d6000fd5b5050600354868401925061087091506001600160a01b0316338363ffffffff610f7a16565b60408051828152905133917f0f5bb82176feb1b5e747e28471aa92156a04d9f3ab9f45f28e2d704232b93f75919081900360200190a2600197505050505050505090565b6002546001600160a01b031681565b60065481565b6108d16109fa565b610910576040805162461bcd60e51b81526020600482018190526024820152600080516020611704833981519152604482015290519081900360640190fd5b60078190556040805182815290517f078e652549da3e15b969845fe97b8ac18df2d95c7cf6a42a16363de347b500469181900360200190a150565b6005546001600160a01b031681565b6109626109fa565b6109a1576040805162461bcd60e51b81526020600482018190526024820152600080516020611704833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b600080546001600160a01b0316610a0f610fd1565b6001600160a01b031614905090565b60075481565b610a2c6109fa565b610a6b576040805162461bcd60e51b81526020600482018190526024820152600080516020611704833981519152604482015290519081900360640190fd5b610a7481610fd5565b50565b6003546001600160a01b031681565b6004546001600160a01b031681565b6004805460408051630240bc6b60e21b81529051600285049360009384936001600160a01b0390911692630902f1ac92828101926060929190829003018186803b158015610ae257600080fd5b505afa158015610af6573d6000803e3d6000fd5b505050506040513d6060811015610b0c57600080fd5b5080516020909101516001600160701b0391821693501690506000610b32848385610e8a565b600754909150610b5685610b51846402540be40063ffffffff61107516565b6110d7565b1115610b935760405162461bcd60e51b815260040180806020018281038252602881526020018061165b6028913960400191505060405180910390fd5b610bad84600654670de0b6b3a76400006305f5e1006111a4565b811015610beb5760405162461bcd60e51b815260040180806020018281038252602c8152602001806117a1602c913960400191505060405180910390fd5b600454600354610c0e916001600160a01b0391821691168663ffffffff610f7a16565b600480546040805163022c0d9f60e01b8152928301849052600060248401819052306044850152608060648501526084840181905290516001600160a01b039092169263022c0d9f9260c4808301939282900301818387803b158015610c7357600080fd5b505af1158015610c87573d6000803e3d6000fd5b5050600454600354610cae93506001600160a01b039081169250168663ffffffff610f7a16565b600454600254610cd1916001600160a01b0391821691168363ffffffff610f7a16565b60048054604080516335313c2160e11b81523093810193909352516000926001600160a01b0390921691636a62784291602480830192602092919082900301818787803b158015610d2157600080fd5b505af1158015610d35573d6000803e3d6000fd5b505050506040513d6020811015610d4b57600080fd5b5051600480546005546040805163095ea7b360e01b81526001600160a01b03928316948101949094526024840185905251939450169163095ea7b3916044808201926020929091908290030181600087803b158015610da957600080fd5b505af1158015610dbd573d6000803e3d6000fd5b505050506040513d6020811015610dd357600080fd5b5050600554604080516305dc812160e31b81526001600160a01b038a811660048301526024820185905291519190921691632ee4090891604480830192600092919082900301818387803b158015610e2a57600080fd5b505af1158015610e3e573d6000803e3d6000fd5b50506040805189815290516001600160a01b038b1693507f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d92509081900360200190a250505050505050565b6000808411610eca5760405162461bcd60e51b815260040180806020018281038252602b815260200180611776602b913960400191505060405180910390fd5b600083118015610eda5750600082115b610f155760405162461bcd60e51b81526004018080602001828103825260288152602001806116836028913960400191505060405180910390fd5b6000610f29856103e563ffffffff61107516565b90506000610f3d828563ffffffff61107516565b90506000610f6383610f57886103e863ffffffff61107516565b9063ffffffff61123416565b9050808281610f6e57fe5b04979650505050505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610fcc90849061128e565b505050565b3390565b6001600160a01b03811661101a5760405162461bcd60e51b81526004018080602001828103825260268152602001806116096026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600082611084575060006110d1565b8282028284828161109157fe5b04146110ce5760405162461bcd60e51b81526004018080602001828103825260218152602001806116ab6021913960400191505060405180910390fd5b90505b92915050565b60008083116111175760405162461bcd60e51b815260040180806020018281038252602b815260200180611776602b913960400191505060405180910390fd5b600082116111565760405162461bcd60e51b815260040180806020018281038252602c81526020018061162f602c913960400191505060405180910390fd5b818311611189576111848261117861271080830290870263ffffffff61144c16565b9063ffffffff61148e16565b6110ce565b6110ce8361117861271080830290860263ffffffff61144c16565b60008085116111e45760405162461bcd60e51b815260040180806020018281038252602b815260200180611776602b913960400191505060405180910390fd5b600061121061271061117887820361120488838c8a63ffffffff61107516565b9063ffffffff61107516565b905061122a6103e8611178836103e563ffffffff61107516565b9695505050505050565b6000828201838110156110ce576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6112a0826001600160a01b03166114d0565b6112f1576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b6020831061132f5780518252601f199092019160209182019101611310565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611391576040519150601f19603f3d011682016040523d82523d6000602084013e611396565b606091505b5091509150816113ed576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b8051156114465780806020019051602081101561140957600080fd5b50516114465760405162461bcd60e51b815260040180806020018281038252602a81526020018061174c602a913960400191505060405180910390fd5b50505050565b60006110ce83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061150c565b60006110ce83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506115a3565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081158015906115045750808214155b949350505050565b6000818484111561159b5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611560578181015183820152602001611548565b50505050905090810190601f16801561158d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836115f25760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611560578181015183820152602001611548565b5060008385816115fe57fe5b049594505050505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373556e697377617056324c6962726172793a20494e53554646494349454e545f4f55545055545f414d4f554e5452657761726465645762746350627463556e695632506169723a207261746520746f6f2068696768556e697377617056324c6962726172793a20494e53554646494349454e545f4c4951554944495459536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7752657761726465645762746350627463556e695632506169723a20616d6f756e74206d7573742062652067726561746572207468616e20304f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657252657761726465645762746350627463556e695632506169723a20496e76616c696420746f6b656e5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564556e697377617056324c6962726172793a20494e53554646494349454e545f494e5055545f414d4f554e5452657761726465645762746350627463556e695632506169723a20746f6f206d75636820736c69707061676552657761726465645762746350627463556e695632506169723a20616d6f756e74206e6f7420617070726f766564a265627a7a72315820179a1f38b4604a6adf619cfc6dbdf5cee1f753367d90eb95b4be5c33d1e1b9e364736f6c63430005100032
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000009f8d8df26d5ab71b492ddce9799f432e36c289df0000000000000000000000007c43ea3bb6921e9b1ac53ba06f196efd296b3fa8
-----Decoded View---------------
Arg [0] : _uniV2 (address): 0x9f8D8Df26d5ab71b492DdCe9799f432E36C289DF
Arg [1] : _modifiedUnipool (address): 0x7c43Ea3bB6921E9B1AC53Ba06f196eFD296b3fa8
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000009f8d8df26d5ab71b492ddce9799f432e36c289df
Arg [1] : 0000000000000000000000007c43ea3bb6921e9b1ac53ba06f196efd296b3fa8
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.