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
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Source Code Verified (Exact Match)
Contract Name:
BABYTOKENDividendTracker
Compiler Version
v0.8.4+commit.c7e474f2
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity =0.8.4; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "../interfaces/IUniswapV2Factory.sol"; import "../interfaces/IUniswapV2Router02.sol"; import "../interfaces/IUniswapV2Pair.sol"; import "../libs/SafeMathInt.sol"; import "../libs/SafeMathUint.sol"; import "./IterableMapping.sol"; /// @title Dividend-Paying Token Interface /// @author Roger Wu (https://github.com/roger-wu) /// @dev An interface for a dividend-paying token contract. interface DividendPayingTokenInterface { /// @notice View the amount of dividend in wei that an address can withdraw. /// @param _owner The address of a token holder. /// @return The amount of dividend in wei that `_owner` can withdraw. function dividendOf(address _owner) external view returns (uint256); /// @notice Withdraws the ether distributed to the sender. /// @dev SHOULD transfer `dividendOf(msg.sender)` wei to `msg.sender`, and `dividendOf(msg.sender)` SHOULD be 0 after the transfer. /// MUST emit a `DividendWithdrawn` event if the amount of ether transferred is greater than 0. function withdrawDividend() external; /// @dev This event MUST emit when ether is distributed to token holders. /// @param from The address which sends ether to this contract. /// @param weiAmount The amount of distributed ether in wei. event DividendsDistributed(address indexed from, uint256 weiAmount); /// @dev This event MUST emit when an address withdraws their dividend. /// @param to The address which withdraws ether from this contract. /// @param weiAmount The amount of withdrawn ether in wei. event DividendWithdrawn(address indexed to, uint256 weiAmount); } /// @title Dividend-Paying Token Optional Interface /// @author Roger Wu (https://github.com/roger-wu) /// @dev OPTIONAL functions for a dividend-paying token contract. interface DividendPayingTokenOptionalInterface { /// @notice View the amount of dividend in wei that an address can withdraw. /// @param _owner The address of a token holder. /// @return The amount of dividend in wei that `_owner` can withdraw. function withdrawableDividendOf(address _owner) external view returns (uint256); /// @notice View the amount of dividend in wei that an address has withdrawn. /// @param _owner The address of a token holder. /// @return The amount of dividend in wei that `_owner` has withdrawn. function withdrawnDividendOf(address _owner) external view returns (uint256); /// @notice View the amount of dividend in wei that an address has earned in total. /// @dev accumulativeDividendOf(_owner) = withdrawableDividendOf(_owner) + withdrawnDividendOf(_owner) /// @param _owner The address of a token holder. /// @return The amount of dividend in wei that `_owner` has earned in total. function accumulativeDividendOf(address _owner) external view returns (uint256); } /// @title Dividend-Paying Token /// @author Roger Wu (https://github.com/roger-wu) /// @dev A mintable ERC20 token that allows anyone to pay and distribute ether /// to token holders as dividends and allows token holders to withdraw their dividends. /// Reference: the source code of PoWH3D: https://etherscan.io/address/0xB3775fB83F7D12A36E0475aBdD1FCA35c091efBe#code contract DividendPayingToken is ERC20Upgradeable, OwnableUpgradeable, DividendPayingTokenInterface, DividendPayingTokenOptionalInterface { using SafeMath for uint256; using SafeMathUint for uint256; using SafeMathInt for int256; address public rewardToken; // With `magnitude`, we can properly distribute dividends even if the amount of received ether is small. // For more discussion about choosing the value of `magnitude`, // see https://github.com/ethereum/EIPs/issues/1726#issuecomment-472352728 uint256 internal constant magnitude = 2**128; uint256 internal magnifiedDividendPerShare; // About dividendCorrection: // If the token balance of a `_user` is never changed, the dividend of `_user` can be computed with: // `dividendOf(_user) = dividendPerShare * balanceOf(_user)`. // When `balanceOf(_user)` is changed (via minting/burning/transferring tokens), // `dividendOf(_user)` should not be changed, // but the computed value of `dividendPerShare * balanceOf(_user)` is changed. // To keep the `dividendOf(_user)` unchanged, we add a correction term: // `dividendOf(_user) = dividendPerShare * balanceOf(_user) + dividendCorrectionOf(_user)`, // where `dividendCorrectionOf(_user)` is updated whenever `balanceOf(_user)` is changed: // `dividendCorrectionOf(_user) = dividendPerShare * (old balanceOf(_user)) - (new balanceOf(_user))`. // So now `dividendOf(_user)` returns the same value before and after `balanceOf(_user)` is changed. mapping(address => int256) internal magnifiedDividendCorrections; mapping(address => uint256) internal withdrawnDividends; uint256 public totalDividendsDistributed; function __DividendPayingToken_init( address _rewardToken, string memory _name, string memory _symbol ) internal initializer { __Ownable_init(); __ERC20_init(_name, _symbol); rewardToken = _rewardToken; } function distributeCAKEDividends(uint256 amount) public onlyOwner { require(totalSupply() > 0); if (amount > 0) { magnifiedDividendPerShare = magnifiedDividendPerShare.add( (amount).mul(magnitude) / totalSupply() ); emit DividendsDistributed(msg.sender, amount); totalDividendsDistributed = totalDividendsDistributed.add(amount); } } /// @notice Withdraws the ether distributed to the sender. /// @dev It emits a `DividendWithdrawn` event if the amount of withdrawn ether is greater than 0. function withdrawDividend() public virtual override { _withdrawDividendOfUser(payable(msg.sender)); } /// @notice Withdraws the ether distributed to the sender. /// @dev It emits a `DividendWithdrawn` event if the amount of withdrawn ether is greater than 0. function _withdrawDividendOfUser(address payable user) internal returns (uint256) { uint256 _withdrawableDividend = withdrawableDividendOf(user); if (_withdrawableDividend > 0) { withdrawnDividends[user] = withdrawnDividends[user].add( _withdrawableDividend ); emit DividendWithdrawn(user, _withdrawableDividend); bool success = IERC20(rewardToken).transfer( user, _withdrawableDividend ); if (!success) { withdrawnDividends[user] = withdrawnDividends[user].sub( _withdrawableDividend ); return 0; } return _withdrawableDividend; } return 0; } /// @notice View the amount of dividend in wei that an address can withdraw. /// @param _owner The address of a token holder. /// @return The amount of dividend in wei that `_owner` can withdraw. function dividendOf(address _owner) public view override returns (uint256) { return withdrawableDividendOf(_owner); } /// @notice View the amount of dividend in wei that an address can withdraw. /// @param _owner The address of a token holder. /// @return The amount of dividend in wei that `_owner` can withdraw. function withdrawableDividendOf(address _owner) public view override returns (uint256) { return accumulativeDividendOf(_owner).sub(withdrawnDividends[_owner]); } /// @notice View the amount of dividend in wei that an address has withdrawn. /// @param _owner The address of a token holder. /// @return The amount of dividend in wei that `_owner` has withdrawn. function withdrawnDividendOf(address _owner) public view override returns (uint256) { return withdrawnDividends[_owner]; } /// @notice View the amount of dividend in wei that an address has earned in total. /// @dev accumulativeDividendOf(_owner) = withdrawableDividendOf(_owner) + withdrawnDividendOf(_owner) /// = (magnifiedDividendPerShare * balanceOf(_owner) + magnifiedDividendCorrections[_owner]) / magnitude /// @param _owner The address of a token holder. /// @return The amount of dividend in wei that `_owner` has earned in total. function accumulativeDividendOf(address _owner) public view override returns (uint256) { return magnifiedDividendPerShare .mul(balanceOf(_owner)) .toInt256Safe() .add(magnifiedDividendCorrections[_owner]) .toUint256Safe() / magnitude; } /// @dev Internal function that transfer tokens from one address to another. /// Update magnifiedDividendCorrections to keep dividends unchanged. /// @param from The address to transfer from. /// @param to The address to transfer to. /// @param value The amount to be transferred. function _transfer( address from, address to, uint256 value ) internal virtual override { require(false); int256 _magCorrection = magnifiedDividendPerShare .mul(value) .toInt256Safe(); magnifiedDividendCorrections[from] = magnifiedDividendCorrections[from] .add(_magCorrection); magnifiedDividendCorrections[to] = magnifiedDividendCorrections[to].sub( _magCorrection ); } /// @dev Internal function that mints tokens to an account. /// Update magnifiedDividendCorrections to keep dividends unchanged. /// @param account The account that will receive the created tokens. /// @param value The amount that will be created. function _mint(address account, uint256 value) internal override { super._mint(account, value); magnifiedDividendCorrections[account] = magnifiedDividendCorrections[ account ].sub((magnifiedDividendPerShare.mul(value)).toInt256Safe()); } /// @dev Internal function that burns an amount of the token of a given account. /// Update magnifiedDividendCorrections to keep dividends unchanged. /// @param account The account whose tokens will be burnt. /// @param value The amount that will be burnt. function _burn(address account, uint256 value) internal override { super._burn(account, value); magnifiedDividendCorrections[account] = magnifiedDividendCorrections[ account ].add((magnifiedDividendPerShare.mul(value)).toInt256Safe()); } function _setBalance(address account, uint256 newBalance) internal { uint256 currentBalance = balanceOf(account); if (newBalance > currentBalance) { uint256 mintAmount = newBalance.sub(currentBalance); _mint(account, mintAmount); } else if (newBalance < currentBalance) { uint256 burnAmount = currentBalance.sub(newBalance); _burn(account, burnAmount); } } } contract BABYTOKENDividendTracker is OwnableUpgradeable, DividendPayingToken { using SafeMath for uint256; using SafeMathInt for int256; using IterableMapping for IterableMapping.Map; IterableMapping.Map private tokenHoldersMap; uint256 public lastProcessedIndex; mapping(address => bool) public excludedFromDividends; mapping(address => uint256) public lastClaimTimes; uint256 public claimWait; uint256 public minimumTokenBalanceForDividends; event ExcludeFromDividends(address indexed account); event ClaimWaitUpdated(uint256 indexed newValue, uint256 indexed oldValue); event Claim( address indexed account, uint256 amount, bool indexed automatic ); function initialize( address rewardToken_, uint256 minimumTokenBalanceForDividends_ ) external initializer { DividendPayingToken.__DividendPayingToken_init( rewardToken_, "DIVIDEND_TRACKER", "DIVIDEND_TRACKER" ); claimWait = 3600; minimumTokenBalanceForDividends = minimumTokenBalanceForDividends_; } function _transfer( address, address, uint256 ) internal pure override { require(false, "Dividend_Tracker: No transfers allowed"); } function withdrawDividend() public pure override { require( false, "Dividend_Tracker: withdrawDividend disabled. Use the 'claim' function on the main BABYTOKEN contract." ); } function excludeFromDividends(address account) external onlyOwner { require(!excludedFromDividends[account]); excludedFromDividends[account] = true; _setBalance(account, 0); tokenHoldersMap.remove(account); emit ExcludeFromDividends(account); } function isExcludedFromDividends(address account) public view returns (bool) { return excludedFromDividends[account]; } function updateClaimWait(uint256 newClaimWait) external onlyOwner { require( newClaimWait >= 3600 && newClaimWait <= 86400, "Dividend_Tracker: claimWait must be updated to between 1 and 24 hours" ); require( newClaimWait != claimWait, "Dividend_Tracker: Cannot update claimWait to same value" ); emit ClaimWaitUpdated(newClaimWait, claimWait); claimWait = newClaimWait; } function updateMinimumTokenBalanceForDividends(uint256 amount) external onlyOwner { minimumTokenBalanceForDividends = amount; } function getLastProcessedIndex() external view returns (uint256) { return lastProcessedIndex; } function getNumberOfTokenHolders() external view returns (uint256) { return tokenHoldersMap.keys.length; } function getAccount(address _account) public view returns ( address account, int256 index, int256 iterationsUntilProcessed, uint256 withdrawableDividends, uint256 totalDividends, uint256 lastClaimTime, uint256 nextClaimTime, uint256 secondsUntilAutoClaimAvailable ) { account = _account; index = tokenHoldersMap.getIndexOfKey(account); iterationsUntilProcessed = -1; if (index >= 0) { if (uint256(index) > lastProcessedIndex) { iterationsUntilProcessed = index.sub( int256(lastProcessedIndex) ); } else { uint256 processesUntilEndOfArray = tokenHoldersMap.keys.length > lastProcessedIndex ? tokenHoldersMap.keys.length.sub(lastProcessedIndex) : 0; iterationsUntilProcessed = index.add( int256(processesUntilEndOfArray) ); } } withdrawableDividends = withdrawableDividendOf(account); totalDividends = accumulativeDividendOf(account); lastClaimTime = lastClaimTimes[account]; nextClaimTime = lastClaimTime > 0 ? lastClaimTime.add(claimWait) : 0; secondsUntilAutoClaimAvailable = nextClaimTime > block.timestamp ? nextClaimTime.sub(block.timestamp) : 0; } function getAccountAtIndex(uint256 index) public view returns ( address, int256, int256, uint256, uint256, uint256, uint256, uint256 ) { if (index >= tokenHoldersMap.size()) { return (address(0), -1, -1, 0, 0, 0, 0, 0); } address account = tokenHoldersMap.getKeyAtIndex(index); return getAccount(account); } function canAutoClaim(uint256 lastClaimTime) private view returns (bool) { if (lastClaimTime > block.timestamp) { return false; } return block.timestamp.sub(lastClaimTime) >= claimWait; } function setBalance(address payable account, uint256 newBalance) external onlyOwner { if (excludedFromDividends[account]) { return; } if (newBalance >= minimumTokenBalanceForDividends) { _setBalance(account, newBalance); tokenHoldersMap.set(account, newBalance); } else { _setBalance(account, 0); tokenHoldersMap.remove(account); } processAccount(account, true); } function process(uint256 gas) public returns ( uint256, uint256, uint256 ) { uint256 numberOfTokenHolders = tokenHoldersMap.keys.length; if (numberOfTokenHolders == 0) { return (0, 0, lastProcessedIndex); } uint256 _lastProcessedIndex = lastProcessedIndex; uint256 gasUsed = 0; uint256 gasLeft = gasleft(); uint256 iterations = 0; uint256 claims = 0; while (gasUsed < gas && iterations < numberOfTokenHolders) { _lastProcessedIndex++; if (_lastProcessedIndex >= tokenHoldersMap.keys.length) { _lastProcessedIndex = 0; } address account = tokenHoldersMap.keys[_lastProcessedIndex]; if (canAutoClaim(lastClaimTimes[account])) { if (processAccount(payable(account), true)) { claims++; } } iterations++; uint256 newGasLeft = gasleft(); if (gasLeft > newGasLeft) { gasUsed = gasUsed.add(gasLeft.sub(newGasLeft)); } gasLeft = newGasLeft; } lastProcessedIndex = _lastProcessedIndex; return (iterations, claims, lastProcessedIndex); } function processAccount(address payable account, bool automatic) public onlyOwner returns (bool) { uint256 amount = _withdrawDividendOfUser(account); if (amount > 0) { lastClaimTimes[account] = block.timestamp; emit Claim(account, amount, automatic); return true; } return false; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC20.sol"; import "./extensions/IERC20Metadata.sol"; import "../../utils/Context.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 Contracts guidelines: functions revert * instead 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, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override 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 this function is * overridden; * * 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 override returns (uint8) { return 18; } /** * @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); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } 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] + 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) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(_msgSender(), spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * This 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); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; emit Transfer(sender, recipient, amount); _afterTokenTransfer(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: * * - `account` 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 += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(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); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(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 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 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 {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been 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 _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC20Upgradeable.sol"; import "./extensions/IERC20MetadataUpgradeable.sol"; import "../../utils/ContextUpgradeable.sol"; import "../../proxy/utils/Initializable.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 Contracts guidelines: functions revert * instead 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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ function __ERC20_init(string memory name_, string memory symbol_) internal initializer { __Context_init_unchained(); __ERC20_init_unchained(name_, symbol_); } function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override 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 this function is * overridden; * * 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 override returns (uint8) { return 18; } /** * @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); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } 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] + 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) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(_msgSender(), spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * This 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); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; emit Transfer(sender, recipient, amount); _afterTokenTransfer(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: * * - `account` 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 += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(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); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(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 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 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 {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been 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 _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} uint256[45] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^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.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal initializer { __Context_init_unchained(); __Ownable_init_unchained(); } function __Ownable_init_unchained() internal initializer { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } uint256[49] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */ 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) { unchecked { 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) { unchecked { 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) { unchecked { // 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) { unchecked { 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) { unchecked { 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) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return 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) { return a * b; } /** * @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. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { 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) { 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) { unchecked { 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. * * 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) { unchecked { 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) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; interface IUniswapV2Factory { event PairCreated( address indexed token0, address indexed token1, address pair, uint256 ); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint256) external view returns (address pair); function allPairsLength() external view returns (uint256); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2; interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint256 amountADesired, uint256 amountBDesired, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline ) external returns ( uint256 amountA, uint256 amountB, uint256 liquidity ); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); function removeLiquidity( address tokenA, address tokenB, uint256 liquidity, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline ) external returns (uint256 amountA, uint256 amountB); function removeLiquidityETH( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external returns (uint256 amountToken, uint256 amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint256 liquidity, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint256 amountA, uint256 amountB); function removeLiquidityETHWithPermit( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint256 amountToken, uint256 amountETH); function swapExactTokensForTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); function swapTokensForExactTokens( uint256 amountOut, uint256 amountInMax, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); function swapExactETHForTokens( uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external payable returns (uint256[] memory amounts); function swapTokensForExactETH( uint256 amountOut, uint256 amountInMax, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); function swapExactTokensForETH( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); function swapETHForExactTokens( uint256 amountOut, address[] calldata path, address to, uint256 deadline ) external payable returns (uint256[] memory amounts); function quote( uint256 amountA, uint256 reserveA, uint256 reserveB ) external pure returns (uint256 amountB); function getAmountOut( uint256 amountIn, uint256 reserveIn, uint256 reserveOut ) external pure returns (uint256 amountOut); function getAmountIn( uint256 amountOut, uint256 reserveIn, uint256 reserveOut ) external pure returns (uint256 amountIn); function getAmountsOut(uint256 amountIn, address[] calldata path) external view returns (uint256[] memory amounts); function getAmountsIn(uint256 amountOut, address[] calldata path) external view returns (uint256[] memory amounts); } interface IUniswapV2Router02 is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external returns (uint256 amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint256 amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; interface IUniswapV2Pair { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint); function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; event Mint(address indexed sender, uint amount0, uint amount1); event Burn(address indexed sender, uint amount0, uint amount1, address indexed to); event Swap( address indexed sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); function MINIMUM_LIQUIDITY() external pure returns (uint); function factory() external view returns (address); function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view returns (uint); function kLast() external view returns (uint); function mint(address to) external returns (uint liquidity); function burn(address to) external returns (uint amount0, uint amount1); function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external; function skim(address to) external; function sync() external; function initialize(address, address) external; }
// SPDX-License-Identifier: MIT pragma solidity =0.8.4; /** * @title SafeMathInt * @dev Math operations for int256 with overflow safety checks. */ library SafeMathInt { int256 private constant MIN_INT256 = int256(1) << 255; int256 private constant MAX_INT256 = ~(int256(1) << 255); /** * @dev Multiplies two int256 variables and fails on overflow. */ function mul(int256 a, int256 b) internal pure returns (int256) { int256 c = a * b; // Detect overflow when multiplying MIN_INT256 with -1 require(c != MIN_INT256 || (a & MIN_INT256) != (b & MIN_INT256)); require((b == 0) || (c / b == a)); return c; } /** * @dev Division of two int256 variables and fails on overflow. */ function div(int256 a, int256 b) internal pure returns (int256) { // Prevent overflow when dividing MIN_INT256 by -1 require(b != -1 || a != MIN_INT256); // Solidity already throws when dividing by 0. return a / b; } /** * @dev Subtracts two int256 variables and fails on overflow. */ function sub(int256 a, int256 b) internal pure returns (int256) { int256 c = a - b; require((b >= 0 && c <= a) || (b < 0 && c > a)); return c; } /** * @dev Adds two int256 variables and fails on overflow. */ function add(int256 a, int256 b) internal pure returns (int256) { int256 c = a + b; require((b >= 0 && c >= a) || (b < 0 && c < a)); return c; } /** * @dev Converts to absolute value, and fails on overflow. */ function abs(int256 a) internal pure returns (int256) { require(a != MIN_INT256); return a < 0 ? -a : a; } function toUint256Safe(int256 a) internal pure returns (uint256) { require(a >= 0); return uint256(a); } }
// SPDX-License-Identifier: MIT pragma solidity =0.8.4; /** * @title SafeMathUint * @dev Math operations with safety checks that revert on error */ library SafeMathUint { function toInt256Safe(uint256 a) internal pure returns (int256) { int256 b = int256(a); require(b >= 0); return b; } }
// SPDX-License-Identifier: MIT pragma solidity =0.8.4; library IterableMapping { // Iterable mapping from address to uint; struct Map { address[] keys; mapping(address => uint256) values; mapping(address => uint256) indexOf; mapping(address => bool) inserted; } function get(Map storage map, address key) public view returns (uint256) { return map.values[key]; } function getIndexOfKey(Map storage map, address key) public view returns (int256) { if (!map.inserted[key]) { return -1; } return int256(map.indexOf[key]); } function getKeyAtIndex(Map storage map, uint256 index) public view returns (address) { return map.keys[index]; } function size(Map storage map) public view returns (uint256) { return map.keys.length; } function set( Map storage map, address key, uint256 val ) public { if (map.inserted[key]) { map.values[key] = val; } else { map.inserted[key] = true; map.values[key] = val; map.indexOf[key] = map.keys.length; map.keys.push(key); } } function remove(Map storage map, address key) public { if (!map.inserted[key]) { return; } delete map.inserted[key]; delete map.values[key]; uint256 index = map.indexOf[key]; uint256 lastIndex = map.keys.length - 1; address lastKey = map.keys[lastIndex]; map.indexOf[lastKey] = index; delete map.indexOf[key]; map.keys[index] = lastKey; map.keys.pop(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT pragma solidity ^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 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) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @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.8.0; import "../IERC20Upgradeable.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20MetadataUpgradeable is IERC20Upgradeable { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @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 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 ContextUpgradeable is Initializable { function __Context_init() internal initializer { __Context_init_unchained(); } function __Context_init_unchained() internal initializer { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { require(_initializing || !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": { "contracts/baby/IterableMapping.sol": { "IterableMapping": "0x00fec8b7ee9c14424f71b30dac7c1cfe054b6771" } } }
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":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"bool","name":"automatic","type":"bool"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"newValue","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"oldValue","type":"uint256"}],"name":"ClaimWaitUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"weiAmount","type":"uint256"}],"name":"DividendWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"weiAmount","type":"uint256"}],"name":"DividendsDistributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"ExcludeFromDividends","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"accumulativeDividendOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimWait","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":"uint256","name":"amount","type":"uint256"}],"name":"distributeCAKEDividends","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"dividendOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"excludeFromDividends","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"excludedFromDividends","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"getAccount","outputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"int256","name":"index","type":"int256"},{"internalType":"int256","name":"iterationsUntilProcessed","type":"int256"},{"internalType":"uint256","name":"withdrawableDividends","type":"uint256"},{"internalType":"uint256","name":"totalDividends","type":"uint256"},{"internalType":"uint256","name":"lastClaimTime","type":"uint256"},{"internalType":"uint256","name":"nextClaimTime","type":"uint256"},{"internalType":"uint256","name":"secondsUntilAutoClaimAvailable","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getAccountAtIndex","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"int256","name":"","type":"int256"},{"internalType":"int256","name":"","type":"int256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastProcessedIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNumberOfTokenHolders","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"address","name":"rewardToken_","type":"address"},{"internalType":"uint256","name":"minimumTokenBalanceForDividends_","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isExcludedFromDividends","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastClaimTimes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastProcessedIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minimumTokenBalanceForDividends","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"gas","type":"uint256"}],"name":"process","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"account","type":"address"},{"internalType":"bool","name":"automatic","type":"bool"}],"name":"processAccount","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"account","type":"address"},{"internalType":"uint256","name":"newBalance","type":"uint256"}],"name":"setBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalDividendsDistributed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newClaimWait","type":"uint256"}],"name":"updateClaimWait","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"updateMinimumTokenBalanceForDividends","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawDividend","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"withdrawableDividendOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"withdrawnDividendOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b5061236d806100206000396000f3fe608060405234801561001057600080fd5b506004361061023d5760003560e01c80638da5cb5b1161013b578063c705c569116100b8578063e98030c71161007c578063e98030c714610560578063f2fde38b14610573578063f7c618c114610586578063fbcbc0f114610599578063ffb2c479146105ac57600080fd5b8063c705c569146104cd578063cd6dc687146104f9578063dd62ed3e1461050c578063e30443bc14610545578063e7841ec01461055857600080fd5b8063a9059cbb116100ff578063a9059cbb14610462578063aafd847a14610475578063ba72a9551461049e578063bc4c4b37146104b1578063be10b614146104c457600080fd5b80638da5cb5b146103fc57806391b89fba1461042157806395d89b4114610434578063a457c2d71461043c578063a8b9d2401461044f57600080fd5b8063313ce567116101c95780636a4740021161018d5780636a474002146103b15780636f2789ec146103b957806370a08231146103c2578063715018a6146103eb57806385a6b3ae146103f357600080fd5b8063313ce5671461030157806331e79db01461031057806339509351146103235780634e7b827f146103365780635183d6fd1461035957600080fd5b806318160ddd1161021057806318160ddd146102aa578063226cfa3d146102b257806323b872dd146102d257806327ce0147146102e55780633009a609146102f857600080fd5b806306fdde0314610242578063095ea7b31461026057806309bbedde146102835780630dcb2e8914610295575b600080fd5b61024a6105da565b60405161025791906120e4565b60405180910390f35b61027361026e366004612000565b61066c565b6040519015158152602001610257565b609c545b604051908152602001610257565b6102a86102a33660046120cc565b610683565b005b603554610287565b6102876102c0366004611f90565b60a26020526000908152604090205481565b6102736102e0366004612058565b6106bb565b6102876102f3366004611f90565b610765565b61028760a05481565b60405160128152602001610257565b6102a861031e366004611f90565b6107c2565b610273610331366004612000565b6108e9565b610273610344366004611f90565b60a16020526000908152604090205460ff1681565b61036c6103673660046120cc565b610925565b604080516001600160a01b0390991689526020890197909752958701949094526060860192909252608085015260a084015260c083015260e082015261010001610257565b6102a8610a97565b61028760a35481565b6102876103d0366004611f90565b6001600160a01b031660009081526033602052604090205490565b6102a8610b3b565b610287609b5481565b6065546001600160a01b03165b6040516001600160a01b039091168152602001610257565b61028761042f366004611f90565b610b6f565b61024a610b7a565b61027361044a366004612000565b610b89565b61028761045d366004611f90565b610c22565b610273610470366004612000565b610c4e565b610287610483366004611f90565b6001600160a01b03166000908152609a602052604090205490565b6102a86104ac3660046120cc565b610c5b565b6102736104bf366004611fc8565b610d19565b61028760a45481565b6102736104db366004611f90565b6001600160a01b0316600090815260a1602052604090205460ff1690565b6102a8610507366004612000565b610dc7565b61028761051a36600461202b565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b6102a8610553366004612000565b610e9b565b60a054610287565b6102a861056e3660046120cc565b611004565b6102a8610581366004611f90565b61116e565b609754610409906001600160a01b031681565b61036c6105a7366004611f90565b611206565b6105bf6105ba3660046120cc565b61137e565b60408051938452602084019290925290820152606001610257565b6060603680546105e9906122a8565b80601f0160208091040260200160405190810160405280929190818152602001828054610615906122a8565b80156106625780601f1061063757610100808354040283529160200191610662565b820191906000526020600020905b81548152906001019060200180831161064557829003601f168201915b5050505050905090565b60006106793384846114a7565b5060015b92915050565b6065546001600160a01b031633146106b65760405162461bcd60e51b81526004016106ad90612185565b60405180910390fd5b60a455565b60006106c88484846115cb565b6001600160a01b03841660009081526034602090815260408083203384529091529020548281101561074d5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084016106ad565b61075a85338584036114a7565b506001949350505050565b6001600160a01b0381166000908152609960209081526040808320546033909252822054609854600160801b926107b8926107b3926107ad916107a89190611622565b611635565b90611645565b611683565b61067d9190612213565b6065546001600160a01b031633146107ec5760405162461bcd60e51b81526004016106ad90612185565b6001600160a01b038116600090815260a1602052604090205460ff161561081257600080fd5b6001600160a01b038116600090815260a160205260408120805460ff19166001179055610840908290611696565b60405163131836e760e21b8152609c60048201526001600160a01b03821660248201527300fec8b7ee9c14424f71b30dac7c1cfe054b677190634c60db9c9060440160006040518083038186803b15801561089a57600080fd5b505af41580156108ae573d6000803e3d6000fd5b50506040516001600160a01b03841692507fa878b31040b2e6d0a9a3d3361209db3908ba62014b0dca52adbaee451d128b259150600090a250565b3360008181526034602090815260408083206001600160a01b038716845290915281205490916106799185906109209086906121fb565b6114a7565b600080600080600080600080609c7300fec8b7ee9c14424f71b30dac7c1cfe054b677163deb3d89690916040518263ffffffff1660e01b815260040161096d91815260200190565b60206040518083038186803b15801561098557600080fd5b505af4158015610999573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109bd91906120b4565b89106109e2575060009650600019955085945086935083925082915081905080610a8c565b6040516368d54f3f60e11b8152609c6004820152602481018a90526000907300fec8b7ee9c14424f71b30dac7c1cfe054b67719063d1aa9e7e9060440160206040518083038186803b158015610a3757600080fd5b505af4158015610a4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6f9190611fac565b9050610a7a81611206565b98509850985098509850985098509850505b919395975091939597565b60405162461bcd60e51b815260206004820152606560248201527f4469766964656e645f547261636b65723a20776974686472617744697669646560448201527f6e642064697361626c65642e20557365207468652027636c61696d272066756e60648201527f6374696f6e206f6e20746865206d61696e2042414259544f4b454e20636f6e746084820152643930b1ba1760d91b60a482015260c4016106ad565b565b6065546001600160a01b03163314610b655760405162461bcd60e51b81526004016106ad90612185565b610b3960006116f5565b600061067d82610c22565b6060603780546105e9906122a8565b3360009081526034602090815260408083206001600160a01b038616845290915281205482811015610c0b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016106ad565b610c1833858584036114a7565b5060019392505050565b6001600160a01b0381166000908152609a602052604081205461067d90610c4884610765565b90611747565b60006106793384846115cb565b6065546001600160a01b03163314610c855760405162461bcd60e51b81526004016106ad90612185565b6000610c9060355490565b11610c9a57600080fd5b8015610d1657610ccd610cac60355490565b610cba83600160801b611622565b610cc49190612213565b60985490611753565b60985560405181815233907fa493a9229478c3fcd73f66d2cdeb7f94fd0f341da924d1054236d784541165119060200160405180910390a2609b54610d129082611753565b609b555b50565b6065546000906001600160a01b03163314610d465760405162461bcd60e51b81526004016106ad90612185565b6000610d518461175f565b90508015610dbd576001600160a01b038416600081815260a26020526040908190204290555184151591907fa2c38e2d2fb7e3e1912d937fd1ca11ed6d51864dee4cfa7a7bf02becd7acf09290610dab9085815260200190565b60405180910390a3600191505061067d565b5060009392505050565b600054610100900460ff1680610de0575060005460ff16155b610dfc5760405162461bcd60e51b81526004016106ad90612137565b600054610100900460ff16158015610e1e576000805461ffff19166101011790555b610e79836040518060400160405280601081526020016f2224ab24a222a7222faa2920a1a5a2a960811b8152506040518060400160405280601081526020016f2224ab24a222a7222faa2920a1a5a2a960811b8152506118d3565b610e1060a35560a48290558015610e96576000805461ff00191690555b505050565b6065546001600160a01b03163314610ec55760405162461bcd60e51b81526004016106ad90612185565b6001600160a01b038216600090815260a1602052604090205460ff1615610eea575050565b60a4548110610f7b57610efd8282611696565b604051632f0ad01760e21b8152609c60048201526001600160a01b0383166024820152604481018290527300fec8b7ee9c14424f71b30dac7c1cfe054b67719063bc2b405c9060640160006040518083038186803b158015610f5e57600080fd5b505af4158015610f72573d6000803e3d6000fd5b50505050610ff9565b610f86826000611696565b60405163131836e760e21b8152609c60048201526001600160a01b03831660248201527300fec8b7ee9c14424f71b30dac7c1cfe054b677190634c60db9c9060440160006040518083038186803b158015610fe057600080fd5b505af4158015610ff4573d6000803e3d6000fd5b505050505b610e96826001610d19565b6065546001600160a01b0316331461102e5760405162461bcd60e51b81526004016106ad90612185565b610e1081101580156110435750620151808111155b6110c35760405162461bcd60e51b815260206004820152604560248201527f4469766964656e645f547261636b65723a20636c61696d57616974206d75737460448201527f206265207570646174656420746f206265747765656e203120616e6420323420606482015264686f75727360d81b608482015260a4016106ad565b60a35481141561113b5760405162461bcd60e51b815260206004820152603760248201527f4469766964656e645f547261636b65723a2043616e6e6f74207570646174652060448201527f636c61696d5761697420746f2073616d652076616c756500000000000000000060648201526084016106ad565b60a35460405182907f474ea64804364a1e29a4487ddb63c3342a2dd826ccd8acf48825e680a0e6f20f90600090a360a355565b6065546001600160a01b031633146111985760405162461bcd60e51b81526004016106ad90612185565b6001600160a01b0381166111fd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106ad565b610d16816116f5565b6040516317e142d160e01b8152609c60048201526001600160a01b038216602482015281906000908190819081908190819081907300fec8b7ee9c14424f71b30dac7c1cfe054b6771906317e142d19060440160206040518083038186803b15801561127157600080fd5b505af4158015611285573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a991906120b4565b965060001995506000871261130b5760a0548711156112d75760a0546112d090889061196e565b955061130b565b60a054609c54600091106112ec5760006112fb565b60a054609c546112fb91611747565b90506113078882611645565b9650505b61131488610c22565b945061131f88610765565b6001600160a01b038916600090815260a26020526040902054909450925082611349576000611357565b60a354611357908490611753565b9150428211611367576000611371565b6113718242611747565b9050919395975091939597565b609c54600090819081908061139e57505060a054600092508291506114a0565b60a0546000805a90506000805b89841080156113b957508582105b1561148f57846113c8816122e3565b609c54909650861090506113db57600094505b6000609c600001868154811061140157634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031680835260a2909152604090912054909150611432906119ab565b1561145557611442816001610d19565b156114555781611451816122e3565b9250505b8261145f816122e3565b93505060005a9050808511156114865761148361147c8683611747565b8790611753565b95505b93506113ab9050565b60a085905590975095509193505050505b9193909250565b6001600160a01b0383166115095760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106ad565b6001600160a01b03821661156a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106ad565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60405162461bcd60e51b815260206004820152602660248201527f4469766964656e645f547261636b65723a204e6f207472616e736665727320616044820152651b1b1bddd95960d21b60648201526084016106ad565b600061162e8284612233565b9392505050565b6000818181121561067d57600080fd5b60008061165283856121ba565b9050600083121580156116655750838112155b8061167a575060008312801561167a57508381125b61162e57600080fd5b60008082121561169257600080fd5b5090565b6001600160a01b038216600090815260336020526040902054808211156116d55760006116c38383611747565b90506116cf84826119d2565b50505050565b80821015610e965760006116e98284611747565b90506116cf8482611a36565b606580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600061162e8284612291565b600061162e82846121fb565b60008061176b83610c22565b905080156118ca576001600160a01b0383166000908152609a60205260409020546117969082611753565b6001600160a01b0384166000818152609a6020526040908190209290925590517fee503bee2bb6a87e57bc57db795f98137327401a0e7b7ce42e37926cc1a9ca4d906117e59084815260200190565b60405180910390a260975460405163a9059cbb60e01b81526001600160a01b03858116600483015260248201849052600092169063a9059cbb90604401602060405180830381600087803b15801561183c57600080fd5b505af1158015611850573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118749190612098565b9050806118c3576001600160a01b0384166000908152609a602052604090205461189e9083611747565b6001600160a01b039094166000908152609a6020526040812094909455509192915050565b5092915050565b50600092915050565b600054610100900460ff16806118ec575060005460ff16155b6119085760405162461bcd60e51b81526004016106ad90612137565b600054610100900460ff1615801561192a576000805461ffff19166101011790555b611932611a7a565b61193c8383611af5565b609780546001600160a01b0319166001600160a01b03861617905580156116cf576000805461ff001916905550505050565b60008061197b8385612252565b90506000831215801561198e5750838113155b8061167a575060008312801561167a575083811361162e57600080fd5b6000428211156119bd57506000919050565b60a3546119ca4284611747565b101592915050565b6119dc8282611b74565b611a166119f76107a88360985461162290919063ffffffff16565b6001600160a01b0384166000908152609960205260409020549061196e565b6001600160a01b0390921660009081526099602052604090209190915550565b611a408282611c53565b611a16611a5b6107a88360985461162290919063ffffffff16565b6001600160a01b03841660009081526099602052604090205490611645565b600054610100900460ff1680611a93575060005460ff16155b611aaf5760405162461bcd60e51b81526004016106ad90612137565b600054610100900460ff16158015611ad1576000805461ffff19166101011790555b611ad9611da1565b611ae1611e0b565b8015610d16576000805461ff001916905550565b600054610100900460ff1680611b0e575060005460ff16155b611b2a5760405162461bcd60e51b81526004016106ad90612137565b600054610100900460ff16158015611b4c576000805461ffff19166101011790555b611b54611da1565b611b5e8383611e6b565b8015610e96576000805461ff0019169055505050565b6001600160a01b038216611bca5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016106ad565b8060356000828254611bdc91906121fb565b90915550506001600160a01b03821660009081526033602052604081208054839290611c099084906121fb565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6001600160a01b038216611cb35760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016106ad565b6001600160a01b03821660009081526033602052604090205481811015611d275760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016106ad565b6001600160a01b0383166000908152603360205260408120838303905560358054849290611d56908490612291565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b600054610100900460ff1680611dba575060005460ff16155b611dd65760405162461bcd60e51b81526004016106ad90612137565b600054610100900460ff16158015611ae1576000805461ffff19166101011790558015610d16576000805461ff001916905550565b600054610100900460ff1680611e24575060005460ff16155b611e405760405162461bcd60e51b81526004016106ad90612137565b600054610100900460ff16158015611e62576000805461ffff19166101011790555b611ae1336116f5565b600054610100900460ff1680611e84575060005460ff16155b611ea05760405162461bcd60e51b81526004016106ad90612137565b600054610100900460ff16158015611ec2576000805461ffff19166101011790555b8251611ed5906036906020860190611f00565b508151611ee9906037906020850190611f00565b508015610e96576000805461ff0019169055505050565b828054611f0c906122a8565b90600052602060002090601f016020900481019282611f2e5760008555611f74565b82601f10611f4757805160ff1916838001178555611f74565b82800160010185558215611f74579182015b82811115611f74578251825591602001919060010190611f59565b506116929291505b808211156116925760008155600101611f7c565b600060208284031215611fa1578081fd5b813561162e81612314565b600060208284031215611fbd578081fd5b815161162e81612314565b60008060408385031215611fda578081fd5b8235611fe581612314565b91506020830135611ff581612329565b809150509250929050565b60008060408385031215612012578182fd5b823561201d81612314565b946020939093013593505050565b6000806040838503121561203d578182fd5b823561204881612314565b91506020830135611ff581612314565b60008060006060848603121561206c578081fd5b833561207781612314565b9250602084013561208781612314565b929592945050506040919091013590565b6000602082840312156120a9578081fd5b815161162e81612329565b6000602082840312156120c5578081fd5b5051919050565b6000602082840312156120dd578081fd5b5035919050565b6000602080835283518082850152825b81811015612110578581018301518582016040015282016120f4565b818111156121215783604083870101525b50601f01601f1916929092016040019392505050565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600080821280156001600160ff1b03849003851316156121dc576121dc6122fe565b600160ff1b83900384128116156121f5576121f56122fe565b50500190565b6000821982111561220e5761220e6122fe565b500190565b60008261222e57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561224d5761224d6122fe565b500290565b60008083128015600160ff1b850184121615612270576122706122fe565b6001600160ff1b038401831381161561228b5761228b6122fe565b50500390565b6000828210156122a3576122a36122fe565b500390565b600181811c908216806122bc57607f821691505b602082108114156122dd57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156122f7576122f76122fe565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b0381168114610d1657600080fd5b8015158114610d1657600080fdfea2646970667358221220a42bde881d4bcdcf7f290cf4e0cd2d5a5534076c4f35e0dc9a28b9caa753fec064736f6c63430008040033
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061023d5760003560e01c80638da5cb5b1161013b578063c705c569116100b8578063e98030c71161007c578063e98030c714610560578063f2fde38b14610573578063f7c618c114610586578063fbcbc0f114610599578063ffb2c479146105ac57600080fd5b8063c705c569146104cd578063cd6dc687146104f9578063dd62ed3e1461050c578063e30443bc14610545578063e7841ec01461055857600080fd5b8063a9059cbb116100ff578063a9059cbb14610462578063aafd847a14610475578063ba72a9551461049e578063bc4c4b37146104b1578063be10b614146104c457600080fd5b80638da5cb5b146103fc57806391b89fba1461042157806395d89b4114610434578063a457c2d71461043c578063a8b9d2401461044f57600080fd5b8063313ce567116101c95780636a4740021161018d5780636a474002146103b15780636f2789ec146103b957806370a08231146103c2578063715018a6146103eb57806385a6b3ae146103f357600080fd5b8063313ce5671461030157806331e79db01461031057806339509351146103235780634e7b827f146103365780635183d6fd1461035957600080fd5b806318160ddd1161021057806318160ddd146102aa578063226cfa3d146102b257806323b872dd146102d257806327ce0147146102e55780633009a609146102f857600080fd5b806306fdde0314610242578063095ea7b31461026057806309bbedde146102835780630dcb2e8914610295575b600080fd5b61024a6105da565b60405161025791906120e4565b60405180910390f35b61027361026e366004612000565b61066c565b6040519015158152602001610257565b609c545b604051908152602001610257565b6102a86102a33660046120cc565b610683565b005b603554610287565b6102876102c0366004611f90565b60a26020526000908152604090205481565b6102736102e0366004612058565b6106bb565b6102876102f3366004611f90565b610765565b61028760a05481565b60405160128152602001610257565b6102a861031e366004611f90565b6107c2565b610273610331366004612000565b6108e9565b610273610344366004611f90565b60a16020526000908152604090205460ff1681565b61036c6103673660046120cc565b610925565b604080516001600160a01b0390991689526020890197909752958701949094526060860192909252608085015260a084015260c083015260e082015261010001610257565b6102a8610a97565b61028760a35481565b6102876103d0366004611f90565b6001600160a01b031660009081526033602052604090205490565b6102a8610b3b565b610287609b5481565b6065546001600160a01b03165b6040516001600160a01b039091168152602001610257565b61028761042f366004611f90565b610b6f565b61024a610b7a565b61027361044a366004612000565b610b89565b61028761045d366004611f90565b610c22565b610273610470366004612000565b610c4e565b610287610483366004611f90565b6001600160a01b03166000908152609a602052604090205490565b6102a86104ac3660046120cc565b610c5b565b6102736104bf366004611fc8565b610d19565b61028760a45481565b6102736104db366004611f90565b6001600160a01b0316600090815260a1602052604090205460ff1690565b6102a8610507366004612000565b610dc7565b61028761051a36600461202b565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b6102a8610553366004612000565b610e9b565b60a054610287565b6102a861056e3660046120cc565b611004565b6102a8610581366004611f90565b61116e565b609754610409906001600160a01b031681565b61036c6105a7366004611f90565b611206565b6105bf6105ba3660046120cc565b61137e565b60408051938452602084019290925290820152606001610257565b6060603680546105e9906122a8565b80601f0160208091040260200160405190810160405280929190818152602001828054610615906122a8565b80156106625780601f1061063757610100808354040283529160200191610662565b820191906000526020600020905b81548152906001019060200180831161064557829003601f168201915b5050505050905090565b60006106793384846114a7565b5060015b92915050565b6065546001600160a01b031633146106b65760405162461bcd60e51b81526004016106ad90612185565b60405180910390fd5b60a455565b60006106c88484846115cb565b6001600160a01b03841660009081526034602090815260408083203384529091529020548281101561074d5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084016106ad565b61075a85338584036114a7565b506001949350505050565b6001600160a01b0381166000908152609960209081526040808320546033909252822054609854600160801b926107b8926107b3926107ad916107a89190611622565b611635565b90611645565b611683565b61067d9190612213565b6065546001600160a01b031633146107ec5760405162461bcd60e51b81526004016106ad90612185565b6001600160a01b038116600090815260a1602052604090205460ff161561081257600080fd5b6001600160a01b038116600090815260a160205260408120805460ff19166001179055610840908290611696565b60405163131836e760e21b8152609c60048201526001600160a01b03821660248201527300fec8b7ee9c14424f71b30dac7c1cfe054b677190634c60db9c9060440160006040518083038186803b15801561089a57600080fd5b505af41580156108ae573d6000803e3d6000fd5b50506040516001600160a01b03841692507fa878b31040b2e6d0a9a3d3361209db3908ba62014b0dca52adbaee451d128b259150600090a250565b3360008181526034602090815260408083206001600160a01b038716845290915281205490916106799185906109209086906121fb565b6114a7565b600080600080600080600080609c7300fec8b7ee9c14424f71b30dac7c1cfe054b677163deb3d89690916040518263ffffffff1660e01b815260040161096d91815260200190565b60206040518083038186803b15801561098557600080fd5b505af4158015610999573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109bd91906120b4565b89106109e2575060009650600019955085945086935083925082915081905080610a8c565b6040516368d54f3f60e11b8152609c6004820152602481018a90526000907300fec8b7ee9c14424f71b30dac7c1cfe054b67719063d1aa9e7e9060440160206040518083038186803b158015610a3757600080fd5b505af4158015610a4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6f9190611fac565b9050610a7a81611206565b98509850985098509850985098509850505b919395975091939597565b60405162461bcd60e51b815260206004820152606560248201527f4469766964656e645f547261636b65723a20776974686472617744697669646560448201527f6e642064697361626c65642e20557365207468652027636c61696d272066756e60648201527f6374696f6e206f6e20746865206d61696e2042414259544f4b454e20636f6e746084820152643930b1ba1760d91b60a482015260c4016106ad565b565b6065546001600160a01b03163314610b655760405162461bcd60e51b81526004016106ad90612185565b610b3960006116f5565b600061067d82610c22565b6060603780546105e9906122a8565b3360009081526034602090815260408083206001600160a01b038616845290915281205482811015610c0b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016106ad565b610c1833858584036114a7565b5060019392505050565b6001600160a01b0381166000908152609a602052604081205461067d90610c4884610765565b90611747565b60006106793384846115cb565b6065546001600160a01b03163314610c855760405162461bcd60e51b81526004016106ad90612185565b6000610c9060355490565b11610c9a57600080fd5b8015610d1657610ccd610cac60355490565b610cba83600160801b611622565b610cc49190612213565b60985490611753565b60985560405181815233907fa493a9229478c3fcd73f66d2cdeb7f94fd0f341da924d1054236d784541165119060200160405180910390a2609b54610d129082611753565b609b555b50565b6065546000906001600160a01b03163314610d465760405162461bcd60e51b81526004016106ad90612185565b6000610d518461175f565b90508015610dbd576001600160a01b038416600081815260a26020526040908190204290555184151591907fa2c38e2d2fb7e3e1912d937fd1ca11ed6d51864dee4cfa7a7bf02becd7acf09290610dab9085815260200190565b60405180910390a3600191505061067d565b5060009392505050565b600054610100900460ff1680610de0575060005460ff16155b610dfc5760405162461bcd60e51b81526004016106ad90612137565b600054610100900460ff16158015610e1e576000805461ffff19166101011790555b610e79836040518060400160405280601081526020016f2224ab24a222a7222faa2920a1a5a2a960811b8152506040518060400160405280601081526020016f2224ab24a222a7222faa2920a1a5a2a960811b8152506118d3565b610e1060a35560a48290558015610e96576000805461ff00191690555b505050565b6065546001600160a01b03163314610ec55760405162461bcd60e51b81526004016106ad90612185565b6001600160a01b038216600090815260a1602052604090205460ff1615610eea575050565b60a4548110610f7b57610efd8282611696565b604051632f0ad01760e21b8152609c60048201526001600160a01b0383166024820152604481018290527300fec8b7ee9c14424f71b30dac7c1cfe054b67719063bc2b405c9060640160006040518083038186803b158015610f5e57600080fd5b505af4158015610f72573d6000803e3d6000fd5b50505050610ff9565b610f86826000611696565b60405163131836e760e21b8152609c60048201526001600160a01b03831660248201527300fec8b7ee9c14424f71b30dac7c1cfe054b677190634c60db9c9060440160006040518083038186803b158015610fe057600080fd5b505af4158015610ff4573d6000803e3d6000fd5b505050505b610e96826001610d19565b6065546001600160a01b0316331461102e5760405162461bcd60e51b81526004016106ad90612185565b610e1081101580156110435750620151808111155b6110c35760405162461bcd60e51b815260206004820152604560248201527f4469766964656e645f547261636b65723a20636c61696d57616974206d75737460448201527f206265207570646174656420746f206265747765656e203120616e6420323420606482015264686f75727360d81b608482015260a4016106ad565b60a35481141561113b5760405162461bcd60e51b815260206004820152603760248201527f4469766964656e645f547261636b65723a2043616e6e6f74207570646174652060448201527f636c61696d5761697420746f2073616d652076616c756500000000000000000060648201526084016106ad565b60a35460405182907f474ea64804364a1e29a4487ddb63c3342a2dd826ccd8acf48825e680a0e6f20f90600090a360a355565b6065546001600160a01b031633146111985760405162461bcd60e51b81526004016106ad90612185565b6001600160a01b0381166111fd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106ad565b610d16816116f5565b6040516317e142d160e01b8152609c60048201526001600160a01b038216602482015281906000908190819081908190819081907300fec8b7ee9c14424f71b30dac7c1cfe054b6771906317e142d19060440160206040518083038186803b15801561127157600080fd5b505af4158015611285573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a991906120b4565b965060001995506000871261130b5760a0548711156112d75760a0546112d090889061196e565b955061130b565b60a054609c54600091106112ec5760006112fb565b60a054609c546112fb91611747565b90506113078882611645565b9650505b61131488610c22565b945061131f88610765565b6001600160a01b038916600090815260a26020526040902054909450925082611349576000611357565b60a354611357908490611753565b9150428211611367576000611371565b6113718242611747565b9050919395975091939597565b609c54600090819081908061139e57505060a054600092508291506114a0565b60a0546000805a90506000805b89841080156113b957508582105b1561148f57846113c8816122e3565b609c54909650861090506113db57600094505b6000609c600001868154811061140157634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031680835260a2909152604090912054909150611432906119ab565b1561145557611442816001610d19565b156114555781611451816122e3565b9250505b8261145f816122e3565b93505060005a9050808511156114865761148361147c8683611747565b8790611753565b95505b93506113ab9050565b60a085905590975095509193505050505b9193909250565b6001600160a01b0383166115095760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106ad565b6001600160a01b03821661156a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106ad565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60405162461bcd60e51b815260206004820152602660248201527f4469766964656e645f547261636b65723a204e6f207472616e736665727320616044820152651b1b1bddd95960d21b60648201526084016106ad565b600061162e8284612233565b9392505050565b6000818181121561067d57600080fd5b60008061165283856121ba565b9050600083121580156116655750838112155b8061167a575060008312801561167a57508381125b61162e57600080fd5b60008082121561169257600080fd5b5090565b6001600160a01b038216600090815260336020526040902054808211156116d55760006116c38383611747565b90506116cf84826119d2565b50505050565b80821015610e965760006116e98284611747565b90506116cf8482611a36565b606580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600061162e8284612291565b600061162e82846121fb565b60008061176b83610c22565b905080156118ca576001600160a01b0383166000908152609a60205260409020546117969082611753565b6001600160a01b0384166000818152609a6020526040908190209290925590517fee503bee2bb6a87e57bc57db795f98137327401a0e7b7ce42e37926cc1a9ca4d906117e59084815260200190565b60405180910390a260975460405163a9059cbb60e01b81526001600160a01b03858116600483015260248201849052600092169063a9059cbb90604401602060405180830381600087803b15801561183c57600080fd5b505af1158015611850573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118749190612098565b9050806118c3576001600160a01b0384166000908152609a602052604090205461189e9083611747565b6001600160a01b039094166000908152609a6020526040812094909455509192915050565b5092915050565b50600092915050565b600054610100900460ff16806118ec575060005460ff16155b6119085760405162461bcd60e51b81526004016106ad90612137565b600054610100900460ff1615801561192a576000805461ffff19166101011790555b611932611a7a565b61193c8383611af5565b609780546001600160a01b0319166001600160a01b03861617905580156116cf576000805461ff001916905550505050565b60008061197b8385612252565b90506000831215801561198e5750838113155b8061167a575060008312801561167a575083811361162e57600080fd5b6000428211156119bd57506000919050565b60a3546119ca4284611747565b101592915050565b6119dc8282611b74565b611a166119f76107a88360985461162290919063ffffffff16565b6001600160a01b0384166000908152609960205260409020549061196e565b6001600160a01b0390921660009081526099602052604090209190915550565b611a408282611c53565b611a16611a5b6107a88360985461162290919063ffffffff16565b6001600160a01b03841660009081526099602052604090205490611645565b600054610100900460ff1680611a93575060005460ff16155b611aaf5760405162461bcd60e51b81526004016106ad90612137565b600054610100900460ff16158015611ad1576000805461ffff19166101011790555b611ad9611da1565b611ae1611e0b565b8015610d16576000805461ff001916905550565b600054610100900460ff1680611b0e575060005460ff16155b611b2a5760405162461bcd60e51b81526004016106ad90612137565b600054610100900460ff16158015611b4c576000805461ffff19166101011790555b611b54611da1565b611b5e8383611e6b565b8015610e96576000805461ff0019169055505050565b6001600160a01b038216611bca5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016106ad565b8060356000828254611bdc91906121fb565b90915550506001600160a01b03821660009081526033602052604081208054839290611c099084906121fb565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6001600160a01b038216611cb35760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016106ad565b6001600160a01b03821660009081526033602052604090205481811015611d275760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016106ad565b6001600160a01b0383166000908152603360205260408120838303905560358054849290611d56908490612291565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b600054610100900460ff1680611dba575060005460ff16155b611dd65760405162461bcd60e51b81526004016106ad90612137565b600054610100900460ff16158015611ae1576000805461ffff19166101011790558015610d16576000805461ff001916905550565b600054610100900460ff1680611e24575060005460ff16155b611e405760405162461bcd60e51b81526004016106ad90612137565b600054610100900460ff16158015611e62576000805461ffff19166101011790555b611ae1336116f5565b600054610100900460ff1680611e84575060005460ff16155b611ea05760405162461bcd60e51b81526004016106ad90612137565b600054610100900460ff16158015611ec2576000805461ffff19166101011790555b8251611ed5906036906020860190611f00565b508151611ee9906037906020850190611f00565b508015610e96576000805461ff0019169055505050565b828054611f0c906122a8565b90600052602060002090601f016020900481019282611f2e5760008555611f74565b82601f10611f4757805160ff1916838001178555611f74565b82800160010185558215611f74579182015b82811115611f74578251825591602001919060010190611f59565b506116929291505b808211156116925760008155600101611f7c565b600060208284031215611fa1578081fd5b813561162e81612314565b600060208284031215611fbd578081fd5b815161162e81612314565b60008060408385031215611fda578081fd5b8235611fe581612314565b91506020830135611ff581612329565b809150509250929050565b60008060408385031215612012578182fd5b823561201d81612314565b946020939093013593505050565b6000806040838503121561203d578182fd5b823561204881612314565b91506020830135611ff581612314565b60008060006060848603121561206c578081fd5b833561207781612314565b9250602084013561208781612314565b929592945050506040919091013590565b6000602082840312156120a9578081fd5b815161162e81612329565b6000602082840312156120c5578081fd5b5051919050565b6000602082840312156120dd578081fd5b5035919050565b6000602080835283518082850152825b81811015612110578581018301518582016040015282016120f4565b818111156121215783604083870101525b50601f01601f1916929092016040019392505050565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600080821280156001600160ff1b03849003851316156121dc576121dc6122fe565b600160ff1b83900384128116156121f5576121f56122fe565b50500190565b6000821982111561220e5761220e6122fe565b500190565b60008261222e57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561224d5761224d6122fe565b500290565b60008083128015600160ff1b850184121615612270576122706122fe565b6001600160ff1b038401831381161561228b5761228b6122fe565b50500390565b6000828210156122a3576122a36122fe565b500390565b600181811c908216806122bc57607f821691505b602082108114156122dd57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156122f7576122f76122fe565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b0381168114610d1657600080fd5b8015158114610d1657600080fdfea2646970667358221220a42bde881d4bcdcf7f290cf4e0cd2d5a5534076c4f35e0dc9a28b9caa753fec064736f6c63430008040033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
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.