More Info
Private Name Tags
ContractCreator
Latest 22 from a total of 22 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Buy | 13670053 | 1014 days ago | IN | 0 ETH | 0.02183423 | ||||
Buy | 13659701 | 1016 days ago | IN | 0 ETH | 0.04090386 | ||||
Buy | 13649685 | 1018 days ago | IN | 0 ETH | 0.02469838 | ||||
Buy | 13644905 | 1018 days ago | IN | 0 ETH | 0.02827632 | ||||
Buy | 13631558 | 1020 days ago | IN | 0 ETH | 0.02443639 | ||||
Buy | 13626899 | 1021 days ago | IN | 0 ETH | 0.02695754 | ||||
Buy | 13479059 | 1044 days ago | IN | 0 ETH | 0.01536223 | ||||
Buy | 13462590 | 1047 days ago | IN | 0 ETH | 0.02176091 | ||||
Buy | 13459549 | 1047 days ago | IN | 0 ETH | 0.01559364 | ||||
Buy | 13319171 | 1069 days ago | IN | 0 ETH | 0.01884541 | ||||
Buy | 13273960 | 1076 days ago | IN | 0 ETH | 0.01699332 | ||||
Buy | 13228408 | 1083 days ago | IN | 0 ETH | 0.01638133 | ||||
Buy | 13228327 | 1083 days ago | IN | 0 ETH | 0.02028679 | ||||
Buy | 13216400 | 1085 days ago | IN | 0 ETH | 0.01989022 | ||||
Buy | 13108073 | 1102 days ago | IN | 0 ETH | 0.02509945 | ||||
Buy | 13106979 | 1102 days ago | IN | 0 ETH | 0.01888448 | ||||
Buy | 13106896 | 1102 days ago | IN | 0 ETH | 0.01403308 | ||||
Buy | 13106225 | 1102 days ago | IN | 0 ETH | 0.01788678 | ||||
Buy | 13106110 | 1102 days ago | IN | 0 ETH | 0.02013879 | ||||
Buy | 13101475 | 1103 days ago | IN | 0 ETH | 0.02597977 | ||||
Transfer Ownersh... | 13101347 | 1103 days ago | IN | 0 ETH | 0.00172302 | ||||
0x60a06040 | 13101337 | 1103 days ago | IN | 0 ETH | 0.15963258 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
UniV2BuybackDepositaryBalanceView
Compiler Version
v0.6.12+commit.27d51765
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "@openzeppelin/contracts/math/Math.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "../uniswap/IUniswapV2Router02.sol"; import "../utils/OwnablePausable.sol"; import "./IDepositaryBalanceView.sol"; import "../Issuer.sol"; contract UniV2BuybackDepositaryBalanceView is IDepositaryBalanceView, OwnablePausable { using Math for uint256; using SafeMath for uint256; using SafeERC20 for ERC20; /// @notice Balance decimals. uint256 public constant override decimals = 18; /// @notice Address of buyback token. ERC20 public immutable token; /// @notice Address of issuer contract. Issuer public issuer; /// @notice Uniswap router contract. IUniswapV2Router02 public uniswapRouter; /// @notice Buyback caller. address public caller; /// @notice An event that is emitted when an issuer contract address changed. event IssuerChanged(address newIssuer); /// @notice An event that is emitted when an Uniswap router contract address changed. event UniswapRouterChanged(address newRouter); /// @notice An event that is emitted when an caller wallet changed. event CallerChanged(address newCaller); /// @notice An event that is emitted when an contract buyback stable token. event Buyback(uint256 amount, uint256 buy); constructor( address _token, address _issuer, address _uniswapRouter, address _caller ) public { token = ERC20(_token); issuer = Issuer(_issuer); uniswapRouter = IUniswapV2Router02(_uniswapRouter); caller = _caller; } /** * @notice Change issuer contract address. * @param _issuer New issuer contract address. */ function changeIssuer(address _issuer) external onlyOwner { require(_issuer != address(0), "UniV2BuybackDepositaryBalanceView::changeIssuer: invalid address"); issuer = Issuer(_issuer); require(issuer.stableToken().decimals() >= ERC20(token).decimals(), "UniV2BuybackDepositaryBalanceView::changeIssuer: invalid stable token decimals"); emit IssuerChanged(_issuer); } /** * @notice Change Uniswap router contract address. * @param _uniswapRouter New Uniswap router contract address. */ function changeUniswapRouter(address _uniswapRouter) external onlyOwner { require(_uniswapRouter != address(0), "UniV2BuybackDepositaryBalanceView::changeUniswapRouter: invalid address"); uniswapRouter = IUniswapV2Router02(_uniswapRouter); emit UniswapRouterChanged(_uniswapRouter); } /** * @notice Change caller wallet. * @param _caller New caller wallet. */ function changeCaller(address _caller) external onlyOwner { caller = _caller; emit CallerChanged(_caller); } /** * @notice Transfer token to recipient. * @param _token Target token. * @param recipient Address of recipient. * @param amount Amount of transferred token. */ function transfer( address _token, address recipient, uint256 amount ) external onlyOwner { ERC20(_token).safeTransfer(recipient, amount); } /** * @notice Buyback stable token from Uniswap pool. * @param amount Amount of buyback token. */ function buy(uint256 amount) external whenNotPaused { require(_msgSender() == owner() || _msgSender() == caller, "UniV2BuybackDepositaryBalanceView::buy: invalid caller"); require(amount > 0, "UniV2BuybackDepositaryBalanceView::buy: zero amount"); address stableToken = address(issuer.stableToken()); uint256 stableTokenDecimals = ERC20(stableToken).decimals(); uint256 allowance = token.allowance(address(this), address(uniswapRouter)); if (allowance < amount) { if (allowance > 0) { token.approve(address(uniswapRouter), 0); } token.approve(address(uniswapRouter), amount); } address[] memory path = new address[](2); path[0] = address(token); path[1] = stableToken; uint256[] memory amounts = uniswapRouter.swapExactTokensForTokens( amount, amount.mul(10**(stableTokenDecimals.sub(token.decimals()))), // 1 to 1 path, address(this), block.timestamp + 10 minutes ); uint256 stableTotalSupply = ERC20(stableToken).totalSupply(); uint256 collateralBalance = issuer.balance(); if (stableTotalSupply > collateralBalance) { uint256 issuerInbalance = stableTotalSupply.sub(collateralBalance); uint256 burningAmount = issuerInbalance.min(ERC20(stableToken).balanceOf(address(this))); if (burningAmount > 0) { ERC20(stableToken).safeTransfer(address(issuer), burningAmount); issuer.rebalance(); } } emit Buyback(amount, amounts[1]); } /** * @notice Get balance of depositary. * @return Balance of depositary. */ function balance() external view override returns (uint256) { uint256 tokenBalance = token.balanceOf(address(this)); return tokenBalance.mul(10**(decimals.sub(token.decimals()))); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.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; import "../GSN/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.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: MIT pragma solidity ^0.6.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "../../GSN/Context.sol"; import "./IERC20.sol"; import "../../math/SafeMath.sol"; import "../../utils/Address.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; using Address for address; 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 returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view 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 returns (uint8) { return _decimals; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view 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 { _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; /** * @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; import "./IERC20.sol"; import "../../math/SafeMath.sol"; import "../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.2; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies in extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256` * (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping (bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(value))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(value))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(value))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint256(_at(set._inner, index))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "../GSN/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor () internal { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!_paused, "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(_paused, "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "@openzeppelin/contracts/math/Math.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./depositary/AgregateDepositaryBalanceView.sol"; import "./StableToken.sol"; contract Issuer is AgregateDepositaryBalanceView { using Math for uint256; using SafeMath for uint256; /// @notice Stable token contract address. StableToken public stableToken; /// @notice Treasury contract address. address public treasury; /// @notice An event thats emitted when an Treasury contract transfered. event TransferTreasury(address newTreasury); /// @notice An event thats emitted when an stable token total supply rebalanced. event Rebalance(); /** * @param _stableToken Stable token contract address. * @param _treasury Treasury contract address. */ constructor(address _stableToken, address _treasury) public AgregateDepositaryBalanceView(StableToken(_stableToken).decimals(), 50) { stableToken = StableToken(_stableToken); treasury = _treasury; } /** * @notice Transfer Treasury contract to new address. * @param _treasury New address Treasury contract. */ function changeTreasury(address _treasury) external onlyOwner { treasury = _treasury; emit TransferTreasury(treasury); } /** * @notice Change owner of Stable token contract. * @param _owner New owner address. */ function changeStableTokenOwner(address _owner) external onlyOwner { stableToken.transferOwnership(_owner); } /** * @notice Rebalance stable token total supply by depositary balance. Mint stable token if depositary balance greater token total supply and burn otherwise. */ function rebalance() external whenNotPaused { uint256 currentDepositaryBalance = this.balance(); uint256 stableTokenTotalSupply = stableToken.totalSupply(); if (stableTokenTotalSupply > currentDepositaryBalance) { uint256 burningBalance = stableToken.balanceOf(address(this)); if (burningBalance > 0) { stableToken.burn(address(this), burningBalance.min(stableTokenTotalSupply.sub(currentDepositaryBalance))); emit Rebalance(); } } else if (stableTokenTotalSupply < currentDepositaryBalance) { stableToken.mint(treasury, currentDepositaryBalance.sub(stableTokenTotalSupply)); emit Rebalance(); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "./utils/AccessControl.sol"; contract StableToken is ERC20, AccessControl { /** * @param initialSupply Total supply. */ constructor(uint256 initialSupply) public ERC20("Bond Appetite USD", "USDap") { _mint(_msgSender(), initialSupply); } /** * @param account Recipient of created token. * @param amount Amount of token to be created. */ function mint(address account, uint256 amount) public onlyAllowed { _mint(account, amount); } /** * @param account Owner of removed token. * @param amount Amount of token to be removed. */ function burn(address account, uint256 amount) public onlyAllowed { _burn(account, amount); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "@openzeppelin/contracts/math/SafeMath.sol"; import "../utils/OwnablePausable.sol"; import "./IDepositaryBalanceView.sol"; contract AgregateDepositaryBalanceView is IDepositaryBalanceView, OwnablePausable { using SafeMath for uint256; /// @notice The number of depositaries in agregate. uint256 public maxSize; /// @notice Decimals balance. uint256 public override decimals; /// @notice Depositaries in agregate. IDepositaryBalanceView[] public depositaries; /// @dev Depositaries index. mapping(address => uint256) internal depositariesIndex; /// @notice An event thats emitted when an new depositary added to agregate. event DepositaryAdded(address depositary); /// @notice An event thats emitted when an depositary removed from agregate. event DepositaryRemoved(address depositary); /** * @param _decimals Decimals balance. * @param _maxSize Max number depositaries in agregate. */ constructor(uint256 _decimals, uint256 _maxSize) public { decimals = _decimals; maxSize = _maxSize; } /** * @return Depositaries count of agregate. */ function size() public view returns (uint256) { return depositaries.length; } /** * @notice Add depositary address to agregate. * @param depositary Added depositary address. */ function addDepositary(address depositary) external onlyOwner { require(depositariesIndex[depositary] == 0, "AgregateDepositaryBalanceView::addDepositary: depositary already added"); require(size() < maxSize, "AgregateDepositaryBalanceView::addDepositary: too many depositaries"); depositaries.push(IDepositaryBalanceView(depositary)); depositariesIndex[depositary] = size(); emit DepositaryAdded(depositary); } /** * @notice Removed depositary address from agregate. * @param depositary Removed depositary address. */ function removeDepositary(address depositary) external onlyOwner { uint256 valueIndex = depositariesIndex[depositary]; require(valueIndex != 0, "AgregateDepositaryBalanceView::removeDepositary: depositary already removed"); uint256 toDeleteIndex = valueIndex.sub(1); uint256 lastIndex = size().sub(1); IDepositaryBalanceView lastValue = depositaries[lastIndex]; depositaries[toDeleteIndex] = lastValue; depositariesIndex[address(lastValue)] = toDeleteIndex.add(1); depositaries.pop(); delete depositariesIndex[depositary]; emit DepositaryRemoved(depositary); } /** * @param depositary Target depositary address. * @return True if target depositary is allowed. */ function hasDepositary(address depositary) external view returns (bool) { return depositariesIndex[depositary] != 0; } /** * @return Allowed depositaries list. */ function allowedDepositaries() external view returns (address[] memory) { address[] memory result = new address[](size()); for (uint256 i = 0; i < size(); i++) { result[i] = address(depositaries[i]); } return result; } function balance() external view override returns (uint256) { uint256 result; for (uint256 i = 0; i < size(); i++) { uint256 depositaryBalance = depositaries[i].balance(); uint256 depositaryDecimals = depositaries[i].decimals(); uint256 decimalsPower = decimals.sub(depositaryDecimals); result = result.add(depositaryBalance.mul(10**decimalsPower)); } return result; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @title The Depositary Balance interface. */ interface IDepositaryBalanceView { /** * @notice Get decimals balance. * @return Decimals balance. */ function decimals() external view returns(uint256); /** * @notice Get balance of depositary. * @return Balance of depositary. */ function balance() external view returns(uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; interface IUniswapV2Router02 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint256 amountADesired, uint256 amountBDesired, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline ) external returns ( uint256 amountA, uint256 amountB, uint256 liquidity ); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); function removeLiquidity( address tokenA, address tokenB, uint256 liquidity, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline ) external returns (uint256 amountA, uint256 amountB); function removeLiquidityETH( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external returns (uint256 amountToken, uint256 amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint256 liquidity, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint256 amountA, uint256 amountB); function removeLiquidityETHWithPermit( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint256 amountToken, uint256 amountETH); function swapExactTokensForTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); function swapTokensForExactTokens( uint256 amountOut, uint256 amountInMax, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); function swapExactETHForTokens( uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external payable returns (uint256[] memory amounts); function swapTokensForExactETH( uint256 amountOut, uint256 amountInMax, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); function swapExactTokensForETH( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); function swapETHForExactTokens( uint256 amountOut, address[] calldata path, address to, uint256 deadline ) external payable returns (uint256[] memory amounts); function quote( uint256 amountA, uint256 reserveA, uint256 reserveB ) external pure returns (uint256 amountB); function getAmountOut( uint256 amountIn, uint256 reserveIn, uint256 reserveOut ) external pure returns (uint256 amountOut); function getAmountIn( uint256 amountOut, uint256 reserveIn, uint256 reserveOut ) external pure returns (uint256 amountIn); function getAmountsOut(uint256 amountIn, address[] calldata path) external view returns (uint256[] memory amounts); function getAmountsIn(uint256 amountOut, address[] calldata path) external view returns (uint256[] memory amounts); function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external returns (uint256 amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint256 amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; contract AccessControl is Ownable { using EnumerableSet for EnumerableSet.AddressSet; /// @dev Allowed address list. EnumerableSet.AddressSet private allowed; /// @notice An event emitted when address allowed. event AccessAllowed(address member); /// @notice An event emitted when address denied. event AccessDenied(address member); /** * @notice Allow access. * @param member Target address. */ function allowAccess(address member) external onlyOwner { require(!allowed.contains(member), "AccessControl::allowAccess: member already allowed"); allowed.add(member); emit AccessAllowed(member); } /** * @notice Deny access. * @param member Target address. */ function denyAccess(address member) external onlyOwner { require(allowed.contains(member), "AccessControl::denyAccess: member already denied"); allowed.remove(member); emit AccessDenied(member); } /** * @return Allowed address list. */ function accessList() external view returns (address[] memory) { address[] memory result = new address[](allowed.length()); for (uint256 i = 0; i < allowed.length(); i++) { result[i] = allowed.at(i); } return result; } /** * @dev Throws if called by any account other than allowed. */ modifier onlyAllowed() { require(allowed.contains(_msgSender()) || _msgSender() == owner(), "AccessControl: caller is not allowed"); _; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Pausable.sol"; contract OwnablePausable is Ownable, Pausable { /// @notice Address that can pause a contract. address public pauser; /// @notice An event thats emitted when an pauser address changed. event PauserChanged(address newPauser); constructor() internal { pauser = owner(); } /** * @notice Change pauser account. * @param newPauser Address of new pauser account. */ function changePauser(address newPauser) external onlyOwner { pauser = newPauser; emit PauserChanged(pauser); } /** * @notice Triggers stopped state. */ function pause() public virtual { require(pauser == _msgSender() || owner() == _msgSender(), "OwnablePausable::pause: only pauser and owner must pause contract"); _pause(); } /** * @notice Returns to normal state. */ function unpause() public virtual { require(pauser == _msgSender() || owner() == _msgSender(), "OwnablePausable::unpause: only pauser and owner must unpause contract"); _unpause(); } }
{ "evmVersion": "istanbul", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": false, "runs": 200 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_issuer","type":"address"},{"internalType":"address","name":"_uniswapRouter","type":"address"},{"internalType":"address","name":"_caller","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"buy","type":"uint256"}],"name":"Buyback","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newCaller","type":"address"}],"name":"CallerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newIssuer","type":"address"}],"name":"IssuerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newPauser","type":"address"}],"name":"PauserChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newRouter","type":"address"}],"name":"UniswapRouterChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"balance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"buy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"caller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_caller","type":"address"}],"name":"changeCaller","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_issuer","type":"address"}],"name":"changeIssuer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newPauser","type":"address"}],"name":"changePauser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_uniswapRouter","type":"address"}],"name":"changeUniswapRouter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"issuer","outputs":[{"internalType":"contract Issuer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pauser","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract ERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"uniswapRouter","outputs":[{"internalType":"contract IUniswapV2Router02","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a06040523480156200001157600080fd5b506040516200301138038062003011833981810160405260808110156200003757600080fd5b81019080805190602001909291908051906020019092919080519060200190929190805190602001909291905050506000620000786200028460201b60201c565b9050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35060008060146101000a81548160ff021916908315150217905550620001406200028c60201b60201c565b600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1660601b8152505082600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050620002b5565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60805160601c612d16620002fb60003980610c155280610fd3528061109d528061173e528061185352806119445280611a805280611b77528061230a5250612d166000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c80638456cb59116100ad578063c337083711610071578063c3370837146103aa578063d96a094a146103ee578063f2fde38b1461041c578063fc0c546a14610460578063fc9c8d391461049457610121565b80638456cb59146102ac5780638da5cb5b146102b65780639fd0506d146102ea578063b69ef8a81461031e578063beabacc81461033c57610121565b80633f4ba83a116100f45780633f4ba83a146102005780635c975abb1461020a578063715018a61461022a578063735de9f7146102345780637e8931591461026857610121565b80631d143848146101265780632921d8d41461015a5780632cd271e71461019e578063313ce567146101e2575b600080fd5b61012e6104c8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61019c6004803603602081101561017057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506104ee565b005b6101e0600480360360208110156101b457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610647565b005b6101ea6107c2565b6040518082815260200191505060405180910390f35b6102086107c7565b005b6102126108c2565b60405180821515815260200191505060405180910390f35b6102326108d8565b005b61023c610a5e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102aa6004803603602081101561027e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a84565b005b6102b4610e84565b005b6102be610f7f565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f2610fa8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610326610fce565b6040518082815260200191505060405180910390f35b6103a86004803603606081101561035257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611167565b005b6103ec600480360360208110156103c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061125f565b005b61041a6004803603602081101561040457600080fd5b810190808035906020019092919050505061143e565b005b61045e6004803603602081101561043257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506120fd565b005b610468612308565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61049c61232c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6104f6612352565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f253229f04b74cc2f5a234fa09c6e0147a424d1798c5753516b98d7a48e1b0b3f81604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b61064f612352565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461070f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fb80482a293ca2e013eda8683c9bd7fc8347cfdaeea5ede58cba46df502c2a604600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b601281565b6107cf612352565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610863575061082d612352565b73ffffffffffffffffffffffffffffffffffffffff1661084b610f7f565b73ffffffffffffffffffffffffffffffffffffffff16145b6108b8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526045815260200180612b536045913960600191505060405180910390fd5b6108c061235a565b565b60008060149054906101000a900460ff16905090565b6108e0612352565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610a8c612352565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b4c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610bd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526040815260200180612b136040913960400191505060405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610c7957600080fd5b505afa158015610c8d573d6000803e3d6000fd5b505050506040513d6020811015610ca357600080fd5b810190808051906020019092919050505060ff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9d75b2b6040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1f57600080fd5b505afa158015610d33573d6000803e3d6000fd5b505050506040513d6020811015610d4957600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610d9f57600080fd5b505afa158015610db3573d6000803e3d6000fd5b505050506040513d6020811015610dc957600080fd5b810190808051906020019092919050505060ff161015610e34576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252604e815260200180612bce604e913960600191505060405180910390fd5b7fcad349a575b7a312fc947b899cb436e2fde2cde8be518bf412258b1d7836a54e81604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b610e8c612352565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610f205750610eea612352565b73ffffffffffffffffffffffffffffffffffffffff16610f08610f7f565b73ffffffffffffffffffffffffffffffffffffffff16145b610f75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526041815260200180612ad26041913960600191505060405180910390fd5b610f7d61244c565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561105857600080fd5b505afa15801561106c573d6000803e3d6000fd5b505050506040513d602081101561108257600080fd5b8101908080519060200190929190505050905061116161114f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561110157600080fd5b505afa158015611115573d6000803e3d6000fd5b505050506040513d602081101561112b57600080fd5b810190808051906020019092919050505060ff16601261254090919063ffffffff16565b600a0a8261258a90919063ffffffff16565b91505090565b61116f612352565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461122f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61125a82828573ffffffffffffffffffffffffffffffffffffffff166126109092919063ffffffff16565b505050565b611267612352565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611327576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113ad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526047815260200180612c9a6047913960600191505060405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f0a3776494a324cdd72863deb1475d9eb705db96d66e7e199f3ebe4948343a43881604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b600060149054906101000a900460ff16156114c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6114c9610f7f565b73ffffffffffffffffffffffffffffffffffffffff166114e7612352565b73ffffffffffffffffffffffffffffffffffffffff16148061155d5750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611545612352565b73ffffffffffffffffffffffffffffffffffffffff16145b6115b2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526036815260200180612b986036913960400191505060405180910390fd5b6000811161160b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526033815260200180612c1c6033913960400191505060405180910390fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9d75b2b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561167557600080fd5b505afa158015611689573d6000803e3d6000fd5b505050506040513d602081101561169f57600080fd5b8101908080519060200190929190505050905060008173ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156116fa57600080fd5b505afa15801561170e573d6000803e3d6000fd5b505050506040513d602081101561172457600080fd5b810190808051906020019092919050505060ff16905060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b15801561180357600080fd5b505afa158015611817573d6000803e3d6000fd5b505050506040513d602081101561182d57600080fd5b8101908080519060200190929190505050905083811015611a32576000811115611942577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660006040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561190557600080fd5b505af1158015611919573d6000803e3d6000fd5b505050506040513d602081101561192f57600080fd5b8101908080519060200190929190505050505b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16866040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156119f557600080fd5b505af1158015611a09573d6000803e3d6000fd5b505050506040513d6020811015611a1f57600080fd5b8101908080519060200190929190505050505b6060600267ffffffffffffffff81118015611a4c57600080fd5b50604051908082528060200260200182016040528015611a7b5781602001602082028036833780820191505090505b5090507f000000000000000000000000000000000000000000000000000000000000000081600081518110611aac57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508381600181518110611af457fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506060600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166338ed173987611c3a611c287f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015611bdb57600080fd5b505afa158015611bef573d6000803e3d6000fd5b505050506040513d6020811015611c0557600080fd5b810190808051906020019092919050505060ff168961254090919063ffffffff16565b600a0a8a61258a90919063ffffffff16565b853061025842016040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015611cc1578082015181840152602081019050611ca6565b505050509050019650505050505050600060405180830381600087803b158015611cea57600080fd5b505af1158015611cfe573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506020811015611d2857600080fd5b8101908080516040519392919084640100000000821115611d4857600080fd5b83820191506020820185811115611d5e57600080fd5b8251866020820283011164010000000082111715611d7b57600080fd5b8083526020830192505050908051906020019060200280838360005b83811015611db2578082015181840152602081019050611d97565b50505050905001604052505050905060008573ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015611e0957600080fd5b505afa158015611e1d573d6000803e3d6000fd5b505050506040513d6020811015611e3357600080fd5b810190808051906020019092919050505090506000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b69ef8a86040518163ffffffff1660e01b815260040160206040518083038186803b158015611eb057600080fd5b505afa158015611ec4573d6000803e3d6000fd5b505050506040513d6020811015611eda57600080fd5b81019080805190602001909291905050509050808211156120a0576000611f0a828461254090919063ffffffff16565b90506000611fc28973ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611f7857600080fd5b505afa158015611f8c573d6000803e3d6000fd5b505050506040513d6020811015611fa257600080fd5b8101908080519060200190929190505050836126b290919063ffffffff16565b9050600081111561209d5761201a600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828b73ffffffffffffffffffffffffffffffffffffffff166126109092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637d7c2a1c6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561208457600080fd5b505af1158015612098573d6000803e3d6000fd5b505050505b50505b7f4e57162cf2059954fd33f1ecaaf1832e379957714070ad171bc5382b18c98d3c88846001815181106120cf57fe5b6020026020010151604051808381526020018281526020019250505060405180910390a15050505050505050565b612105612352565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146121c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561224b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612aac6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b7f000000000000000000000000000000000000000000000000000000000000000081565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600033905090565b600060149054906101000a900460ff166123dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f5061757361626c653a206e6f742070617573656400000000000000000000000081525060200191505060405180910390fd5b60008060146101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61241f612352565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b600060149054906101000a900460ff16156124cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6001600060146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612513612352565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b600061258283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506126cb565b905092915050565b60008083141561259d576000905061260a565b60008284029050828482816125ae57fe5b0414612605576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612c4f6021913960400191505060405180910390fd5b809150505b92915050565b6126ad8363a9059cbb60e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061278b565b505050565b60008183106126c157816126c3565b825b905092915050565b6000838311158290612778576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561273d578082015181840152602081019050612722565b50505050905090810190601f16801561276a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60606127ed826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661287a9092919063ffffffff16565b90506000815111156128755780806020019051602081101561280e57600080fd5b8101908080519060200190929190505050612874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180612c70602a913960400191505060405180910390fd5b5b505050565b60606128898484600085612892565b90509392505050565b606061289d85612a98565b61290f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000081525060200191505060405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b6020831061295f578051825260208201915060208101905060208303925061293c565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146129c1576040519150601f19603f3d011682016040523d82523d6000602084013e6129c6565b606091505b509150915081156129db578092505050612a90565b6000815111156129ee5780518082602001fd5b836040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612a55578082015181840152602081019050612a3a565b50505050905090810190601f168015612a825780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b949350505050565b600080823b90506000811191505091905056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c655061757361626c653a3a70617573653a206f6e6c792070617573657220616e64206f776e6572206d75737420706175736520636f6e7472616374556e6956324275796261636b4465706f73697461727942616c616e6365566965773a3a6368616e67654973737565723a20696e76616c696420616464726573734f776e61626c655061757361626c653a3a756e70617573653a206f6e6c792070617573657220616e64206f776e6572206d75737420756e706175736520636f6e7472616374556e6956324275796261636b4465706f73697461727942616c616e6365566965773a3a6275793a20696e76616c69642063616c6c6572556e6956324275796261636b4465706f73697461727942616c616e6365566965773a3a6368616e67654973737565723a20696e76616c696420737461626c6520746f6b656e20646563696d616c73556e6956324275796261636b4465706f73697461727942616c616e6365566965773a3a6275793a207a65726f20616d6f756e74536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564556e6956324275796261636b4465706f73697461727942616c616e6365566965773a3a6368616e6765556e6973776170526f757465723a20696e76616c69642061646472657373a2646970667358221220b44d9f0f3f95206e45ee30718b4fb6ee7d8bba770e6b453a272e1531e9f0b75664736f6c634300060c0033000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000679962cb53af1418f14991efc3c482bf6f241d5e0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d0000000000000000000000006eff5218f3ebb8a813539dba87bd5c7d4d2b3dcc
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101215760003560e01c80638456cb59116100ad578063c337083711610071578063c3370837146103aa578063d96a094a146103ee578063f2fde38b1461041c578063fc0c546a14610460578063fc9c8d391461049457610121565b80638456cb59146102ac5780638da5cb5b146102b65780639fd0506d146102ea578063b69ef8a81461031e578063beabacc81461033c57610121565b80633f4ba83a116100f45780633f4ba83a146102005780635c975abb1461020a578063715018a61461022a578063735de9f7146102345780637e8931591461026857610121565b80631d143848146101265780632921d8d41461015a5780632cd271e71461019e578063313ce567146101e2575b600080fd5b61012e6104c8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61019c6004803603602081101561017057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506104ee565b005b6101e0600480360360208110156101b457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610647565b005b6101ea6107c2565b6040518082815260200191505060405180910390f35b6102086107c7565b005b6102126108c2565b60405180821515815260200191505060405180910390f35b6102326108d8565b005b61023c610a5e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102aa6004803603602081101561027e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a84565b005b6102b4610e84565b005b6102be610f7f565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f2610fa8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610326610fce565b6040518082815260200191505060405180910390f35b6103a86004803603606081101561035257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611167565b005b6103ec600480360360208110156103c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061125f565b005b61041a6004803603602081101561040457600080fd5b810190808035906020019092919050505061143e565b005b61045e6004803603602081101561043257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506120fd565b005b610468612308565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61049c61232c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6104f6612352565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f253229f04b74cc2f5a234fa09c6e0147a424d1798c5753516b98d7a48e1b0b3f81604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b61064f612352565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461070f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fb80482a293ca2e013eda8683c9bd7fc8347cfdaeea5ede58cba46df502c2a604600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b601281565b6107cf612352565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610863575061082d612352565b73ffffffffffffffffffffffffffffffffffffffff1661084b610f7f565b73ffffffffffffffffffffffffffffffffffffffff16145b6108b8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526045815260200180612b536045913960600191505060405180910390fd5b6108c061235a565b565b60008060149054906101000a900460ff16905090565b6108e0612352565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610a8c612352565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b4c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610bd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526040815260200180612b136040913960400191505060405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4873ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610c7957600080fd5b505afa158015610c8d573d6000803e3d6000fd5b505050506040513d6020811015610ca357600080fd5b810190808051906020019092919050505060ff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9d75b2b6040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1f57600080fd5b505afa158015610d33573d6000803e3d6000fd5b505050506040513d6020811015610d4957600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610d9f57600080fd5b505afa158015610db3573d6000803e3d6000fd5b505050506040513d6020811015610dc957600080fd5b810190808051906020019092919050505060ff161015610e34576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252604e815260200180612bce604e913960600191505060405180910390fd5b7fcad349a575b7a312fc947b899cb436e2fde2cde8be518bf412258b1d7836a54e81604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b610e8c612352565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610f205750610eea612352565b73ffffffffffffffffffffffffffffffffffffffff16610f08610f7f565b73ffffffffffffffffffffffffffffffffffffffff16145b610f75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526041815260200180612ad26041913960600191505060405180910390fd5b610f7d61244c565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000807f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4873ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561105857600080fd5b505afa15801561106c573d6000803e3d6000fd5b505050506040513d602081101561108257600080fd5b8101908080519060200190929190505050905061116161114f7f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4873ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561110157600080fd5b505afa158015611115573d6000803e3d6000fd5b505050506040513d602081101561112b57600080fd5b810190808051906020019092919050505060ff16601261254090919063ffffffff16565b600a0a8261258a90919063ffffffff16565b91505090565b61116f612352565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461122f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61125a82828573ffffffffffffffffffffffffffffffffffffffff166126109092919063ffffffff16565b505050565b611267612352565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611327576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113ad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526047815260200180612c9a6047913960600191505060405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f0a3776494a324cdd72863deb1475d9eb705db96d66e7e199f3ebe4948343a43881604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b600060149054906101000a900460ff16156114c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6114c9610f7f565b73ffffffffffffffffffffffffffffffffffffffff166114e7612352565b73ffffffffffffffffffffffffffffffffffffffff16148061155d5750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611545612352565b73ffffffffffffffffffffffffffffffffffffffff16145b6115b2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526036815260200180612b986036913960400191505060405180910390fd5b6000811161160b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526033815260200180612c1c6033913960400191505060405180910390fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9d75b2b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561167557600080fd5b505afa158015611689573d6000803e3d6000fd5b505050506040513d602081101561169f57600080fd5b8101908080519060200190929190505050905060008173ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156116fa57600080fd5b505afa15801561170e573d6000803e3d6000fd5b505050506040513d602081101561172457600080fd5b810190808051906020019092919050505060ff16905060007f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4873ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b15801561180357600080fd5b505afa158015611817573d6000803e3d6000fd5b505050506040513d602081101561182d57600080fd5b8101908080519060200190929190505050905083811015611a32576000811115611942577f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4873ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660006040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561190557600080fd5b505af1158015611919573d6000803e3d6000fd5b505050506040513d602081101561192f57600080fd5b8101908080519060200190929190505050505b7f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4873ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16866040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156119f557600080fd5b505af1158015611a09573d6000803e3d6000fd5b505050506040513d6020811015611a1f57600080fd5b8101908080519060200190929190505050505b6060600267ffffffffffffffff81118015611a4c57600080fd5b50604051908082528060200260200182016040528015611a7b5781602001602082028036833780820191505090505b5090507f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881600081518110611aac57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508381600181518110611af457fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506060600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166338ed173987611c3a611c287f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4873ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015611bdb57600080fd5b505afa158015611bef573d6000803e3d6000fd5b505050506040513d6020811015611c0557600080fd5b810190808051906020019092919050505060ff168961254090919063ffffffff16565b600a0a8a61258a90919063ffffffff16565b853061025842016040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015611cc1578082015181840152602081019050611ca6565b505050509050019650505050505050600060405180830381600087803b158015611cea57600080fd5b505af1158015611cfe573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506020811015611d2857600080fd5b8101908080516040519392919084640100000000821115611d4857600080fd5b83820191506020820185811115611d5e57600080fd5b8251866020820283011164010000000082111715611d7b57600080fd5b8083526020830192505050908051906020019060200280838360005b83811015611db2578082015181840152602081019050611d97565b50505050905001604052505050905060008573ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015611e0957600080fd5b505afa158015611e1d573d6000803e3d6000fd5b505050506040513d6020811015611e3357600080fd5b810190808051906020019092919050505090506000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b69ef8a86040518163ffffffff1660e01b815260040160206040518083038186803b158015611eb057600080fd5b505afa158015611ec4573d6000803e3d6000fd5b505050506040513d6020811015611eda57600080fd5b81019080805190602001909291905050509050808211156120a0576000611f0a828461254090919063ffffffff16565b90506000611fc28973ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611f7857600080fd5b505afa158015611f8c573d6000803e3d6000fd5b505050506040513d6020811015611fa257600080fd5b8101908080519060200190929190505050836126b290919063ffffffff16565b9050600081111561209d5761201a600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828b73ffffffffffffffffffffffffffffffffffffffff166126109092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637d7c2a1c6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561208457600080fd5b505af1158015612098573d6000803e3d6000fd5b505050505b50505b7f4e57162cf2059954fd33f1ecaaf1832e379957714070ad171bc5382b18c98d3c88846001815181106120cf57fe5b6020026020010151604051808381526020018281526020019250505060405180910390a15050505050505050565b612105612352565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146121c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561224b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612aac6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b7f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600033905090565b600060149054906101000a900460ff166123dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f5061757361626c653a206e6f742070617573656400000000000000000000000081525060200191505060405180910390fd5b60008060146101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61241f612352565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b600060149054906101000a900460ff16156124cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6001600060146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612513612352565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b600061258283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506126cb565b905092915050565b60008083141561259d576000905061260a565b60008284029050828482816125ae57fe5b0414612605576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612c4f6021913960400191505060405180910390fd5b809150505b92915050565b6126ad8363a9059cbb60e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061278b565b505050565b60008183106126c157816126c3565b825b905092915050565b6000838311158290612778576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561273d578082015181840152602081019050612722565b50505050905090810190601f16801561276a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60606127ed826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661287a9092919063ffffffff16565b90506000815111156128755780806020019051602081101561280e57600080fd5b8101908080519060200190929190505050612874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180612c70602a913960400191505060405180910390fd5b5b505050565b60606128898484600085612892565b90509392505050565b606061289d85612a98565b61290f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000081525060200191505060405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b6020831061295f578051825260208201915060208101905060208303925061293c565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146129c1576040519150601f19603f3d011682016040523d82523d6000602084013e6129c6565b606091505b509150915081156129db578092505050612a90565b6000815111156129ee5780518082602001fd5b836040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612a55578082015181840152602081019050612a3a565b50505050905090810190601f168015612a825780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b949350505050565b600080823b90506000811191505091905056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c655061757361626c653a3a70617573653a206f6e6c792070617573657220616e64206f776e6572206d75737420706175736520636f6e7472616374556e6956324275796261636b4465706f73697461727942616c616e6365566965773a3a6368616e67654973737565723a20696e76616c696420616464726573734f776e61626c655061757361626c653a3a756e70617573653a206f6e6c792070617573657220616e64206f776e6572206d75737420756e706175736520636f6e7472616374556e6956324275796261636b4465706f73697461727942616c616e6365566965773a3a6275793a20696e76616c69642063616c6c6572556e6956324275796261636b4465706f73697461727942616c616e6365566965773a3a6368616e67654973737565723a20696e76616c696420737461626c6520746f6b656e20646563696d616c73556e6956324275796261636b4465706f73697461727942616c616e6365566965773a3a6275793a207a65726f20616d6f756e74536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564556e6956324275796261636b4465706f73697461727942616c616e6365566965773a3a6368616e6765556e6973776170526f757465723a20696e76616c69642061646472657373a2646970667358221220b44d9f0f3f95206e45ee30718b4fb6ee7d8bba770e6b453a272e1531e9f0b75664736f6c634300060c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000679962cb53af1418f14991efc3c482bf6f241d5e0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d0000000000000000000000006eff5218f3ebb8a813539dba87bd5c7d4d2b3dcc
-----Decoded View---------------
Arg [0] : _token (address): 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
Arg [1] : _issuer (address): 0x679962cb53Af1418f14991eFc3C482bF6F241d5e
Arg [2] : _uniswapRouter (address): 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
Arg [3] : _caller (address): 0x6Eff5218f3EBB8A813539DBA87bD5c7D4d2B3dcc
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Arg [1] : 000000000000000000000000679962cb53af1418f14991efc3c482bf6f241d5e
Arg [2] : 0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d
Arg [3] : 0000000000000000000000006eff5218f3ebb8a813539dba87bd5c7d4d2b3dcc
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.