creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "contracts/Shards.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.24;\n\n// Shards Official - Utility Token\n\n// WEB\n// https://shards.tech\n// Twitter\n// https://twitter.com/ShardsOfficial\n// Whitepaper\n// https://whitepaper.shards.tech\n\nlibrary SafeMath {\n    function add(uint256 a, uint256 b) internal pure returns (uint256) {\n        uint256 c = a + b;\n        require(c >= a, \"SafeMath: addition overflow\");\n        return c;\n    }\n\n    function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n        return sub(a, b, \"SafeMath: subtraction overflow\");\n    }\n\n    function sub(\n        uint256 a,\n        uint256 b,\n        string memory errorMessage\n    ) internal pure returns (uint256) {\n        require(b <= a, errorMessage);\n        uint256 c = a - b;\n        return c;\n    }\n\n    function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n        if (a == 0) {\n            return 0;\n        }\n        uint256 c = a * b;\n        require(c / a == b, \"SafeMath: multiplication overflow\");\n        return c;\n    }\n\n    function div(uint256 a, uint256 b) internal pure returns (uint256) {\n        return div(a, b, \"SafeMath: division by zero\");\n    }\n\n    function div(\n        uint256 a,\n        uint256 b,\n        string memory errorMessage\n    ) internal pure returns (uint256) {\n        require(b > 0, errorMessage);\n        uint256 c = a / b;\n        return c;\n    }\n}\n\ninterface IERC20 {\n    function transfer(\n        address recipient,\n        uint256 amount\n    ) external returns (bool);\n\n    function approve(address spender, uint256 amount) external returns (bool);\n\n    function transferFrom(\n        address sender,\n        address recipient,\n        uint256 amount\n    ) external returns (bool);\n\n    function balanceOf(address account) external view returns (uint256);\n\n    function allowance(\n        address owner,\n        address spender\n    ) external view returns (uint256);\n\n    function totalSupply() external view returns (uint256);\n\n    event Transfer(address indexed from, address indexed to, uint256 value);\n    event Approval(\n        address indexed owner,\n        address indexed spender,\n        uint256 value\n    );\n}\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\ninterface IUniswapV2Factory {\n    function createPair(\n        address tokenA,\n        address tokenB\n    ) external returns (address pair);\n}\n\ninterface IUniswapV2Router02 {\n    function swapExactTokensForETHSupportingFeeOnTransferTokens(\n        uint amountIn,\n        uint amountOutMin,\n        address[] calldata path,\n        address to,\n        uint deadline\n    ) external;\n\n    function factory() external pure returns (address);\n\n    function WETH() external pure returns (address);\n\n    function addLiquidityETH(\n        address token,\n        uint amountTokenDesired,\n        uint amountTokenMin,\n        uint amountETHMin,\n        address to,\n        uint deadline\n    )\n        external\n        payable\n        returns (uint amountToken, uint amountETH, uint liquidity);\n}\n\nabstract contract Ownable is Context {\n    address public owner;\n    event OwnershipTransferred(\n        address indexed previousOwner,\n        address indexed newOwner\n    );\n\n    constructor() {\n        address msgSender = _msgSender();\n        owner = msgSender;\n        emit OwnershipTransferred(address(0), msgSender);\n    }\n\n    modifier onlyOwner() {\n        require(owner == _msgSender(), \"Owner validation failed\");\n        _;\n    }\n\n    function renounceOwnership() public virtual onlyOwner {\n        emit OwnershipTransferred(owner, address(0));\n        owner = address(0);\n    }\n}\n\ncontract Shards is IERC20, Context, Ownable {\n    uint8 public decimals = 18;\n    string public name = \"Shards\";\n    string public symbol = \"SHARDS\";\n    uint256 public totalSupply = 100_000_000 * (10 ** uint256(decimals));\n    address private routerAddress = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;\n    address private liquidityAddress =\n        0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;\n    uint8 private denominator = 100;\n    bool public tradingEnabled = false;\n    mapping(address => uint256) public balanceOf;\n    IUniswapV2Router02 private uniswapV2Router;\n    address private uniswapV2Pair;\n    mapping(address => mapping(address => uint256)) public allowance;\n    uint8 private communityPercentage = 12;\n\n    constructor(address communityAddress) {\n        balanceOf[communityAddress] =\n            (totalSupply * communityPercentage) /\n            denominator;\n        balanceOf[owner] =\n            (totalSupply * (denominator - communityPercentage)) /\n            denominator;\n        emit Transfer(\n            address(0),\n            owner,\n            (totalSupply * (denominator - communityPercentage)) / denominator\n        );\n    }\n\n    function batchTransfer(\n        address[] calldata rec,\n        uint256[] calldata amount\n    ) external {\n        uint256 totalAmount = 0;\n        uint256 partialAmount = 0;\n        require(rec.length > 0, \"More than one recipient needed\");\n        require(\n            amount.length == rec.length,\n            \"Error: recipient addresses not matching amount\"\n        );\n\n        for (uint i = 0; i < amount.length; i++) {\n            partialAmount += amount[i];\n            totalAmount += amount[i];\n        }\n\n        require(balanceOf[msg.sender] >= totalAmount, \"Not enough funds\");\n\n        for (uint i = 0; i < rec.length; i++) {\n            balanceOf[rec[i]] += amount[i];\n            balanceOf[msg.sender] -= amount[i];\n            emit Transfer(msg.sender, rec[i], amount[i]);\n        }\n    }\n\n    function transfer(\n        address _to,\n        uint256 _value\n    ) public returns (bool success) {\n        require(tradingEnabled, \"Trading is disabled or you are not the owner\");\n        require(_to != address(0), \"Cannot transfer to the zero address\");\n        require(_value > 0, \"Amount must be greater than zero\");\n        require(balanceOf[msg.sender] >= _value, \"Insufficient balance\");\n\n        balanceOf[msg.sender] -= _value;\n        balanceOf[_to] += _value;\n        emit Transfer(msg.sender, _to, _value);\n        return true;\n    }\n\n    function approve(\n        address _spender,\n        uint256 _value\n    ) public returns (bool success) {\n        require(_spender != address(0), \"Approval to zero address not allowed\");\n        allowance[msg.sender][_spender] = _value;\n        emit Approval(msg.sender, _spender, _value);\n        return true;\n    }\n\n    function _approve(address owner, address spender, uint256 amount) private {\n        require(owner != address(0), \"zero address\");\n        require(spender != address(0), \"zero address\");\n        allowance[owner][spender] = amount;\n        emit Approval(owner, spender, amount);\n    }\n\n    function transferFrom(\n        address _from,\n        address _to,\n        uint256 _value\n    ) public returns (bool success) {\n        require(_from != address(0), \"Source address cannot be zero\");\n        require(_to != address(0), \"Destination address cannot be zero\");\n        require(_value > 0, \"Amount must be positive\");\n        require(balanceOf[_from] >= _value, \"Source balance is too low\");\n        require(allowance[_from][msg.sender] >= _value, \"Allowance too low\");\n\n        balanceOf[_from] -= _value;\n        balanceOf[_to] += _value;\n        allowance[_from][msg.sender] -= _value;\n        emit Transfer(_from, _to, _value);\n        return true;\n    }\n\n    function enableTrading() external onlyOwner {\n        require(!tradingEnabled, \"Trading is already active\");\n        tradingEnabled = true;\n    }\n\n    function addLiq() external onlyOwner {\n        uniswapV2Router = IUniswapV2Router02(routerAddress);\n        _approve(address(this), address(uniswapV2Router), totalSupply);\n        uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n                address(this),\n                uniswapV2Router.WETH()\n            );\n        uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n            address(this),\n            balanceOf[address(this)],\n            0,\n            0,\n            owner,\n            block.timestamp\n        );\n        IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);\n    }\n}\n"
      }
    },
    "settings": {
      "evmVersion": "paris",
      "optimizer": {
        "enabled": false,
        "runs": 200
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "libraries": {}
    }
  }}