Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0x60806040 | 12133376 | 1290 days ago | IN | 0 ETH | 0.31360494 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
LONStaking
Compiler Version
v0.7.4+commit.3f05b770
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /* Modified from SushiBar contract: https://etherscan.io/address/0x8798249c2E607446EfB7Ad49eC89dD1865Ff4272#code */ /* Added with AAVE StakedToken's cooldown feature: https://etherscan.io/address/0x74a7a4e7566a2f523986e500ce35b20d343f6741#code */ import "@openzeppelin/contracts/math/Math.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/Pausable.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "../../interfaces/ILon.sol"; import "../../upgrade_proxy/ERC20ForUpgradeable.sol"; import "../../upgrade_proxy/OwnableForUpgradeable.sol"; contract LONStaking is ERC20ForUpgradeable, OwnableForUpgradeable, ReentrancyGuard, Pausable { using SafeMath for uint256; using SafeERC20 for ILon; using SafeERC20 for IERC20; // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)") bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9; uint256 private constant BPS_MAX = 10000; ILon public lonToken; bytes32 public DOMAIN_SEPARATOR; uint256 public BPS_RAGE_EXIT_PENALTY; uint256 public COOLDOWN_SECONDS; uint256 public COOLDOWN_IN_DAYS; mapping(address => uint256) public nonces; // For EIP-2612 permit() mapping(address => uint256) public stakersCooldowns; /* ========== EVENTS ========== */ event Staked(address indexed user, uint256 amount, uint256 share); event Cooldown(address indexed user); event Redeem(address indexed user, uint256 share, uint256 redeemAmount, uint256 penaltyAmount); event Recovered(address token, uint256 amount); event SetCooldownAndRageExitParam(uint256 coolDownInDays, uint256 bpsRageExitPenalty); /* ========== CONSTRUCTOR ========== */ function initialize( ILon _lonToken, address _owner, uint256 _COOLDOWN_IN_DAYS, uint256 _BPS_RAGE_EXIT_PENALTY ) external { lonToken = _lonToken; _initializeOwnable(_owner); _initializeERC20("Wrapped Tokenlon", "xLON"); require(_COOLDOWN_IN_DAYS >= 1, "COOLDOWN_IN_DAYS less than 1 day"); require(_BPS_RAGE_EXIT_PENALTY <= BPS_MAX, "BPS_RAGE_EXIT_PENALTY larger than BPS_MAX"); COOLDOWN_IN_DAYS = _COOLDOWN_IN_DAYS; COOLDOWN_SECONDS = _COOLDOWN_IN_DAYS * 86400; BPS_RAGE_EXIT_PENALTY = _BPS_RAGE_EXIT_PENALTY; uint256 chainId ; assembly { chainId := chainid() } DOMAIN_SEPARATOR = keccak256( abi.encode( keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), keccak256(bytes(name())), keccak256(bytes("1")), chainId, address(this) ) ); } /* ========== RESTRICTED FUNCTIONS ========== */ function pause() external onlyOwner whenNotPaused { _pause(); } function unpause() external onlyOwner whenPaused { _unpause(); } function setCooldownAndRageExitParam(uint256 _COOLDOWN_IN_DAYS, uint256 _BPS_RAGE_EXIT_PENALTY) public onlyOwner { require(_COOLDOWN_IN_DAYS >= 1, "COOLDOWN_IN_DAYS less than 1 day"); require(_BPS_RAGE_EXIT_PENALTY <= BPS_MAX, "BPS_RAGE_EXIT_PENALTY larger than BPS_MAX"); COOLDOWN_IN_DAYS = _COOLDOWN_IN_DAYS; COOLDOWN_SECONDS = _COOLDOWN_IN_DAYS * 86400; BPS_RAGE_EXIT_PENALTY = _BPS_RAGE_EXIT_PENALTY; emit SetCooldownAndRageExitParam(_COOLDOWN_IN_DAYS, _BPS_RAGE_EXIT_PENALTY); } function recoverERC20(address _tokenAddress, uint256 _tokenAmount) external onlyOwner { require(_tokenAddress != address(lonToken), "cannot withdraw lon token"); IERC20(_tokenAddress).safeTransfer(owner, _tokenAmount); emit Recovered(_tokenAddress, _tokenAmount); } /* ========== VIEWS ========== */ function cooldownRemainSeconds(address _account) external view returns (uint256) { uint256 cooldownTimestamp = stakersCooldowns[_account]; if ( (cooldownTimestamp == 0) || (cooldownTimestamp.add(COOLDOWN_SECONDS) <= block.timestamp) ) return 0; return cooldownTimestamp.add(COOLDOWN_SECONDS).sub(block.timestamp); } function previewRageExit(address _account) external view returns (uint256 receiveAmount, uint256 penaltyAmount) { uint256 cooldownEndTimestamp = stakersCooldowns[_account].add(COOLDOWN_SECONDS); uint256 totalLon = lonToken.balanceOf(address(this)); uint256 totalShares = totalSupply(); uint256 share = balanceOf(_account); uint256 userTotalAmount = share.mul(totalLon).div(totalShares); if (block.timestamp > cooldownEndTimestamp) { // Normal redeem if cooldown period already passed receiveAmount = userTotalAmount; penaltyAmount = 0; } else { uint256 timeDiffInDays = Math.min( COOLDOWN_IN_DAYS, (cooldownEndTimestamp.sub(block.timestamp)).div(86400).add(1) ); // Penalty share = share * (number_of_days_to_cooldown_end / number_of_days_in_cooldown) * (BPS_RAGE_EXIT_PENALTY / BPS_MAX) uint256 penaltyShare = share.mul(timeDiffInDays).mul(BPS_RAGE_EXIT_PENALTY).div(BPS_MAX).div(COOLDOWN_IN_DAYS); receiveAmount = share.sub(penaltyShare).mul(totalLon).div(totalShares); penaltyAmount = userTotalAmount.sub(receiveAmount); } } /* ========== MUTATIVE FUNCTIONS ========== */ function _getNextCooldownTimestamp( uint256 _fromCooldownTimestamp, uint256 _amountToReceive, address _toAddress, uint256 _toBalance ) internal returns (uint256) { uint256 toCooldownTimestamp = stakersCooldowns[_toAddress]; if (toCooldownTimestamp == 0) { return 0; } uint256 fromCooldownTimestamp; // If sent from user who has not unstake, set fromCooldownTimestamp to current block timestamp, // i.e., pretend the user just unstake now. // This is to prevent user from bypassing cooldown by transferring to an already unstaked account. if (_fromCooldownTimestamp == 0) { fromCooldownTimestamp = block.timestamp; } else { fromCooldownTimestamp = _fromCooldownTimestamp; } // If `to` account has greater timestamp, i.e., `to` has to wait longer, the timestamp remains the same. if (fromCooldownTimestamp <= toCooldownTimestamp) { return toCooldownTimestamp; } else { // Otherwise, count in `from` account's timestamp to derive `to` account's new timestamp. // If the period between `from` and `to` account is greater than COOLDOWN_SECONDS, // reduce the period to COOLDOWN_SECONDS. // This is to prevent user from bypassing cooldown by early unstake with `to` account // and enjoy free cooldown bonus while waiting for `from` account to unstake. if (fromCooldownTimestamp.sub(toCooldownTimestamp) > COOLDOWN_SECONDS) { toCooldownTimestamp = fromCooldownTimestamp.sub(COOLDOWN_SECONDS); } toCooldownTimestamp = ( _amountToReceive.mul(fromCooldownTimestamp).add(_toBalance.mul(toCooldownTimestamp)) ).div(_amountToReceive.add(_toBalance)); return toCooldownTimestamp; } } function _transfer( address _from, address _to, uint256 _amount ) internal override whenNotPaused { uint256 balanceOfFrom = balanceOf(_from); uint256 balanceOfTo = balanceOf(_to); uint256 previousSenderCooldown = stakersCooldowns[_from]; if (_from != _to) { stakersCooldowns[_to] = _getNextCooldownTimestamp( previousSenderCooldown, _amount, _to, balanceOfTo ); // if cooldown was set and whole balance of sender was transferred - clear cooldown if (balanceOfFrom == _amount && previousSenderCooldown != 0) { stakersCooldowns[_from] = 0; } } super._transfer(_from, _to, _amount); } // EIP-2612 permit standard function permit(address _owner, address _spender, uint256 _value, uint256 _deadline, uint8 _v, bytes32 _r, bytes32 _s) external { require(_owner != address(0), "owner is zero address"); require(block.timestamp <= _deadline || _deadline == 0, "permit expired"); bytes32 digest = keccak256( abi.encodePacked( uint16(0x1901), DOMAIN_SEPARATOR, keccak256(abi.encode(PERMIT_TYPEHASH, _owner, _spender, _value, nonces[_owner]++, _deadline)) ) ); require(_owner == ecrecover(digest, _v, _r, _s), "invalid signature"); _approve(_owner, _spender, _value); } function _stake(address _account, uint256 _amount) internal { require(_amount > 0, "cannot stake 0 amount"); // Mint xLON according to current share and Lon amount uint256 totalLon = lonToken.balanceOf(address(this)); uint256 totalShares = totalSupply(); uint256 share; if (totalShares == 0 || totalLon == 0) { share = _amount; } else { share = _amount.mul(totalShares).div(totalLon); } // Update staker's Cooldown timestamp stakersCooldowns[_account] = _getNextCooldownTimestamp( block.timestamp, share, _account, balanceOf(_account) ); _mint(_account, share); emit Staked(_account, _amount, share); } function stake(uint256 _amount) public nonReentrant whenNotPaused { _stake(msg.sender, _amount); lonToken.transferFrom(msg.sender, address(this), _amount); } function stakeWithPermit(uint256 _amount, uint256 _deadline, uint8 _v, bytes32 _r, bytes32 _s) public nonReentrant whenNotPaused { _stake(msg.sender, _amount); // Use permit to allow LONStaking contract to transferFrom user lonToken.permit(msg.sender, address(this), _amount, _deadline, _v, _r, _s); lonToken.transferFrom(msg.sender, address(this), _amount); } function unstake() public { require(balanceOf(msg.sender) > 0, "no share to unstake"); require(stakersCooldowns[msg.sender] == 0, "already unstake"); stakersCooldowns[msg.sender] = block.timestamp; emit Cooldown(msg.sender); } function _redeem(uint256 _share, uint256 _penalty) internal { require(_share != 0, "cannot redeem 0 share"); uint256 totalLon = lonToken.balanceOf(address(this)); uint256 totalShares = totalSupply(); uint256 userTotalAmount = _share.add(_penalty).mul(totalLon).div(totalShares); uint256 redeemAmount = _share.mul(totalLon).div(totalShares); uint256 penaltyAmount = userTotalAmount.sub(redeemAmount); _burn(msg.sender, _share.add(_penalty)); if (balanceOf(msg.sender) == 0) { stakersCooldowns[msg.sender] = 0; } lonToken.transfer(msg.sender, redeemAmount); emit Redeem(msg.sender, _share, redeemAmount, penaltyAmount); } function redeem(uint256 _share) public nonReentrant { uint256 cooldownStartTimestamp = stakersCooldowns[msg.sender]; require(cooldownStartTimestamp > 0, "not yet unstake"); require( block.timestamp > cooldownStartTimestamp.add(COOLDOWN_SECONDS), "Still in cooldown" ); _redeem(_share, 0); } function rageExit() public nonReentrant { uint256 cooldownStartTimestamp = stakersCooldowns[msg.sender]; require(cooldownStartTimestamp > 0, "not yet unstake"); uint256 cooldownEndTimestamp = cooldownStartTimestamp.add(COOLDOWN_SECONDS); uint256 share = balanceOf(msg.sender); if (block.timestamp > cooldownEndTimestamp) { // Normal redeem if cooldown period already passed _redeem(share, 0); } else { uint256 timeDiffInDays = Math.min( COOLDOWN_IN_DAYS, (cooldownEndTimestamp.sub(block.timestamp)).div(86400).add(1) ); // Penalty = share * (number_of_days_to_cooldown_end / number_of_days_in_cooldown) * (BPS_RAGE_EXIT_PENALTY / BPS_MAX) uint256 penalty = share.mul(timeDiffInDays).mul(BPS_RAGE_EXIT_PENALTY).div(BPS_MAX).div(COOLDOWN_IN_DAYS); _redeem(share.sub(penalty), penalty); } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow, so we distribute return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a / b); } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) return 0; uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); return a - b; } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a % b; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../../utils/Context.sol"; import "./IERC20.sol"; import "../../math/SafeMath.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; /** * @dev Sets the values for {name} and {symbol}, initializes {decimals} with * a default value of 18. * * To select a different value for {decimals}, use {_setupDecimals}. * * All three of these values are immutable: they can only be set once during * construction. */ constructor (string memory name_, string memory symbol_) public { _name = name_; _symbol = symbol_; _decimals = 18; } /** * @dev Returns the name of the token. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is * called. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual returns (uint8) { return _decimals; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Sets {decimals} to a value other than the default one of 18. * * WARNING: This function should only be called from the constructor. Most * applications that interact with token contracts will not expect * {decimals} to ever change, and may work incorrectly if it does. */ function _setupDecimals(uint8 decimals_) internal virtual { _decimals = decimals_; } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; 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 <0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "./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. */ abstract 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 virtual 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 <0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor () internal { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and make it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "./IEmergency.sol"; import "./IEIP2612.sol"; interface ILon is IEmergency, IEIP2612 { function cap() external view returns(uint256); function mint(address to, uint256 amount) external; function burn(uint256 amount) external; }
// SPDX-License-Identifier: MIT /* Copied and modifier from openzepplin ERC20 contract to replace constructor with initialize function*/ pragma solidity >=0.6.0 <0.8.0; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20ForUpgradeable is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; /** * @dev Sets the values for {name} and {symbol}, initializes {decimals} with * a default value of 18. * * To select a different value for {decimals}, use {_setupDecimals}. * * All three of these values are immutable: they can only be set once during * construction. */ function _initializeERC20 (string memory name_, string memory symbol_) internal { require( (keccak256(abi.encodePacked(_name)) == keccak256(abi.encodePacked(""))) && (keccak256(abi.encodePacked(_symbol)) == keccak256(abi.encodePacked(""))), "ERC20 already initialized" ); _name = name_; _symbol = symbol_; _decimals = 18; } /** * @dev Returns the name of the token. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is * called. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual returns (uint8) { return _decimals; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Sets {decimals} to a value other than the default one of 18. * * WARNING: This function should only be called from the constructor. Most * applications that interact with token contracts will not expect * {decimals} to ever change, and may work incorrectly if it does. */ function _setupDecimals(uint8 decimals_) internal virtual { _decimals = decimals_; } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; abstract contract OwnableForUpgradeable { address public owner; address public nominatedOwner; function _initializeOwnable(address _owner) internal { require(owner == address(0), "Ownable already initialized"); owner = _owner; } function acceptOwnership() external { require(msg.sender == nominatedOwner, "not nominated"); emit OwnerChanged(owner, nominatedOwner); owner = nominatedOwner; nominatedOwner = address(0); } function renounceOwnership() external onlyOwner { emit OwnerChanged(owner, address(0)); owner = address(0); } function nominateNewOwner(address newOwner) external onlyOwner { nominatedOwner = newOwner; emit OwnerNominated(newOwner); } modifier onlyOwner { require(msg.sender == owner, "not owner"); _; } event OwnerNominated(address indexed newOwner); event OwnerChanged(address indexed oldOwner, address indexed newOwner); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; interface IEmergency { function emergencyWithdraw(IERC20 token) external ; }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; interface IEIP2612 is IERC20 { function DOMAIN_SEPARATOR() external view returns (bytes32); function nonces(address owner) external view returns (uint256); function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external; }
{ "optimizer": { "enabled": true, "runs": 1000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"Cooldown","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerNominated","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":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Recovered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"share","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"redeemAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"penaltyAmount","type":"uint256"}],"name":"Redeem","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"coolDownInDays","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"bpsRageExitPenalty","type":"uint256"}],"name":"SetCooldownAndRageExitParam","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"share","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"BPS_RAGE_EXIT_PENALTY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"COOLDOWN_IN_DAYS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"COOLDOWN_SECONDS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"cooldownRemainSeconds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ILon","name":"_lonToken","type":"address"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_COOLDOWN_IN_DAYS","type":"uint256"},{"internalType":"uint256","name":"_BPS_RAGE_EXIT_PENALTY","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lonToken","outputs":[{"internalType":"contract ILon","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"nominateNewOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nominatedOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_spender","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"uint256","name":"_deadline","type":"uint256"},{"internalType":"uint8","name":"_v","type":"uint8"},{"internalType":"bytes32","name":"_r","type":"bytes32"},{"internalType":"bytes32","name":"_s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"previewRageExit","outputs":[{"internalType":"uint256","name":"receiveAmount","type":"uint256"},{"internalType":"uint256","name":"penaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rageExit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"uint256","name":"_tokenAmount","type":"uint256"}],"name":"recoverERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_share","type":"uint256"}],"name":"redeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_COOLDOWN_IN_DAYS","type":"uint256"},{"internalType":"uint256","name":"_BPS_RAGE_EXIT_PENALTY","type":"uint256"}],"name":"setCooldownAndRageExitParam","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_deadline","type":"uint256"},{"internalType":"uint8","name":"_v","type":"uint8"},{"internalType":"bytes32","name":"_r","type":"bytes32"},{"internalType":"bytes32","name":"_s","type":"bytes32"}],"name":"stakeWithPermit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"stakersCooldowns","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b5060016007556008805460ff191690556132458061002f6000396000f3fe608060405234801561001057600080fd5b50600436106102915760003560e01c8063715018a61161016057806395d89b41116100d8578063d505accf1161008c578063dd62ed3e11610071578063dd62ed3e146106ba578063eb990c59146106e8578063ecd9ba821461072457610291565b8063d505accf1461064c578063db006a751461069d57610291565b8063a694fc3a116100bd578063a694fc3a146105dd578063a9059cbb146105fa578063bfd74e091461062657610291565b806395d89b41146105a9578063a457c2d7146105b157610291565b8063822cb39c1161012f5780638980f11f116101145780638980f11f1461056d5780638da5cb5b146105995780638e0dde19146105a157610291565b8063822cb39c1461055d5780638456cb591461056557610291565b8063715018a61461051f57806372b49d631461052757806379ba50971461052f5780637ecebe001461053757610291565b80632def66201161020e5780633f4ba83a116101c25780635c975abb116101a75780635c975abb146104e95780635f372e41146104f157806370a08231146104f957610291565b80633f4ba83a146104bd57806353a47bb7146104c557610291565b8063313ce567116101f3578063313ce5671461046b5780633644e51514610489578063395093511461049157610291565b80632def66201461045b57806330adf81f1461046357610291565b8063095ea7b3116102655780631627540c1161024a5780631627540c146103f757806318160ddd1461041d57806323b872dd1461042557610291565b8063095ea7b3146103785780630a56ede9146103b857610291565b8062825d8e1461029657806304c45c3a146102b057806306fdde03146102d5578063091030c314610352575b600080fd5b61029e61075c565b60408051918252519081900360200190f35b6102d3600480360360408110156102c657600080fd5b5080359060200135610762565b005b6102dd61089b565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103175781810151838201526020016102ff565b50505050905090810190601f1680156103445780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61029e6004803603602081101561036857600080fd5b50356001600160a01b0316610931565b6103a46004803603604081101561038e57600080fd5b506001600160a01b038135169060200135610943565b604080519115158252519081900360200190f35b6103de600480360360208110156103ce57600080fd5b50356001600160a01b0316610961565b6040805192835260208301919091528051918290030190f35b6102d36004803603602081101561040d57600080fd5b50356001600160a01b0316610aef565b61029e610b96565b6103a46004803603606081101561043b57600080fd5b506001600160a01b03813581169160208101359091169060400135610b9c565b6102d3610c24565b61029e610d1d565b610473610d41565b6040805160ff9092168252519081900360200190f35b61029e610d4a565b6103a4600480360360408110156104a757600080fd5b506001600160a01b038135169060200135610d50565b6102d3610d9e565b6104cd610e51565b604080516001600160a01b039092168252519081900360200190f35b6103a4610e60565b6104cd610e69565b61029e6004803603602081101561050f57600080fd5b50356001600160a01b0316610e7d565b6102d3610e9c565b61029e610f49565b6102d3610f4f565b61029e6004803603602081101561054d57600080fd5b50356001600160a01b031661103f565b6102d3611051565b6102d36111b9565b6102d36004803603604081101561058357600080fd5b506001600160a01b03813516906020013561125e565b6104cd61137d565b61029e611391565b6102dd611397565b6103a4600480360360408110156105c757600080fd5b506001600160a01b0381351690602001356113f8565b6102d3600480360360208110156105f357600080fd5b5035611460565b6103a46004803603604081101561061057600080fd5b506001600160a01b03813516906020013561159c565b61029e6004803603602081101561063c57600080fd5b50356001600160a01b03166115b0565b6102d3600480360360e081101561066257600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611618565b6102d3600480360360208110156106b357600080fd5b503561188d565b61029e600480360360408110156106d057600080fd5b506001600160a01b03813581169160200135166119c1565b6102d3600480360360808110156106fe57600080fd5b506001600160a01b038135811691602081013590911690604081013590606001356119ec565b6102d3600480360360a081101561073a57600080fd5b5080359060208101359060ff6040820135169060608101359060800135611c0c565b600a5481565b60055461010090046001600160a01b031633146107b2576040805162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b604482015290519081900360640190fd5b6001821015610808576040805162461bcd60e51b815260206004820181905260248201527f434f4f4c444f574e5f494e5f44415953206c657373207468616e203120646179604482015290519081900360640190fd5b6127108111156108495760405162461bcd60e51b815260040180806020018281038252602981526020018061314f6029913960400191505060405180910390fd5b600c829055620151808202600b55600a819055604080518381526020810183905281517f819897d5a1b90db1d7ae49ee7b823ba8fa7ea44f7b38bff514ddfa4c20569773929181900390910190a15050565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109275780601f106108fc57610100808354040283529160200191610927565b820191906000526020600020905b81548152906001019060200180831161090a57829003601f168201915b5050505050905090565b600e6020526000908152604090205481565b6000610957610950611e02565b8484611e06565b5060015b92915050565b600b546001600160a01b0382166000908152600e602052604081205490918291829161098d9190611ef2565b90506000600860019054906101000a90046001600160a01b03166001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156109f357600080fd5b505afa158015610a07573d6000803e3d6000fd5b505050506040513d6020811015610a1d57600080fd5b505190506000610a2b610b96565b90506000610a3887610e7d565b90506000610a5083610a4a8487611f4c565b90611fa5565b905084421115610a665780965060009550610ae5565b600c54600090610a9190610a8c6001610a8662015180610a4a8c4261200c565b90611ef2565b612069565b90506000610ac0600c54610a4a612710610a4a600a54610aba888b611f4c90919063ffffffff16565b90611f4c565b9050610ad485610a4a88610aba888661200c565b9850610ae0838a61200c565b975050505b5050505050915091565b60055461010090046001600160a01b03163314610b3f576040805162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce2290600090a250565b60025490565b6000610ba984848461207f565b610c1984610bb5611e02565b610c1485604051806060016040528060288152602001613106602891396001600160a01b038a16600090815260016020526040812090610bf3611e02565b6001600160a01b03168152602081019190915260400160002054919061216e565b611e06565b5060015b9392505050565b6000610c2f33610e7d565b11610c81576040805162461bcd60e51b815260206004820152601360248201527f6e6f20736861726520746f20756e7374616b6500000000000000000000000000604482015290519081900360640190fd5b336000908152600e602052604090205415610ce3576040805162461bcd60e51b815260206004820152600f60248201527f616c726561647920756e7374616b650000000000000000000000000000000000604482015290519081900360640190fd5b336000818152600e6020526040808220429055517ff52f50426b32362d3e6bb8cb36b7074756b224622def6352a59eac7f66ebe6e89190a2565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b60055460ff1690565b60095481565b6000610957610d5d611e02565b84610c148560016000610d6e611e02565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490611ef2565b60055461010090046001600160a01b03163314610dee576040805162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b604482015290519081900360640190fd5b610df6610e60565b610e47576040805162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015290519081900360640190fd5b610e4f612205565b565b6006546001600160a01b031681565b60085460ff1690565b60085461010090046001600160a01b031681565b6001600160a01b0381166000908152602081905260409020545b919050565b60055461010090046001600160a01b03163314610eec576040805162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b604482015290519081900360640190fd5b60055460405160009161010090046001600160a01b0316907fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c908390a36005805474ffffffffffffffffffffffffffffffffffffffff0019169055565b600b5481565b6006546001600160a01b03163314610fae576040805162461bcd60e51b815260206004820152600d60248201527f6e6f74206e6f6d696e6174656400000000000000000000000000000000000000604482015290519081900360640190fd5b6006546005546040516001600160a01b0392831692610100909204909116907fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c90600090a3600680546005805474ffffffffffffffffffffffffffffffffffffffff0019166101006001600160a01b0384160217905573ffffffffffffffffffffffffffffffffffffffff19169055565b600d6020526000908152604090205481565b600260075414156110a9576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600755336000908152600e602052604090205480611110576040805162461bcd60e51b815260206004820152600f60248201527f6e6f742079657420756e7374616b650000000000000000000000000000000000604482015290519081900360640190fd5b6000611127600b5483611ef290919063ffffffff16565b9050600061113433610e7d565b90508142111561114e576111498160006122ae565b6111af565b600c5460009061116e90610a8c6001610a8662015180610a4a894261200c565b90506000611197600c54610a4a612710610a4a600a54610aba888a611f4c90919063ffffffff16565b90506111ac6111a6848361200c565b826122ae565b50505b5050600160075550565b60055461010090046001600160a01b03163314611209576040805162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b604482015290519081900360640190fd5b611211610e60565b15611256576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b610e4f6124c1565b60055461010090046001600160a01b031633146112ae576040805162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b604482015290519081900360640190fd5b6008546001600160a01b03838116610100909204161415611316576040805162461bcd60e51b815260206004820152601960248201527f63616e6e6f74207769746864726177206c6f6e20746f6b656e00000000000000604482015290519081900360640190fd5b600554611335906001600160a01b038481169161010090041683612544565b604080516001600160a01b03841681526020810183905281517f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa28929181900390910190a15050565b60055461010090046001600160a01b031681565b600c5481565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109275780601f106108fc57610100808354040283529160200191610927565b6000610957611405611e02565b84610c14856040518060600160405280602581526020016131eb602591396001600061142f611e02565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919061216e565b600260075414156114b8576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026007556114c5610e60565b1561150a576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b61151433826125b0565b600854604080516323b872dd60e01b81523360048201523060248201526044810184905290516101009092046001600160a01b0316916323b872dd916064808201926020929091908290030181600087803b15801561157257600080fd5b505af1158015611586573d6000803e3d6000fd5b505050506040513d60208110156111af57600080fd5b60006109576115a9611e02565b848461207f565b6001600160a01b0381166000908152600e60205260408120548015806115ea5750426115e7600b5483611ef290919063ffffffff16565b11155b156115f9576000915050610e97565b610c1d42611612600b5484611ef290919063ffffffff16565b9061200c565b6001600160a01b038716611673576040805162461bcd60e51b815260206004820152601560248201527f6f776e6572206973207a65726f20616464726573730000000000000000000000604482015290519081900360640190fd5b8342111580611680575083155b6116d1576040805162461bcd60e51b815260206004820152600e60248201527f7065726d69742065787069726564000000000000000000000000000000000000604482015290519081900360640190fd5b6009546001600160a01b038089166000818152600d602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962092909552610162830180865282905260ff88166101828401526101a283018790526101c28301869052935190936101e2808401939192601f1981019281900390910190855afa158015611809573d6000803e3d6000fd5b505050602060405103516001600160a01b0316886001600160a01b031614611878576040805162461bcd60e51b815260206004820152601160248201527f696e76616c6964207369676e6174757265000000000000000000000000000000604482015290519081900360640190fd5b611883888888611e06565b5050505050505050565b600260075414156118e5576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600755336000908152600e60205260409020548061194c576040805162461bcd60e51b815260206004820152600f60248201527f6e6f742079657420756e7374616b650000000000000000000000000000000000604482015290519081900360640190fd5b600b5461195a908290611ef2565b42116119ad576040805162461bcd60e51b815260206004820152601160248201527f5374696c6c20696e20636f6f6c646f776e000000000000000000000000000000604482015290519081900360640190fd5b6119b88260006122ae565b50506001600755565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6008805474ffffffffffffffffffffffffffffffffffffffff0019166101006001600160a01b03871602179055611a228361273a565b611a966040518060400160405280601081526020017f5772617070656420546f6b656e6c6f6e000000000000000000000000000000008152506040518060400160405280600481526020017f784c4f4e000000000000000000000000000000000000000000000000000000008152506127d2565b6001821015611aec576040805162461bcd60e51b815260206004820181905260248201527f434f4f4c444f574e5f494e5f44415953206c657373207468616e203120646179604482015290519081900360640190fd5b612710811115611b2d5760405162461bcd60e51b815260040180806020018281038252602981526020018061314f6029913960400191505060405180910390fd5b600c829055620151808202600b55600a819055467f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f611b6a61089b565b8051602091820120604080518082018252600181527f310000000000000000000000000000000000000000000000000000000000000090840152805180840194909452838101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606084015260808301939093523060a0808401919091528351808403909101815260c0909201909252805191012060095550505050565b60026007541415611c64576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600755611c71610e60565b15611cb6576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b611cc033866125b0565b600854604080517fd505accf000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018890526064810187905260ff8616608482015260a4810185905260c4810184905290516101009092046001600160a01b03169163d505accf9160e48082019260009290919082900301818387803b158015611d5457600080fd5b505af1158015611d68573d6000803e3d6000fd5b5050600854604080516323b872dd60e01b8152336004820152306024820152604481018a905290516101009092046001600160a01b031693506323b872dd92506064808201926020929091908290030181600087803b158015611dca57600080fd5b505af1158015611dde573d6000803e3d6000fd5b505050506040513d6020811015611df457600080fd5b505060016007555050505050565b3390565b6001600160a01b038316611e4b5760405162461bcd60e51b815260040180806020018281038252602481526020018061319d6024913960400191505060405180910390fd5b6001600160a01b038216611e905760405162461bcd60e51b815260040180806020018281038252602281526020018061309d6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600082820183811015610c1d576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082611f5b5750600061095b565b82820282848281611f6857fe5b0414610c1d5760405162461bcd60e51b81526004018080602001828103825260218152602001806130e56021913960400191505060405180910390fd5b6000808211611ffb576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161200457fe5b049392505050565b600082821115612063576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60008183106120785781610c1d565b5090919050565b612087610e60565b156120cc576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b60006120d784610e7d565b905060006120e484610e7d565b6001600160a01b038087166000818152600e60205260409020549293509086161461215b576121158185878561298a565b6001600160a01b0386166000908152600e6020526040902055828414801561213c57508015155b1561215b576001600160a01b0386166000908152600e60205260408120555b612166868686612a2c565b505050505050565b600081848411156121fd5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156121c25781810151838201526020016121aa565b50505050905090810190601f1680156121ef5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b61220d610e60565b61225e576040805162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015290519081900360640190fd5b6008805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa612291611e02565b604080516001600160a01b039092168252519081900360200190a1565b81612300576040805162461bcd60e51b815260206004820152601560248201527f63616e6e6f742072656465656d20302073686172650000000000000000000000604482015290519081900360640190fd5b600854604080516370a0823160e01b8152306004820152905160009261010090046001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561235057600080fd5b505afa158015612364573d6000803e3d6000fd5b505050506040513d602081101561237a57600080fd5b505190506000612388610b96565b9050600061239e82610a4a85610aba8989611ef2565b905060006123b083610a4a8887611f4c565b905060006123be838361200c565b90506123d3336123ce8989611ef2565b612b87565b6123dc33610e7d565b6123f157336000908152600e60205260408120555b6008546040805163a9059cbb60e01b81523360048201526024810185905290516101009092046001600160a01b03169163a9059cbb916044808201926020929091908290030181600087803b15801561244957600080fd5b505af115801561245d573d6000803e3d6000fd5b505050506040513d602081101561247357600080fd5b50506040805188815260208101849052808201839052905133917fbd5034ffbd47e4e72a94baa2cdb74c6fad73cb3bcdc13036b72ec8306f5a7646919081900360600190a250505050505050565b6124c9610e60565b1561250e576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6008805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612291611e02565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b1790526125ab908490612c83565b505050565b60008111612605576040805162461bcd60e51b815260206004820152601560248201527f63616e6e6f74207374616b65203020616d6f756e740000000000000000000000604482015290519081900360640190fd5b600854604080516370a0823160e01b8152306004820152905160009261010090046001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561265557600080fd5b505afa158015612669573d6000803e3d6000fd5b505050506040513d602081101561267f57600080fd5b50519050600061268d610b96565b9050600081158061269c575082155b156126a85750826126b9565b6126b683610a4a8685611f4c565b90505b6126cd4282876126c889610e7d565b61298a565b6001600160a01b0386166000908152600e60205260409020556126f08582612d34565b604080518581526020810183905281516001600160a01b038816927f1449c6dd7851abc30abf37f57715f492010519147cc2652fbc38202c18a6ee90928290030190a25050505050565b60055461010090046001600160a01b03161561279d576040805162461bcd60e51b815260206004820152601b60248201527f4f776e61626c6520616c726561647920696e697469616c697a65640000000000604482015290519081900360640190fd5b600580546001600160a01b039092166101000274ffffffffffffffffffffffffffffffffffffffff0019909216919091179055565b6040805160008152602081018083528151902060038054919390920190819083906002600019610100600184161502019091160480156128495780601f10612827576101008083540402835291820191612849565b820191906000526020600020905b815481529060010190602001808311612835575b50509150506040516020818303038152906040528051906020012014801561290057506040805160008152602081018083528151902060048054919390920190819083906002600019610100600184161502019091160480156128e35780601f106128c15761010080835404028352918201916128e3565b820191906000526020600020905b8154815290600101906020018083116128cf575b505091505060405160208183030381529060405280519060200120145b612951576040805162461bcd60e51b815260206004820152601960248201527f455243323020616c726561647920696e697469616c697a656400000000000000604482015290519081900360640190fd5b8151612964906003906020850190612fb6565b508051612978906004906020840190612fb6565b50506005805460ff1916601217905550565b6001600160a01b0382166000908152600e6020526040812054806129b2576000915050612a24565b6000866129c05750426129c3565b50855b8181116129d257509050612a24565b600b546129df828461200c565b11156129f657600b546129f390829061200c565b91505b612a1a612a038786611ef2565b610a4a612a108786611f4c565b610a868a86611f4c565b9250612a24915050565b949350505050565b6001600160a01b038316612a715760405162461bcd60e51b81526004018080602001828103825260258152602001806131786025913960400191505060405180910390fd5b6001600160a01b038216612ab65760405162461bcd60e51b81526004018080602001828103825260238152602001806130586023913960400191505060405180910390fd5b612ac18383836125ab565b612afe816040518060600160405280602681526020016130bf602691396001600160a01b038616600090815260208190526040902054919061216e565b6001600160a01b038085166000908152602081905260408082209390935590841681522054612b2d9082611ef2565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6001600160a01b038216612bcc5760405162461bcd60e51b815260040180806020018281038252602181526020018061312e6021913960400191505060405180910390fd5b612bd8826000836125ab565b612c158160405180606001604052806022815260200161307b602291396001600160a01b038516600090815260208190526040902054919061216e565b6001600160a01b038316600090815260208190526040902055600254612c3b908261200c565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6060612cd8826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612e249092919063ffffffff16565b8051909150156125ab57808060200190516020811015612cf757600080fd5b50516125ab5760405162461bcd60e51b815260040180806020018281038252602a8152602001806131c1602a913960400191505060405180910390fd5b6001600160a01b038216612d8f576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b612d9b600083836125ab565b600254612da89082611ef2565b6002556001600160a01b038216600090815260208190526040902054612dce9082611ef2565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6060612a24848460008585612e3885612f4a565b612e89576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310612ec85780518252601f199092019160209182019101612ea9565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114612f2a576040519150601f19603f3d011682016040523d82523d6000602084013e612f2f565b606091505b5091509150612f3f828286612f50565b979650505050505050565b3b151590565b60608315612f5f575081610c1d565b825115612f6f5782518084602001fd5b60405162461bcd60e51b81526020600482018181528451602484015284518593919283926044019190850190808383600083156121c25781810151838201526020016121aa565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282612fec5760008555613032565b82601f1061300557805160ff1916838001178555613032565b82800160010185558215613032579182015b82811115613032578251825591602001919060010190613017565b5061303e929150613042565b5090565b5b8082111561303e576000815560010161304356fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f20616464726573734250535f524147455f455849545f50454e414c5459206c6172676572207468616e204250535f4d415845524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573735361666545524332303a204552433230206f7065726174696f6e20646964206e6f74207375636365656445524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212209ded450ab68e7e718c860116afd582d23e234b2794f597be4c6c50a4947f567764736f6c63430007040033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102915760003560e01c8063715018a61161016057806395d89b41116100d8578063d505accf1161008c578063dd62ed3e11610071578063dd62ed3e146106ba578063eb990c59146106e8578063ecd9ba821461072457610291565b8063d505accf1461064c578063db006a751461069d57610291565b8063a694fc3a116100bd578063a694fc3a146105dd578063a9059cbb146105fa578063bfd74e091461062657610291565b806395d89b41146105a9578063a457c2d7146105b157610291565b8063822cb39c1161012f5780638980f11f116101145780638980f11f1461056d5780638da5cb5b146105995780638e0dde19146105a157610291565b8063822cb39c1461055d5780638456cb591461056557610291565b8063715018a61461051f57806372b49d631461052757806379ba50971461052f5780637ecebe001461053757610291565b80632def66201161020e5780633f4ba83a116101c25780635c975abb116101a75780635c975abb146104e95780635f372e41146104f157806370a08231146104f957610291565b80633f4ba83a146104bd57806353a47bb7146104c557610291565b8063313ce567116101f3578063313ce5671461046b5780633644e51514610489578063395093511461049157610291565b80632def66201461045b57806330adf81f1461046357610291565b8063095ea7b3116102655780631627540c1161024a5780631627540c146103f757806318160ddd1461041d57806323b872dd1461042557610291565b8063095ea7b3146103785780630a56ede9146103b857610291565b8062825d8e1461029657806304c45c3a146102b057806306fdde03146102d5578063091030c314610352575b600080fd5b61029e61075c565b60408051918252519081900360200190f35b6102d3600480360360408110156102c657600080fd5b5080359060200135610762565b005b6102dd61089b565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103175781810151838201526020016102ff565b50505050905090810190601f1680156103445780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61029e6004803603602081101561036857600080fd5b50356001600160a01b0316610931565b6103a46004803603604081101561038e57600080fd5b506001600160a01b038135169060200135610943565b604080519115158252519081900360200190f35b6103de600480360360208110156103ce57600080fd5b50356001600160a01b0316610961565b6040805192835260208301919091528051918290030190f35b6102d36004803603602081101561040d57600080fd5b50356001600160a01b0316610aef565b61029e610b96565b6103a46004803603606081101561043b57600080fd5b506001600160a01b03813581169160208101359091169060400135610b9c565b6102d3610c24565b61029e610d1d565b610473610d41565b6040805160ff9092168252519081900360200190f35b61029e610d4a565b6103a4600480360360408110156104a757600080fd5b506001600160a01b038135169060200135610d50565b6102d3610d9e565b6104cd610e51565b604080516001600160a01b039092168252519081900360200190f35b6103a4610e60565b6104cd610e69565b61029e6004803603602081101561050f57600080fd5b50356001600160a01b0316610e7d565b6102d3610e9c565b61029e610f49565b6102d3610f4f565b61029e6004803603602081101561054d57600080fd5b50356001600160a01b031661103f565b6102d3611051565b6102d36111b9565b6102d36004803603604081101561058357600080fd5b506001600160a01b03813516906020013561125e565b6104cd61137d565b61029e611391565b6102dd611397565b6103a4600480360360408110156105c757600080fd5b506001600160a01b0381351690602001356113f8565b6102d3600480360360208110156105f357600080fd5b5035611460565b6103a46004803603604081101561061057600080fd5b506001600160a01b03813516906020013561159c565b61029e6004803603602081101561063c57600080fd5b50356001600160a01b03166115b0565b6102d3600480360360e081101561066257600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611618565b6102d3600480360360208110156106b357600080fd5b503561188d565b61029e600480360360408110156106d057600080fd5b506001600160a01b03813581169160200135166119c1565b6102d3600480360360808110156106fe57600080fd5b506001600160a01b038135811691602081013590911690604081013590606001356119ec565b6102d3600480360360a081101561073a57600080fd5b5080359060208101359060ff6040820135169060608101359060800135611c0c565b600a5481565b60055461010090046001600160a01b031633146107b2576040805162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b604482015290519081900360640190fd5b6001821015610808576040805162461bcd60e51b815260206004820181905260248201527f434f4f4c444f574e5f494e5f44415953206c657373207468616e203120646179604482015290519081900360640190fd5b6127108111156108495760405162461bcd60e51b815260040180806020018281038252602981526020018061314f6029913960400191505060405180910390fd5b600c829055620151808202600b55600a819055604080518381526020810183905281517f819897d5a1b90db1d7ae49ee7b823ba8fa7ea44f7b38bff514ddfa4c20569773929181900390910190a15050565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109275780601f106108fc57610100808354040283529160200191610927565b820191906000526020600020905b81548152906001019060200180831161090a57829003601f168201915b5050505050905090565b600e6020526000908152604090205481565b6000610957610950611e02565b8484611e06565b5060015b92915050565b600b546001600160a01b0382166000908152600e602052604081205490918291829161098d9190611ef2565b90506000600860019054906101000a90046001600160a01b03166001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156109f357600080fd5b505afa158015610a07573d6000803e3d6000fd5b505050506040513d6020811015610a1d57600080fd5b505190506000610a2b610b96565b90506000610a3887610e7d565b90506000610a5083610a4a8487611f4c565b90611fa5565b905084421115610a665780965060009550610ae5565b600c54600090610a9190610a8c6001610a8662015180610a4a8c4261200c565b90611ef2565b612069565b90506000610ac0600c54610a4a612710610a4a600a54610aba888b611f4c90919063ffffffff16565b90611f4c565b9050610ad485610a4a88610aba888661200c565b9850610ae0838a61200c565b975050505b5050505050915091565b60055461010090046001600160a01b03163314610b3f576040805162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce2290600090a250565b60025490565b6000610ba984848461207f565b610c1984610bb5611e02565b610c1485604051806060016040528060288152602001613106602891396001600160a01b038a16600090815260016020526040812090610bf3611e02565b6001600160a01b03168152602081019190915260400160002054919061216e565b611e06565b5060015b9392505050565b6000610c2f33610e7d565b11610c81576040805162461bcd60e51b815260206004820152601360248201527f6e6f20736861726520746f20756e7374616b6500000000000000000000000000604482015290519081900360640190fd5b336000908152600e602052604090205415610ce3576040805162461bcd60e51b815260206004820152600f60248201527f616c726561647920756e7374616b650000000000000000000000000000000000604482015290519081900360640190fd5b336000818152600e6020526040808220429055517ff52f50426b32362d3e6bb8cb36b7074756b224622def6352a59eac7f66ebe6e89190a2565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b60055460ff1690565b60095481565b6000610957610d5d611e02565b84610c148560016000610d6e611e02565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490611ef2565b60055461010090046001600160a01b03163314610dee576040805162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b604482015290519081900360640190fd5b610df6610e60565b610e47576040805162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015290519081900360640190fd5b610e4f612205565b565b6006546001600160a01b031681565b60085460ff1690565b60085461010090046001600160a01b031681565b6001600160a01b0381166000908152602081905260409020545b919050565b60055461010090046001600160a01b03163314610eec576040805162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b604482015290519081900360640190fd5b60055460405160009161010090046001600160a01b0316907fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c908390a36005805474ffffffffffffffffffffffffffffffffffffffff0019169055565b600b5481565b6006546001600160a01b03163314610fae576040805162461bcd60e51b815260206004820152600d60248201527f6e6f74206e6f6d696e6174656400000000000000000000000000000000000000604482015290519081900360640190fd5b6006546005546040516001600160a01b0392831692610100909204909116907fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c90600090a3600680546005805474ffffffffffffffffffffffffffffffffffffffff0019166101006001600160a01b0384160217905573ffffffffffffffffffffffffffffffffffffffff19169055565b600d6020526000908152604090205481565b600260075414156110a9576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600755336000908152600e602052604090205480611110576040805162461bcd60e51b815260206004820152600f60248201527f6e6f742079657420756e7374616b650000000000000000000000000000000000604482015290519081900360640190fd5b6000611127600b5483611ef290919063ffffffff16565b9050600061113433610e7d565b90508142111561114e576111498160006122ae565b6111af565b600c5460009061116e90610a8c6001610a8662015180610a4a894261200c565b90506000611197600c54610a4a612710610a4a600a54610aba888a611f4c90919063ffffffff16565b90506111ac6111a6848361200c565b826122ae565b50505b5050600160075550565b60055461010090046001600160a01b03163314611209576040805162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b604482015290519081900360640190fd5b611211610e60565b15611256576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b610e4f6124c1565b60055461010090046001600160a01b031633146112ae576040805162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b604482015290519081900360640190fd5b6008546001600160a01b03838116610100909204161415611316576040805162461bcd60e51b815260206004820152601960248201527f63616e6e6f74207769746864726177206c6f6e20746f6b656e00000000000000604482015290519081900360640190fd5b600554611335906001600160a01b038481169161010090041683612544565b604080516001600160a01b03841681526020810183905281517f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa28929181900390910190a15050565b60055461010090046001600160a01b031681565b600c5481565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109275780601f106108fc57610100808354040283529160200191610927565b6000610957611405611e02565b84610c14856040518060600160405280602581526020016131eb602591396001600061142f611e02565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919061216e565b600260075414156114b8576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026007556114c5610e60565b1561150a576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b61151433826125b0565b600854604080516323b872dd60e01b81523360048201523060248201526044810184905290516101009092046001600160a01b0316916323b872dd916064808201926020929091908290030181600087803b15801561157257600080fd5b505af1158015611586573d6000803e3d6000fd5b505050506040513d60208110156111af57600080fd5b60006109576115a9611e02565b848461207f565b6001600160a01b0381166000908152600e60205260408120548015806115ea5750426115e7600b5483611ef290919063ffffffff16565b11155b156115f9576000915050610e97565b610c1d42611612600b5484611ef290919063ffffffff16565b9061200c565b6001600160a01b038716611673576040805162461bcd60e51b815260206004820152601560248201527f6f776e6572206973207a65726f20616464726573730000000000000000000000604482015290519081900360640190fd5b8342111580611680575083155b6116d1576040805162461bcd60e51b815260206004820152600e60248201527f7065726d69742065787069726564000000000000000000000000000000000000604482015290519081900360640190fd5b6009546001600160a01b038089166000818152600d602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962092909552610162830180865282905260ff88166101828401526101a283018790526101c28301869052935190936101e2808401939192601f1981019281900390910190855afa158015611809573d6000803e3d6000fd5b505050602060405103516001600160a01b0316886001600160a01b031614611878576040805162461bcd60e51b815260206004820152601160248201527f696e76616c6964207369676e6174757265000000000000000000000000000000604482015290519081900360640190fd5b611883888888611e06565b5050505050505050565b600260075414156118e5576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600755336000908152600e60205260409020548061194c576040805162461bcd60e51b815260206004820152600f60248201527f6e6f742079657420756e7374616b650000000000000000000000000000000000604482015290519081900360640190fd5b600b5461195a908290611ef2565b42116119ad576040805162461bcd60e51b815260206004820152601160248201527f5374696c6c20696e20636f6f6c646f776e000000000000000000000000000000604482015290519081900360640190fd5b6119b88260006122ae565b50506001600755565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6008805474ffffffffffffffffffffffffffffffffffffffff0019166101006001600160a01b03871602179055611a228361273a565b611a966040518060400160405280601081526020017f5772617070656420546f6b656e6c6f6e000000000000000000000000000000008152506040518060400160405280600481526020017f784c4f4e000000000000000000000000000000000000000000000000000000008152506127d2565b6001821015611aec576040805162461bcd60e51b815260206004820181905260248201527f434f4f4c444f574e5f494e5f44415953206c657373207468616e203120646179604482015290519081900360640190fd5b612710811115611b2d5760405162461bcd60e51b815260040180806020018281038252602981526020018061314f6029913960400191505060405180910390fd5b600c829055620151808202600b55600a819055467f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f611b6a61089b565b8051602091820120604080518082018252600181527f310000000000000000000000000000000000000000000000000000000000000090840152805180840194909452838101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606084015260808301939093523060a0808401919091528351808403909101815260c0909201909252805191012060095550505050565b60026007541415611c64576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600755611c71610e60565b15611cb6576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b611cc033866125b0565b600854604080517fd505accf000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018890526064810187905260ff8616608482015260a4810185905260c4810184905290516101009092046001600160a01b03169163d505accf9160e48082019260009290919082900301818387803b158015611d5457600080fd5b505af1158015611d68573d6000803e3d6000fd5b5050600854604080516323b872dd60e01b8152336004820152306024820152604481018a905290516101009092046001600160a01b031693506323b872dd92506064808201926020929091908290030181600087803b158015611dca57600080fd5b505af1158015611dde573d6000803e3d6000fd5b505050506040513d6020811015611df457600080fd5b505060016007555050505050565b3390565b6001600160a01b038316611e4b5760405162461bcd60e51b815260040180806020018281038252602481526020018061319d6024913960400191505060405180910390fd5b6001600160a01b038216611e905760405162461bcd60e51b815260040180806020018281038252602281526020018061309d6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600082820183811015610c1d576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082611f5b5750600061095b565b82820282848281611f6857fe5b0414610c1d5760405162461bcd60e51b81526004018080602001828103825260218152602001806130e56021913960400191505060405180910390fd5b6000808211611ffb576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161200457fe5b049392505050565b600082821115612063576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60008183106120785781610c1d565b5090919050565b612087610e60565b156120cc576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b60006120d784610e7d565b905060006120e484610e7d565b6001600160a01b038087166000818152600e60205260409020549293509086161461215b576121158185878561298a565b6001600160a01b0386166000908152600e6020526040902055828414801561213c57508015155b1561215b576001600160a01b0386166000908152600e60205260408120555b612166868686612a2c565b505050505050565b600081848411156121fd5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156121c25781810151838201526020016121aa565b50505050905090810190601f1680156121ef5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b61220d610e60565b61225e576040805162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015290519081900360640190fd5b6008805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa612291611e02565b604080516001600160a01b039092168252519081900360200190a1565b81612300576040805162461bcd60e51b815260206004820152601560248201527f63616e6e6f742072656465656d20302073686172650000000000000000000000604482015290519081900360640190fd5b600854604080516370a0823160e01b8152306004820152905160009261010090046001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561235057600080fd5b505afa158015612364573d6000803e3d6000fd5b505050506040513d602081101561237a57600080fd5b505190506000612388610b96565b9050600061239e82610a4a85610aba8989611ef2565b905060006123b083610a4a8887611f4c565b905060006123be838361200c565b90506123d3336123ce8989611ef2565b612b87565b6123dc33610e7d565b6123f157336000908152600e60205260408120555b6008546040805163a9059cbb60e01b81523360048201526024810185905290516101009092046001600160a01b03169163a9059cbb916044808201926020929091908290030181600087803b15801561244957600080fd5b505af115801561245d573d6000803e3d6000fd5b505050506040513d602081101561247357600080fd5b50506040805188815260208101849052808201839052905133917fbd5034ffbd47e4e72a94baa2cdb74c6fad73cb3bcdc13036b72ec8306f5a7646919081900360600190a250505050505050565b6124c9610e60565b1561250e576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6008805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612291611e02565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b1790526125ab908490612c83565b505050565b60008111612605576040805162461bcd60e51b815260206004820152601560248201527f63616e6e6f74207374616b65203020616d6f756e740000000000000000000000604482015290519081900360640190fd5b600854604080516370a0823160e01b8152306004820152905160009261010090046001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561265557600080fd5b505afa158015612669573d6000803e3d6000fd5b505050506040513d602081101561267f57600080fd5b50519050600061268d610b96565b9050600081158061269c575082155b156126a85750826126b9565b6126b683610a4a8685611f4c565b90505b6126cd4282876126c889610e7d565b61298a565b6001600160a01b0386166000908152600e60205260409020556126f08582612d34565b604080518581526020810183905281516001600160a01b038816927f1449c6dd7851abc30abf37f57715f492010519147cc2652fbc38202c18a6ee90928290030190a25050505050565b60055461010090046001600160a01b03161561279d576040805162461bcd60e51b815260206004820152601b60248201527f4f776e61626c6520616c726561647920696e697469616c697a65640000000000604482015290519081900360640190fd5b600580546001600160a01b039092166101000274ffffffffffffffffffffffffffffffffffffffff0019909216919091179055565b6040805160008152602081018083528151902060038054919390920190819083906002600019610100600184161502019091160480156128495780601f10612827576101008083540402835291820191612849565b820191906000526020600020905b815481529060010190602001808311612835575b50509150506040516020818303038152906040528051906020012014801561290057506040805160008152602081018083528151902060048054919390920190819083906002600019610100600184161502019091160480156128e35780601f106128c15761010080835404028352918201916128e3565b820191906000526020600020905b8154815290600101906020018083116128cf575b505091505060405160208183030381529060405280519060200120145b612951576040805162461bcd60e51b815260206004820152601960248201527f455243323020616c726561647920696e697469616c697a656400000000000000604482015290519081900360640190fd5b8151612964906003906020850190612fb6565b508051612978906004906020840190612fb6565b50506005805460ff1916601217905550565b6001600160a01b0382166000908152600e6020526040812054806129b2576000915050612a24565b6000866129c05750426129c3565b50855b8181116129d257509050612a24565b600b546129df828461200c565b11156129f657600b546129f390829061200c565b91505b612a1a612a038786611ef2565b610a4a612a108786611f4c565b610a868a86611f4c565b9250612a24915050565b949350505050565b6001600160a01b038316612a715760405162461bcd60e51b81526004018080602001828103825260258152602001806131786025913960400191505060405180910390fd5b6001600160a01b038216612ab65760405162461bcd60e51b81526004018080602001828103825260238152602001806130586023913960400191505060405180910390fd5b612ac18383836125ab565b612afe816040518060600160405280602681526020016130bf602691396001600160a01b038616600090815260208190526040902054919061216e565b6001600160a01b038085166000908152602081905260408082209390935590841681522054612b2d9082611ef2565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6001600160a01b038216612bcc5760405162461bcd60e51b815260040180806020018281038252602181526020018061312e6021913960400191505060405180910390fd5b612bd8826000836125ab565b612c158160405180606001604052806022815260200161307b602291396001600160a01b038516600090815260208190526040902054919061216e565b6001600160a01b038316600090815260208190526040902055600254612c3b908261200c565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6060612cd8826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612e249092919063ffffffff16565b8051909150156125ab57808060200190516020811015612cf757600080fd5b50516125ab5760405162461bcd60e51b815260040180806020018281038252602a8152602001806131c1602a913960400191505060405180910390fd5b6001600160a01b038216612d8f576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b612d9b600083836125ab565b600254612da89082611ef2565b6002556001600160a01b038216600090815260208190526040902054612dce9082611ef2565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6060612a24848460008585612e3885612f4a565b612e89576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310612ec85780518252601f199092019160209182019101612ea9565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114612f2a576040519150601f19603f3d011682016040523d82523d6000602084013e612f2f565b606091505b5091509150612f3f828286612f50565b979650505050505050565b3b151590565b60608315612f5f575081610c1d565b825115612f6f5782518084602001fd5b60405162461bcd60e51b81526020600482018181528451602484015284518593919283926044019190850190808383600083156121c25781810151838201526020016121aa565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282612fec5760008555613032565b82601f1061300557805160ff1916838001178555613032565b82800160010185558215613032579182015b82811115613032578251825591602001919060010190613017565b5061303e929150613042565b5090565b5b8082111561303e576000815560010161304356fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f20616464726573734250535f524147455f455849545f50454e414c5459206c6172676572207468616e204250535f4d415845524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573735361666545524332303a204552433230206f7065726174696f6e20646964206e6f74207375636365656445524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212209ded450ab68e7e718c860116afd582d23e234b2794f597be4c6c50a4947f567764736f6c63430007040033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 27 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.