Overview
ETH Balance
0 ETH
ETH Value
$0.00Token Holdings
Latest 25 from a total of 2,375 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Approve | 128877748 | 1 hr ago | IN | 0 ETH | 0.000001620357 | ||||
Approve | 128877687 | 1 hr ago | IN | 0 ETH | 0.000001401901 | ||||
Approve | 128544948 | 7 days ago | IN | 0 ETH | 0.00000155623 | ||||
Approve | 128544943 | 7 days ago | IN | 0 ETH | 0.00000155623 | ||||
Approve | 128529915 | 8 days ago | IN | 0 ETH | 0.00000943637 | ||||
Approve | 128436817 | 10 days ago | IN | 0 ETH | 0.000001768182 | ||||
Enter | 128189970 | 15 days ago | IN | 0 ETH | 0.000000102282 | ||||
Enter | 127996583 | 20 days ago | IN | 0 ETH | 0.00000027257 | ||||
Transfer | 127867160 | 23 days ago | IN | 0 ETH | 0.000001465241 | ||||
Approve | 127867102 | 23 days ago | IN | 0 ETH | 0.000001365675 | ||||
Approve | 127688041 | 27 days ago | IN | 0 ETH | 0.000000192563 | ||||
Approve | 127550139 | 30 days ago | IN | 0 ETH | 0.000000591129 | ||||
Approve | 127317016 | 36 days ago | IN | 0 ETH | 0.000000284577 | ||||
Approve | 127141234 | 40 days ago | IN | 0 ETH | 0.000000121481 | ||||
Approve | 127099263 | 41 days ago | IN | 0 ETH | 0.000000139314 | ||||
Enter | 127021427 | 43 days ago | IN | 0 ETH | 0.000000179729 | ||||
Approve | 127000892 | 43 days ago | IN | 0 ETH | 0.000000195998 | ||||
Enter | 126964154 | 44 days ago | IN | 0 ETH | 0.000000126696 | ||||
Leave | 126951186 | 44 days ago | IN | 0 ETH | 0.000000081751 | ||||
Approve | 126917046 | 45 days ago | IN | 0 ETH | 0.000000136511 | ||||
Approve | 126916958 | 45 days ago | IN | 0 ETH | 0.000000139039 | ||||
Approve | 126916646 | 45 days ago | IN | 0 ETH | 0.000000120084 | ||||
Approve | 126916283 | 45 days ago | IN | 0 ETH | 0.000000147532 | ||||
Enter | 126881599 | 46 days ago | IN | 0 ETH | 0.000000207085 | ||||
Approve | 126874772 | 46 days ago | IN | 0 ETH | 0.000000201222 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
107555274 | 493 days ago | 0 ETH | ||||
107555274 | 493 days ago | 0 ETH | ||||
107555274 | 493 days ago | 0 ETH | ||||
107552031 | 493 days ago | 0 ETH | ||||
107552031 | 493 days ago | 0 ETH | ||||
107552031 | 493 days ago | 0 ETH | ||||
107552031 | 493 days ago | 0 ETH | ||||
107546892 | 493 days ago | 0 ETH | ||||
107545094 | 493 days ago | 0 ETH | ||||
107545094 | 493 days ago | 0 ETH | ||||
107545094 | 493 days ago | 0 ETH | ||||
107528995 | 494 days ago | 0 ETH | ||||
107528995 | 494 days ago | 0 ETH | ||||
107528995 | 494 days ago | 0 ETH | ||||
107528995 | 494 days ago | 0 ETH | ||||
107528995 | 494 days ago | 0 ETH | ||||
107517447 | 494 days ago | 0 ETH | ||||
107517447 | 494 days ago | 0 ETH | ||||
107517447 | 494 days ago | 0 ETH | ||||
107517447 | 494 days ago | 0 ETH | ||||
107516067 | 494 days ago | 0 ETH | ||||
107516067 | 494 days ago | 0 ETH | ||||
107516067 | 494 days ago | 0 ETH | ||||
107516067 | 494 days ago | 0 ETH | ||||
107515589 | 494 days ago | 0 ETH |
Loading...
Loading
Contract Name:
OpenXGov
Compiler Version
v0.6.12+commit.27d51765
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20Snapshot.sol"; interface IMC{ function deposit(uint256 _pid, uint256 _amount,address _to) external; function harvest(uint256 pid, address to) external; } // OpenXBar is the second coolest bar in town (after Sushi (mad respect)). You come in with some OpenX, and leave with more! The longer you stay, the more OpenX you get. // // This contract handles swapping to and from xOpenX, OpenXSwap's staking token. contract OpenXGov is ERC20("OpenXSwap Gov Token", "xOpenX"), ERC20Snapshot{ using SafeMath for uint256; IERC20 public OpenX; IMC public masterchef; IERC20 dummyToken; address public snapAdmin; uint256 public lockEnd; // Define the OpenX token contract constructor(IERC20 _OpenX, IERC20 _dummyToken) public { OpenX = _OpenX; dummyToken = _dummyToken; snapAdmin = msg.sender; lockEnd = block.timestamp + 180 days; } function changeSnapshotAdmin(address _admin) public { require(msg.sender == snapAdmin, "Unauthorized"); snapAdmin = _admin; } function snapshot() public { require(msg.sender == snapAdmin, "Unauthorized"); _snapshot(); } uint private unlocked = 1; //reentrancy guard for deposit/withdraw modifier lock() { require(unlocked == 1, 'OpenX LOCKED'); unlocked = 0; _; unlocked = 1; } // Enter the bar. Pay some OPENXs. Earn some shares. // Locks OpenX and mints xOpenX function enter(uint256 _amount) public lock { require(address(masterchef) != address(0)); _harvestOpenX(); // Gets the amount of OpenX locked in the contract uint256 totalOpenX = OpenX.balanceOf(address(this)); // Gets the amount of xOpenX in existence uint256 totalShares = totalSupply(); // If no xOpenX exists, mint it 1:1 to the amount put in if (totalShares == 0 || totalOpenX == 0) { _mint(msg.sender, _amount); } // Calculate and mint the amount of xOpenX the OpenX is worth. The ratio will change overtime, as xOpenX is burned/minted and OpenX deposited + gained from fees / withdrawn. else { uint256 what = _amount.mul(totalShares).div(totalOpenX); _mint(msg.sender, what); } // Lock the OpenX in the contract OpenX.transferFrom(msg.sender, address(this), _amount); } function _harvestOpenX() internal { masterchef.harvest(0, address(this)); } function init(IMC _masterchef) public { require(address(masterchef) == address(0)); //To set same ratio old token to refund Masterchef Bug. _mint(msg.sender, 62643 * 10 ** 18); OpenX.transferFrom(msg.sender, address(this), 285889 * 10 ** 18); masterchef = _masterchef; uint256 balance = dummyToken.balanceOf(msg.sender); require(balance != 0, "Balance must exceed 0"); dummyToken.transferFrom(msg.sender, address(this), balance); dummyToken.approve(address(masterchef), balance); masterchef.deposit(0, balance, address(this)); } // Leave the bar. Claim back your OPENXs. // Unlocks the staked + gained OpenX and burns xOpenX function leave(uint256 _share) public lock { require(block.timestamp >= lockEnd, "Tokens still locked."); _harvestOpenX(); // Gets the amount of xOpenX in existence uint256 totalShares = totalSupply(); // Calculates the amount of OpenX the xOpenX is worth uint256 what = _share.mul(OpenX.balanceOf(address(this))).div(totalShares); _burn(msg.sender, _share); OpenX.transfer(msg.sender, what); } // The following functions are overrides required by Solidity. function _beforeTokenTransfer(address from, address to, uint256 amount) internal override(ERC20, ERC20Snapshot) { super._beforeTokenTransfer(from, to, amount); } }
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract xPool is ERC20 { constructor( string memory name, string memory symbol, uint8 decimals ) public ERC20(name, symbol) { _setupDecimals(decimals); _mint(msg.sender, 1*10**18); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../../utils/Context.sol"; import "./IERC20.sol"; import "../../math/SafeMath.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; /** * @dev Sets the values for {name} and {symbol}, initializes {decimals} with * a default value of 18. * * To select a different value for {decimals}, use {_setupDecimals}. * * All three of these values are immutable: they can only be set once during * construction. */ constructor (string memory name_, string memory symbol_) public { _name = name_; _symbol = symbol_; _decimals = 18; } /** * @dev Returns the name of the token. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is * called. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual returns (uint8) { return _decimals; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Sets {decimals} to a value other than the default one of 18. * * WARNING: This function should only be called from the constructor. Most * applications that interact with token contracts will not expect * {decimals} to ever change, and may work incorrectly if it does. */ function _setupDecimals(uint8 decimals_) internal virtual { _decimals = decimals_; } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with 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. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.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, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, 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 (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a / b); } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } /** * @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) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } /** * @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) { 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, reverting 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) { require(b > 0, "SafeMath: division by zero"); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting 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) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * 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); return a - b; } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * 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); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * 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; } }
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract testnetToken is ERC20 { mapping(address => bool) public didMint; uint256 public mintAmount; constructor( string memory name, string memory symbol, uint8 decimals, uint256 _mintAmount ) public ERC20(name, symbol) { _setupDecimals(decimals); mintAmount = _mintAmount; _mint(msg.sender, mintAmount); } function mint() public{ require(!didMint[msg.sender], "Sorry bruh..."); didMint[msg.sender] = true; _mint(msg.sender, mintAmount); } }
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract DummyOP is ERC20 { mapping(address => bool) public didMint; constructor( string memory name, string memory symbol, uint8 decimals ) public ERC20(name, symbol) { _setupDecimals(decimals); _mint(msg.sender, 30000*10**18); } function mint() public{ require(!didMint[msg.sender], "Once per account..."); didMint[msg.sender] = true; _mint(msg.sender, 20000*10**18); } }
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract test0netERC20 is ERC20 { constructor( string memory name, string memory symbol, uint8 decimals ) public ERC20(name, symbol) { _setupDecimals(decimals); } function mint(uint256 _amount, address _to) public{ _mint(_to, _amount); } }
//SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract OpenX is ERC20 { constructor() public ERC20("OpenX Optimism", "OpenX") { _setupDecimals(18); _mint(msg.sender, 16624999990000000000000000); } function burn(uint256 _amount) public { _burn(msg.sender, _amount); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../../math/SafeMath.sol"; import "../../utils/Arrays.sol"; import "../../utils/Counters.sol"; import "./ERC20.sol"; /** * @dev This contract extends an ERC20 token with a snapshot mechanism. When a snapshot is created, the balances and * total supply at the time are recorded for later access. * * This can be used to safely create mechanisms based on token balances such as trustless dividends or weighted voting. * In naive implementations it's possible to perform a "double spend" attack by reusing the same balance from different * accounts. By using snapshots to calculate dividends or voting power, those attacks no longer apply. It can also be * used to create an efficient ERC20 forking mechanism. * * Snapshots are created by the internal {_snapshot} function, which will emit the {Snapshot} event and return a * snapshot id. To get the total supply at the time of a snapshot, call the function {totalSupplyAt} with the snapshot * id. To get the balance of an account at the time of a snapshot, call the {balanceOfAt} function with the snapshot id * and the account address. * * ==== Gas Costs * * Snapshots are efficient. Snapshot creation is _O(1)_. Retrieval of balances or total supply from a snapshot is _O(log * n)_ in the number of snapshots that have been created, although _n_ for a specific account will generally be much * smaller since identical balances in subsequent snapshots are stored as a single entry. * * There is a constant overhead for normal ERC20 transfers due to the additional snapshot bookkeeping. This overhead is * only significant for the first transfer that immediately follows a snapshot for a particular account. Subsequent * transfers will have normal cost until the next snapshot, and so on. */ abstract contract ERC20Snapshot is ERC20 { // Inspired by Jordi Baylina's MiniMeToken to record historical balances: // https://github.com/Giveth/minimd/blob/ea04d950eea153a04c51fa510b068b9dded390cb/contracts/MiniMeToken.sol using SafeMath for uint256; using Arrays for uint256[]; using Counters for Counters.Counter; // Snapshotted values have arrays of ids and the value corresponding to that id. These could be an array of a // Snapshot struct, but that would impede usage of functions that work on an array. struct Snapshots { uint256[] ids; uint256[] values; } mapping (address => Snapshots) private _accountBalanceSnapshots; Snapshots private _totalSupplySnapshots; // Snapshot ids increase monotonically, with the first value being 1. An id of 0 is invalid. Counters.Counter private _currentSnapshotId; /** * @dev Emitted by {_snapshot} when a snapshot identified by `id` is created. */ event Snapshot(uint256 id); /** * @dev Creates a new snapshot and returns its snapshot id. * * Emits a {Snapshot} event that contains the same id. * * {_snapshot} is `internal` and you have to decide how to expose it externally. Its usage may be restricted to a * set of accounts, for example using {AccessControl}, or it may be open to the public. * * [WARNING] * ==== * While an open way of calling {_snapshot} is required for certain trust minimization mechanisms such as forking, * you must consider that it can potentially be used by attackers in two ways. * * First, it can be used to increase the cost of retrieval of values from snapshots, although it will grow * logarithmically thus rendering this attack ineffective in the long term. Second, it can be used to target * specific accounts and increase the cost of ERC20 transfers for them, in the ways specified in the Gas Costs * section above. * * We haven't measured the actual numbers; if this is something you're interested in please reach out to us. * ==== */ function _snapshot() internal virtual returns (uint256) { _currentSnapshotId.increment(); uint256 currentId = _currentSnapshotId.current(); emit Snapshot(currentId); return currentId; } /** * @dev Retrieves the balance of `account` at the time `snapshotId` was created. */ function balanceOfAt(address account, uint256 snapshotId) public view virtual returns (uint256) { (bool snapshotted, uint256 value) = _valueAt(snapshotId, _accountBalanceSnapshots[account]); return snapshotted ? value : balanceOf(account); } /** * @dev Retrieves the total supply at the time `snapshotId` was created. */ function totalSupplyAt(uint256 snapshotId) public view virtual returns(uint256) { (bool snapshotted, uint256 value) = _valueAt(snapshotId, _totalSupplySnapshots); return snapshotted ? value : totalSupply(); } // Update balance and/or total supply snapshots before the values are modified. This is implemented // in the _beforeTokenTransfer hook, which is executed for _mint, _burn, and _transfer operations. function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override { super._beforeTokenTransfer(from, to, amount); if (from == address(0)) { // mint _updateAccountSnapshot(to); _updateTotalSupplySnapshot(); } else if (to == address(0)) { // burn _updateAccountSnapshot(from); _updateTotalSupplySnapshot(); } else { // transfer _updateAccountSnapshot(from); _updateAccountSnapshot(to); } } function _valueAt(uint256 snapshotId, Snapshots storage snapshots) private view returns (bool, uint256) { require(snapshotId > 0, "ERC20Snapshot: id is 0"); // solhint-disable-next-line max-line-length require(snapshotId <= _currentSnapshotId.current(), "ERC20Snapshot: nonexistent id"); // When a valid snapshot is queried, there are three possibilities: // a) The queried value was not modified after the snapshot was taken. Therefore, a snapshot entry was never // created for this id, and all stored snapshot ids are smaller than the requested one. The value that corresponds // to this id is the current one. // b) The queried value was modified after the snapshot was taken. Therefore, there will be an entry with the // requested id, and its value is the one to return. // c) More snapshots were created after the requested one, and the queried value was later modified. There will be // no entry for the requested id: the value that corresponds to it is that of the smallest snapshot id that is // larger than the requested one. // // In summary, we need to find an element in an array, returning the index of the smallest value that is larger if // it is not found, unless said value doesn't exist (e.g. when all values are smaller). Arrays.findUpperBound does // exactly this. uint256 index = snapshots.ids.findUpperBound(snapshotId); if (index == snapshots.ids.length) { return (false, 0); } else { return (true, snapshots.values[index]); } } function _updateAccountSnapshot(address account) private { _updateSnapshot(_accountBalanceSnapshots[account], balanceOf(account)); } function _updateTotalSupplySnapshot() private { _updateSnapshot(_totalSupplySnapshots, totalSupply()); } function _updateSnapshot(Snapshots storage snapshots, uint256 currentValue) private { uint256 currentId = _currentSnapshotId.current(); if (_lastSnapshotId(snapshots.ids) < currentId) { snapshots.ids.push(currentId); snapshots.values.push(currentValue); } } function _lastSnapshotId(uint256[] storage ids) private view returns (uint256) { if (ids.length == 0) { return 0; } else { return ids[ids.length - 1]; } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../math/Math.sol"; /** * @dev Collection of functions related to array types. */ library Arrays { /** * @dev Searches a sorted `array` and returns the first index that contains * a value greater or equal to `element`. If no such index exists (i.e. all * values in the array are strictly less than `element`), the array length is * returned. Time complexity O(log n). * * `array` is expected to be sorted in ascending order, and to contain no * repeated elements. */ function findUpperBound(uint256[] storage array, uint256 element) internal view returns (uint256) { if (array.length == 0) { return 0; } uint256 low = 0; uint256 high = array.length; while (low < high) { uint256 mid = Math.average(low, high); // Note that mid will always be strictly less than high (i.e. it will be a valid array index) // because Math.average rounds down (it does integer division with truncation). if (array[mid] > element) { high = mid; } else { low = mid + 1; } } // At this point `low` is the exclusive upper bound. We will return the inclusive upper bound. if (low > 0 && array[low - 1] == element) { return low - 1; } else { return low; } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../math/SafeMath.sol"; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented or decremented by one. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` * Since it is not possible to overflow a 256 bit integer with increments of one, `increment` can skip the {SafeMath} * overflow check, thereby saving gas. This does assume however correct usage, in that the underlying `_value` is never * directly accessed. */ library Counters { using SafeMath for uint256; struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { // The {SafeMath} overflow check can be skipped here, see the comment at the top counter._value += 1; } function decrement(Counter storage counter) internal { counter._value = counter._value.sub(1); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @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); } }
// SPDX-License-Identifier: UNLICENCED pragma solidity 0.6.12; import "@openzeppelin/contracts/math/SafeMath.sol"; library Babylonian { function sqrt(uint256 y) internal pure returns (uint256 z) { if (y > 3) { z = y; uint256 x = y / 2 + 1; while (x < z) { z = x; x = (y / x + x) / 2; } } else if (y != 0) { z = 1; } // else z = 0 } } contract lpHelper { using SafeMath for uint256; function calculateSwapInAmount(uint256 reserveIn, uint256 userIn) public pure returns (uint256) { return Babylonian .sqrt( reserveIn.mul(userIn.mul(3988000) + reserveIn.mul(3988009)) ) .sub(reserveIn.mul(1997)) / 1994; } }
// SPDX-License-Identifier: MIT // P1 - P3: OK pragma solidity 0.6.12; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./uniswapv2/interfaces/IUniswapV2ERC20.sol"; import "./uniswapv2/interfaces/IUniswapV2Pair.sol"; import "./uniswapv2/interfaces/IUniswapV2Factory.sol"; // OpenXMaker is MasterChef's left hand and kinda a wizard. He can cook up OpenX from pretty much anything! // This contract handles "serving up" rewards for xOpenX holders by trading tokens collected from fees for OpenX. interface IERC20BURNABLE{ function burn(uint256 _amount) external; } // T1 - T4: OK contract OpenXMaker { using SafeMath for uint256; // V1 - V5: OK IUniswapV2Factory public immutable factory; address public admin; // V1 - V5: OK address private immutable openx; // V1 - V5: OK address private immutable weth; address private immutable bar; // V1 - V5: OK mapping(address => address) internal _bridges; // E1: OK event LogBridgeSet(address indexed token, address indexed bridge); // E1: OK event LogConvert(address indexed server, address indexed token0, address indexed token1, uint256 amount0, uint256 amount1, uint256 amountSUSHI); constructor (address _factory, address _openx, address _weth, address _bar) public { factory = IUniswapV2Factory(_factory); openx = _openx; weth = _weth; admin = msg.sender; bar = _bar; } function setAdmin(address _admin) public { require(msg.sender == admin, "Unauthorized"); admin = _admin; } // F1 - F10: OK // C1 - C24: OK function bridgeFor(address token) public view returns (address bridge) { bridge = _bridges[token]; if (bridge == address(0)) { bridge = weth; } } // F1 - F10: OK // C1 - C24: OK function setBridge(address token, address bridge) external { require(msg.sender == admin, "Unauthorized"); // Checks require(token != openx && token != weth && token != bridge, "OpenSwap Maker: Invalid bridge"); // Effects _bridges[token] = bridge; emit LogBridgeSet(token, bridge); } // M1 - M5: OK // C1 - C24: OK // C6: It's not a fool proof solution, but it prevents flash loans, so here it's ok to use tx.origin modifier onlyEOA() { // Try to make flash-loan exploit harder to do by only allowing externally owned addresses. require(msg.sender == tx.origin, "OpenSwap Maker: must use EOA"); _; } // F1 - F10: OK // F3: _convert is separate to save gas by only checking the 'onlyEOA' modifier once in case of convertMultiple // F6: There is an exploit to add lots of SUSHI to the bar, run convert, then remove the SUSHI again. // As the size of the OpenXBar has grown, this requires large amounts of funds and isn't super profitable anymore // The onlyEOA modifier prevents this being done with a flash loan. // C1 - C24: OK function convert(address token0, address token1) external onlyEOA() { _convert(token0, token1); } // F1 - F10: OK, see convert // C1 - C24: OK // C3: Loop is under control of the caller function convertMultiple(address[] calldata token0, address[] calldata token1) external onlyEOA() { // TODO: This can be optimized a fair bit, but this is safer and simpler for now uint256 len = token0.length; for(uint256 i=0; i < len; i++) { _convert(token0[i], token1[i]); } } function burnX() public { uint256 balance = IERC20(openx).balanceOf(address(this)); IERC20BURNABLE(openx).burn(balance); } // F1 - F10: OK // C1- C24: OK function _convert(address token0, address token1) internal { // Interactions // S1 - S4: OK IUniswapV2Pair pair = IUniswapV2Pair(factory.getPair(token0, token1)); require(address(pair) != address(0), "OpenSwap Maker: Invalid pair"); // balanceOf: S1 - S4: OK // transfer: X1 - X5: OK IERC20(address(pair)).transfer(address(pair), pair.balanceOf(address(this))); // X1 - X5: OK (uint256 amount0, uint256 amount1) = pair.burn(address(this)); if (token0 != pair.token0()) { (amount0, amount1) = (amount1, amount0); } emit LogConvert(msg.sender, token0, token1, amount0, amount1, _convertStep(token0, token1, amount0, amount1)); } // F1 - F10: OK // C1 - C24: OK // All transfer, _swap, _toOPENX, _convertStep: X1 - X5: OK function _convertStep(address token0, address token1, uint256 amount0, uint256 amount1) internal returns(uint256 openXOut) { // Interactions if (token0 == token1) { uint256 amount = amount0.add(amount1); if (token0 == openx) { IERC20BURNABLE(openx).burn(amount.div(3).mul(2)); //burn IERC20(openx).transfer(bar, amount.div(3)); //send to bar openXOut = amount; } else if (token0 == weth) { openXOut = _toOPENX(weth, amount); } else { address bridge = bridgeFor(token0); amount = _swap(token0, bridge, amount, address(this)); openXOut = _convertStep(bridge, bridge, amount, 0); } } else if (token0 == openx) { // eg. SUSHI - ETH IERC20BURNABLE(openx).burn(amount0.div(3).mul(2)); //BURN IERC20(openx).transfer(bar, amount0.div(3)); //BAR openXOut = _toOPENX(token1, amount1).add(amount0); } else if (token1 == openx) { // eg. USDT - SUSHI IERC20BURNABLE(openx).burn(amount1.div(3).mul(2)); //BURN IERC20(openx).transfer(bar, amount1.div(3)); //BAR openXOut = _toOPENX(token0, amount0).add(amount1); } else if (token0 == weth) { // eg. ETH - USDC openXOut = _toOPENX(weth, _swap(token1, weth, amount1, address(this)).add(amount0)); } else if (token1 == weth) { // eg. USDT - ETH openXOut = _toOPENX(weth, _swap(token0, weth, amount0, address(this)).add(amount1)); } else { // eg. MIC - USDT address bridge0 = bridgeFor(token0); address bridge1 = bridgeFor(token1); if (bridge0 == token1) { // eg. MIC - USDT - and bridgeFor(MIC) = USDT openXOut = _convertStep(bridge0, token1, _swap(token0, bridge0, amount0, address(this)), amount1 ); } else if (bridge1 == token0) { // eg. WBTC - DSD - and bridgeFor(DSD) = WBTC openXOut = _convertStep(token0, bridge1, amount0, _swap(token1, bridge1, amount1, address(this)) ); } else { openXOut = _convertStep(bridge0, bridge1, // eg. USDT - DSD - and bridgeFor(DSD) = WBTC _swap(token0, bridge0, amount0, address(this)), _swap(token1, bridge1, amount1, address(this)) ); } } } // F1 - F10: OK // C1 - C24: OK // All transfer, swap: X1 - X5: OK function _swap(address fromToken, address toToken, uint256 amountIn, address to) internal returns (uint256 amountOut) { // Checks // X1 - X5: OK IUniswapV2Pair pair = IUniswapV2Pair(factory.getPair(fromToken, toToken)); require(address(pair) != address(0), "OpenSwap Maker: Cannot convert"); // Interactions // X1 - X5: OK (uint256 reserve0, uint256 reserve1,) = pair.getReserves(); uint256 amountInWithFee = amountIn.mul(997); if (fromToken == pair.token0()) { amountOut = amountIn.mul(997).mul(reserve1) / reserve0.mul(1000).add(amountInWithFee); IERC20(fromToken).transfer(address(pair), amountIn); pair.swap(0, amountOut, to, new bytes(0)); // TODO: Add maximum slippage? } else { amountOut = amountIn.mul(997).mul(reserve0) / reserve1.mul(1000).add(amountInWithFee); IERC20(fromToken).transfer(address(pair), amountIn); pair.swap(amountOut, 0, to, new bytes(0)); // TODO: Add maximum slippage? } } // F1 - F10: OK // C1 - C24: OK function _toOPENX(address token, uint256 amountIn) internal returns(uint256 amountOut) { // X1 - X5: OK amountOut = _swap(token, openx, amountIn, address(this)); IERC20BURNABLE(openx).burn(amountOut.div(3).mul(2)); //BAR IERC20(openx).transfer(bar, amountOut.div(3)); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; interface IUniswapV2ERC20 { 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; }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; 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; }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint) external view returns (address pair); function allPairsLength() external view returns (uint); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; }
// SPDX-License-Identifier: MIT pragma solidity =0.6.12; import './libraries/UniswapV2Library.sol'; import './libraries/SafeMath.sol'; import './libraries/TransferHelper.sol'; import './interfaces/IUniswapV2Router02.sol'; import './interfaces/IUniswapV2Factory.sol'; import './interfaces/IERC20.sol'; import './interfaces/IWETH.sol'; contract UniswapV2Router02 is IUniswapV2Router02 { using SafeMathUniswap for uint; address public immutable override factory; address public immutable override WETH; modifier ensure(uint deadline) { require(deadline >= block.timestamp, 'OpenSwap EXPIRED'); _; } constructor(address _factory, address _WETH) public { factory = _factory; WETH = _WETH; } receive() external payable { assert(msg.sender == WETH); // only accept ETH via fallback from the WETH contract } // **** ADD LIQUIDITY **** function _addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin ) internal virtual returns (uint amountA, uint amountB) { // create the pair if it doesn't exist yet if (IUniswapV2Factory(factory).getPair(tokenA, tokenB) == address(0)) { IUniswapV2Factory(factory).createPair(tokenA, tokenB); } (uint reserveA, uint reserveB) = UniswapV2Library.getReserves(factory, tokenA, tokenB); if (reserveA == 0 && reserveB == 0) { (amountA, amountB) = (amountADesired, amountBDesired); } else { uint amountBOptimal = UniswapV2Library.quote(amountADesired, reserveA, reserveB); if (amountBOptimal <= amountBDesired) { require(amountBOptimal >= amountBMin, 'OpenSwap INSUFFICIENT_B_AMOUNT'); (amountA, amountB) = (amountADesired, amountBOptimal); } else { uint amountAOptimal = UniswapV2Library.quote(amountBDesired, reserveB, reserveA); assert(amountAOptimal <= amountADesired); require(amountAOptimal >= amountAMin, 'OpenSwap INSUFFICIENT_A_AMOUNT'); (amountA, amountB) = (amountAOptimal, amountBDesired); } } } function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external virtual override ensure(deadline) returns (uint amountA, uint amountB, uint liquidity) { (amountA, amountB) = _addLiquidity(tokenA, tokenB, amountADesired, amountBDesired, amountAMin, amountBMin); address pair = UniswapV2Library.pairFor(factory, tokenA, tokenB); TransferHelper.safeTransferFrom(tokenA, msg.sender, pair, amountA); TransferHelper.safeTransferFrom(tokenB, msg.sender, pair, amountB); liquidity = IUniswapV2Pair(pair).mint(to); } function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external virtual override payable ensure(deadline) returns (uint amountToken, uint amountETH, uint liquidity) { (amountToken, amountETH) = _addLiquidity( token, WETH, amountTokenDesired, msg.value, amountTokenMin, amountETHMin ); address pair = UniswapV2Library.pairFor(factory, token, WETH); TransferHelper.safeTransferFrom(token, msg.sender, pair, amountToken); IWETH(WETH).deposit{value: amountETH}(); assert(IWETH(WETH).transfer(pair, amountETH)); liquidity = IUniswapV2Pair(pair).mint(to); // refund dust eth, if any if (msg.value > amountETH) TransferHelper.safeTransferETH(msg.sender, msg.value - amountETH); } // **** REMOVE LIQUIDITY **** function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) public virtual override ensure(deadline) returns (uint amountA, uint amountB) { address pair = UniswapV2Library.pairFor(factory, tokenA, tokenB); IUniswapV2Pair(pair).transferFrom(msg.sender, pair, liquidity); // send liquidity to pair (uint amount0, uint amount1) = IUniswapV2Pair(pair).burn(to); (address token0,) = UniswapV2Library.sortTokens(tokenA, tokenB); (amountA, amountB) = tokenA == token0 ? (amount0, amount1) : (amount1, amount0); require(amountA >= amountAMin, 'OpenSwap INSUFFICIENT_A_AMOUNT'); require(amountB >= amountBMin, 'OpenSwap INSUFFICIENT_B_AMOUNT'); } function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) public virtual override ensure(deadline) returns (uint amountToken, uint amountETH) { (amountToken, amountETH) = removeLiquidity( token, WETH, liquidity, amountTokenMin, amountETHMin, address(this), deadline ); TransferHelper.safeTransfer(token, to, amountToken); IWETH(WETH).withdraw(amountETH); TransferHelper.safeTransferETH(to, amountETH); } function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external virtual override returns (uint amountA, uint amountB) { address pair = UniswapV2Library.pairFor(factory, tokenA, tokenB); uint value = approveMax ? uint(-1) : liquidity; IUniswapV2Pair(pair).permit(msg.sender, address(this), value, deadline, v, r, s); (amountA, amountB) = removeLiquidity(tokenA, tokenB, liquidity, amountAMin, amountBMin, to, deadline); } function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external virtual override returns (uint amountToken, uint amountETH) { address pair = UniswapV2Library.pairFor(factory, token, WETH); uint value = approveMax ? uint(-1) : liquidity; IUniswapV2Pair(pair).permit(msg.sender, address(this), value, deadline, v, r, s); (amountToken, amountETH) = removeLiquidityETH(token, liquidity, amountTokenMin, amountETHMin, to, deadline); } // **** REMOVE LIQUIDITY (supporting fee-on-transfer tokens) **** function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) public virtual override ensure(deadline) returns (uint amountETH) { (, amountETH) = removeLiquidity( token, WETH, liquidity, amountTokenMin, amountETHMin, address(this), deadline ); TransferHelper.safeTransfer(token, to, IERC20Uniswap(token).balanceOf(address(this))); IWETH(WETH).withdraw(amountETH); TransferHelper.safeTransferETH(to, amountETH); } function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external virtual override returns (uint amountETH) { address pair = UniswapV2Library.pairFor(factory, token, WETH); uint value = approveMax ? uint(-1) : liquidity; IUniswapV2Pair(pair).permit(msg.sender, address(this), value, deadline, v, r, s); amountETH = removeLiquidityETHSupportingFeeOnTransferTokens( token, liquidity, amountTokenMin, amountETHMin, to, deadline ); } // **** SWAP **** // requires the initial amount to have already been sent to the first pair function _swap(uint[] memory amounts, address[] memory path, address _to) internal virtual { for (uint i; i < path.length - 1; i++) { (address input, address output) = (path[i], path[i + 1]); (address token0,) = UniswapV2Library.sortTokens(input, output); uint amountOut = amounts[i + 1]; (uint amount0Out, uint amount1Out) = input == token0 ? (uint(0), amountOut) : (amountOut, uint(0)); address to = i < path.length - 2 ? UniswapV2Library.pairFor(factory, output, path[i + 2]) : _to; IUniswapV2Pair(UniswapV2Library.pairFor(factory, input, output)).swap( amount0Out, amount1Out, to, new bytes(0) ); } } function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external virtual override ensure(deadline) returns (uint[] memory amounts) { amounts = UniswapV2Library.getAmountsOut(factory, amountIn, path); require(amounts[amounts.length - 1] >= amountOutMin, 'OpenSwap INSUFFICIENT_OUTPUT_AMOUNT'); TransferHelper.safeTransferFrom( path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0] ); _swap(amounts, path, to); } function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external virtual override ensure(deadline) returns (uint[] memory amounts) { amounts = UniswapV2Library.getAmountsIn(factory, amountOut, path); require(amounts[0] <= amountInMax, 'OpenSwap EXCESSIVE_INPUT_AMOUNT'); TransferHelper.safeTransferFrom( path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0] ); _swap(amounts, path, to); } function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external virtual override payable ensure(deadline) returns (uint[] memory amounts) { require(path[0] == WETH, 'OpenSwap INVALID_PATH'); amounts = UniswapV2Library.getAmountsOut(factory, msg.value, path); require(amounts[amounts.length - 1] >= amountOutMin, 'OpenSwap INSUFFICIENT_OUTPUT_AMOUNT'); IWETH(WETH).deposit{value: amounts[0]}(); assert(IWETH(WETH).transfer(UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0])); _swap(amounts, path, to); } function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external virtual override ensure(deadline) returns (uint[] memory amounts) { require(path[path.length - 1] == WETH, 'OpenSwap INVALID_PATH'); amounts = UniswapV2Library.getAmountsIn(factory, amountOut, path); require(amounts[0] <= amountInMax, 'OpenSwap EXCESSIVE_INPUT_AMOUNT'); TransferHelper.safeTransferFrom( path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0] ); _swap(amounts, path, address(this)); IWETH(WETH).withdraw(amounts[amounts.length - 1]); TransferHelper.safeTransferETH(to, amounts[amounts.length - 1]); } function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external virtual override ensure(deadline) returns (uint[] memory amounts) { require(path[path.length - 1] == WETH, 'OpenSwap INVALID_PATH'); amounts = UniswapV2Library.getAmountsOut(factory, amountIn, path); require(amounts[amounts.length - 1] >= amountOutMin, 'OpenSwap INSUFFICIENT_OUTPUT_AMOUNT'); TransferHelper.safeTransferFrom( path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0] ); _swap(amounts, path, address(this)); IWETH(WETH).withdraw(amounts[amounts.length - 1]); TransferHelper.safeTransferETH(to, amounts[amounts.length - 1]); } function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external virtual override payable ensure(deadline) returns (uint[] memory amounts) { require(path[0] == WETH, 'OpenSwap INVALID_PATH'); amounts = UniswapV2Library.getAmountsIn(factory, amountOut, path); require(amounts[0] <= msg.value, 'OpenSwap EXCESSIVE_INPUT_AMOUNT'); IWETH(WETH).deposit{value: amounts[0]}(); assert(IWETH(WETH).transfer(UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0])); _swap(amounts, path, to); // refund dust eth, if any if (msg.value > amounts[0]) TransferHelper.safeTransferETH(msg.sender, msg.value - amounts[0]); } // **** SWAP (supporting fee-on-transfer tokens) **** // requires the initial amount to have already been sent to the first pair function _swapSupportingFeeOnTransferTokens(address[] memory path, address _to) internal virtual { for (uint i; i < path.length - 1; i++) { (address input, address output) = (path[i], path[i + 1]); (address token0,) = UniswapV2Library.sortTokens(input, output); IUniswapV2Pair pair = IUniswapV2Pair(UniswapV2Library.pairFor(factory, input, output)); uint amountInput; uint amountOutput; { // scope to avoid stack too deep errors (uint reserve0, uint reserve1,) = pair.getReserves(); (uint reserveInput, uint reserveOutput) = input == token0 ? (reserve0, reserve1) : (reserve1, reserve0); amountInput = IERC20Uniswap(input).balanceOf(address(pair)).sub(reserveInput); amountOutput = UniswapV2Library.getAmountOut(amountInput, reserveInput, reserveOutput); } (uint amount0Out, uint amount1Out) = input == token0 ? (uint(0), amountOutput) : (amountOutput, uint(0)); address to = i < path.length - 2 ? UniswapV2Library.pairFor(factory, output, path[i + 2]) : _to; pair.swap(amount0Out, amount1Out, to, new bytes(0)); } } function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external virtual override ensure(deadline) { TransferHelper.safeTransferFrom( path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amountIn ); uint balanceBefore = IERC20Uniswap(path[path.length - 1]).balanceOf(to); _swapSupportingFeeOnTransferTokens(path, to); require( IERC20Uniswap(path[path.length - 1]).balanceOf(to).sub(balanceBefore) >= amountOutMin, 'OpenSwap INSUFFICIENT_OUTPUT_AMOUNT' ); } function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external virtual override payable ensure(deadline) { require(path[0] == WETH, 'OpenSwap INVALID_PATH'); uint amountIn = msg.value; IWETH(WETH).deposit{value: amountIn}(); assert(IWETH(WETH).transfer(UniswapV2Library.pairFor(factory, path[0], path[1]), amountIn)); uint balanceBefore = IERC20Uniswap(path[path.length - 1]).balanceOf(to); _swapSupportingFeeOnTransferTokens(path, to); require( IERC20Uniswap(path[path.length - 1]).balanceOf(to).sub(balanceBefore) >= amountOutMin, 'OpenSwap INSUFFICIENT_OUTPUT_AMOUNT' ); } function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external virtual override ensure(deadline) { require(path[path.length - 1] == WETH, 'OpenSwap INVALID_PATH'); TransferHelper.safeTransferFrom( path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amountIn ); _swapSupportingFeeOnTransferTokens(path, address(this)); uint amountOut = IERC20Uniswap(WETH).balanceOf(address(this)); require(amountOut >= amountOutMin, 'OpenSwap INSUFFICIENT_OUTPUT_AMOUNT'); IWETH(WETH).withdraw(amountOut); TransferHelper.safeTransferETH(to, amountOut); } // **** LIBRARY FUNCTIONS **** function quote(uint amountA, uint reserveA, uint reserveB) public pure virtual override returns (uint amountB) { return UniswapV2Library.quote(amountA, reserveA, reserveB); } function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) public pure virtual override returns (uint amountOut) { return UniswapV2Library.getAmountOut(amountIn, reserveIn, reserveOut); } function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) public pure virtual override returns (uint amountIn) { return UniswapV2Library.getAmountIn(amountOut, reserveIn, reserveOut); } function getAmountsOut(uint amountIn, address[] memory path) public view virtual override returns (uint[] memory amounts) { return UniswapV2Library.getAmountsOut(factory, amountIn, path); } function getAmountsIn(uint amountOut, address[] memory path) public view virtual override returns (uint[] memory amounts) { return UniswapV2Library.getAmountsIn(factory, amountOut, path); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; import '../interfaces/IUniswapV2Pair.sol'; import "./SafeMath.sol"; library UniswapV2Library { using SafeMathUniswap for uint; // returns sorted token addresses, used to handle return values from pairs sorted in this order function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) { require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES'); (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS'); } // calculates the CREATE2 address for a pair without making any external calls function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) { (address token0, address token1) = sortTokens(tokenA, tokenB); pair = address(uint(keccak256(abi.encodePacked( hex'ff', factory, keccak256(abi.encodePacked(token0, token1)), hex'b8e25c7c292760c2b31f651189d7ec6943cbc24cc061640b5e40b9e244b78df4' // init code hash )))); } // fetches and sorts the reserves for a pair function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) { (address token0,) = sortTokens(tokenA, tokenB); (uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves(); (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0); } // given some amount of an asset and pair reserves, returns an equivalent amount of the other asset function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) { require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT'); require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); amountB = amountA.mul(reserveB) / reserveA; } // given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) { require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); uint amountInWithFee = amountIn.mul(997); uint numerator = amountInWithFee.mul(reserveOut); uint denominator = reserveIn.mul(1000).add(amountInWithFee); amountOut = numerator / denominator; } // given an output amount of an asset and pair reserves, returns a required input amount of the other asset function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) { require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); uint numerator = reserveIn.mul(amountOut).mul(1000); uint denominator = reserveOut.sub(amountOut).mul(997); amountIn = (numerator / denominator).add(1); } // performs chained getAmountOut calculations on any number of pairs function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'UniswapV2Library: INVALID_PATH'); amounts = new uint[](path.length); amounts[0] = amountIn; for (uint i; i < path.length - 1; i++) { (uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]); amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut); } } // performs chained getAmountIn calculations on any number of pairs function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'UniswapV2Library: INVALID_PATH'); amounts = new uint[](path.length); amounts[amounts.length - 1] = amountOut; for (uint i = path.length - 1; i > 0; i--) { (uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]); amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut); } } }
// SPDX-License-Identifier: MIT pragma solidity =0.6.12; // a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math) library SafeMathUniswap { function add(uint x, uint y) internal pure returns (uint z) { require((z = x + y) >= x, 'ds-math-add-overflow'); } function sub(uint x, uint y) internal pure returns (uint z) { require((z = x - y) <= x, 'ds-math-sub-underflow'); } function mul(uint x, uint y) internal pure returns (uint z) { require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow'); } }
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.6.0; // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false library TransferHelper { function safeApprove(address token, address to, uint value) internal { // bytes4(keccak256(bytes('approve(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED'); } function safeTransfer(address token, address to, uint value) internal { // bytes4(keccak256(bytes('transfer(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED'); } function safeTransferFrom(address token, address from, address to, uint value) internal { // bytes4(keccak256(bytes('transferFrom(address,address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED'); } function safeTransferETH(address to, uint value) internal { (bool success,) = to.call{value:value}(new bytes(0)); require(success, 'TransferHelper: ETH_TRANSFER_FAILED'); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2; import './IUniswapV2Router01.sol'; interface IUniswapV2Router02 is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; interface IERC20Uniswap { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view 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); }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; interface IWETH { function deposit() external payable; function transfer(address to, uint value) external returns (bool); function withdraw(uint) external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2; interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); }
// SPDX-License-Identifier: MIT pragma solidity =0.6.12; import './UniswapV2ERC20.sol'; import './libraries/Math.sol'; import './libraries/UQ112x112.sol'; import './interfaces/IERC20.sol'; import './interfaces/IUniswapV2Factory.sol'; import './interfaces/IUniswapV2Callee.sol'; contract UniswapV2Pair is UniswapV2ERC20 { using SafeMathUniswap for uint; using UQ112x112 for uint224; uint public constant MINIMUM_LIQUIDITY = 10**3; bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)'))); address public factory; string public symbol; address public token0; address public token1; uint112 private reserve0; // uses single storage slot, accessible via getReserves uint112 private reserve1; // uses single storage slot, accessible via getReserves uint32 private blockTimestampLast; // uses single storage slot, accessible via getReserves uint public price0CumulativeLast; uint public price1CumulativeLast; uint public kLast; // reserve0 * reserve1, as of immediately after the most recent liquidity event uint private unlocked = 1; modifier lock() { require(unlocked == 1, 'OpenSwapV2 LOCKED'); unlocked = 0; _; unlocked = 1; } function getReserves() public view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast) { _reserve0 = reserve0; _reserve1 = reserve1; _blockTimestampLast = blockTimestampLast; } function _safeTransfer(address token, address to, uint value) private { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(SELECTOR, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'OpenSwapV2 TRANSFER_FAILED'); } 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); constructor() public { factory = msg.sender; } // called once by the factory at time of deployment function initialize(address _token0, address _token1) external { require(msg.sender == factory, 'OpenSwapV2 FORBIDDEN'); // sufficient check token0 = _token0; token1 = _token1; string memory name0 = IERC20Uniswap(token0).symbol(); string memory name1 = IERC20Uniswap(token1).symbol(); symbol = concat(name0, "-", name1); } function concat(string memory a, string memory b, string memory c) internal pure returns (string memory) { return string(abi.encodePacked(a, b, c)); } // update reserves and, on the first call per block, price accumulators function _update(uint balance0, uint balance1, uint112 _reserve0, uint112 _reserve1) private { require(balance0 <= uint112(-1) && balance1 <= uint112(-1), 'OpenSwapV2 OVERFLOW'); uint32 blockTimestamp = uint32(block.timestamp % 2**32); uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) { // * never overflows, and + overflow is desired price0CumulativeLast += uint(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed; price1CumulativeLast += uint(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed; } reserve0 = uint112(balance0); reserve1 = uint112(balance1); blockTimestampLast = blockTimestamp; emit Sync(reserve0, reserve1); } // if fee is on, mint liquidity equivalent to 1/6th of the growth in sqrt(k) function _mintFee(uint112 _reserve0, uint112 _reserve1) private returns (bool feeOn) { address feeTo = IUniswapV2Factory(factory).feeTo(); feeOn = feeTo != address(0); uint _kLast = kLast; // gas savings if (feeOn) { if (_kLast != 0) { uint rootK = Math.sqrt(uint(_reserve0).mul(_reserve1)); uint rootKLast = Math.sqrt(_kLast); if (rootK > rootKLast) { uint numerator = totalSupply.mul(rootK.sub(rootKLast)); uint denominator = rootK.add(rootKLast); // 1/2 of fee uint liquidity = numerator / denominator; if (liquidity > 0) _mint(feeTo, liquidity); } } } else if (_kLast != 0) { kLast = 0; } } // this low-level function should be called from a contract which performs important safety checks function mint(address to) external lock returns (uint liquidity) { (uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings uint balance0 = IERC20Uniswap(token0).balanceOf(address(this)); uint balance1 = IERC20Uniswap(token1).balanceOf(address(this)); uint amount0 = balance0.sub(_reserve0); uint amount1 = balance1.sub(_reserve1); bool feeOn = _mintFee(_reserve0, _reserve1); uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee if (_totalSupply == 0) { liquidity = Math.sqrt(amount0.mul(amount1)).sub(MINIMUM_LIQUIDITY); _mint(address(0), MINIMUM_LIQUIDITY); // permanently lock the first MINIMUM_LIQUIDITY tokens } else { liquidity = Math.min(amount0.mul(_totalSupply) / _reserve0, amount1.mul(_totalSupply) / _reserve1); } require(liquidity > 0, 'OpenSwapV2 INSUFFICIENT_LIQUIDITY_MINTED'); _mint(to, liquidity); _update(balance0, balance1, _reserve0, _reserve1); if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date emit Mint(msg.sender, amount0, amount1); } // this low-level function should be called from a contract which performs important safety checks function burn(address to) external lock returns (uint amount0, uint amount1) { (uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings address _token0 = token0; // gas savings address _token1 = token1; // gas savings uint balance0 = IERC20Uniswap(_token0).balanceOf(address(this)); uint balance1 = IERC20Uniswap(_token1).balanceOf(address(this)); uint liquidity = balanceOf[address(this)]; bool feeOn = _mintFee(_reserve0, _reserve1); uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee amount0 = liquidity.mul(balance0) / _totalSupply; // using balances ensures pro-rata distribution amount1 = liquidity.mul(balance1) / _totalSupply; // using balances ensures pro-rata distribution require(amount0 > 0 && amount1 > 0, 'OpenSwapV2 INSUFFICIENT_LIQUIDITY_BURNED'); _burn(address(this), liquidity); _safeTransfer(_token0, to, amount0); _safeTransfer(_token1, to, amount1); balance0 = IERC20Uniswap(_token0).balanceOf(address(this)); balance1 = IERC20Uniswap(_token1).balanceOf(address(this)); _update(balance0, balance1, _reserve0, _reserve1); if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date emit Burn(msg.sender, amount0, amount1, to); } // this low-level function should be called from a contract which performs important safety checks function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external lock { require(amount0Out > 0 || amount1Out > 0, 'OpenSwapV2 INSUFFICIENT_OUTPUT_AMOUNT'); (uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings require(amount0Out < _reserve0 && amount1Out < _reserve1, 'OpenSwapV2 INSUFFICIENT_LIQUIDITY'); uint balance0; uint balance1; { // scope for _token{0,1}, avoids stack too deep errors address _token0 = token0; address _token1 = token1; require(to != _token0 && to != _token1, 'OpenSwapV2 INVALID_TO'); if (amount0Out > 0) _safeTransfer(_token0, to, amount0Out); // optimistically transfer tokens if (amount1Out > 0) _safeTransfer(_token1, to, amount1Out); // optimistically transfer tokens if (data.length > 0) IUniswapV2Callee(to).uniswapV2Call(msg.sender, amount0Out, amount1Out, data); balance0 = IERC20Uniswap(_token0).balanceOf(address(this)); balance1 = IERC20Uniswap(_token1).balanceOf(address(this)); } uint amount0In = balance0 > _reserve0 - amount0Out ? balance0 - (_reserve0 - amount0Out) : 0; uint amount1In = balance1 > _reserve1 - amount1Out ? balance1 - (_reserve1 - amount1Out) : 0; require(amount0In > 0 || amount1In > 0, 'OpenSwapV2 INSUFFICIENT_INPUT_AMOUNT'); { // scope for reserve{0,1}Adjusted, avoids stack too deep errors uint balance0Adjusted = balance0.mul(1000).sub(amount0In.mul(3)); uint balance1Adjusted = balance1.mul(1000).sub(amount1In.mul(3)); require(balance0Adjusted.mul(balance1Adjusted) >= uint(_reserve0).mul(_reserve1).mul(1000**2), 'OpenSwapV2 K'); } _update(balance0, balance1, _reserve0, _reserve1); emit Swap(msg.sender, amount0In, amount1In, amount0Out, amount1Out, to); } // force balances to match reserves function skim(address to) external lock { address _token0 = token0; // gas savings address _token1 = token1; // gas savings _safeTransfer(_token0, to, IERC20Uniswap(_token0).balanceOf(address(this)).sub(reserve0)); _safeTransfer(_token1, to, IERC20Uniswap(_token1).balanceOf(address(this)).sub(reserve1)); } // force reserves to match balances function sync() external lock { _update(IERC20Uniswap(token0).balanceOf(address(this)), IERC20Uniswap(token1).balanceOf(address(this)), reserve0, reserve1); } }
// SPDX-License-Identifier: MIT pragma solidity =0.6.12; import './libraries/SafeMath.sol'; contract UniswapV2ERC20 { using SafeMathUniswap for uint; string public constant name = 'OpenSwap LP Token'; uint8 public constant decimals = 18; uint public totalSupply; mapping(address => uint) public balanceOf; mapping(address => mapping(address => uint)) public allowance; bytes32 public DOMAIN_SEPARATOR; // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9; mapping(address => uint) public nonces; event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); constructor() public { uint chainId; assembly { chainId := chainid() } DOMAIN_SEPARATOR = keccak256( abi.encode( keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'), keccak256(bytes(name)), keccak256(bytes('1')), chainId, address(this) ) ); } function _mint(address to, uint value) internal { totalSupply = totalSupply.add(value); balanceOf[to] = balanceOf[to].add(value); emit Transfer(address(0), to, value); } function _burn(address from, uint value) internal { balanceOf[from] = balanceOf[from].sub(value); totalSupply = totalSupply.sub(value); emit Transfer(from, address(0), value); } function _approve(address owner, address spender, uint value) private { allowance[owner][spender] = value; emit Approval(owner, spender, value); } function _transfer(address from, address to, uint value) private { balanceOf[from] = balanceOf[from].sub(value); balanceOf[to] = balanceOf[to].add(value); emit Transfer(from, to, value); } function approve(address spender, uint value) external returns (bool) { _approve(msg.sender, spender, value); return true; } function transfer(address to, uint value) external returns (bool) { _transfer(msg.sender, to, value); return true; } function transferFrom(address from, address to, uint value) external returns (bool) { if (allowance[from][msg.sender] != uint(-1)) { allowance[from][msg.sender] = allowance[from][msg.sender].sub(value); } _transfer(from, to, value); return true; } function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external { require(deadline >= block.timestamp, 'OpenSwap: EXPIRED'); bytes32 digest = keccak256( abi.encodePacked( '\x19\x01', DOMAIN_SEPARATOR, keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline)) ) ); address recoveredAddress = ecrecover(digest, v, r, s); require(recoveredAddress != address(0) && recoveredAddress == owner, 'OpenSwap: INVALID_SIGNATURE'); _approve(owner, spender, value); } }
// SPDX-License-Identifier: MIT pragma solidity =0.6.12; // a library for performing various math operations library Math { function min(uint x, uint y) internal pure returns (uint z) { z = x < y ? x : y; } // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method) function sqrt(uint y) internal pure returns (uint z) { if (y > 3) { z = y; uint x = y / 2 + 1; while (x < z) { z = x; x = (y / x + x) / 2; } } else if (y != 0) { z = 1; } } }
// SPDX-License-Identifier: MIT pragma solidity =0.6.12; // a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format)) // range: [0, 2**112 - 1] // resolution: 1 / 2**112 library UQ112x112 { uint224 constant Q112 = 2**112; // encode a uint112 as a UQ112x112 function encode(uint112 y) internal pure returns (uint224 z) { z = uint224(y) * Q112; // never overflows } // divide a UQ112x112 by a uint112, returning a UQ112x112 function uqdiv(uint224 x, uint112 y) internal pure returns (uint224 z) { z = x / uint224(y); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; interface IUniswapV2Callee { function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external; }
// SPDX-License-Identifier: MIT pragma solidity =0.6.12; import './interfaces/IUniswapV2Factory.sol'; import './UniswapV2Pair.sol'; contract UniswapV2Factory is IUniswapV2Factory { address public override feeTo; address public override feeToSetter; mapping(address => mapping(address => address)) public override getPair; address[] public override allPairs; event PairCreated(address indexed token0, address indexed token1, address pair, uint); constructor(address _feeToSetter) public { feeToSetter = _feeToSetter; } function allPairsLength() external override view returns (uint) { return allPairs.length; } function pairCodeHash() external pure returns (bytes32) { return keccak256(type(UniswapV2Pair).creationCode); } function createPair(address tokenA, address tokenB) external override returns (address pair) { require(tokenA != tokenB, 'OpenSwap IDENTICAL_ADDRESSES'); (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); require(token0 != address(0), 'OpenSwap ZERO_ADDRESS'); require(getPair[token0][token1] == address(0), 'OpenSwap PAIR_EXISTS'); // single check is sufficient bytes memory bytecode = type(UniswapV2Pair).creationCode; bytes32 salt = keccak256(abi.encodePacked(token0, token1)); assembly { pair := create2(0, add(bytecode, 32), mload(bytecode), salt) } UniswapV2Pair(pair).initialize(token0, token1); getPair[token0][token1] = pair; getPair[token1][token0] = pair; // populate mapping in the reverse direction allPairs.push(pair); emit PairCreated(token0, token1, pair, allPairs.length); } function setFeeTo(address _feeTo) external override { require(msg.sender == feeToSetter, 'OpenSwap FORBIDDEN'); feeTo = _feeTo; } function setFeeToSetter(address _feeToSetter) external override { require(msg.sender == feeToSetter, 'OpenSwap FORBIDDEN'); feeToSetter = _feeToSetter; } }
{ "optimizer": { "enabled": true, "runs": 1000000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract IERC20","name":"_OpenX","type":"address"},{"internalType":"contract IERC20","name":"_dummyToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"}],"name":"Snapshot","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"OpenX","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"snapshotId","type":"uint256"}],"name":"balanceOfAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_admin","type":"address"}],"name":"changeSnapshotAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"enter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IMC","name":"_masterchef","type":"address"}],"name":"init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_share","type":"uint256"}],"name":"leave","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lockEnd","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"masterchef","outputs":[{"internalType":"contract IMC","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"snapAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"snapshot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"snapshotId","type":"uint256"}],"name":"totalSupplyAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040526001600f553480156200001657600080fd5b506040516200235938038062002359833981810160405260408110156200003c57600080fd5b508051602091820151604080518082018252601381527f4f70656e585377617020476f7620546f6b656e00000000000000000000000000818601908152825180840190935260068352650f09ee0cadcb60d31b958301959095528051939492939092620000ad91600391906200011e565b508051620000c39060049060208401906200011e565b50506005805460ff1916601217905550600a80546001600160a01b039384166001600160a01b031991821617909155600c80549290931691811691909117909155600d80549091163317905562ed4e004201600e55620001ba565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200016157805160ff191683800117855562000191565b8280016001018555821562000191579182015b828111156200019157825182559160200191906001019062000174565b506200019f929150620001a3565b5090565b5b808211156200019f5760008155600101620001a4565b61218f80620001ca6000396000f3fe608060405234801561001057600080fd5b50600436106101825760003560e01c80639711715a116100d8578063a9059cbb1161008c578063f1ac6e8511610066578063f1ac6e85146104f3578063f45620f9146104fb578063fb1db2781461052e57610182565b8063a9059cbb1461044e578063b01e62af14610487578063dd62ed3e146104b857610182565b8063a0ee4501116100bd578063a0ee4501146103f0578063a457c2d7146103f8578063a59f3e0c1461043157610182565b80639711715a146103cb578063981b24d0146103d357610182565b8063313ce5671161013a57806367dfd4c91161011457806367dfd4c91461037357806370a082311461039057806395d89b41146103c357610182565b8063313ce567146102e357806339509351146103015780634ee2cd7e1461033a57610182565b806318160ddd1161016b57806318160ddd1461025157806319ab453c1461026b57806323b872dd146102a057610182565b806306fdde0314610187578063095ea7b314610204575b600080fd5b61018f610536565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101c95781810151838201526020016101b1565b50505050905090810190601f1680156101f65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61023d6004803603604081101561021a57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356105ea565b604080519115158252519081900360200190f35b610259610608565b60408051918252519081900360200190f35b61029e6004803603602081101561028157600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661060e565b005b61023d600480360360608110156102b657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610a2b565b6102eb610acc565b6040805160ff9092168252519081900360200190f35b61023d6004803603604081101561031757600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610ad5565b6102596004803603604081101561035057600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610b30565b61029e6004803603602081101561038957600080fd5b5035610b86565b610259600480360360208110156103a657600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610df5565b61018f610e21565b61029e610ea0565b610259600480360360208110156103e957600080fd5b5035610f31565b610259610f61565b61023d6004803603604081101561040e57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610f67565b61029e6004803603602081101561044757600080fd5b5035610fdc565b61023d6004803603604081101561046457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356111e4565b61048f6111f8565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b610259600480360360408110156104ce57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611214565b61048f61124c565b61029e6004803603602081101561051157600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611268565b61048f611335565b60038054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156105e05780601f106105b5576101008083540402835291602001916105e0565b820191906000526020600020905b8154815290600101906020018083116105c357829003601f168201915b5050505050905090565b60006105fe6105f7611351565b8484611355565b5060015b92915050565b60025490565b600b5473ffffffffffffffffffffffffffffffffffffffff161561063157600080fd5b61064533690d43e242fb295aec000061149c565b600a54604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152693c8a12e0eb29226400006044820152905173ffffffffffffffffffffffffffffffffffffffff909216916323b872dd916064808201926020929091908290030181600087803b1580156106ce57600080fd5b505af11580156106e2573d6000803e3d6000fd5b505050506040513d60208110156106f857600080fd5b5050600b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691909117909155600c54604080517f70a08231000000000000000000000000000000000000000000000000000000008152336004820152905160009392909216916370a0823191602480820192602092909190829003018186803b15801561079f57600080fd5b505afa1580156107b3573d6000803e3d6000fd5b505050506040513d60208110156107c957600080fd5b505190508061083957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f42616c616e6365206d7573742065786365656420300000000000000000000000604482015290519081900360640190fd5b600c54604080517f23b872dd00000000000000000000000000000000000000000000000000000000815233600482015230602482015260448101849052905173ffffffffffffffffffffffffffffffffffffffff909216916323b872dd916064808201926020929091908290030181600087803b1580156108b957600080fd5b505af11580156108cd573d6000803e3d6000fd5b505050506040513d60208110156108e357600080fd5b5050600c54600b54604080517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9283166004820152602481018590529051919092169163095ea7b39160448083019260209291908290030181600087803b15801561096457600080fd5b505af1158015610978573d6000803e3d6000fd5b505050506040513d602081101561098e57600080fd5b5050600b54604080517f8dbdbe6d00000000000000000000000000000000000000000000000000000000815260006004820181905260248201859052306044830152915173ffffffffffffffffffffffffffffffffffffffff90931692638dbdbe6d9260648084019391929182900301818387803b158015610a0f57600080fd5b505af1158015610a23573d6000803e3d6000fd5b505050505050565b6000610a388484846115cd565b610ac284610a44611351565b610abd856040518060600160405280602881526020016120a36028913973ffffffffffffffffffffffffffffffffffffffff8a16600090815260016020526040812090610a8f611351565b73ffffffffffffffffffffffffffffffffffffffff168152602081019190915260400160002054919061179d565b611355565b5060019392505050565b60055460ff1690565b60006105fe610ae2611351565b84610abd8560016000610af3611351565b73ffffffffffffffffffffffffffffffffffffffff908116825260208083019390935260409182016000908120918c16815292529020549061184e565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260066020526040812081908190610b649085906118c9565b9150915081610b7b57610b7685610df5565b610b7d565b805b95945050505050565b600f54600114610bf757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4f70656e58204c4f434b45440000000000000000000000000000000000000000604482015290519081900360640190fd5b6000600f55600e54421015610c6d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f546f6b656e73207374696c6c206c6f636b65642e000000000000000000000000604482015290519081900360640190fd5b610c75611a01565b6000610c7f610608565b600a54604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051929350600092610d39928592610d339273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015610d0057600080fd5b505afa158015610d14573d6000803e3d6000fd5b505050506040513d6020811015610d2a57600080fd5b50518690611a93565b90611b06565b9050610d453384611b87565b600a54604080517fa9059cbb00000000000000000000000000000000000000000000000000000000815233600482015260248101849052905173ffffffffffffffffffffffffffffffffffffffff9092169163a9059cbb916044808201926020929091908290030181600087803b158015610dbf57600080fd5b505af1158015610dd3573d6000803e3d6000fd5b505050506040513d6020811015610de957600080fd5b50506001600f55505050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152602081905260409020545b919050565b60048054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156105e05780601f106105b5576101008083540402835291602001916105e0565b600d5473ffffffffffffffffffffffffffffffffffffffff163314610f2657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e617574686f72697a65640000000000000000000000000000000000000000604482015290519081900360640190fd5b610f2e611cd1565b50565b6000806000610f418460076118c9565b9150915081610f5757610f52610608565b610f59565b805b949350505050565b600e5481565b60006105fe610f74611351565b84610abd856040518060600160405280602581526020016121356025913960016000610f9e611351565b73ffffffffffffffffffffffffffffffffffffffff908116825260208083019390935260409182016000908120918d1681529252902054919061179d565b600f5460011461104d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4f70656e58204c4f434b45440000000000000000000000000000000000000000604482015290519081900360640190fd5b6000600f55600b5473ffffffffffffffffffffffffffffffffffffffff1661107457600080fd5b61107c611a01565b600a54604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905160009273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b1580156110ed57600080fd5b505afa158015611101573d6000803e3d6000fd5b505050506040513d602081101561111757600080fd5b505190506000611125610608565b9050801580611132575081155b1561114657611141338461149c565b611164565b600061115683610d338685611a93565b9050611162338261149c565b505b600a54604080517f23b872dd00000000000000000000000000000000000000000000000000000000815233600482015230602482015260448101869052905173ffffffffffffffffffffffffffffffffffffffff909216916323b872dd916064808201926020929091908290030181600087803b158015610dbf57600080fd5b60006105fe6111f1611351565b84846115cd565b600a5473ffffffffffffffffffffffffffffffffffffffff1681565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b600d5473ffffffffffffffffffffffffffffffffffffffff1681565b600d5473ffffffffffffffffffffffffffffffffffffffff1633146112ee57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e617574686f72697a65640000000000000000000000000000000000000000604482015290519081900360640190fd5b600d80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600b5473ffffffffffffffffffffffffffffffffffffffff1681565b3390565b73ffffffffffffffffffffffffffffffffffffffff83166113c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806121116024913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff821661142d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061203a6022913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff821661151e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b61152a60008383611d25565b600254611537908261184e565b60025573ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604090205461156a908261184e565b73ffffffffffffffffffffffffffffffffffffffff83166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b73ffffffffffffffffffffffffffffffffffffffff8316611639576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806120ec6025913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166116a5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611ff56023913960400191505060405180910390fd5b6116b0838383611d25565b6116fa8160405180606001604052806026815260200161205c6026913973ffffffffffffffffffffffffffffffffffffffff8616600090815260208190526040902054919061179d565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152602081905260408082209390935590841681522054611736908261184e565b73ffffffffffffffffffffffffffffffffffffffff8084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008184841115611846576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561180b5781810151838201526020016117f3565b50505050905090810190601f1680156118385780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6000828201838110156118c257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6000806000841161193b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4552433230536e617073686f743a206964206973203000000000000000000000604482015290519081900360640190fd5b6119456009611d35565b8411156119b357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4552433230536e617073686f743a206e6f6e6578697374656e74206964000000604482015290519081900360640190fd5b60006119bf8486611d39565b84549091508114156119d85760008092509250506119fa565b60018460010182815481106119e957fe5b906000526020600020015492509250505b9250929050565b600b54604080517f18fccc76000000000000000000000000000000000000000000000000000000008152600060048201819052306024830152915173ffffffffffffffffffffffffffffffffffffffff909316926318fccc769260448084019391929182900301818387803b158015611a7957600080fd5b505af1158015611a8d573d6000803e3d6000fd5b50505050565b600082611aa257506000610602565b82820282848281611aaf57fe5b04146118c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806120826021913960400191505060405180910390fd5b6000808211611b7657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381611b7f57fe5b049392505050565b73ffffffffffffffffffffffffffffffffffffffff8216611bf3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806120cb6021913960400191505060405180910390fd5b611bff82600083611d25565b611c49816040518060600160405280602281526020016120186022913973ffffffffffffffffffffffffffffffffffffffff8516600090815260208190526040902054919061179d565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260208190526040902055600254611c7c9082611df8565b60025560408051828152905160009173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6000611cdd6009611e6f565b6000611ce96009611d35565b6040805182815290519192507f8030e83b04d87bef53480e26263266d6ca66863aa8506aca6f2559d18aa1cb67919081900360200190a1905090565b611d30838383611e78565b505050565b5490565b8154600090611d4a57506000610602565b82546000905b80821015611d99576000611d648383611eea565b905084868281548110611d7357fe5b90600052602060002001541115611d8c57809150611d93565b8060010192505b50611d50565b600082118015611dc1575083856001840381548110611db457fe5b9060005260206000200154145b15611df057507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019050610602565b509050610602565b600082821115611e6957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b80546001019055565b611e83838383611d30565b73ffffffffffffffffffffffffffffffffffffffff8316611eb457611ea782611f0f565b611eaf611f46565b611d30565b73ffffffffffffffffffffffffffffffffffffffff8216611ed857611ea783611f0f565b611ee183611f0f565b611d3082611f0f565b60006002808306600285060181611efd57fe5b04600283046002850401019392505050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600660205260409020610f2e90611f4183610df5565b611f55565b611f536007611f41610608565b565b6000611f616009611d35565b905080611f6d84611fa1565b1015611d30578254600180820185556000858152602080822090930193909355938401805494850181558252902090910155565b8054600090611fb257506000610e1c565b815482907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101908110611fe257fe5b90600052602060002001549050610e1c56fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212206425b6ee5f402e28d1a0977be9f44a46c12692f5bece9cd3e8af77d69dc2ca0664736f6c634300060c0033000000000000000000000000c3864f98f2a61a7caeb95b039d031b4e2f55e0e9000000000000000000000000cd476505861bde63942ef0bcebc2fb2538e46765
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101825760003560e01c80639711715a116100d8578063a9059cbb1161008c578063f1ac6e8511610066578063f1ac6e85146104f3578063f45620f9146104fb578063fb1db2781461052e57610182565b8063a9059cbb1461044e578063b01e62af14610487578063dd62ed3e146104b857610182565b8063a0ee4501116100bd578063a0ee4501146103f0578063a457c2d7146103f8578063a59f3e0c1461043157610182565b80639711715a146103cb578063981b24d0146103d357610182565b8063313ce5671161013a57806367dfd4c91161011457806367dfd4c91461037357806370a082311461039057806395d89b41146103c357610182565b8063313ce567146102e357806339509351146103015780634ee2cd7e1461033a57610182565b806318160ddd1161016b57806318160ddd1461025157806319ab453c1461026b57806323b872dd146102a057610182565b806306fdde0314610187578063095ea7b314610204575b600080fd5b61018f610536565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101c95781810151838201526020016101b1565b50505050905090810190601f1680156101f65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61023d6004803603604081101561021a57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356105ea565b604080519115158252519081900360200190f35b610259610608565b60408051918252519081900360200190f35b61029e6004803603602081101561028157600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661060e565b005b61023d600480360360608110156102b657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610a2b565b6102eb610acc565b6040805160ff9092168252519081900360200190f35b61023d6004803603604081101561031757600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610ad5565b6102596004803603604081101561035057600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610b30565b61029e6004803603602081101561038957600080fd5b5035610b86565b610259600480360360208110156103a657600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610df5565b61018f610e21565b61029e610ea0565b610259600480360360208110156103e957600080fd5b5035610f31565b610259610f61565b61023d6004803603604081101561040e57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610f67565b61029e6004803603602081101561044757600080fd5b5035610fdc565b61023d6004803603604081101561046457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356111e4565b61048f6111f8565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b610259600480360360408110156104ce57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611214565b61048f61124c565b61029e6004803603602081101561051157600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611268565b61048f611335565b60038054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156105e05780601f106105b5576101008083540402835291602001916105e0565b820191906000526020600020905b8154815290600101906020018083116105c357829003601f168201915b5050505050905090565b60006105fe6105f7611351565b8484611355565b5060015b92915050565b60025490565b600b5473ffffffffffffffffffffffffffffffffffffffff161561063157600080fd5b61064533690d43e242fb295aec000061149c565b600a54604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152693c8a12e0eb29226400006044820152905173ffffffffffffffffffffffffffffffffffffffff909216916323b872dd916064808201926020929091908290030181600087803b1580156106ce57600080fd5b505af11580156106e2573d6000803e3d6000fd5b505050506040513d60208110156106f857600080fd5b5050600b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691909117909155600c54604080517f70a08231000000000000000000000000000000000000000000000000000000008152336004820152905160009392909216916370a0823191602480820192602092909190829003018186803b15801561079f57600080fd5b505afa1580156107b3573d6000803e3d6000fd5b505050506040513d60208110156107c957600080fd5b505190508061083957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f42616c616e6365206d7573742065786365656420300000000000000000000000604482015290519081900360640190fd5b600c54604080517f23b872dd00000000000000000000000000000000000000000000000000000000815233600482015230602482015260448101849052905173ffffffffffffffffffffffffffffffffffffffff909216916323b872dd916064808201926020929091908290030181600087803b1580156108b957600080fd5b505af11580156108cd573d6000803e3d6000fd5b505050506040513d60208110156108e357600080fd5b5050600c54600b54604080517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9283166004820152602481018590529051919092169163095ea7b39160448083019260209291908290030181600087803b15801561096457600080fd5b505af1158015610978573d6000803e3d6000fd5b505050506040513d602081101561098e57600080fd5b5050600b54604080517f8dbdbe6d00000000000000000000000000000000000000000000000000000000815260006004820181905260248201859052306044830152915173ffffffffffffffffffffffffffffffffffffffff90931692638dbdbe6d9260648084019391929182900301818387803b158015610a0f57600080fd5b505af1158015610a23573d6000803e3d6000fd5b505050505050565b6000610a388484846115cd565b610ac284610a44611351565b610abd856040518060600160405280602881526020016120a36028913973ffffffffffffffffffffffffffffffffffffffff8a16600090815260016020526040812090610a8f611351565b73ffffffffffffffffffffffffffffffffffffffff168152602081019190915260400160002054919061179d565b611355565b5060019392505050565b60055460ff1690565b60006105fe610ae2611351565b84610abd8560016000610af3611351565b73ffffffffffffffffffffffffffffffffffffffff908116825260208083019390935260409182016000908120918c16815292529020549061184e565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260066020526040812081908190610b649085906118c9565b9150915081610b7b57610b7685610df5565b610b7d565b805b95945050505050565b600f54600114610bf757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4f70656e58204c4f434b45440000000000000000000000000000000000000000604482015290519081900360640190fd5b6000600f55600e54421015610c6d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f546f6b656e73207374696c6c206c6f636b65642e000000000000000000000000604482015290519081900360640190fd5b610c75611a01565b6000610c7f610608565b600a54604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051929350600092610d39928592610d339273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015610d0057600080fd5b505afa158015610d14573d6000803e3d6000fd5b505050506040513d6020811015610d2a57600080fd5b50518690611a93565b90611b06565b9050610d453384611b87565b600a54604080517fa9059cbb00000000000000000000000000000000000000000000000000000000815233600482015260248101849052905173ffffffffffffffffffffffffffffffffffffffff9092169163a9059cbb916044808201926020929091908290030181600087803b158015610dbf57600080fd5b505af1158015610dd3573d6000803e3d6000fd5b505050506040513d6020811015610de957600080fd5b50506001600f55505050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152602081905260409020545b919050565b60048054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156105e05780601f106105b5576101008083540402835291602001916105e0565b600d5473ffffffffffffffffffffffffffffffffffffffff163314610f2657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e617574686f72697a65640000000000000000000000000000000000000000604482015290519081900360640190fd5b610f2e611cd1565b50565b6000806000610f418460076118c9565b9150915081610f5757610f52610608565b610f59565b805b949350505050565b600e5481565b60006105fe610f74611351565b84610abd856040518060600160405280602581526020016121356025913960016000610f9e611351565b73ffffffffffffffffffffffffffffffffffffffff908116825260208083019390935260409182016000908120918d1681529252902054919061179d565b600f5460011461104d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4f70656e58204c4f434b45440000000000000000000000000000000000000000604482015290519081900360640190fd5b6000600f55600b5473ffffffffffffffffffffffffffffffffffffffff1661107457600080fd5b61107c611a01565b600a54604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905160009273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b1580156110ed57600080fd5b505afa158015611101573d6000803e3d6000fd5b505050506040513d602081101561111757600080fd5b505190506000611125610608565b9050801580611132575081155b1561114657611141338461149c565b611164565b600061115683610d338685611a93565b9050611162338261149c565b505b600a54604080517f23b872dd00000000000000000000000000000000000000000000000000000000815233600482015230602482015260448101869052905173ffffffffffffffffffffffffffffffffffffffff909216916323b872dd916064808201926020929091908290030181600087803b158015610dbf57600080fd5b60006105fe6111f1611351565b84846115cd565b600a5473ffffffffffffffffffffffffffffffffffffffff1681565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b600d5473ffffffffffffffffffffffffffffffffffffffff1681565b600d5473ffffffffffffffffffffffffffffffffffffffff1633146112ee57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e617574686f72697a65640000000000000000000000000000000000000000604482015290519081900360640190fd5b600d80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600b5473ffffffffffffffffffffffffffffffffffffffff1681565b3390565b73ffffffffffffffffffffffffffffffffffffffff83166113c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806121116024913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff821661142d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061203a6022913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff821661151e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b61152a60008383611d25565b600254611537908261184e565b60025573ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604090205461156a908261184e565b73ffffffffffffffffffffffffffffffffffffffff83166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b73ffffffffffffffffffffffffffffffffffffffff8316611639576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806120ec6025913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166116a5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611ff56023913960400191505060405180910390fd5b6116b0838383611d25565b6116fa8160405180606001604052806026815260200161205c6026913973ffffffffffffffffffffffffffffffffffffffff8616600090815260208190526040902054919061179d565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152602081905260408082209390935590841681522054611736908261184e565b73ffffffffffffffffffffffffffffffffffffffff8084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008184841115611846576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561180b5781810151838201526020016117f3565b50505050905090810190601f1680156118385780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6000828201838110156118c257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6000806000841161193b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4552433230536e617073686f743a206964206973203000000000000000000000604482015290519081900360640190fd5b6119456009611d35565b8411156119b357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4552433230536e617073686f743a206e6f6e6578697374656e74206964000000604482015290519081900360640190fd5b60006119bf8486611d39565b84549091508114156119d85760008092509250506119fa565b60018460010182815481106119e957fe5b906000526020600020015492509250505b9250929050565b600b54604080517f18fccc76000000000000000000000000000000000000000000000000000000008152600060048201819052306024830152915173ffffffffffffffffffffffffffffffffffffffff909316926318fccc769260448084019391929182900301818387803b158015611a7957600080fd5b505af1158015611a8d573d6000803e3d6000fd5b50505050565b600082611aa257506000610602565b82820282848281611aaf57fe5b04146118c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806120826021913960400191505060405180910390fd5b6000808211611b7657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381611b7f57fe5b049392505050565b73ffffffffffffffffffffffffffffffffffffffff8216611bf3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806120cb6021913960400191505060405180910390fd5b611bff82600083611d25565b611c49816040518060600160405280602281526020016120186022913973ffffffffffffffffffffffffffffffffffffffff8516600090815260208190526040902054919061179d565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260208190526040902055600254611c7c9082611df8565b60025560408051828152905160009173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6000611cdd6009611e6f565b6000611ce96009611d35565b6040805182815290519192507f8030e83b04d87bef53480e26263266d6ca66863aa8506aca6f2559d18aa1cb67919081900360200190a1905090565b611d30838383611e78565b505050565b5490565b8154600090611d4a57506000610602565b82546000905b80821015611d99576000611d648383611eea565b905084868281548110611d7357fe5b90600052602060002001541115611d8c57809150611d93565b8060010192505b50611d50565b600082118015611dc1575083856001840381548110611db457fe5b9060005260206000200154145b15611df057507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019050610602565b509050610602565b600082821115611e6957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b80546001019055565b611e83838383611d30565b73ffffffffffffffffffffffffffffffffffffffff8316611eb457611ea782611f0f565b611eaf611f46565b611d30565b73ffffffffffffffffffffffffffffffffffffffff8216611ed857611ea783611f0f565b611ee183611f0f565b611d3082611f0f565b60006002808306600285060181611efd57fe5b04600283046002850401019392505050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600660205260409020610f2e90611f4183610df5565b611f55565b611f536007611f41610608565b565b6000611f616009611d35565b905080611f6d84611fa1565b1015611d30578254600180820185556000858152602080822090930193909355938401805494850181558252902090910155565b8054600090611fb257506000610e1c565b815482907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101908110611fe257fe5b90600052602060002001549050610e1c56fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212206425b6ee5f402e28d1a0977be9f44a46c12692f5bece9cd3e8af77d69dc2ca0664736f6c634300060c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000c3864f98f2a61a7caeb95b039d031b4e2f55e0e9000000000000000000000000cd476505861bde63942ef0bcebc2fb2538e46765
-----Decoded View---------------
Arg [0] : _OpenX (address): 0xc3864f98f2a61A7cAeb95b039D031b4E2f55e0e9
Arg [1] : _dummyToken (address): 0xCD476505861BDe63942eF0BceBC2fb2538e46765
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000c3864f98f2a61a7caeb95b039d031b4e2f55e0e9
Arg [1] : 000000000000000000000000cd476505861bde63942ef0bcebc2fb2538e46765
Deployed Bytecode Sourcemap
687:3530:9:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2168:89:2;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4244:166;;;;;;;;;;;;;;;;-1:-1:-1;4244:166:2;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;3235:106;;;:::i;:::-;;;;;;;;;;;;;;;;2757:621:9;;;;;;;;;;;;;;;;-1:-1:-1;2757:621:9;;;;:::i;:::-;;4877:317:2;;;;;;;;;;;;;;;;-1:-1:-1;4877:317:2;;;;;;;;;;;;;;;;;;:::i;3086:89::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;5589:215;;;;;;;;;;;;;;;;-1:-1:-1;5589:215:2;;;;;;;;;:::i;4285:262:3:-;;;;;;;;;;;;;;;;-1:-1:-1;4285:262:3;;;;;;;;;:::i;3488:459:9:-;;;;;;;;;;;;;;;;-1:-1:-1;3488:459:9;;:::i;3399:125:2:-;;;;;;;;;;;;;;;;-1:-1:-1;3399:125:2;;;;:::i;2370:93::-;;;:::i;1320:110:9:-;;;:::i;4646:229:3:-;;;;;;;;;;;;;;;;-1:-1:-1;4646:229:3;;:::i;904:22:9:-;;;:::i;6291:266:2:-;;;;;;;;;;;;;;;;-1:-1:-1;6291:266:2;;;;;;;;;:::i;1736:925:9:-;;;;;;;;;;;;;;;;-1:-1:-1;1736:925:9;;:::i;3727:172:2:-;;;;;;;;;;;;;;;;-1:-1:-1;3727:172:2;;;;;;;;;:::i;799:19:9:-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;3957:149:2;;;;;;;;;;;;;;;;-1:-1:-1;3957:149:2;;;;;;;;;;;:::i;874:24:9:-;;;:::i;1175:139::-;;;;;;;;;;;;;;;;-1:-1:-1;1175:139:9;;;;:::i;824:21::-;;;:::i;2168:89:2:-;2245:5;2238:12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2213:13;;2238:12;;2245:5;;2238:12;;2245:5;2238:12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2168:89;:::o;4244:166::-;4327:4;4343:39;4352:12;:10;:12::i;:::-;4366:7;4375:6;4343:8;:39::i;:::-;-1:-1:-1;4399:4:2;4244:166;;;;;:::o;3235:106::-;3322:12;;3235:106;:::o;2757:621:9:-;2821:10;;2813:33;2821:10;2813:33;2805:42;;;;;;2921:35;2927:10;2939:16;2921:5;:35::i;:::-;2966:5;;:64;;;;;;2985:10;2966:64;;;;3005:4;2966:64;;;;3012:17;2966:64;;;;;;:5;;;;;:18;;:64;;;;;;;;;;;;;;;:5;;:64;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;3049:10:9;:24;;;;;;;;;;;;;;;3101:10;;:32;;;;;;3122:10;3101:32;;;;;;-1:-1:-1;;3101:10:9;;;;;:20;;:32;;;;;2966:64;;3101:32;;;;;;;;:10;:32;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;3101:32:9;;-1:-1:-1;3151:12:9;3143:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3199:10;;:59;;;;;;3223:10;3199:59;;;;3243:4;3199:59;;;;;;;;;;;;:10;;;;;:23;;:59;;;;;;;;;;;;;;;:10;;:59;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;3268:10:9;;3295;;3268:48;;;;;;:10;3295;;;3268:48;;;;;;;;;;;;:10;;;;;:18;;:48;;;;;3199:59;;3268:48;;;;;;;:10;;:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;3326:10:9;;:45;;;;;;:10;:45;;;;;;;;;;;;3365:4;3326:45;;;;;;:10;;;;;:18;;:45;;;;;:10;;:45;;;;;;:10;;:45;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2757:621;;:::o;4877:317:2:-;4983:4;4999:36;5009:6;5017:9;5028:6;4999:9;:36::i;:::-;5045:121;5054:6;5062:12;:10;:12::i;:::-;5076:89;5114:6;5076:89;;;;;;;;;;;;;;;;;:19;;;;;;;:11;:19;;;;;;5096:12;:10;:12::i;:::-;5076:33;;;;;;;;;;;;;-1:-1:-1;5076:33:2;;;:89;:37;:89::i;:::-;5045:8;:121::i;:::-;-1:-1:-1;5183:4:2;4877:317;;;;;:::o;3086:89::-;3159:9;;;;3086:89;:::o;5589:215::-;5677:4;5693:83;5702:12;:10;:12::i;:::-;5716:7;5725:50;5764:10;5725:11;:25;5737:12;:10;:12::i;:::-;5725:25;;;;;;;;;;;;;;;;;;-1:-1:-1;5725:25:2;;;:34;;;;;;;;;;;:38;:50::i;4285:262:3:-;4448:33;;;4372:7;4448:33;;;:24;:33;;;;;4372:7;;;;4427:55;;4436:10;;4427:8;:55::i;:::-;4391:91;;;;4500:11;:40;;4522:18;4532:7;4522:9;:18::i;:::-;4500:40;;;4514:5;4500:40;4493:47;4285:262;-1:-1:-1;;;;;4285:262:3:o;3488:459:9:-;1545:8;;1557:1;1545:13;1537:38;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1596:1;1585:8;:12;3568:7:::1;::::0;3549:15:::1;:26;;3541:59;;;::::0;;::::1;::::0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;::::1;::::0;;;;;;;;;;;;;::::1;;3607:15;:13;:15::i;:::-;3682:19;3704:13;:11;:13::i;:::-;3815:5;::::0;:30:::1;::::0;;;;;3839:4:::1;3815:30;::::0;::::1;::::0;;;3682:35;;-1:-1:-1;3789:12:9::1;::::0;3804:59:::1;::::0;3682:35;;3804:42:::1;::::0;3815:5:::1;::::0;;::::1;::::0;:15:::1;::::0;:30;;;;;::::1;::::0;;;;;;;;;:5;:30;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;-1:-1:-1::0;3815:30:9;3804:6;;:10:::1;:42::i;:::-;:46:::0;::::1;:59::i;:::-;3789:74;;3873:25;3879:10;3891:6;3873:5;:25::i;:::-;3908:5;::::0;:32:::1;::::0;;;;;3923:10:::1;3908:32;::::0;::::1;::::0;;;;;;;;;:5:::1;::::0;;::::1;::::0;:14:::1;::::0;:32;;;;;::::1;::::0;;;;;;;;;:5:::1;::::0;:32;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;-1:-1:-1::0;;1629:1:9;1618:8;:12;-1:-1:-1;;;3488:459:9:o;3399:125:2:-;3499:18;;;3473:7;3499:18;;;;;;;;;;;3399:125;;;;:::o;2370:93::-;2449:7;2442:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2417:13;;2442:14;;2449:7;;2442:14;;2449:7;2442:14;;;;;;;;;;;;;;;;;;;;;;;;1320:110:9;1376:9;;;;1362:10;:23;1354:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1412:11;:9;:11::i;:::-;;1320:110::o;4646:229:3:-;4717:7;4737:16;4755:13;4772:43;4781:10;4793:21;4772:8;:43::i;:::-;4736:79;;;;4833:11;:35;;4855:13;:11;:13::i;:::-;4833:35;;;4847:5;4833:35;4826:42;4646:229;-1:-1:-1;;;;4646:229:3:o;904:22:9:-;;;;:::o;6291:266:2:-;6384:4;6400:129;6409:12;:10;:12::i;:::-;6423:7;6432:96;6471:15;6432:96;;;;;;;;;;;;;;;;;:11;:25;6444:12;:10;:12::i;:::-;6432:25;;;;;;;;;;;;;;;;;;-1:-1:-1;6432:25:2;;;:34;;;;;;;;;;;:96;:38;:96::i;1736:925:9:-;1545:8;;1557:1;1545:13;1537:38;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1596:1;1585:8;:12;1806:10:::1;::::0;1798:33:::1;1806:10;1790:42;;;::::0;::::1;;1839:15;:13;:15::i;:::-;1944:5;::::0;:30:::1;::::0;;;;;1968:4:::1;1944:30;::::0;::::1;::::0;;;1923:18:::1;::::0;1944:5:::1;;::::0;:15:::1;::::0;:30;;;;;::::1;::::0;;;;;;;;:5;:30;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;-1:-1:-1::0;1944:30:9;;-1:-1:-1;2034:19:9::1;2056:13;:11;:13::i;:::-;2034:35:::0;-1:-1:-1;2148:16:9;;;:35:::1;;-1:-1:-1::0;2168:15:9;;2148:35:::1;2144:405;;;2199:26;2205:10;2217:7;2199:5;:26::i;:::-;2144:405;;;2446:12;2461:40;2490:10:::0;2461:24:::1;:7:::0;2473:11;2461::::1;:24::i;:40::-;2446:55;;2515:23;2521:10;2533:4;2515:5;:23::i;:::-;2144:405;;2600:5;::::0;:54:::1;::::0;;;;;2619:10:::1;2600:54;::::0;::::1;::::0;2639:4:::1;2600:54:::0;;;;;;;;;;;;:5:::1;::::0;;::::1;::::0;:18:::1;::::0;:54;;;;;::::1;::::0;;;;;;;;;:5:::1;::::0;:54;::::1;;::::0;::::1;;;;::::0;::::1;3727:172:2::0;3813:4;3829:42;3839:12;:10;:12::i;:::-;3853:9;3864:6;3829:9;:42::i;799:19:9:-;;;;;;:::o;3957:149:2:-;4072:18;;;;4046:7;4072:18;;;:11;:18;;;;;;;;:27;;;;;;;;;;;;;3957:149::o;874:24:9:-;;;;;;:::o;1175:139::-;1256:9;;;;1242:10;:23;1234:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1289:9;:18;;;;;;;;;;;;;;;1175:139::o;824:21::-;;;;;;:::o;598:104:6:-;685:10;598:104;:::o;9355:340:2:-;9456:19;;;9448:68;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9534:21;;;9526:68;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9605:18;;;;;;;;:11;:18;;;;;;;;:27;;;;;;;;;;;;;:36;;;9656:32;;;;;;;;;;;;;;;;;9355:340;;;:::o;7832:370::-;7915:21;;;7907:65;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7983:49;8012:1;8016:7;8025:6;7983:20;:49::i;:::-;8058:12;;:24;;8075:6;8058:16;:24::i;:::-;8043:12;:39;8113:18;;;:9;:18;;;;;;;;;;;:30;;8136:6;8113:22;:30::i;:::-;8092:18;;;:9;:18;;;;;;;;;;;:51;;;;8158:37;;;;;;;8092:18;;:9;;8158:37;;;;;;;;;;7832:370;;:::o;7031:530::-;7136:20;;;7128:70;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7216:23;;;7208:71;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7290:47;7311:6;7319:9;7330:6;7290:20;:47::i;:::-;7368:71;7390:6;7368:71;;;;;;;;;;;;;;;;;:17;;;:9;:17;;;;;;;;;;;;:71;:21;:71::i;:::-;7348:17;;;;:9;:17;;;;;;;;;;;:91;;;;7472:20;;;;;;;:32;;7497:6;7472:24;:32::i;:::-;7449:20;;;;:9;:20;;;;;;;;;;;;:55;;;;7519:35;;;;;;;7449:20;;7519:35;;;;;;;;;;;;;7031:530;;;:::o;5432:163:1:-;5518:7;5553:12;5545:6;;;;5537:29;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;5583:5:1;;;5432:163::o;2690:175::-;2748:7;2779:5;;;2802:6;;;;2794:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2857:1;2690:175;-1:-1:-1;;;2690:175:1:o;5621:1664:3:-;5718:4;5724:7;5768:1;5755:10;:14;5747:49;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5881:28;:18;:26;:28::i;:::-;5867:10;:42;;5859:84;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7066:13;7082:40;:9;7111:10;7082:28;:40::i;:::-;7146:20;;7066:56;;-1:-1:-1;7137:29:3;;7133:146;;;7190:5;7197:1;7182:17;;;;;;;7133:146;7238:4;7244:9;:16;;7261:5;7244:23;;;;;;;;;;;;;;;;7230:38;;;;;5621:1664;;;;;;:::o;2667:84:9:-;2708:10;;:36;;;;;;:10;:36;;;;;;2738:4;2708:36;;;;;;:10;;;;;:18;;:36;;;;;:10;;:36;;;;;;:10;;:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2667:84::o;3538:215:1:-;3596:7;3619:6;3615:20;;-1:-1:-1;3634:1:1;3627:8;;3615:20;3657:5;;;3661:1;3657;:5;:1;3680:5;;;;;:10;3672:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4217:150;4275:7;4306:1;4302;:5;4294:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4359:1;4355;:5;;;;;;;4217:150;-1:-1:-1;;;4217:150:1:o;8522:410:2:-;8605:21;;;8597:67;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8675:49;8696:7;8713:1;8717:6;8675:20;:49::i;:::-;8756:68;8779:6;8756:68;;;;;;;;;;;;;;;;;:18;;;:9;:18;;;;;;;;;;;;:68;:22;:68::i;:::-;8735:18;;;:9;:18;;;;;;;;;;:89;8849:12;;:24;;8866:6;8849:16;:24::i;:::-;8834:12;:39;8888:37;;;;;;;;8914:1;;8888:37;;;;;;;;;;;;;8522:410;;:::o;3956:222:3:-;4003:7;4022:30;:18;:28;:30::i;:::-;4063:17;4083:28;:18;:26;:28::i;:::-;4126:19;;;;;;;;4063:48;;-1:-1:-1;4126:19:3;;;;;;;;;;4162:9;-1:-1:-1;3956:222:3;:::o;4021:193:9:-;4163:44;4190:4;4196:2;4200:6;4163:26;:44::i;:::-;4021:193;;;:::o;1106:112:7:-;1197:14;;1106:112::o;590:892:5:-;702:12;;679:7;;698:56;;-1:-1:-1;742:1:5;735:8;;698:56;804:12;;764:11;;827:414;840:4;834:3;:10;827:414;;;860:11;874:23;887:3;892:4;874:12;:23::i;:::-;860:37;;1127:7;1114:5;1120:3;1114:10;;;;;;;;;;;;;;;;:20;1110:121;;;1161:3;1154:10;;1110:121;;;1209:3;1215:1;1209:7;1203:13;;1110:121;827:414;;;;1364:1;1358:3;:7;:36;;;;;1387:7;1369:5;1381:1;1375:3;:7;1369:14;;;;;;;;;;;;;;;;:25;1358:36;1354:122;;;-1:-1:-1;1417:7:5;;;-1:-1:-1;1410:14:5;;1354:122;-1:-1:-1;1462:3:5;-1:-1:-1;1455:10:5;;3136:155:1;3194:7;3226:1;3221;:6;;3213:49;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;3279:5:1;;;3136:155::o;1224:178:7:-;1376:19;;1394:1;1376:19;;;1224:178::o;5089:526:3:-;5195:44;5222:4;5228:2;5232:6;5195:26;:44::i;:::-;5252:18;;;5248:361;;5298:26;5321:2;5298:22;:26::i;:::-;5334:28;:26;:28::i;:::-;5248:361;;;5381:16;;;5377:232;;5425:28;5448:4;5425:22;:28::i;5377:232::-;5536:28;5559:4;5536:22;:28::i;:::-;5574:26;5597:2;5574:22;:26::i;616:190:0:-;678:7;797:1;;788;:5;784:1;780;:5;:13;779:19;;;;;;773:1;769;:5;763:1;759;:5;758:17;:41;;616:190;-1:-1:-1;;;616:190:0:o;7291:144:3:-;7374:33;;;;;;;:24;:33;;;;;7358:70;;7409:18;7399:7;7409:9;:18::i;:::-;7358:15;:70::i;7441:116::-;7497:53;7513:21;7536:13;:11;:13::i;7497:53::-;7441:116::o;7563:309::-;7657:17;7677:28;:18;:26;:28::i;:::-;7657:48;-1:-1:-1;7657:48:3;7719:30;7735:9;7719:15;:30::i;:::-;:42;7715:151;;;7777:29;;;;;;;;-1:-1:-1;7777:29:3;;;;;;;;;;;;;;7820:16;;;:35;;;;;;;;;;;;;;;7563:309::o;7878:206::-;7971:10;;7948:7;;7967:111;;-1:-1:-1;8009:1:3;8002:8;;7967:111;8052:10;;8048:3;;8052:14;;;;8048:19;;;;;;;;;;;;;;8041:26;;;
Swarm Source
ipfs://6425b6ee5f402e28d1a0977be9f44a46c12692f5bece9cd3e8af77d69dc2ca06
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
OP | 100.00% | $0.052055 | 2,913,468.1335 | $151,660.58 |
[ Download: CSV Export ]
[ 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.