Token 10X: Africa's First Cryptocurrency Hub
Gnome Mines Token Token
Gnome Mines is a Play 2 Earn game that you may like playing. A game in which players take charge of a gnome crew that is sent to work in a mine that contains precious ore. Every day, the gnomes get up early to go into the mines and gather as much ore as they can throughout the day. Get your best tea...
About Gnome Mines Token
Gnome Mines is a Play 2 Earn game that you may like playing. A game in which players take charge of a gnome crew that is sent to work in a mine that contains precious ore. Every day, the gnomes get up early to go into the mines and gather as much ore as they can throughout the day. Get your best team together and go to the mines, where they may be rewarded for their efforts.
29 total visits
Token information and links
Circulating Supply
99700000000000000000000000
Token Contract (BSC Chain)
0X9888D3D9FBC12487259D1C82665B2FFD009936C6
Contract license:
Launch Date
12/05/2022
KYC Information
No
Audit Information
None
Team Information
Team leader: None
Team leader contact: None
Contract source code
{{
"language": "Solidity",
"sources": {
"contracts/solidity/Token/GnomeMines.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity 0.8.13;\n\nimport \"./ERC20.sol\";\n\nimport \"./IPancake.sol\";\nimport \"./GasHelper.sol\";\nimport \"./SwapHelper.sol\";\n\ncontract GnomeMines is GasHelper, ERC20 {\n address constant private DEAD = 0x000000000000000000000000000000000000dEaD;\n address constant private ZERO = 0x0000000000000000000000000000000000000000;\n address constant private WBNB = 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c; // BSC WBNB\n\n string constant private _nameToken = \"Gnome Mines Token\";\n string constant private _symbolToken = \"GMINES\";\n\n string constant public url = \"www.gnomemines.com\";\n string constant public author = \"Lameni\";\n\n // Token Details\n uint8 constant private decimal = 18;\n uint256 constant private maxSupply = 100_000_000 * (10 ** decimal);\n\n // Wallets limits\n uint256 public _maxTxAmount = maxSupply;\n uint256 public _maxAccountAmount = maxSupply;\n uint256 public _minAmountToAutoSwap = 1000 * (10 ** decimal); // 1000\n\n // Fees\n uint256 public feeAdministrationWallet = 300; // 3%\n\n uint constant private maxTotalFee = 1000;\n mapping(address => uint) public specialFeesByWallet;\n\n // Helpers\n bool internal pausedToken = false;\n bool private _noReentrancy = false;\n\n bool public pausedSwapAdmin = false;\n\n // Counters\n uint256 public accumulatedToAdmin;\n\n // Liquidity Pair\n address public liquidityPool;\n\n // Wallets\n address public administrationWallet;\n address public swapHelperAddress;\n\n struct Receivers { address wallet; uint256 amount; }\n receive() external payable { }\n\n constructor()ERC20(_nameToken, _symbolToken) {\n PancakeRouter router = PancakeRouter(0x10ED43C718714eb63d5aA57B78B54704E256024E); // BSC\n liquidityPool = address(PancakeFactory(router.factory()).createPair(WBNB, address(this)));\n\n administrationWallet = _msgSender();\n _permissions[administrationWallet] = 15;\n\n uint baseAttributes = 0;\n baseAttributes = setExemptAmountLimit(baseAttributes, true);\n _attributeMap[liquidityPool] = baseAttributes;\n\n baseAttributes = setExemptTxLimit(baseAttributes, true);\n _attributeMap[DEAD] = baseAttributes;\n _attributeMap[ZERO] = baseAttributes;\n\n baseAttributes = setExemptFee(baseAttributes, true);\n baseAttributes = setExemptSwapMaker(baseAttributes, true);\n _attributeMap[address(this)] = baseAttributes;\n\n baseAttributes = setExemptOperatePausedToken(baseAttributes, true);\n _attributeMap[_msgSender()] = baseAttributes;\n\n SwapHelper swapHelper = new SwapHelper();\n swapHelper.safeApprove(WBNB, address(this), type(uint256).max);\n swapHelper.transferOwnership(_msgSender());\n swapHelperAddress = address(swapHelper);\n\n baseAttributes = setExemptOperatePausedToken(baseAttributes, false);\n _attributeMap[swapHelperAddress] = baseAttributes;\n\n _mint(_msgSender(), maxSupply);\n\n pausedToken = true;\n }\n\n // ----------------- Public Views -----------------\n function name() public pure override returns (string memory) { return _nameToken; }\n function symbol() public pure override returns (string memory) { return _symbolToken; }\n function getOwner() external view returns (address) { return owner(); }\n function decimals() public pure override returns (uint8) { return decimal; }\n function getFeeTotal() public view returns(uint256) { return feeAdministrationWallet; }\n function getSpecialWalletFee(address target) public view returns(uint adminFee ) {\n adminFee = specialFeesByWallet[target];\n }\n\n // ----------------- Authorized Methods -----------------\n\n function enableToken() external isAdmin { pausedToken = false; }\n function setLiquidityPool(address newPair) external isAdmin {\n require(newPair != address(0), \"invalid new pair address\");\n liquidityPool = newPair;\n }\n function setPausedSwapAdmin(bool state) external isAdmin { pausedSwapAdmin = state; }\n\n // ----------------- Wallets Settings -----------------\n function setAdministrationWallet(address account) public isAdmin {\n require(account != address(0), \"adminWallet cannot be Zero\");\n administrationWallet = account;\n }\n\n // ----------------- Fee Settings -----------------\n function setFeesOperational(uint256 administration) external isFinancial {\n feeAdministrationWallet = administration;\n require(getFeeTotal() <= maxTotalFee, \"All rates and fee together must be equal or lower than 10%\");\n }\n\n function setSpecialWalletFee(address target, uint adminFee) external isFinancial {\n require(adminFee <= maxTotalFee, \"All rates and fee together must be equal or lower than 10%\");\n specialFeesByWallet[target] = adminFee;\n }\n\n // ----------------- Token Flow Settings -----------------\n function setMaxTxAmount(uint256 maxTxAmount) public isFinancial {\n require(maxTxAmount >= maxSupply / 10000, \"Amount must be bigger then 0.01% tokens\"); // 10000 tokens\n _maxTxAmount = maxTxAmount;\n }\n\n function setMaxAccountAmount(uint256 maxAccountAmount) public isFinancial {\n require(maxAccountAmount >= maxSupply / 10000, \"Amount must be bigger then 0.01% tokens\"); // 10000 tokens\n _maxAccountAmount = maxAccountAmount;\n }\n function setMinAmountToAutoSwap(uint256 amount) public isFinancial {\n _minAmountToAutoSwap = amount;\n }\n\n // ----------------- Special Authorized Operations -----------------\n function buyBackAndHoldWithDecimals(uint256 decimalAmount, address receiver) public isController { buyBackWithDecimals(decimalAmount, receiver); }\n function buyBackAndBurnWithDecimals(uint256 decimalAmount) public isController { buyBackWithDecimals(decimalAmount, address(0)); }\n\n // ----------------- External Methods -----------------\n function burn(uint256 amount) external { _burn(_msgSender(), amount); }\n\n function multiTransfer(Receivers[] memory users) external {\n for ( uint i = 0; i < users.length; i ) transfer(users[i].wallet, users[i].amount);\n }\n\n // ----------------- Internal CORE -----------------\n function _transfer( address sender, address receiver,uint256 amount) internal override {\n require(amount > 0, \"Invalid Amount\");\n require(!_noReentrancy, \"ReentrancyGuard Alert\");\n _noReentrancy = true;\n\n uint senderAttributes = _attributeMap[sender];\n uint receiverAttributes = _attributeMap[receiver];\n // Initial Checks\n require(sender != address(0) && receiver != address(0), \"transfer from the zero address\");\n require(!pausedToken || isExemptOperatePausedToken(senderAttributes), \"Token is paused\");\n require(amount <= _maxTxAmount || isExemptTxLimit(senderAttributes), \"Exceeded the maximum transaction limit\");\n\n uint256 senderBalance = _balances[sender];\n require(senderBalance >= amount, \"Transfer amount exceeds your balance\");\n uint256 newSenderBalance = senderBalance - amount;\n _balances[sender] = newSenderBalance;\n\n\n uint adminFee = feeAdministrationWallet;\n\n // Calculate Fees\n uint256 feeAmount = 0;\n if(!isExemptFee(senderAttributes) && !isExemptFeeReceiver(receiverAttributes)) {\n if(isSpecialFeeWallet(senderAttributes)) { // Check special wallet fee on sender\n adminFee = getSpecialWalletFee(sender);\n } else if(isSpecialFeeWalletReceiver(receiverAttributes)) { // Check special wallet fee on receiver\n adminFee = getSpecialWalletFee(receiver);\n }\n feeAmount = (adminFee * amount) / 10000;\n }\n\n if (feeAmount != 0) splitFee(feeAmount, sender, adminFee);\n if ((!pausedSwapAdmin) && !isExemptSwapMaker(senderAttributes)) autoSwap(sender, adminFee);\n\n // Update Recipent Balance\n uint256 newRecipientBalance = _balances[receiver] (amount - feeAmount);\n _balances[receiver] = newRecipientBalance;\n require(newRecipientBalance <= _maxAccountAmount || isExemptAmountLimit(receiverAttributes), \"Exceeded the maximum tokens an wallet can hold\");\n\n _noReentrancy = false;\n emit Transfer(sender, receiver, amount);\n }\n\n function autoSwap(address sender, uint adminFee) private {\n // --------------------- Execute Auto Swap -------------------------\n address liquidityPair = liquidityPool;\n if (sender == liquidityPair) return;\n\n uint adminAmount = accumulatedToAdmin;\n uint totalAmount = adminAmount;\n if (totalAmount < _minAmountToAutoSwap) return;\n\n // Execute auto swap\n address wbnbAddress = WBNB;\n address swapHelper = swapHelperAddress;\n\n (uint112 reserve0, uint112 reserve1) = getTokenReserves(liquidityPair);\n bool reversed = isReversed(liquidityPair, wbnbAddress);\n if (reversed) { uint112 temp = reserve0; reserve0 = reserve1; reserve1 = temp; }\n _balances[liquidityPair] = totalAmount;\n\n uint256 wbnbBalanceBefore = getTokenBalanceOf(wbnbAddress, swapHelper);\n uint256 wbnbAmount = getAmountOut(totalAmount, reserve1, reserve0);\n swapToken(liquidityPair, reversed ? 0 : wbnbAmount, reversed ? wbnbAmount : 0, swapHelper);\n uint256 wbnbBalanceNew = getTokenBalanceOf(wbnbAddress, swapHelper);\n require(wbnbBalanceNew == wbnbBalanceBefore wbnbAmount, \"Wrong amount of swapped on WBNB\");\n\n // --------------------- Transfer Swapped Amount -------------------------\n if (adminAmount > 0 && adminFee > 0) { // Cost 2 cents\n uint amountToSend = wbnbBalanceNew;\n tokenTransferFrom(wbnbAddress, swapHelper, administrationWallet, amountToSend);\n }\n accumulatedToAdmin = 0;\n }\n\n function splitFee(uint256 incomingFeeTokenAmount, address sender, uint adminFee) private {\n uint256 totalFee = adminFee;\n\n // Administrative distribution\n if (adminFee > 0) {\n accumulatedToAdmin = (incomingFeeTokenAmount * adminFee) / totalFee;\n if (pausedSwapAdmin) {\n address wallet = administrationWallet;\n uint256 walletBalance = _balances[wallet] accumulatedToAdmin;\n _balances[wallet] = walletBalance;\n emit Transfer(sender, wallet, accumulatedToAdmin);\n accumulatedToAdmin = 0;\n }\n }\n }\n\n // --------------------- Private Methods -------------------------\n\n function buyBackWithDecimals(uint256 decimalAmount, address destAddress) private {\n uint256 maxBalance = getTokenBalanceOf(WBNB, address(this));\n if (maxBalance < decimalAmount) revert(\"insufficient WBNB amount on contract\");\n\n address liquidityPair = liquidityPool;\n uint liquidityAttribute = _attributeMap[liquidityPair];\n\n uint newAttributes = setExemptTxLimit(liquidityAttribute, true);\n newAttributes = setExemptFee(liquidityAttribute, true);\n _attributeMap[liquidityPair] = newAttributes;\n\n address helperAddress = swapHelperAddress;\n\n (uint112 reserve0, uint112 reserve1) = getTokenReserves(liquidityPair);\n bool reversed = isReversed(liquidityPair, WBNB);\n if (reversed) { uint112 temp = reserve0; reserve0 = reserve1; reserve1 = temp; }\n\n tokenTransfer(WBNB, liquidityPair, decimalAmount);\n\n uint256 tokenAmount = getAmountOut(decimalAmount, reserve0, reserve1);\n if (destAddress == address(0)) {\n swapToken(liquidityPair, reversed ? tokenAmount : 0, reversed ? 0 : tokenAmount, helperAddress);\n _burn(helperAddress, tokenAmount);\n } else {\n swapToken(liquidityPair, reversed ? tokenAmount : 0, reversed ? 0 : tokenAmount, destAddress);\n }\n _attributeMap[liquidityPair] = liquidityAttribute;\n }\n\n}\n"
},
"contracts/solidity/Token/ERC20.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/ERC20.sol)\n// Modified version to provide _balances as internal instead private\n\npragma solidity 0.8.13;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport \"@openzeppelin/contracts/utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) internal _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `recipient` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address recipient, uint256 amount) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * Requirements:\n *\n * - `sender` and `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n * - the caller must have allowance for ``sender``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(currentAllowance >= amount, \"ERC20: transfer amount exceeds allowance\");\n unchecked {\n _approve(sender, _msgSender(), currentAllowance - amount);\n }\n\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender] addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `sender` to `recipient`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `sender` cannot be the zero address.\n * - `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n */\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n uint256 senderBalance = _balances[sender];\n require(senderBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[sender] = senderBalance - amount;\n }\n _balances[recipient] = amount;\n\n emit Transfer(sender, recipient, amount);\n\n _afterTokenTransfer(sender, recipient, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply = amount;\n _balances[account] = amount;\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n }\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n"
},
"contracts/solidity/Token/IPancake.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity 0.8.13;\ninterface PancakeFactory {\n function createPair(address tokenA, address tokenB) external returns (address pair);\n}\n\ninterface PancakeRouter {\n function factory() external pure returns (address);\n}\n"
},
"contracts/solidity/Token/GasHelper.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity 0.8.13;\n\nimport \"./AttributeMap.sol\";\n\ncontract GasHelper is AttributeMap {\n uint internal swapFee = 25;\n\n function setSwapFee(uint amount) external isAdmin { swapFee = amount; }\n\n function getAmountOut(uint256 amountIn, uint256 reserveIn, uint256 reserveOut) internal view returns (uint256 amountOut) {\n require(amountIn > 0, 'Insufficient amount in');\n require(reserveIn > 0 && reserveOut > 0, 'Insufficient liquidity');\n uint256 amountInWithFee = amountIn * (10000 - swapFee);\n uint256 numerator = amountInWithFee * reserveOut;\n uint256 denominator = (reserveIn * 10000) amountInWithFee;\n amountOut = numerator / denominator;\n }\n\n function isReversed(address pair, address tokenA) internal view returns (bool) {\n address token0;\n bool failed = false;\n assembly {\n let emptyPointer := mload(0x40)\n mstore(emptyPointer, 0x0dfe168100000000000000000000000000000000000000000000000000000000)\n failed := iszero(staticcall(gas(), pair, emptyPointer, 0x04, emptyPointer, 0x20))\n token0 := mload(emptyPointer)\n }\n if (failed) revert(\"Unable to check tokens direction\");\n return token0 != tokenA;\n }\n\n // gas optimization on transfer token\n function tokenTransfer(address token, address recipient, uint256 amount) internal {\n bool failed = false;\n assembly {\n let emptyPointer := mload(0x40)\n mstore(emptyPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000)\n mstore(add(emptyPointer, 0x04), recipient)\n mstore(add(emptyPointer, 0x24), amount)\n failed := iszero(call(gas(), token, 0, emptyPointer, 0x44, 0, 0))\n }\n if (failed) revert(\"Unable to transfer token\");\n }\n\n // gas optimization on transfer from token method\n function tokenTransferFrom(address token, address from, address recipient, uint256 amount) internal {\n bool failed = false;\n assembly {\n let emptyPointer := mload(0x40)\n mstore(emptyPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n mstore(add(emptyPointer, 0x04), from)\n mstore(add(emptyPointer, 0x24), recipient)\n mstore(add(emptyPointer, 0x44), amount)\n failed := iszero(call(gas(), token, 0, emptyPointer, 0x64, 0, 0))\n }\n if (failed) revert(\"Unable to transferFrom token\");\n }\n\n // gas optimization on swap operation using a liquidity pool\n function swapToken(address pair, uint amount0Out, uint amount1Out, address receiver) internal {\n bool failed = false;\n assembly {\n let emptyPointer := mload(0x40)\n mstore(emptyPointer, 0x022c0d9f00000000000000000000000000000000000000000000000000000000)\n mstore(add(emptyPointer, 0x04), amount0Out)\n mstore(add(emptyPointer, 0x24), amount1Out)\n mstore(add(emptyPointer, 0x44), receiver)\n mstore(add(emptyPointer, 0x64), 0x80)\n mstore(add(emptyPointer, 0x84), 0)\n failed := iszero(call(gas(), pair, 0, emptyPointer, 0xa4, 0, 0))\n }\n if (failed) revert(\"Unable to swap Pair\");\n }\n\n // gas optimization on get balanceOf from BEP20 or ERC20 token\n function getTokenBalanceOf(address token, address holder) internal view returns (uint112 tokenBalance) {\n bool failed = false;\n assembly {\n let emptyPointer := mload(0x40)\n mstore(emptyPointer, 0x70a0823100000000000000000000000000000000000000000000000000000000)\n mstore(add(emptyPointer, 0x04), holder)\n failed := iszero(staticcall(gas(), token, emptyPointer, 0x24, emptyPointer, 0x40))\n tokenBalance := mload(emptyPointer)\n }\n if (failed) revert(\"Unable to get balance\");\n }\n\n // gas optimization on get reserves from liquidity pool\n function getTokenReserves(address pairAddress) internal view returns (uint112 reserve0, uint112 reserve1) {\n bool failed = false;\n assembly {\n let emptyPointer := mload(0x40)\n mstore(emptyPointer, 0x0902f1ac00000000000000000000000000000000000000000000000000000000)\n failed := iszero(staticcall(gas(), pairAddress, emptyPointer, 0x4, emptyPointer, 0x40))\n reserve0 := mload(emptyPointer)\n reserve1 := mload(add(emptyPointer, 0x20))\n }\n if (failed) revert(\"Unable to get reserves from pair\");\n }\n}\n"
},
"contracts/solidity/Token/SwapHelper.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity 0.8.13;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ncontract SwapHelper is Ownable {\n constructor() {}\n\n function safeApprove(address token, address spender, uint256 amount) external onlyOwner { IERC20(token).approve(spender, amount); }\n\n function safeWithdraw() external onlyOwner { payable(_msgSender()).transfer(address(this).balance); }\n}"
},
"@openzeppelin/contracts/token/ERC20/IERC20.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external returns (bool);\n\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n"
},
"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n"
},
"@openzeppelin/contracts/utils/Context.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n"
},
"contracts/solidity/Token/AttributeMap.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity 0.8.13;\n\nimport \"./Authorized.sol\";\n\ncontract AttributeMap is Authorized {\n\n mapping (address => uint) internal _attributeMap;\n\n // ------------- Public Views -------------\n function isExemptFee(address target) public view returns(bool) { return checkMapAttribute(_attributeMap[target], 0); }\n function isExemptFeeReceiver(address target) public view returns(bool) { return checkMapAttribute(_attributeMap[target], 1); }\n function isExemptTxLimit(address target) public view returns(bool) { return checkMapAttribute(_attributeMap[target], 2); }\n function isExemptAmountLimit(address target) public view returns(bool) { return checkMapAttribute(_attributeMap[target], 3); }\n function isExemptOperatePausedToken(address target) public view returns(bool) { return checkMapAttribute(_attributeMap[target], 4); }\n function isSpecialFeeWallet(address target) public view returns(bool) { return checkMapAttribute(_attributeMap[target], 5); }\n function isSpecialFeeWalletReceiver(address target) public view returns(bool) { return checkMapAttribute(_attributeMap[target], 6); }\n function isExemptSwapMaker(address target) public view returns(bool) { return checkMapAttribute(_attributeMap[target], 7); }\n\n // ------------- Internal PURE GET Functions -------------\n function isExemptFee(uint mapValue) internal pure returns(bool) { return checkMapAttribute(mapValue, 0); }\n function isExemptFeeReceiver(uint mapValue) internal pure returns(bool) { return checkMapAttribute(mapValue, 1); }\n function isExemptTxLimit(uint mapValue) internal pure returns(bool) { return checkMapAttribute(mapValue, 2); }\n function isExemptAmountLimit(uint mapValue) internal pure returns(bool) { return checkMapAttribute(mapValue, 3); }\n function isExemptOperatePausedToken(uint mapValue) internal pure returns(bool) { return checkMapAttribute(mapValue, 4); }\n function isSpecialFeeWallet(uint mapValue) internal pure returns(bool) { return checkMapAttribute(mapValue, 5); }\n function isSpecialFeeWalletReceiver(uint mapValue) internal pure returns(bool) { return checkMapAttribute(mapValue, 6); }\n function isExemptSwapMaker(uint mapValue) internal pure returns(bool) { return checkMapAttribute(mapValue, 7); }\n\n // ------------- Public Internal SET Functions -------------\n function setExemptFee(uint mapValue, bool operation) internal pure returns(uint) { return setMapAttribute(mapValue, 0, operation); }\n function setExemptFeeReceiver(uint mapValue, bool operation) internal pure returns(uint) { return setMapAttribute(mapValue, 1, operation); }\n function setExemptTxLimit(uint mapValue, bool operation) internal pure returns(uint) { return setMapAttribute(mapValue, 2, operation); }\n function setExemptAmountLimit(uint mapValue, bool operation) internal pure returns(uint) { return setMapAttribute(mapValue, 3, operation); }\n function setExemptOperatePausedToken(uint mapValue, bool operation) internal pure returns(uint) { return setMapAttribute(mapValue, 4, operation); }\n function setSpecialFeeWallet(uint mapValue, bool operation) internal pure returns(uint) { return setMapAttribute(mapValue, 5, operation); }\n function setSpecialFeeWalletReceiver(uint mapValue, bool operation) internal pure returns(uint) { return setMapAttribute(mapValue, 6, operation); }\n function setExemptSwapMaker(uint mapValue, bool operation) internal pure returns(uint) { return setMapAttribute(mapValue, 7, operation); }\n\n\n // ------------- Public Authorized SET Functions -------------\n function setExemptFee(address target, bool operation) public isFinancial { _attributeMap[target] = setExemptFee(_attributeMap[target], operation); }\n function setExemptFeeReceiver(address target, bool operation) public isFinancial { _attributeMap[target] = setExemptFeeReceiver(_attributeMap[target], operation); }\n function setExemptTxLimit(address target, bool operation) public isFinancial { _attributeMap[target] = setExemptTxLimit(_attributeMap[target], operation); }\n function setExemptAmountLimit(address target, bool operation) public isFinancial { _attributeMap[target] = setExemptAmountLimit(_attributeMap[target], operation); }\n function setExemptOperatePausedToken(address target, bool operation) public isFinancial { _attributeMap[target] = setExemptOperatePausedToken(_attributeMap[target], operation); }\n function setSpecialFeeWallet(address target, bool operation) public isFinancial { _attributeMap[target] = setSpecialFeeWallet(_attributeMap[target], operation); }\n function setSpecialFeeWalletReceiver(address target, bool operation) public isFinancial { _attributeMap[target] = setSpecialFeeWalletReceiver(_attributeMap[target], operation); }\n function setExemptSwapMaker(address target, bool operation) public isFinancial { _attributeMap[target] = setExemptSwapMaker(_attributeMap[target], operation); }\n\n\n}\n"
},
"contracts/solidity/Token/Authorized.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity 0.8.13;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ncontract Authorized is Ownable {\n mapping(address => uint) internal _permissions;\n\n function safeApprove(address token, address spender, uint256 amount) external isAdmin { IERC20(token).approve(spender, amount); }\n function safeTransfer(address token, address receiver, uint256 amount) external isAdmin { IERC20(token).transfer(receiver, amount); }\n function safeWithdraw() external isAdmin { payable(_msgSender()).transfer(address(this).balance); }\n\n function setPermission(address wallet, uint8 typeIndex, bool state) external isAdmin { _permissions[wallet] = setMapAttribute(_permissions[wallet], typeIndex, state); }\n function checkMapAttribute(uint mapValue, uint8 shift) internal pure returns(bool) { return mapValue >> shift & 1 == 1; }\n function setMapAttribute(uint mapValue, uint8 shift, bool include) internal pure returns(uint) { return include ? 1 << shift | mapValue : 1 << shift ^ type(uint).max & mapValue; }\n function hasPermission(address wallet, uint8 typeIndex) external view returns(bool) { return checkMapAttribute(_permissions[wallet], typeIndex); }\n function checkPermission(uint8 typeIndex) private view { require(checkMapAttribute(_permissions[msg.sender], typeIndex) || owner() == msg.sender, \"Wallet does not have permission\"); }\n\n modifier isAdmin { checkPermission(0); _; }\n modifier isFinancial { checkPermission(1); _; }\n modifier isController { checkPermission(2); _; }\n modifier isUpdater { checkPermission(3); _; }\n}"
},
"@openzeppelin/contracts/access/Ownable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 9999
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}
}}
"language": "Solidity",
"sources": {
"contracts/solidity/Token/GnomeMines.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity 0.8.13;\n\nimport \"./ERC20.sol\";\n\nimport \"./IPancake.sol\";\nimport \"./GasHelper.sol\";\nimport \"./SwapHelper.sol\";\n\ncontract GnomeMines is GasHelper, ERC20 {\n address constant private DEAD = 0x000000000000000000000000000000000000dEaD;\n address constant private ZERO = 0x0000000000000000000000000000000000000000;\n address constant private WBNB = 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c; // BSC WBNB\n\n string constant private _nameToken = \"Gnome Mines Token\";\n string constant private _symbolToken = \"GMINES\";\n\n string constant public url = \"www.gnomemines.com\";\n string constant public author = \"Lameni\";\n\n // Token Details\n uint8 constant private decimal = 18;\n uint256 constant private maxSupply = 100_000_000 * (10 ** decimal);\n\n // Wallets limits\n uint256 public _maxTxAmount = maxSupply;\n uint256 public _maxAccountAmount = maxSupply;\n uint256 public _minAmountToAutoSwap = 1000 * (10 ** decimal); // 1000\n\n // Fees\n uint256 public feeAdministrationWallet = 300; // 3%\n\n uint constant private maxTotalFee = 1000;\n mapping(address => uint) public specialFeesByWallet;\n\n // Helpers\n bool internal pausedToken = false;\n bool private _noReentrancy = false;\n\n bool public pausedSwapAdmin = false;\n\n // Counters\n uint256 public accumulatedToAdmin;\n\n // Liquidity Pair\n address public liquidityPool;\n\n // Wallets\n address public administrationWallet;\n address public swapHelperAddress;\n\n struct Receivers { address wallet; uint256 amount; }\n receive() external payable { }\n\n constructor()ERC20(_nameToken, _symbolToken) {\n PancakeRouter router = PancakeRouter(0x10ED43C718714eb63d5aA57B78B54704E256024E); // BSC\n liquidityPool = address(PancakeFactory(router.factory()).createPair(WBNB, address(this)));\n\n administrationWallet = _msgSender();\n _permissions[administrationWallet] = 15;\n\n uint baseAttributes = 0;\n baseAttributes = setExemptAmountLimit(baseAttributes, true);\n _attributeMap[liquidityPool] = baseAttributes;\n\n baseAttributes = setExemptTxLimit(baseAttributes, true);\n _attributeMap[DEAD] = baseAttributes;\n _attributeMap[ZERO] = baseAttributes;\n\n baseAttributes = setExemptFee(baseAttributes, true);\n baseAttributes = setExemptSwapMaker(baseAttributes, true);\n _attributeMap[address(this)] = baseAttributes;\n\n baseAttributes = setExemptOperatePausedToken(baseAttributes, true);\n _attributeMap[_msgSender()] = baseAttributes;\n\n SwapHelper swapHelper = new SwapHelper();\n swapHelper.safeApprove(WBNB, address(this), type(uint256).max);\n swapHelper.transferOwnership(_msgSender());\n swapHelperAddress = address(swapHelper);\n\n baseAttributes = setExemptOperatePausedToken(baseAttributes, false);\n _attributeMap[swapHelperAddress] = baseAttributes;\n\n _mint(_msgSender(), maxSupply);\n\n pausedToken = true;\n }\n\n // ----------------- Public Views -----------------\n function name() public pure override returns (string memory) { return _nameToken; }\n function symbol() public pure override returns (string memory) { return _symbolToken; }\n function getOwner() external view returns (address) { return owner(); }\n function decimals() public pure override returns (uint8) { return decimal; }\n function getFeeTotal() public view returns(uint256) { return feeAdministrationWallet; }\n function getSpecialWalletFee(address target) public view returns(uint adminFee ) {\n adminFee = specialFeesByWallet[target];\n }\n\n // ----------------- Authorized Methods -----------------\n\n function enableToken() external isAdmin { pausedToken = false; }\n function setLiquidityPool(address newPair) external isAdmin {\n require(newPair != address(0), \"invalid new pair address\");\n liquidityPool = newPair;\n }\n function setPausedSwapAdmin(bool state) external isAdmin { pausedSwapAdmin = state; }\n\n // ----------------- Wallets Settings -----------------\n function setAdministrationWallet(address account) public isAdmin {\n require(account != address(0), \"adminWallet cannot be Zero\");\n administrationWallet = account;\n }\n\n // ----------------- Fee Settings -----------------\n function setFeesOperational(uint256 administration) external isFinancial {\n feeAdministrationWallet = administration;\n require(getFeeTotal() <= maxTotalFee, \"All rates and fee together must be equal or lower than 10%\");\n }\n\n function setSpecialWalletFee(address target, uint adminFee) external isFinancial {\n require(adminFee <= maxTotalFee, \"All rates and fee together must be equal or lower than 10%\");\n specialFeesByWallet[target] = adminFee;\n }\n\n // ----------------- Token Flow Settings -----------------\n function setMaxTxAmount(uint256 maxTxAmount) public isFinancial {\n require(maxTxAmount >= maxSupply / 10000, \"Amount must be bigger then 0.01% tokens\"); // 10000 tokens\n _maxTxAmount = maxTxAmount;\n }\n\n function setMaxAccountAmount(uint256 maxAccountAmount) public isFinancial {\n require(maxAccountAmount >= maxSupply / 10000, \"Amount must be bigger then 0.01% tokens\"); // 10000 tokens\n _maxAccountAmount = maxAccountAmount;\n }\n function setMinAmountToAutoSwap(uint256 amount) public isFinancial {\n _minAmountToAutoSwap = amount;\n }\n\n // ----------------- Special Authorized Operations -----------------\n function buyBackAndHoldWithDecimals(uint256 decimalAmount, address receiver) public isController { buyBackWithDecimals(decimalAmount, receiver); }\n function buyBackAndBurnWithDecimals(uint256 decimalAmount) public isController { buyBackWithDecimals(decimalAmount, address(0)); }\n\n // ----------------- External Methods -----------------\n function burn(uint256 amount) external { _burn(_msgSender(), amount); }\n\n function multiTransfer(Receivers[] memory users) external {\n for ( uint i = 0; i < users.length; i ) transfer(users[i].wallet, users[i].amount);\n }\n\n // ----------------- Internal CORE -----------------\n function _transfer( address sender, address receiver,uint256 amount) internal override {\n require(amount > 0, \"Invalid Amount\");\n require(!_noReentrancy, \"ReentrancyGuard Alert\");\n _noReentrancy = true;\n\n uint senderAttributes = _attributeMap[sender];\n uint receiverAttributes = _attributeMap[receiver];\n // Initial Checks\n require(sender != address(0) && receiver != address(0), \"transfer from the zero address\");\n require(!pausedToken || isExemptOperatePausedToken(senderAttributes), \"Token is paused\");\n require(amount <= _maxTxAmount || isExemptTxLimit(senderAttributes), \"Exceeded the maximum transaction limit\");\n\n uint256 senderBalance = _balances[sender];\n require(senderBalance >= amount, \"Transfer amount exceeds your balance\");\n uint256 newSenderBalance = senderBalance - amount;\n _balances[sender] = newSenderBalance;\n\n\n uint adminFee = feeAdministrationWallet;\n\n // Calculate Fees\n uint256 feeAmount = 0;\n if(!isExemptFee(senderAttributes) && !isExemptFeeReceiver(receiverAttributes)) {\n if(isSpecialFeeWallet(senderAttributes)) { // Check special wallet fee on sender\n adminFee = getSpecialWalletFee(sender);\n } else if(isSpecialFeeWalletReceiver(receiverAttributes)) { // Check special wallet fee on receiver\n adminFee = getSpecialWalletFee(receiver);\n }\n feeAmount = (adminFee * amount) / 10000;\n }\n\n if (feeAmount != 0) splitFee(feeAmount, sender, adminFee);\n if ((!pausedSwapAdmin) && !isExemptSwapMaker(senderAttributes)) autoSwap(sender, adminFee);\n\n // Update Recipent Balance\n uint256 newRecipientBalance = _balances[receiver] (amount - feeAmount);\n _balances[receiver] = newRecipientBalance;\n require(newRecipientBalance <= _maxAccountAmount || isExemptAmountLimit(receiverAttributes), \"Exceeded the maximum tokens an wallet can hold\");\n\n _noReentrancy = false;\n emit Transfer(sender, receiver, amount);\n }\n\n function autoSwap(address sender, uint adminFee) private {\n // --------------------- Execute Auto Swap -------------------------\n address liquidityPair = liquidityPool;\n if (sender == liquidityPair) return;\n\n uint adminAmount = accumulatedToAdmin;\n uint totalAmount = adminAmount;\n if (totalAmount < _minAmountToAutoSwap) return;\n\n // Execute auto swap\n address wbnbAddress = WBNB;\n address swapHelper = swapHelperAddress;\n\n (uint112 reserve0, uint112 reserve1) = getTokenReserves(liquidityPair);\n bool reversed = isReversed(liquidityPair, wbnbAddress);\n if (reversed) { uint112 temp = reserve0; reserve0 = reserve1; reserve1 = temp; }\n _balances[liquidityPair] = totalAmount;\n\n uint256 wbnbBalanceBefore = getTokenBalanceOf(wbnbAddress, swapHelper);\n uint256 wbnbAmount = getAmountOut(totalAmount, reserve1, reserve0);\n swapToken(liquidityPair, reversed ? 0 : wbnbAmount, reversed ? wbnbAmount : 0, swapHelper);\n uint256 wbnbBalanceNew = getTokenBalanceOf(wbnbAddress, swapHelper);\n require(wbnbBalanceNew == wbnbBalanceBefore wbnbAmount, \"Wrong amount of swapped on WBNB\");\n\n // --------------------- Transfer Swapped Amount -------------------------\n if (adminAmount > 0 && adminFee > 0) { // Cost 2 cents\n uint amountToSend = wbnbBalanceNew;\n tokenTransferFrom(wbnbAddress, swapHelper, administrationWallet, amountToSend);\n }\n accumulatedToAdmin = 0;\n }\n\n function splitFee(uint256 incomingFeeTokenAmount, address sender, uint adminFee) private {\n uint256 totalFee = adminFee;\n\n // Administrative distribution\n if (adminFee > 0) {\n accumulatedToAdmin = (incomingFeeTokenAmount * adminFee) / totalFee;\n if (pausedSwapAdmin) {\n address wallet = administrationWallet;\n uint256 walletBalance = _balances[wallet] accumulatedToAdmin;\n _balances[wallet] = walletBalance;\n emit Transfer(sender, wallet, accumulatedToAdmin);\n accumulatedToAdmin = 0;\n }\n }\n }\n\n // --------------------- Private Methods -------------------------\n\n function buyBackWithDecimals(uint256 decimalAmount, address destAddress) private {\n uint256 maxBalance = getTokenBalanceOf(WBNB, address(this));\n if (maxBalance < decimalAmount) revert(\"insufficient WBNB amount on contract\");\n\n address liquidityPair = liquidityPool;\n uint liquidityAttribute = _attributeMap[liquidityPair];\n\n uint newAttributes = setExemptTxLimit(liquidityAttribute, true);\n newAttributes = setExemptFee(liquidityAttribute, true);\n _attributeMap[liquidityPair] = newAttributes;\n\n address helperAddress = swapHelperAddress;\n\n (uint112 reserve0, uint112 reserve1) = getTokenReserves(liquidityPair);\n bool reversed = isReversed(liquidityPair, WBNB);\n if (reversed) { uint112 temp = reserve0; reserve0 = reserve1; reserve1 = temp; }\n\n tokenTransfer(WBNB, liquidityPair, decimalAmount);\n\n uint256 tokenAmount = getAmountOut(decimalAmount, reserve0, reserve1);\n if (destAddress == address(0)) {\n swapToken(liquidityPair, reversed ? tokenAmount : 0, reversed ? 0 : tokenAmount, helperAddress);\n _burn(helperAddress, tokenAmount);\n } else {\n swapToken(liquidityPair, reversed ? tokenAmount : 0, reversed ? 0 : tokenAmount, destAddress);\n }\n _attributeMap[liquidityPair] = liquidityAttribute;\n }\n\n}\n"
},
"contracts/solidity/Token/ERC20.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/ERC20.sol)\n// Modified version to provide _balances as internal instead private\n\npragma solidity 0.8.13;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport \"@openzeppelin/contracts/utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) internal _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `recipient` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address recipient, uint256 amount) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * Requirements:\n *\n * - `sender` and `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n * - the caller must have allowance for ``sender``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(currentAllowance >= amount, \"ERC20: transfer amount exceeds allowance\");\n unchecked {\n _approve(sender, _msgSender(), currentAllowance - amount);\n }\n\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender] addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `sender` to `recipient`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `sender` cannot be the zero address.\n * - `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n */\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n uint256 senderBalance = _balances[sender];\n require(senderBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[sender] = senderBalance - amount;\n }\n _balances[recipient] = amount;\n\n emit Transfer(sender, recipient, amount);\n\n _afterTokenTransfer(sender, recipient, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply = amount;\n _balances[account] = amount;\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n }\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n"
},
"contracts/solidity/Token/IPancake.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity 0.8.13;\ninterface PancakeFactory {\n function createPair(address tokenA, address tokenB) external returns (address pair);\n}\n\ninterface PancakeRouter {\n function factory() external pure returns (address);\n}\n"
},
"contracts/solidity/Token/GasHelper.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity 0.8.13;\n\nimport \"./AttributeMap.sol\";\n\ncontract GasHelper is AttributeMap {\n uint internal swapFee = 25;\n\n function setSwapFee(uint amount) external isAdmin { swapFee = amount; }\n\n function getAmountOut(uint256 amountIn, uint256 reserveIn, uint256 reserveOut) internal view returns (uint256 amountOut) {\n require(amountIn > 0, 'Insufficient amount in');\n require(reserveIn > 0 && reserveOut > 0, 'Insufficient liquidity');\n uint256 amountInWithFee = amountIn * (10000 - swapFee);\n uint256 numerator = amountInWithFee * reserveOut;\n uint256 denominator = (reserveIn * 10000) amountInWithFee;\n amountOut = numerator / denominator;\n }\n\n function isReversed(address pair, address tokenA) internal view returns (bool) {\n address token0;\n bool failed = false;\n assembly {\n let emptyPointer := mload(0x40)\n mstore(emptyPointer, 0x0dfe168100000000000000000000000000000000000000000000000000000000)\n failed := iszero(staticcall(gas(), pair, emptyPointer, 0x04, emptyPointer, 0x20))\n token0 := mload(emptyPointer)\n }\n if (failed) revert(\"Unable to check tokens direction\");\n return token0 != tokenA;\n }\n\n // gas optimization on transfer token\n function tokenTransfer(address token, address recipient, uint256 amount) internal {\n bool failed = false;\n assembly {\n let emptyPointer := mload(0x40)\n mstore(emptyPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000)\n mstore(add(emptyPointer, 0x04), recipient)\n mstore(add(emptyPointer, 0x24), amount)\n failed := iszero(call(gas(), token, 0, emptyPointer, 0x44, 0, 0))\n }\n if (failed) revert(\"Unable to transfer token\");\n }\n\n // gas optimization on transfer from token method\n function tokenTransferFrom(address token, address from, address recipient, uint256 amount) internal {\n bool failed = false;\n assembly {\n let emptyPointer := mload(0x40)\n mstore(emptyPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\n mstore(add(emptyPointer, 0x04), from)\n mstore(add(emptyPointer, 0x24), recipient)\n mstore(add(emptyPointer, 0x44), amount)\n failed := iszero(call(gas(), token, 0, emptyPointer, 0x64, 0, 0))\n }\n if (failed) revert(\"Unable to transferFrom token\");\n }\n\n // gas optimization on swap operation using a liquidity pool\n function swapToken(address pair, uint amount0Out, uint amount1Out, address receiver) internal {\n bool failed = false;\n assembly {\n let emptyPointer := mload(0x40)\n mstore(emptyPointer, 0x022c0d9f00000000000000000000000000000000000000000000000000000000)\n mstore(add(emptyPointer, 0x04), amount0Out)\n mstore(add(emptyPointer, 0x24), amount1Out)\n mstore(add(emptyPointer, 0x44), receiver)\n mstore(add(emptyPointer, 0x64), 0x80)\n mstore(add(emptyPointer, 0x84), 0)\n failed := iszero(call(gas(), pair, 0, emptyPointer, 0xa4, 0, 0))\n }\n if (failed) revert(\"Unable to swap Pair\");\n }\n\n // gas optimization on get balanceOf from BEP20 or ERC20 token\n function getTokenBalanceOf(address token, address holder) internal view returns (uint112 tokenBalance) {\n bool failed = false;\n assembly {\n let emptyPointer := mload(0x40)\n mstore(emptyPointer, 0x70a0823100000000000000000000000000000000000000000000000000000000)\n mstore(add(emptyPointer, 0x04), holder)\n failed := iszero(staticcall(gas(), token, emptyPointer, 0x24, emptyPointer, 0x40))\n tokenBalance := mload(emptyPointer)\n }\n if (failed) revert(\"Unable to get balance\");\n }\n\n // gas optimization on get reserves from liquidity pool\n function getTokenReserves(address pairAddress) internal view returns (uint112 reserve0, uint112 reserve1) {\n bool failed = false;\n assembly {\n let emptyPointer := mload(0x40)\n mstore(emptyPointer, 0x0902f1ac00000000000000000000000000000000000000000000000000000000)\n failed := iszero(staticcall(gas(), pairAddress, emptyPointer, 0x4, emptyPointer, 0x40))\n reserve0 := mload(emptyPointer)\n reserve1 := mload(add(emptyPointer, 0x20))\n }\n if (failed) revert(\"Unable to get reserves from pair\");\n }\n}\n"
},
"contracts/solidity/Token/SwapHelper.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity 0.8.13;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ncontract SwapHelper is Ownable {\n constructor() {}\n\n function safeApprove(address token, address spender, uint256 amount) external onlyOwner { IERC20(token).approve(spender, amount); }\n\n function safeWithdraw() external onlyOwner { payable(_msgSender()).transfer(address(this).balance); }\n}"
},
"@openzeppelin/contracts/token/ERC20/IERC20.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external returns (bool);\n\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n"
},
"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n"
},
"@openzeppelin/contracts/utils/Context.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n"
},
"contracts/solidity/Token/AttributeMap.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity 0.8.13;\n\nimport \"./Authorized.sol\";\n\ncontract AttributeMap is Authorized {\n\n mapping (address => uint) internal _attributeMap;\n\n // ------------- Public Views -------------\n function isExemptFee(address target) public view returns(bool) { return checkMapAttribute(_attributeMap[target], 0); }\n function isExemptFeeReceiver(address target) public view returns(bool) { return checkMapAttribute(_attributeMap[target], 1); }\n function isExemptTxLimit(address target) public view returns(bool) { return checkMapAttribute(_attributeMap[target], 2); }\n function isExemptAmountLimit(address target) public view returns(bool) { return checkMapAttribute(_attributeMap[target], 3); }\n function isExemptOperatePausedToken(address target) public view returns(bool) { return checkMapAttribute(_attributeMap[target], 4); }\n function isSpecialFeeWallet(address target) public view returns(bool) { return checkMapAttribute(_attributeMap[target], 5); }\n function isSpecialFeeWalletReceiver(address target) public view returns(bool) { return checkMapAttribute(_attributeMap[target], 6); }\n function isExemptSwapMaker(address target) public view returns(bool) { return checkMapAttribute(_attributeMap[target], 7); }\n\n // ------------- Internal PURE GET Functions -------------\n function isExemptFee(uint mapValue) internal pure returns(bool) { return checkMapAttribute(mapValue, 0); }\n function isExemptFeeReceiver(uint mapValue) internal pure returns(bool) { return checkMapAttribute(mapValue, 1); }\n function isExemptTxLimit(uint mapValue) internal pure returns(bool) { return checkMapAttribute(mapValue, 2); }\n function isExemptAmountLimit(uint mapValue) internal pure returns(bool) { return checkMapAttribute(mapValue, 3); }\n function isExemptOperatePausedToken(uint mapValue) internal pure returns(bool) { return checkMapAttribute(mapValue, 4); }\n function isSpecialFeeWallet(uint mapValue) internal pure returns(bool) { return checkMapAttribute(mapValue, 5); }\n function isSpecialFeeWalletReceiver(uint mapValue) internal pure returns(bool) { return checkMapAttribute(mapValue, 6); }\n function isExemptSwapMaker(uint mapValue) internal pure returns(bool) { return checkMapAttribute(mapValue, 7); }\n\n // ------------- Public Internal SET Functions -------------\n function setExemptFee(uint mapValue, bool operation) internal pure returns(uint) { return setMapAttribute(mapValue, 0, operation); }\n function setExemptFeeReceiver(uint mapValue, bool operation) internal pure returns(uint) { return setMapAttribute(mapValue, 1, operation); }\n function setExemptTxLimit(uint mapValue, bool operation) internal pure returns(uint) { return setMapAttribute(mapValue, 2, operation); }\n function setExemptAmountLimit(uint mapValue, bool operation) internal pure returns(uint) { return setMapAttribute(mapValue, 3, operation); }\n function setExemptOperatePausedToken(uint mapValue, bool operation) internal pure returns(uint) { return setMapAttribute(mapValue, 4, operation); }\n function setSpecialFeeWallet(uint mapValue, bool operation) internal pure returns(uint) { return setMapAttribute(mapValue, 5, operation); }\n function setSpecialFeeWalletReceiver(uint mapValue, bool operation) internal pure returns(uint) { return setMapAttribute(mapValue, 6, operation); }\n function setExemptSwapMaker(uint mapValue, bool operation) internal pure returns(uint) { return setMapAttribute(mapValue, 7, operation); }\n\n\n // ------------- Public Authorized SET Functions -------------\n function setExemptFee(address target, bool operation) public isFinancial { _attributeMap[target] = setExemptFee(_attributeMap[target], operation); }\n function setExemptFeeReceiver(address target, bool operation) public isFinancial { _attributeMap[target] = setExemptFeeReceiver(_attributeMap[target], operation); }\n function setExemptTxLimit(address target, bool operation) public isFinancial { _attributeMap[target] = setExemptTxLimit(_attributeMap[target], operation); }\n function setExemptAmountLimit(address target, bool operation) public isFinancial { _attributeMap[target] = setExemptAmountLimit(_attributeMap[target], operation); }\n function setExemptOperatePausedToken(address target, bool operation) public isFinancial { _attributeMap[target] = setExemptOperatePausedToken(_attributeMap[target], operation); }\n function setSpecialFeeWallet(address target, bool operation) public isFinancial { _attributeMap[target] = setSpecialFeeWallet(_attributeMap[target], operation); }\n function setSpecialFeeWalletReceiver(address target, bool operation) public isFinancial { _attributeMap[target] = setSpecialFeeWalletReceiver(_attributeMap[target], operation); }\n function setExemptSwapMaker(address target, bool operation) public isFinancial { _attributeMap[target] = setExemptSwapMaker(_attributeMap[target], operation); }\n\n\n}\n"
},
"contracts/solidity/Token/Authorized.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity 0.8.13;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ncontract Authorized is Ownable {\n mapping(address => uint) internal _permissions;\n\n function safeApprove(address token, address spender, uint256 amount) external isAdmin { IERC20(token).approve(spender, amount); }\n function safeTransfer(address token, address receiver, uint256 amount) external isAdmin { IERC20(token).transfer(receiver, amount); }\n function safeWithdraw() external isAdmin { payable(_msgSender()).transfer(address(this).balance); }\n\n function setPermission(address wallet, uint8 typeIndex, bool state) external isAdmin { _permissions[wallet] = setMapAttribute(_permissions[wallet], typeIndex, state); }\n function checkMapAttribute(uint mapValue, uint8 shift) internal pure returns(bool) { return mapValue >> shift & 1 == 1; }\n function setMapAttribute(uint mapValue, uint8 shift, bool include) internal pure returns(uint) { return include ? 1 << shift | mapValue : 1 << shift ^ type(uint).max & mapValue; }\n function hasPermission(address wallet, uint8 typeIndex) external view returns(bool) { return checkMapAttribute(_permissions[wallet], typeIndex); }\n function checkPermission(uint8 typeIndex) private view { require(checkMapAttribute(_permissions[msg.sender], typeIndex) || owner() == msg.sender, \"Wallet does not have permission\"); }\n\n modifier isAdmin { checkPermission(0); _; }\n modifier isFinancial { checkPermission(1); _; }\n modifier isController { checkPermission(2); _; }\n modifier isUpdater { checkPermission(3); _; }\n}"
},
"@openzeppelin/contracts/access/Ownable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 9999
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}
}}