Token 10X: Africa's First Cryptocurrency Hub
Floki Vader Token
Created by a Star Wars fanbase, it has popular elements like the FLOKI and the DARTH VADER merging into a new, super catchy character that will make it easy for the community to spread the word and lead it to become the new trending, #1 viral token!
...
About Floki Vader
Created by a Star Wars fanbase, it has popular elements like the FLOKI and the DARTH VADER merging into a new, super catchy character that will make it easy for the community to spread the word and lead it to become the new trending, #1 viral token!
79 total visits
Token information and links
Circulating Supply
1000000000000000000000000
Token Contract (BSC Chain)
0X4F302A5A1BE8A522E875C70A08F7CD08D7EC332C
Contract license: None
Launch Date
22/02/2022
KYC Information
No
Audit Information
None
Team Information
Team leader: None
Team leader contact: None
Contract source code
{"Context.sol":{"content":"// SPDX-License-Identifier: MIT\r\n\r\npragma solidity ^0.8.6;\r\n\r\n/*\r\n * @dev Provides information about the current execution context, including the\r\n * sender of the transaction and its data. While these are generally available\r\n * via msg.sender and msg.data, they should not be accessed in such a direct\r\n * manner, since when dealing with meta-transactions the account sending and\r\n * paying for execution may not be the actual sender (as far as an application\r\n * is concerned).\r\n *\r\n * This contract is only required for intermediate, library-like contracts.\r\n */\r\nabstract contract Context {\r\n function _msgSender() internal view virtual returns (address) {\r\n return msg.sender;\r\n }\r\n\r\n function _msgData() internal view virtual returns (bytes calldata) {\r\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\r\n return msg.data;\r\n }\r\n}"},"DividendPayingToken.sol":{"content":"// SPDX-License-Identifier: MIT\r\n\r\npragma solidity ^0.8.6;\r\n\r\nimport \"./ERC20.sol\";\r\nimport \"./SafeMath.sol\";\r\nimport \"./DividendPayingTokenInterface.sol\";\r\nimport \"./DividendPayingTokenOptionalInterface.sol\";\r\n\r\n\r\n/// @title Dividend-Paying Token\r\n/// @author Roger Wu (https://github.com/roger-wu)\r\n/// @dev A mintable ERC20 token that allows anyone to pay and distribute ether\r\n/// to token holders as dividends and allows token holders to withdraw their dividends.\r\n/// Reference: the source code of PoWH3D: https://etherscan.io/address/0xB3775fB83F7D12A36E0475aBdD1FCA35c091efBe#code\r\ncontract DividendPayingToken is ERC20, DividendPayingTokenInterface, DividendPayingTokenOptionalInterface {\r\n using SafeMath for uint256;\r\n using SafeMathUint for uint256;\r\n using SafeMathInt for int256;\r\n\r\n // With `magnitude`, we can properly distribute dividends even if the amount of received ether is small.\r\n // For more discussion about choosing the value of `magnitude`,\r\n // see https://github.com/ethereum/EIPs/issues/1726#issuecomment-472352728\r\n uint256 constant internal magnitude = 2**128;\r\n\r\n uint256 internal magnifiedDividendPerShare;\r\n\r\n // About dividendCorrection:\r\n // If the token balance of a `_user` is never changed, the dividend of `_user` can be computed with:\r\n // `dividendOf(_user) = dividendPerShare * balanceOf(_user)`.\r\n // When `balanceOf(_user)` is changed (via minting/burning/transferring tokens),\r\n // `dividendOf(_user)` should not be changed,\r\n // but the computed value of `dividendPerShare * balanceOf(_user)` is changed.\r\n // To keep the `dividendOf(_user)` unchanged, we add a correction term:\r\n // `dividendOf(_user) = dividendPerShare * balanceOf(_user) dividendCorrectionOf(_user)`,\r\n // where `dividendCorrectionOf(_user)` is updated whenever `balanceOf(_user)` is changed:\r\n // `dividendCorrectionOf(_user) = dividendPerShare * (old balanceOf(_user)) - (new balanceOf(_user))`.\r\n // So now `dividendOf(_user)` returns the same value before and after `balanceOf(_user)` is changed.\r\n mapping(address =\u003e int256) internal magnifiedDividendCorrections;\r\n mapping(address =\u003e uint256) internal withdrawnDividends;\r\n\r\n uint256 public totalDividendsDistributed;\r\n\r\n constructor(string memory _name, string memory _symbol) ERC20(_name, _symbol) {\r\n\r\n }\r\n\r\n /// @dev Distributes dividends whenever ether is paid to this contract.\r\n receive() external payable {\r\n distributeDividends();\r\n }\r\n\r\n /// @notice Distributes ether to token holders as dividends.\r\n /// @dev It reverts if the total supply of tokens is 0.\r\n /// It emits the `DividendsDistributed` event if the amount of received ether is greater than 0.\r\n /// About undistributed ether:\r\n /// In each distribution, there is a small amount of ether not distributed,\r\n /// the magnified amount of which is\r\n /// `(msg.value * magnitude) % totalSupply()`.\r\n /// With a well-chosen `magnitude`, the amount of undistributed ether\r\n /// (de-magnified) in a distribution can be less than 1 wei.\r\n /// We can actually keep track of the undistributed ether in a distribution\r\n /// and try to distribute it in the next distribution,\r\n /// but keeping track of such data on-chain costs much more than\r\n /// the saved ether, so we don\u0027t do that.\r\n function distributeDividends() public override payable {\r\n require(totalSupply() \u003e 0);\r\n\r\n if (msg.value \u003e 0) {\r\n magnifiedDividendPerShare = magnifiedDividendPerShare.add(\r\n (msg.value).mul(magnitude) / totalSupply()\r\n );\r\n emit DividendsDistributed(msg.sender, msg.value);\r\n\r\n totalDividendsDistributed = totalDividendsDistributed.add(msg.value);\r\n }\r\n }\r\n\r\n /// @notice Withdraws the ether distributed to the sender.\r\n /// @dev It emits a `DividendWithdrawn` event if the amount of withdrawn ether is greater than 0.\r\n function withdrawDividend() public virtual override {\r\n _withdrawDividendOfUser(payable(msg.sender));\r\n }\r\n\r\n /// @notice Withdraws the ether distributed to the sender.\r\n /// @dev It emits a `DividendWithdrawn` event if the amount of withdrawn ether is greater than 0.\r\n function _withdrawDividendOfUser(address payable user) internal returns (uint256) {\r\n uint256 _withdrawableDividend = withdrawableDividendOf(user);\r\n if (_withdrawableDividend \u003e 0) {\r\n withdrawnDividends[user] = withdrawnDividends[user].add(_withdrawableDividend);\r\n emit DividendWithdrawn(user, _withdrawableDividend);\r\n (bool success,) = user.call{value: _withdrawableDividend, gas: 3000}(\"\");\r\n\r\n if(!success) {\r\n withdrawnDividends[user] = withdrawnDividends[user].sub(_withdrawableDividend);\r\n return 0;\r\n }\r\n\r\n return _withdrawableDividend;\r\n }\r\n\r\n return 0;\r\n }\r\n\r\n\r\n /// @notice View the amount of dividend in wei that an address can withdraw.\r\n /// @param _owner The address of a token holder.\r\n /// @return The amount of dividend in wei that `_owner` can withdraw.\r\n function dividendOf(address _owner) public view override returns(uint256) {\r\n return withdrawableDividendOf(_owner);\r\n }\r\n\r\n /// @notice View the amount of dividend in wei that an address can withdraw.\r\n /// @param _owner The address of a token holder.\r\n /// @return The amount of dividend in wei that `_owner` can withdraw.\r\n function withdrawableDividendOf(address _owner) public view override returns(uint256) {\r\n return accumulativeDividendOf(_owner).sub(withdrawnDividends[_owner]);\r\n }\r\n\r\n /// @notice View the amount of dividend in wei that an address has withdrawn.\r\n /// @param _owner The address of a token holder.\r\n /// @return The amount of dividend in wei that `_owner` has withdrawn.\r\n function withdrawnDividendOf(address _owner) public view override returns(uint256) {\r\n return withdrawnDividends[_owner];\r\n }\r\n\r\n\r\n /// @notice View the amount of dividend in wei that an address has earned in total.\r\n /// @dev accumulativeDividendOf(_owner) = withdrawableDividendOf(_owner) withdrawnDividendOf(_owner)\r\n /// = (magnifiedDividendPerShare * balanceOf(_owner) magnifiedDividendCorrections[_owner]) / magnitude\r\n /// @param _owner The address of a token holder.\r\n /// @return The amount of dividend in wei that `_owner` has earned in total.\r\n function accumulativeDividendOf(address _owner) public view override returns(uint256) {\r\n return magnifiedDividendPerShare.mul(balanceOf(_owner)).toInt256Safe()\r\n .add(magnifiedDividendCorrections[_owner]).toUint256Safe() / magnitude;\r\n }\r\n\r\n /// @dev Internal function that transfer tokens from one address to another.\r\n /// Update magnifiedDividendCorrections to keep dividends unchanged.\r\n /// @param from The address to transfer from.\r\n /// @param to The address to transfer to.\r\n /// @param value The amount to be transferred.\r\n function _transfer(address from, address to, uint256 value) internal virtual override {\r\n require(false);\r\n\r\n int256 _magCorrection = magnifiedDividendPerShare.mul(value).toInt256Safe();\r\n magnifiedDividendCorrections[from] = magnifiedDividendCorrections[from].add(_magCorrection);\r\n magnifiedDividendCorrections[to] = magnifiedDividendCorrections[to].sub(_magCorrection);\r\n }\r\n\r\n /// @dev Internal function that mints tokens to an account.\r\n /// Update magnifiedDividendCorrections to keep dividends unchanged.\r\n /// @param account The account that will receive the created tokens.\r\n /// @param value The amount that will be created.\r\n function _mint(address account, uint256 value) internal override {\r\n super._mint(account, value);\r\n\r\n magnifiedDividendCorrections[account] = magnifiedDividendCorrections[account]\r\n .sub( (magnifiedDividendPerShare.mul(value)).toInt256Safe() );\r\n }\r\n\r\n /// @dev Internal function that burns an amount of the token of a given account.\r\n /// Update magnifiedDividendCorrections to keep dividends unchanged.\r\n /// @param account The account whose tokens will be burnt.\r\n /// @param value The amount that will be burnt.\r\n function _burn(address account, uint256 value) internal override {\r\n super._burn(account, value);\r\n\r\n magnifiedDividendCorrections[account] = magnifiedDividendCorrections[account]\r\n .add( (magnifiedDividendPerShare.mul(value)).toInt256Safe() );\r\n }\r\n\r\n function _setBalance(address account, uint256 newBalance) internal {\r\n uint256 currentBalance = balanceOf(account);\r\n\r\n if(newBalance \u003e currentBalance) {\r\n uint256 mintAmount = newBalance.sub(currentBalance);\r\n _mint(account, mintAmount);\r\n } else if(newBalance \u003c currentBalance) {\r\n uint256 burnAmount = currentBalance.sub(newBalance);\r\n _burn(account, burnAmount);\r\n }\r\n }\r\n}\r\n"},"DividendPayingTokenInterface.sol":{"content":"// SPDX-License-Identifier: MIT\r\n\r\npragma solidity ^0.8.6;\r\n\r\n\r\n/// @title Dividend-Paying Token Interface\r\n/// @author Roger Wu (https://github.com/roger-wu)\r\n/// @dev An interface for a dividend-paying token contract.\r\ninterface DividendPayingTokenInterface {\r\n /// @notice View the amount of dividend in wei that an address can withdraw.\r\n /// @param _owner The address of a token holder.\r\n /// @return The amount of dividend in wei that `_owner` can withdraw.\r\n function dividendOf(address _owner) external view returns(uint256);\r\n\r\n /// @notice Distributes ether to token holders as dividends.\r\n /// @dev SHOULD distribute the paid ether to token holders as dividends.\r\n /// SHOULD NOT directly transfer ether to token holders in this function.\r\n /// MUST emit a `DividendsDistributed` event when the amount of distributed ether is greater than 0.\r\n function distributeDividends() external payable;\r\n\r\n /// @notice Withdraws the ether distributed to the sender.\r\n /// @dev SHOULD transfer `dividendOf(msg.sender)` wei to `msg.sender`, and `dividendOf(msg.sender)` SHOULD be 0 after the transfer.\r\n /// MUST emit a `DividendWithdrawn` event if the amount of ether transferred is greater than 0.\r\n function withdrawDividend() external;\r\n\r\n /// @dev This event MUST emit when ether is distributed to token holders.\r\n /// @param from The address which sends ether to this contract.\r\n /// @param weiAmount The amount of distributed ether in wei.\r\n event DividendsDistributed(\r\n address indexed from,\r\n uint256 weiAmount\r\n );\r\n\r\n /// @dev This event MUST emit when an address withdraws their dividend.\r\n /// @param to The address which withdraws ether from this contract.\r\n /// @param weiAmount The amount of withdrawn ether in wei.\r\n event DividendWithdrawn(\r\n address indexed to,\r\n uint256 weiAmount\r\n );\r\n}\r\n"},"DividendPayingTokenOptionalInterface.sol":{"content":"// SPDX-License-Identifier: MIT\r\n\r\npragma solidity ^0.8.6;\r\n\r\n\r\n/// @title Dividend-Paying Token Optional Interface\r\n/// @author Roger Wu (https://github.com/roger-wu)\r\n/// @dev OPTIONAL functions for a dividend-paying token contract.\r\ninterface DividendPayingTokenOptionalInterface {\r\n /// @notice View the amount of dividend in wei that an address can withdraw.\r\n /// @param _owner The address of a token holder.\r\n /// @return The amount of dividend in wei that `_owner` can withdraw.\r\n function withdrawableDividendOf(address _owner) external view returns(uint256);\r\n\r\n /// @notice View the amount of dividend in wei that an address has withdrawn.\r\n /// @param _owner The address of a token holder.\r\n /// @return The amount of dividend in wei that `_owner` has withdrawn.\r\n function withdrawnDividendOf(address _owner) external view returns(uint256);\r\n\r\n /// @notice View the amount of dividend in wei that an address has earned in total.\r\n /// @dev accumulativeDividendOf(_owner) = withdrawableDividendOf(_owner) withdrawnDividendOf(_owner)\r\n /// @param _owner The address of a token holder.\r\n /// @return The amount of dividend in wei that `_owner` has earned in total.\r\n function accumulativeDividendOf(address _owner) external view returns(uint256);\r\n}"},"ERC20.sol":{"content":"// SPDX-License-Identifier: MIT\r\n\r\npragma solidity ^0.8.6;\r\n\r\nimport \"./IERC20.sol\";\r\nimport \"./Context.sol\";\r\nimport \"./SafeMath.sol\";\r\n\r\n/**\r\n * @dev Implementation of the {IERC20} interface.\r\n *\r\n * This implementation is agnostic to the way tokens are created. This means\r\n * that a supply mechanism has to be added in a derived contract using {_mint}.\r\n * For a generic mechanism see {ERC20PresetMinterPauser}.\r\n *\r\n * TIP: For a detailed writeup see our guide\r\n * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How\r\n * to implement supply mechanisms].\r\n *\r\n * We have followed general OpenZeppelin guidelines: functions revert instead\r\n * of returning `false` on failure. This behavior is nonetheless conventional\r\n * and does not conflict with the expectations of ERC20 applications.\r\n *\r\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\r\n * This allows applications to reconstruct the allowance for all accounts just\r\n * by listening to said events. Other implementations of the EIP may not emit\r\n * these events, as it isn\u0027t required by the specification.\r\n *\r\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\r\n * functions have been added to mitigate the well-known issues around setting\r\n * allowances. See {IERC20-approve}.\r\n */\r\ncontract ERC20 is Context, IERC20, IERC20Metadata {\r\n using SafeMath for uint256;\r\n\r\n mapping(address =\u003e uint256) private _balances;\r\n\r\n mapping(address =\u003e mapping(address =\u003e uint256)) private _allowances;\r\n\r\n uint256 private _totalSupply;\r\n\r\n string private _name;\r\n string private _symbol;\r\n\r\n /**\r\n * @dev Sets the values for {name} and {symbol}.\r\n *\r\n * The default value of {decimals} is 18. To select a different value for\r\n * {decimals} you should overload it.\r\n *\r\n * All two of these values are immutable: they can only be set once during\r\n * construction.\r\n */\r\n constructor(string memory name_, string memory symbol_) {\r\n _name = name_;\r\n _symbol = symbol_;\r\n }\r\n\r\n /**\r\n * @dev Returns the name of the token.\r\n */\r\n function name() public view virtual override returns (string memory) {\r\n return _name;\r\n }\r\n\r\n /**\r\n * @dev Returns the symbol of the token, usually a shorter version of the\r\n * name.\r\n */\r\n function symbol() public view virtual override returns (string memory) {\r\n return _symbol;\r\n }\r\n\r\n /**\r\n * @dev Returns the number of decimals used to get its user representation.\r\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\r\n * be displayed to a user as `5,05` (`505 / 10 ** 2`).\r\n *\r\n * Tokens usually opt for a value of 18, imitating the relationship between\r\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\r\n * overridden;\r\n *\r\n * NOTE: This information is only used for _display_ purposes: it in\r\n * no way affects any of the arithmetic of the contract, including\r\n * {IERC20-balanceOf} and {IERC20-transfer}.\r\n */\r\n function decimals() public view virtual override returns (uint8) {\r\n return 9;\r\n }\r\n\r\n /**\r\n * @dev See {IERC20-totalSupply}.\r\n */\r\n function totalSupply() public view virtual override returns (uint256) {\r\n return _totalSupply;\r\n }\r\n\r\n /**\r\n * @dev See {IERC20-balanceOf}.\r\n */\r\n function balanceOf(address account) public view virtual override returns (uint256) {\r\n return _balances[account];\r\n }\r\n\r\n /**\r\n * @dev See {IERC20-transfer}.\r\n *\r\n * Requirements:\r\n *\r\n * - `recipient` cannot be the zero address.\r\n * - the caller must have a balance of at least `amount`.\r\n */\r\n function transfer(address recipient, uint256 amount) public virtual override returns (bool) {\r\n _transfer(_msgSender(), recipient, amount);\r\n return true;\r\n }\r\n\r\n /**\r\n * @dev See {IERC20-allowance}.\r\n */\r\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\r\n return _allowances[owner][spender];\r\n }\r\n\r\n /**\r\n * @dev See {IERC20-approve}.\r\n *\r\n * Requirements:\r\n *\r\n * - `spender` cannot be the zero address.\r\n */\r\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\r\n _approve(_msgSender(), spender, amount);\r\n return true;\r\n }\r\n\r\n /**\r\n * @dev See {IERC20-transferFrom}.\r\n *\r\n * Emits an {Approval} event indicating the updated allowance. This is not\r\n * required by the EIP. See the note at the beginning of {ERC20}.\r\n *\r\n * Requirements:\r\n *\r\n * - `sender` and `recipient` cannot be the zero address.\r\n * - `sender` must have a balance of at least `amount`.\r\n * - the caller must have allowance for ``sender``\u0027s tokens of at least\r\n * `amount`.\r\n */\r\n function transferFrom(\r\n address sender,\r\n address recipient,\r\n uint256 amount\r\n ) public virtual override returns (bool) {\r\n _transfer(sender, recipient, amount);\r\n _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, \"ERC20: transfer amount exceeds allowance\"));\r\n return true;\r\n }\r\n\r\n /**\r\n * @dev Atomically increases the allowance granted to `spender` by the caller.\r\n *\r\n * This is an alternative to {approve} that can be used as a mitigation for\r\n * problems described in {IERC20-approve}.\r\n *\r\n * Emits an {Approval} event indicating the updated allowance.\r\n *\r\n * Requirements:\r\n *\r\n * - `spender` cannot be the zero address.\r\n */\r\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\r\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));\r\n return true;\r\n }\r\n\r\n /**\r\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\r\n *\r\n * This is an alternative to {approve} that can be used as a mitigation for\r\n * problems described in {IERC20-approve}.\r\n *\r\n * Emits an {Approval} event indicating the updated allowance.\r\n *\r\n * Requirements:\r\n *\r\n * - `spender` cannot be the zero address.\r\n * - `spender` must have allowance for the caller of at least\r\n * `subtractedValue`.\r\n */\r\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\r\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, \"ERC20: decreased allowance below zero\"));\r\n return true;\r\n }\r\n\r\n /**\r\n * @dev Moves tokens `amount` from `sender` to `recipient`.\r\n *\r\n * This is internal function is equivalent to {transfer}, and can be used to\r\n * e.g. implement automatic token fees, slashing mechanisms, etc.\r\n *\r\n * Emits a {Transfer} event.\r\n *\r\n * Requirements:\r\n *\r\n * - `sender` cannot be the zero address.\r\n * - `recipient` cannot be the zero address.\r\n * - `sender` must have a balance of at least `amount`.\r\n */\r\n function _transfer(\r\n address sender,\r\n address recipient,\r\n uint256 amount\r\n ) internal virtual {\r\n require(sender != address(0), \"ERC20: transfer from the zero address\");\r\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\r\n\r\n _beforeTokenTransfer(sender, recipient, amount);\r\n\r\n _balances[sender] = _balances[sender].sub(amount, \"ERC20: transfer amount exceeds balance\");\r\n _balances[recipient] = _balances[recipient].add(amount);\r\n emit Transfer(sender, recipient, amount);\r\n }\r\n\r\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\r\n * the total supply.\r\n *\r\n * Emits a {Transfer} event with `from` set to the zero address.\r\n *\r\n * Requirements:\r\n *\r\n * - `account` cannot be the zero address.\r\n */\r\n function _mint(address account, uint256 amount) internal virtual {\r\n require(account != address(0), \"ERC20: mint to the zero address\");\r\n\r\n _beforeTokenTransfer(address(0), account, amount);\r\n\r\n _totalSupply = _totalSupply.add(amount);\r\n _balances[account] = _balances[account].add(amount);\r\n emit Transfer(address(0), account, amount);\r\n }\r\n\r\n /**\r\n * @dev Destroys `amount` tokens from `account`, reducing the\r\n * total supply.\r\n *\r\n * Emits a {Transfer} event with `to` set to the zero address.\r\n *\r\n * Requirements:\r\n *\r\n * - `account` cannot be the zero address.\r\n * - `account` must have at least `amount` tokens.\r\n */\r\n function _burn(address account, uint256 amount) internal virtual {\r\n require(account != address(0), \"ERC20: burn from the zero address\");\r\n\r\n _beforeTokenTransfer(account, address(0), amount);\r\n\r\n _balances[account] = _balances[account].sub(amount, \"ERC20: burn amount exceeds balance\");\r\n _totalSupply = _totalSupply.sub(amount);\r\n emit Transfer(account, address(0), amount);\r\n }\r\n\r\n /**\r\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\r\n *\r\n * This internal function is equivalent to `approve`, and can be used to\r\n * e.g. set automatic allowances for certain subsystems, etc.\r\n *\r\n * Emits an {Approval} event.\r\n *\r\n * Requirements:\r\n *\r\n * - `owner` cannot be the zero address.\r\n * - `spender` cannot be the zero address.\r\n */\r\n function _approve(\r\n address owner,\r\n address spender,\r\n uint256 amount\r\n ) internal virtual {\r\n require(owner != address(0), \"ERC20: approve from the zero address\");\r\n require(spender != address(0), \"ERC20: approve to the zero address\");\r\n\r\n _allowances[owner][spender] = amount;\r\n emit Approval(owner, spender, amount);\r\n }\r\n\r\n /**\r\n * @dev Hook that is called before any transfer of tokens. This includes\r\n * minting and burning.\r\n *\r\n * Calling conditions:\r\n *\r\n * - when `from` and `to` are both non-zero, `amount` of ``from``\u0027s tokens\r\n * will be to transferred to `to`.\r\n * - when `from` is zero, `amount` tokens will be minted for `to`.\r\n * - when `to` is zero, `amount` of ``from``\u0027s tokens will be burned.\r\n * - `from` and `to` are never both zero.\r\n *\r\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\r\n */\r\n function _beforeTokenTransfer(\r\n address from,\r\n address to,\r\n uint256 amount\r\n ) internal virtual {}\r\n}"},"FlokiVader.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.6;\n\nimport \"./DividendPayingToken.sol\";\nimport \"./IterableMapping.sol\";\nimport \"./Ownable.sol\";\nimport \"./IDex.sol\";\nimport \"./IERC20.sol\";\n\n\nlibrary Address{\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance \u003e= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n}\n\n\ncontract FLOKIVADER is ERC20, Ownable {\n using Address for address payable;\n\n IRouter public router;\n address public pair;\n\n bool private swapping;\n bool public swapEnabled = true;\n \n FLOKIVADERDividendTracker public dividendTracker;\n\n address public marketingWallet = 0x91146d6D4bF42A12ccE6e97467F2E9F48f42a974 ;\n address public charityWallet = 0x850ccE9010f6f4991172B6E5A6c5A5052E44aDe2;\n address public autoBoostWallet = 0xC9e212BE0C405a298CC8B4abb624662F65DF52Ad;\n\n uint256 public swapTokensAtAmount = 200_000_000 * 10**9;\n\n \n ///////////////\n // Fees //\n ///////////////\n \n struct Taxes {\n uint256 rewards;\n uint256 marketing;\n uint256 autoBoost;\n uint256 charity;\n }\n\n Taxes public buyTaxes = Taxes(2,4,5,1);\n Taxes public sellTaxes = Taxes(2,6,6,1);\n Taxes public transferTaxes = Taxes(0,5,0,0);\n\n uint256 public totalBuyTax = 12;\n uint256 public totalSellTax = 15;\n uint256 public totalTransferTax = 5;\n\n // use by default 300,000 gas to process auto-claiming dividends\n uint256 public gasForProcessing = 300000;\n \n mapping (address =\u003e bool) private _isExcludedFromFees;\n mapping (address =\u003e bool) public automatedMarketMakerPairs;\n\n ///////////////\n // Events //\n ///////////////\n \n event ExcludeFromFees(address indexed account, bool isExcluded);\n event ExcludeMultipleAccountsFromFees(address[] accounts, bool isExcluded);\n event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value);\n event GasForProcessingUpdated(uint256 indexed newValue, uint256 indexed oldValue);\n event SendDividends(uint256 tokensSwapped,uint256 amount);\n event ProcessedDividendTracker(uint256 iterations,uint256 claims,uint256 lastProcessedIndex,bool indexed automatic,uint256 gas,address indexed processor);\n\n\n constructor() ERC20(\"Floki Vader\", \"FLOKIVADER\") {\n\n \tdividendTracker = new FLOKIVADERDividendTracker();\n\n \tIRouter _router = IRouter(0x10ED43C718714eb63d5aA57B78B54704E256024E);\n address _pair = IFactory(_router.factory()).createPair(address(this), _router.WETH());\n\n router = _router;\n pair = _pair;\n\n _setAutomatedMarketMakerPair(_pair, true);\n\n\n // exclude from receiving dividends\n dividendTracker.excludeFromDividends(address(dividendTracker), true);\n dividendTracker.excludeFromDividends(address(this), true);\n dividendTracker.excludeFromDividends(owner(), true);\n dividendTracker.excludeFromDividends(address(0xdead), true);\n dividendTracker.excludeFromDividends(address(_router), true);\n\n // exclude from paying fees or having max transaction amount\n excludeFromFees(owner(), true);\n excludeFromFees(address(this), true);\n excludeFromFees(marketingWallet, true);\n excludeFromFees(charityWallet, true);\n excludeFromFees(autoBoostWallet, true);\n\n /*\n _mint is an internal function in ERC20.sol that is only called here,\n and CANNOT be called ever again\n */\n _mint(owner(), 1e15* (10**9));\n }\n\n receive() external payable {}\n function updateDividendTracker(address newAddress) public onlyOwner {\n FLOKIVADERDividendTracker newDividendTracker = FLOKIVADERDividendTracker(payable(newAddress));\n\n newDividendTracker.excludeFromDividends(address(newDividendTracker), true);\n newDividendTracker.excludeFromDividends(address(this), true);\n newDividendTracker.excludeFromDividends(owner(), true);\n newDividendTracker.excludeFromDividends(address(router), true);\n dividendTracker = newDividendTracker;\n }\n\n function processDividendTracker(uint256 gas) external {\n\t\t(uint256 iterations, uint256 claims, uint256 lastProcessedIndex) = dividendTracker.process(gas);\n\t\temit ProcessedDividendTracker(iterations, claims, lastProcessedIndex, false, gas, tx.origin);\n }\n \n /// @notice Manual claim the dividends after claimWait is passed\n /// This can be useful during low volume days.\n function claim() external {\n\t\tdividendTracker.processAccount(payable(msg.sender), false);\n }\n \n /// @notice Withdraw tokens sent by mistake.\n /// @param tokenAddress The address of the token to withdraw\n function rescueBEP20Tokens(address tokenAddress) external onlyOwner{\n IERC20(tokenAddress).transfer(msg.sender, IERC20(tokenAddress).balanceOf(address(this)));\n }\n \n /// @notice Send remaining BNB to marketingWallet\n /// @dev It will send all BNB to marketingWallet\n function forceSend() external {\n uint256 BNBbalance = address(this).balance;\n payable(marketingWallet).sendValue(BNBbalance);\n }\n \n function updateRouter(address newRouter) external onlyOwner{\n router = IRouter(newRouter);\n }\n \n \n /////////////////////////////////\n // Exclude / Include functions //\n /////////////////////////////////\n\n function excludeFromFees(address account, bool excluded) public onlyOwner {\n require(_isExcludedFromFees[account] != excluded, \"FLOKIVADER: Account is already the value of \u0027excluded\u0027\");\n _isExcludedFromFees[account] = excluded;\n\n emit ExcludeFromFees(account, excluded);\n }\n\n function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {\n for(uint256 i = 0; i \u003c accounts.length; i ) {\n _isExcludedFromFees[accounts[i]] = excluded;\n }\n emit ExcludeMultipleAccountsFromFees(accounts, excluded);\n }\n\n /// @dev \"true\" to exlcude, \"false\" to include\n function excludeFromDividends(address account, bool value) external onlyOwner{\n\t dividendTracker.excludeFromDividends(account, value);\n\t}\n\n\n ///////////////////////\n // Setter Functions //\n ///////////////////////\n\n\n function setMarketingWallet(address newWallet) external onlyOwner{\n marketingWallet = newWallet;\n }\n\n function setCharityWallet(address newWallet) external onlyOwner{\n charityWallet = newWallet;\n }\n\n function setAutoBoostWallet(address newWallet) external onlyOwner{\n autoBoostWallet = newWallet;\n }\n\n /// @notice Update the threshold to swap tokens for liquidity,\n /// marketing and dividends.\n function setSwapTokensAtAmount(uint256 amount) external onlyOwner{\n swapTokensAtAmount = amount * 10**9;\n }\n\n function setBuyTaxes(uint256 _rewards, uint256 _marketing, uint256 _autoBoost, uint256 _charity) external onlyOwner{\n buyTaxes = Taxes(_rewards, _marketing, _autoBoost, _charity);\n totalBuyTax = _rewards _marketing _autoBoost _charity;\n }\n\n function setTransferTaxes(uint256 _rewards, uint256 _marketing, uint256 _autoBoost, uint256 _charity) external onlyOwner{\n transferTaxes = Taxes(_rewards, _marketing, _autoBoost, _charity);\n totalTransferTax = _rewards _marketing _autoBoost _charity;\n }\n\n function setSellTaxes(uint256 _rewards, uint256 _marketing, uint256 _autoBoost,uint256 _charity) external onlyOwner{\n sellTaxes = Taxes(_rewards, _marketing, _autoBoost, _charity);\n totalSellTax = _rewards _marketing _autoBoost _charity;\n }\n\n /// @notice Enable or disable internal swaps\n /// @dev Set \"true\" to enable internal swaps for liquidity, marketing and dividends\n function setSwapEnabled(bool _enabled) external onlyOwner{\n swapEnabled = _enabled;\n }\n\n\n /// @dev Set new pairs created due to listing in new DEX\n function setAutomatedMarketMakerPair(address newPair, bool value) external onlyOwner {\n _setAutomatedMarketMakerPair(newPair, value);\n }\n \n function setMinBalanceForDividends(uint256 amount) external onlyOwner{\n dividendTracker.setMinBalanceForDividends(amount);\n }\n \n function _setAutomatedMarketMakerPair(address newPair, bool value) private {\n require(automatedMarketMakerPairs[newPair] != value, \"FLOKIVADER: Automated market maker pair is already set to that value\");\n automatedMarketMakerPairs[newPair] = value;\n\n if(value) {\n dividendTracker.excludeFromDividends(newPair, true);\n }\n\n emit SetAutomatedMarketMakerPair(newPair, value);\n }\n\n /// @notice Update the gasForProcessing needed to auto-distribute rewards\n /// @param newValue The new amount of gas needed\n /// @dev The amount should not be greater than 500k to avoid expensive transactions\n function setGasForProcessing(uint256 newValue) external onlyOwner {\n require(newValue \u003e= 200000 \u0026\u0026 newValue \u003c= 500000, \"FLOKIVADER: gasForProcessing must be between 200,000 and 500,000\");\n require(newValue != gasForProcessing, \"FLOKIVADER: Cannot update gasForProcessing to same value\");\n emit GasForProcessingUpdated(newValue, gasForProcessing);\n gasForProcessing = newValue;\n }\n\n /// @dev Update the dividendTracker claimWait\n function setClaimWait(uint256 claimWait) external onlyOwner {\n dividendTracker.updateClaimWait(claimWait);\n }\n\n //////////////////////\n // Getter Functions //\n //////////////////////\n\n function getClaimWait() external view returns(uint256) {\n return dividendTracker.claimWait();\n }\n\n function getTotalDividendsDistributed() external view returns (uint256) {\n return dividendTracker.totalDividendsDistributed();\n }\n\n function isExcludedFromFees(address account) public view returns(bool) {\n return _isExcludedFromFees[account];\n }\n\n function withdrawableDividendOf(address account) public view returns(uint256) {\n \treturn dividendTracker.withdrawableDividendOf(account);\n \t}\n\n \tfunction dividendTokenBalanceOf(address account) public view returns (uint256) {\n \t\treturn dividendTracker.balanceOf(account);\n \t}\n\n function getAccountDividendsInfo(address account)\n external view returns (\n address,\n int256,\n int256,\n uint256,\n uint256,\n uint256,\n uint256,\n uint256) {\n return dividendTracker.getAccount(account);\n }\n\n\tfunction getAccountDividendsInfoAtIndex(uint256 index)\n external view returns (\n address,\n int256,\n int256,\n uint256,\n uint256,\n uint256,\n uint256,\n uint256) {\n \treturn dividendTracker.getAccountAtIndex(index);\n }\n\n function getLastProcessedIndex() external view returns(uint256) {\n \treturn dividendTracker.getLastProcessedIndex();\n }\n\n function getNumberOfDividendTokenHolders() external view returns(uint256) {\n return dividendTracker.getNumberOfTokenHolders();\n }\n\n ////////////////////////\n // Transfer Functions //\n ////////////////////////\n \n function airdropTokens(address[] memory accounts, uint256[] memory amounts) external onlyOwner{\n require(accounts.length == amounts.length, \"Arrays must have same size\");\n for(uint256 i; i\u003c accounts.length; i ){\n super._transfer(msg.sender, accounts[i], amounts[i]);\n }\n }\n\n function _transfer(address from, address to, uint256 amount) internal override {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n if(amount == 0) {\n super._transfer(from, to, 0);\n return;\n }\n \n\t\tuint256 contractTokenBalance = balanceOf(address(this));\n bool canSwap = contractTokenBalance \u003e= swapTokensAtAmount;\n\n if( canSwap \u0026\u0026 !swapping \u0026\u0026 swapEnabled \u0026\u0026 !automatedMarketMakerPairs[from] \u0026\u0026 !_isExcludedFromFees[from] \u0026\u0026 !_isExcludedFromFees[to]) {\n swapping = true;\n\n bool isSell;\n if(automatedMarketMakerPairs[to]){ isSell = true;}\n\n if(isSell \u0026\u0026 totalSellTax \u003e 0) swapAndLiquify(swapTokensAtAmount, true);\n else if(!isSell \u0026\u0026 totalTransferTax \u003e 0) swapAndLiquify(swapTokensAtAmount, false);\n\n swapping = false;\n }\n\n bool takeFee = !swapping;\n\n // if any account belongs to _isExcludedFromFee account then remove the fee\n if(_isExcludedFromFees[from] || _isExcludedFromFees[to]) {\n takeFee = false;\n }\n\n if(takeFee) {\n uint256 feeAmt;\n \n if(automatedMarketMakerPairs[to]) feeAmt = amount * totalSellTax / 100;\n else if(automatedMarketMakerPairs[from]) feeAmt = amount * totalBuyTax / 100;\n else feeAmt = amount * totalTransferTax / 100;\n\n amount = amount - feeAmt;\n super._transfer(from, address(this), feeAmt);\n }\n super._transfer(from, to, amount);\n\n try dividendTracker.setBalance(from, balanceOf(from)) {} catch {}\n try dividendTracker.setBalance(to, balanceOf(to)) {} catch {}\n\n if(!swapping) {\n\t \tuint256 gas = gasForProcessing;\n\n\t \ttry dividendTracker.process(gas) returns (uint256 iterations, uint256 claims, uint256 lastProcessedIndex) {\n\t \t\temit ProcessedDividendTracker(iterations, claims, lastProcessedIndex, true, gas, tx.origin);\n\t \t}\n\t \tcatch {}\n }\n }\n\n function swapAndLiquify(uint256 tokens, bool isSell) private {\n uint256 initialBalance = address(this).balance;\n swapTokensForBNB(tokens);\n uint256 deltaBalance = address(this).balance - initialBalance;\n\n Taxes memory temp;\n uint256 totalTax;\n if(isSell) { temp = sellTaxes; totalTax = totalSellTax; }\n else { temp = transferTaxes; totalTax = totalTransferTax; }\n\n // Send BNB to marketingWallet\n uint256 marketingWalletAmt = deltaBalance * temp.marketing / totalTax;\n if(marketingWalletAmt \u003e 0){\n payable(marketingWallet).sendValue(marketingWalletAmt);\n }\n\n // Send BNB to charity\n uint256 charityAmt = deltaBalance * temp.charity / totalTax;\n if(charityAmt \u003e 0){\n payable(charityWallet).sendValue(charityAmt);\n }\n\n // Send BNB to autoboost\n uint256 autoBoostAmt = deltaBalance * temp.autoBoost / totalTax;\n if(autoBoostAmt \u003e 0){\n payable(autoBoostWallet).sendValue(autoBoostAmt);\n }\n\n // Send BNB to rewards\n uint256 dividends = deltaBalance * temp.rewards / totalTax;\n if(dividends \u003e 0){\n (bool success,) = address(dividendTracker).call{value: dividends}(\"\");\n if(success)emit SendDividends(tokens, dividends);\n }\n \n\n }\n\n function swapTokensForBNB(uint256 tokenAmount) private {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = router.WETH();\n\n _approve(address(this), address(router), tokenAmount);\n\n // make the swap\n router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0, // accept any amount of ETH\n path,\n address(this),\n block.timestamp\n );\n\n }\n\n function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {\n\n // approve token transfer to cover all possible scenarios\n _approve(address(this), address(router), tokenAmount);\n\n // add the liquidity\n router.addLiquidityETH{value: ethAmount}(\n address(this),\n tokenAmount,\n 0, // slippage is unavoidable\n 0, // slippage is unavoidable\n marketingWallet,\n block.timestamp\n );\n\n }\n\n}\n\ncontract FLOKIVADERDividendTracker is Ownable, DividendPayingToken {\n using SafeMath for uint256;\n using SafeMathInt for int256;\n using IterableMapping for IterableMapping.Map;\n\n IterableMapping.Map private tokenHoldersMap;\n uint256 public lastProcessedIndex;\n\n mapping (address =\u003e bool) public excludedFromDividends;\n\n mapping (address =\u003e uint256) public lastClaimTimes;\n \n uint256 public claimWait;\n uint256 public minimumTokenBalanceForDividends;\n\n event ExcludeFromDividends(address indexed account, bool value);\n event ClaimWaitUpdated(uint256 indexed newValue, uint256 indexed oldValue);\n\n event Claim(address indexed account, uint256 amount, bool indexed automatic);\n\n constructor() DividendPayingToken(\"FLOKIVADER_Dividen_Tracker\", \"FLOKIVADER_Dividend_Tracker\") {\n \tclaimWait = 1 days;\n \tminimumTokenBalanceForDividends = 200_000_000_000 * (10**9);\n }\n\n function _transfer(address, address, uint256) internal pure override {\n require(false, \"FLOKIVADER_Dividend_Tracker: No transfers allowed\");\n }\n \n function setMinBalanceForDividends(uint256 amount) external onlyOwner{\n minimumTokenBalanceForDividends = amount * 10**9;\n }\n\n function excludeFromDividends(address account, bool value) external onlyOwner {\n \trequire(excludedFromDividends[account] != value);\n \texcludedFromDividends[account] = value;\n if(value == true){\n _setBalance(account, 0);\n tokenHoldersMap.remove(account);\n }\n else{\n _setBalance(account, balanceOf(account));\n tokenHoldersMap.set(account, balanceOf(account));\n }\n emit ExcludeFromDividends(account, value);\n\n }\n\n function updateClaimWait(uint256 newClaimWait) external onlyOwner {\n require(newClaimWait \u003e= 3600 \u0026\u0026 newClaimWait \u003c= 86400, \"FLOKIVADER_Dividend_Tracker: claimWait must be updated to between 1 and 24 hours\");\n require(newClaimWait != claimWait, \"FLOKIVADER_Dividend_Tracker: Cannot update claimWait to same value\");\n emit ClaimWaitUpdated(newClaimWait, claimWait);\n claimWait = newClaimWait;\n }\n\n function getLastProcessedIndex() external view returns(uint256) {\n \treturn lastProcessedIndex;\n }\n\n function getNumberOfTokenHolders() external view returns(uint256) {\n return tokenHoldersMap.keys.length;\n }\n\n function getAccount(address _account)\n public view returns (\n address account,\n int256 index,\n int256 iterationsUntilProcessed,\n uint256 withdrawableDividends,\n uint256 totalDividends,\n uint256 lastClaimTime,\n uint256 nextClaimTime,\n uint256 secondsUntilAutoClaimAvailable) {\n account = _account;\n\n index = tokenHoldersMap.getIndexOfKey(account);\n\n iterationsUntilProcessed = -1;\n\n if(index \u003e= 0) {\n if(uint256(index) \u003e lastProcessedIndex) {\n iterationsUntilProcessed = index.sub(int256(lastProcessedIndex));\n }\n else {\n uint256 processesUntilEndOfArray = tokenHoldersMap.keys.length \u003e lastProcessedIndex ?\n tokenHoldersMap.keys.length.sub(lastProcessedIndex) :\n 0;\n\n\n iterationsUntilProcessed = index (int256(processesUntilEndOfArray));\n }\n }\n\n\n withdrawableDividends = withdrawableDividendOf(account);\n totalDividends = accumulativeDividendOf(account);\n\n lastClaimTime = lastClaimTimes[account];\n\n nextClaimTime = lastClaimTime \u003e 0 ?\n lastClaimTime (claimWait) :\n 0;\n\n secondsUntilAutoClaimAvailable = nextClaimTime \u003e block.timestamp ?\n nextClaimTime.sub(block.timestamp) :\n 0;\n }\n\n function getAccountAtIndex(uint256 index)\n public view returns (\n address,\n int256,\n int256,\n uint256,\n uint256,\n uint256,\n uint256,\n uint256) {\n \tif(index \u003e= tokenHoldersMap.size()) {\n return (0x0000000000000000000000000000000000000000, -1, -1, 0, 0, 0, 0, 0);\n }\n\n address account = tokenHoldersMap.getKeyAtIndex(index);\n\n return getAccount(account);\n }\n\n function canAutoClaim(uint256 lastClaimTime) private view returns (bool) {\n \tif(lastClaimTime \u003e block.timestamp) {\n \t\treturn false;\n \t}\n\n \treturn block.timestamp.sub(lastClaimTime) \u003e= claimWait;\n }\n \n\n function setBalance(address account, uint256 newBalance) public onlyOwner {\n \tif(excludedFromDividends[account]) {\n \t\treturn;\n \t}\n \t\n \tif(newBalance \u003e= minimumTokenBalanceForDividends) {\n _setBalance(account, newBalance);\n \t\ttokenHoldersMap.set(account, newBalance);\n \t}\n \t\n \telse {\n _setBalance(account, 0);\n \t\ttokenHoldersMap.remove(account);\n \t}\n\n \tprocessAccount(payable(account), true);\n }\n\n function process(uint256 gas) public returns (uint256, uint256, uint256) {\n \tuint256 numberOfTokenHolders = tokenHoldersMap.keys.length;\n\n \tif(numberOfTokenHolders == 0) {\n \t\treturn (0, 0, lastProcessedIndex);\n \t}\n\n \tuint256 _lastProcessedIndex = lastProcessedIndex;\n\n \tuint256 gasUsed = 0;\n\n \tuint256 gasLeft = gasleft();\n\n \tuint256 iterations = 0;\n \tuint256 claims = 0;\n\n \twhile(gasUsed \u003c gas \u0026\u0026 iterations \u003c numberOfTokenHolders) {\n \t\t_lastProcessedIndex ;\n\n \t\tif(_lastProcessedIndex \u003e= tokenHoldersMap.keys.length) {\n \t\t\t_lastProcessedIndex = 0;\n \t\t}\n\n \t\taddress account = tokenHoldersMap.keys[_lastProcessedIndex];\n\n \t\tif(canAutoClaim(lastClaimTimes[account])) {\n \t\t\tif(processAccount(payable(account), true)) {\n \t\t\t\tclaims ;\n \t\t\t}\n \t\t}\n\n \t\titerations ;\n\n \t\tuint256 newGasLeft = gasleft();\n\n \t\tif(gasLeft \u003e newGasLeft) {\n \t\t\tgasUsed = gasUsed (gasLeft.sub(newGasLeft));\n \t\t}\n\n \t\tgasLeft = newGasLeft;\n \t}\n\n \tlastProcessedIndex = _lastProcessedIndex;\n\n \treturn (iterations, claims, lastProcessedIndex);\n }\n\n function processAccount(address payable account, bool automatic) public onlyOwner returns (bool) {\n uint256 amount = _withdrawDividendOfUser(account);\n\n \tif(amount \u003e 0) {\n \t\tlastClaimTimes[account] = block.timestamp;\n emit Claim(account, amount, automatic);\n \t\treturn true;\n \t}\n\n \treturn false;\n }\n}\n"},"IDex.sol":{"content":"// SPDX-License-Identifier: MIT\r\n\r\npragma solidity ^0.8.6;\r\n\r\ninterface IPair {\r\n function sync() external;\r\n}\r\n\r\ninterface IFactory{\r\n function createPair(address tokenA, address tokenB) external returns (address pair);\r\n function getPair(address tokenA, address tokenB) external view returns (address pair);\r\n}\r\n\r\ninterface IRouter {\r\n function factory() external pure returns (address);\r\n function WETH() external pure returns (address);\r\n function addLiquidityETH(\r\n address token,\r\n uint amountTokenDesired,\r\n uint amountTokenMin,\r\n uint amountETHMin,\r\n address to,\r\n uint deadline\r\n ) external payable returns (uint amountToken, uint amountETH, uint liquidity);\r\n \r\n function swapExactTokensForTokensSupportingFeeOnTransferTokens(\r\n uint amountIn,\r\n uint amountOutMin,\r\n address[] calldata path,\r\n address to,\r\n uint deadline\r\n ) external;\r\n \r\n function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)\r\n external\r\n payable\r\n returns (uint[] memory amounts);\r\n\r\n function swapExactTokensForETHSupportingFeeOnTransferTokens(\r\n uint amountIn,\r\n uint amountOutMin,\r\n address[] calldata path,\r\n address to,\r\n uint deadline) external;\r\n}"},"IERC20.sol":{"content":"// SPDX-License-Identifier: MIT\r\n\r\npragma solidity ^0.8.6;\r\n\r\n/**\r\n * @dev Interface of the ERC20 standard as defined in the EIP.\r\n */\r\ninterface IERC20 {\r\n /**\r\n * @dev Returns the amount of tokens in existence.\r\n */\r\n function totalSupply() external view returns (uint256);\r\n\r\n /**\r\n * @dev Returns the amount of tokens owned by `account`.\r\n */\r\n function balanceOf(address account) external view returns (uint256);\r\n\r\n /**\r\n * @dev Moves `amount` tokens from the caller\u0027s account to `recipient`.\r\n *\r\n * Returns a boolean value indicating whether the operation succeeded.\r\n *\r\n * Emits a {Transfer} event.\r\n */\r\n function transfer(address recipient, uint256 amount) external returns (bool);\r\n\r\n /**\r\n * @dev Returns the remaining number of tokens that `spender` will be\r\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\r\n * zero by default.\r\n *\r\n * This value changes when {approve} or {transferFrom} are called.\r\n */\r\n function allowance(address owner, address spender) external view returns (uint256);\r\n\r\n /**\r\n * @dev Sets `amount` as the allowance of `spender` over the caller\u0027s tokens.\r\n *\r\n * Returns a boolean value indicating whether the operation succeeded.\r\n *\r\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\r\n * that someone may use both the old and the new allowance by unfortunate\r\n * transaction ordering. One possible solution to mitigate this race\r\n * condition is to first reduce the spender\u0027s allowance to 0 and set the\r\n * desired value afterwards:\r\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\r\n *\r\n * Emits an {Approval} event.\r\n */\r\n function approve(address spender, uint256 amount) external returns (bool);\r\n\r\n /**\r\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\r\n * allowance mechanism. `amount` is then deducted from the caller\u0027s\r\n * allowance.\r\n *\r\n * Returns a boolean value indicating whether the operation succeeded.\r\n *\r\n * Emits a {Transfer} event.\r\n */\r\n function transferFrom(\r\n address sender,\r\n address recipient,\r\n uint256 amount\r\n ) external returns (bool);\r\n\r\n /**\r\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\r\n * another (`to`).\r\n *\r\n * Note that `value` may be zero.\r\n */\r\n event Transfer(address indexed from, address indexed to, uint256 value);\r\n\r\n /**\r\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\r\n * a call to {approve}. `value` is the new allowance.\r\n */\r\n event Approval(address indexed owner, address indexed spender, uint256 value);\r\n}\r\n\r\n/**\r\n * @dev Interface for the optional metadata functions from the ERC20 standard.\r\n *\r\n * _Available since v4.1._\r\n */\r\ninterface IERC20Metadata is IERC20 {\r\n /**\r\n * @dev Returns the name of the token.\r\n */\r\n function name() external view returns (string memory);\r\n\r\n /**\r\n * @dev Returns the symbol of the token.\r\n */\r\n function symbol() external view returns (string memory);\r\n\r\n /**\r\n * @dev Returns the decimals places of the token.\r\n */\r\n function decimals() external view returns (uint8);\r\n}"},"IterableMapping.sol":{"content":"// SPDX-License-Identifier: MIT\r\npragma solidity ^0.8.6;\r\n\r\nlibrary IterableMapping {\r\n // Iterable mapping from address to uint;\r\n struct Map {\r\n address[] keys;\r\n mapping(address =\u003e uint) values;\r\n mapping(address =\u003e uint) indexOf;\r\n mapping(address =\u003e bool) inserted;\r\n }\r\n\r\n function get(Map storage map, address key) public view returns (uint) {\r\n return map.values[key];\r\n }\r\n\r\n function getIndexOfKey(Map storage map, address key) public view returns (int) {\r\n if(!map.inserted[key]) {\r\n return -1;\r\n }\r\n return int(map.indexOf[key]);\r\n }\r\n\r\n function getKeyAtIndex(Map storage map, uint index) public view returns (address) {\r\n return map.keys[index];\r\n }\r\n\r\n\r\n\r\n function size(Map storage map) public view returns (uint) {\r\n return map.keys.length;\r\n }\r\n\r\n function set(Map storage map, address key, uint val) public {\r\n if (map.inserted[key]) {\r\n map.values[key] = val;\r\n } else {\r\n map.inserted[key] = true;\r\n map.values[key] = val;\r\n map.indexOf[key] = map.keys.length;\r\n map.keys.push(key);\r\n }\r\n }\r\n\r\n function remove(Map storage map, address key) public {\r\n if (!map.inserted[key]) {\r\n return;\r\n }\r\n\r\n delete map.inserted[key];\r\n delete map.values[key];\r\n\r\n uint index = map.indexOf[key];\r\n uint lastIndex = map.keys.length - 1;\r\n address lastKey = map.keys[lastIndex];\r\n\r\n map.indexOf[lastKey] = index;\r\n delete map.indexOf[key];\r\n\r\n map.keys[index] = lastKey;\r\n map.keys.pop();\r\n }\r\n}"},"Ownable.sol":{"content":"pragma solidity ^0.8.6;\r\n\r\n// SPDX-License-Identifier: MIT License\r\n\r\nimport \"./Context.sol\";\r\n\r\ncontract Ownable is Context {\r\n address private _owner;\r\n\r\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\r\n\r\n /**\r\n * @dev Initializes the contract setting the deployer as the initial owner.\r\n */\r\n constructor () {\r\n address msgSender = _msgSender();\r\n _owner = msgSender;\r\n emit OwnershipTransferred(address(0), msgSender);\r\n }\r\n\r\n /**\r\n * @dev Returns the address of the current owner.\r\n */\r\n function owner() public view returns (address) {\r\n return _owner;\r\n }\r\n\r\n /**\r\n * @dev Throws if called by any account other than the owner.\r\n */\r\n modifier onlyOwner() {\r\n require(_owner == _msgSender(), \"Ownable: caller is not the owner\");\r\n _;\r\n }\r\n\r\n /**\r\n * @dev Leaves the contract without owner. It will not be possible to call\r\n * `onlyOwner` functions anymore. Can only be called by the current owner.\r\n *\r\n * NOTE: Renouncing ownership will leave the contract without an owner,\r\n * thereby removing any functionality that is only available to the owner.\r\n */\r\n function renounceOwnership() public virtual onlyOwner {\r\n emit OwnershipTransferred(_owner, address(0));\r\n _owner = address(0);\r\n }\r\n\r\n /**\r\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\r\n * Can only be called by the current owner.\r\n */\r\n function transferOwnership(address newOwner) public virtual onlyOwner {\r\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\r\n emit OwnershipTransferred(_owner, newOwner);\r\n _owner = newOwner;\r\n }\r\n}"},"SafeMath.sol":{"content":"// SPDX-License-Identifier: MIT\r\n\r\npragma solidity ^0.8.6;\r\n\r\nlibrary SafeMath {\r\n /**\r\n * @dev Returns the addition of two unsigned integers, reverting on\r\n * overflow.\r\n *\r\n * Counterpart to Solidity\u0027s ` ` operator.\r\n *\r\n * Requirements:\r\n *\r\n * - Addition cannot overflow.\r\n */\r\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\r\n uint256 c = a b;\r\n require(c \u003e= a, \"SafeMath: addition overflow\");\r\n\r\n return c;\r\n }\r\n\r\n /**\r\n * @dev Returns the subtraction of two unsigned integers, reverting on\r\n * overflow (when the result is negative).\r\n *\r\n * Counterpart to Solidity\u0027s `-` operator.\r\n *\r\n * Requirements:\r\n *\r\n * - Subtraction cannot overflow.\r\n */\r\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\r\n return sub(a, b, \"SafeMath: subtraction overflow\");\r\n }\r\n\r\n /**\r\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\r\n * overflow (when the result is negative).\r\n *\r\n * Counterpart to Solidity\u0027s `-` operator.\r\n *\r\n * Requirements:\r\n *\r\n * - Subtraction cannot overflow.\r\n */\r\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\r\n require(b \u003c= a, errorMessage);\r\n uint256 c = a - b;\r\n\r\n return c;\r\n }\r\n\r\n /**\r\n * @dev Returns the multiplication of two unsigned integers, reverting on\r\n * overflow.\r\n *\r\n * Counterpart to Solidity\u0027s `*` operator.\r\n *\r\n * Requirements:\r\n *\r\n * - Multiplication cannot overflow.\r\n */\r\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\r\n // Gas optimization: this is cheaper than requiring \u0027a\u0027 not being zero, but the\r\n // benefit is lost if \u0027b\u0027 is also tested.\r\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\r\n if (a == 0) {\r\n return 0;\r\n }\r\n\r\n uint256 c = a * b;\r\n require(c / a == b, \"SafeMath: multiplication overflow\");\r\n\r\n return c;\r\n }\r\n\r\n /**\r\n * @dev Returns the integer division of two unsigned integers. Reverts on\r\n * division by zero. The result is rounded towards zero.\r\n *\r\n * Counterpart to Solidity\u0027s `/` operator. Note: this function uses a\r\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\r\n * uses an invalid opcode to revert (consuming all remaining gas).\r\n *\r\n * Requirements:\r\n *\r\n * - The divisor cannot be zero.\r\n */\r\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\r\n return div(a, b, \"SafeMath: division by zero\");\r\n }\r\n\r\n /**\r\n * @dev Returns the integer division of two unsigned integers. Reverts with custom message on\r\n * division by zero. The result is rounded towards zero.\r\n *\r\n * Counterpart to Solidity\u0027s `/` operator. Note: this function uses a\r\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\r\n * uses an invalid opcode to revert (consuming all remaining gas).\r\n *\r\n * Requirements:\r\n *\r\n * - The divisor cannot be zero.\r\n */\r\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\r\n require(b \u003e 0, errorMessage);\r\n uint256 c = a / b;\r\n // assert(a == b * c a % b); // There is no case in which this doesn\u0027t hold\r\n\r\n return c;\r\n }\r\n\r\n /**\r\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\r\n * Reverts when dividing by zero.\r\n *\r\n * Counterpart to Solidity\u0027s `%` operator. This function uses a `revert`\r\n * opcode (which leaves remaining gas untouched) while Solidity uses an\r\n * invalid opcode to revert (consuming all remaining gas).\r\n *\r\n * Requirements:\r\n *\r\n * - The divisor cannot be zero.\r\n */\r\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\r\n return mod(a, b, \"SafeMath: modulo by zero\");\r\n }\r\n\r\n /**\r\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\r\n * Reverts with custom message when dividing by zero.\r\n *\r\n * Counterpart to Solidity\u0027s `%` operator. This function uses a `revert`\r\n * opcode (which leaves remaining gas untouched) while Solidity uses an\r\n * invalid opcode to revert (consuming all remaining gas).\r\n *\r\n * Requirements:\r\n *\r\n * - The divisor cannot be zero.\r\n */\r\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\r\n require(b != 0, errorMessage);\r\n return a % b;\r\n }\r\n}\r\n\r\n/**\r\n * @title SafeMathInt\r\n * @dev Math operations for int256 with overflow safety checks.\r\n */\r\nlibrary SafeMathInt {\r\n int256 private constant MIN_INT256 = int256(1) \u003c\u003c 255;\r\n int256 private constant MAX_INT256 = ~(int256(1) \u003c\u003c 255);\r\n\r\n /**\r\n * @dev Multiplies two int256 variables and fails on overflow.\r\n */\r\n function mul(int256 a, int256 b) internal pure returns (int256) {\r\n int256 c = a * b;\r\n\r\n // Detect overflow when multiplying MIN_INT256 with -1\r\n require(c != MIN_INT256 || (a \u0026 MIN_INT256) != (b \u0026 MIN_INT256));\r\n require((b == 0) || (c / b == a));\r\n return c;\r\n }\r\n\r\n /**\r\n * @dev Division of two int256 variables and fails on overflow.\r\n */\r\n function div(int256 a, int256 b) internal pure returns (int256) {\r\n // Prevent overflow when dividing MIN_INT256 by -1\r\n require(b != -1 || a != MIN_INT256);\r\n\r\n // Solidity already throws when dividing by 0.\r\n return a / b;\r\n }\r\n\r\n /**\r\n * @dev Subtracts two int256 variables and fails on overflow.\r\n */\r\n function sub(int256 a, int256 b) internal pure returns (int256) {\r\n int256 c = a - b;\r\n require((b \u003e= 0 \u0026\u0026 c \u003c= a) || (b \u003c 0 \u0026\u0026 c \u003e a));\r\n return c;\r\n }\r\n\r\n /**\r\n * @dev Adds two int256 variables and fails on overflow.\r\n */\r\n function add(int256 a, int256 b) internal pure returns (int256) {\r\n int256 c = a b;\r\n require((b \u003e= 0 \u0026\u0026 c \u003e= a) || (b \u003c 0 \u0026\u0026 c \u003c a));\r\n return c;\r\n }\r\n\r\n /**\r\n * @dev Converts to absolute value, and fails on overflow.\r\n */\r\n function abs(int256 a) internal pure returns (int256) {\r\n require(a != MIN_INT256);\r\n return a \u003c 0 ? -a : a;\r\n }\r\n\r\n\r\n function toUint256Safe(int256 a) internal pure returns (uint256) {\r\n require(a \u003e= 0);\r\n return uint256(a);\r\n }\r\n}\r\n\r\n/**\r\n * @title SafeMathUint\r\n * @dev Math operations with safety checks that revert on error\r\n */\r\nlibrary SafeMathUint {\r\n function toInt256Safe(uint256 a) internal pure returns (int256) {\r\n int256 b = int256(a);\r\n require(b \u003e= 0);\r\n return b;\r\n }\r\n}"}}