creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "contracts/AxeCapProfitShare.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ncontract AxeCapProfitShare8 {\n    uint256 public immutable REVENUE_AMOUNT;\n    address public owner;\n    uint256 public totalSnapshotTokens;\n    uint256 public snapshotTime;\n    bool public isSnapshotLocked;\n    bool public isFreezed;\n\n    mapping(address => uint256) public snapshotBalances;\n    mapping(address => bool) public hasClaimed;\n\n    event AxeSnapshotLock();\n    event AxeSnapshotUnlock();\n    event EthClaim(address indexed claimer, uint256 amount);\n    event AdminWithdraw(uint256 amount);\n\n    constructor() payable {\n        owner = msg.sender;\n        REVENUE_AMOUNT = msg.value;\n    }\n\n    modifier onlyOwner() {\n        require(msg.sender == owner, \"Caller is not the owner\");\n        _;\n    }\n    //\n    modifier after3Days() {\n        require(\n            block.timestamp > snapshotTime + 3 days,\n            \"Can only call after 3 days of snapshot\"\n        );\n        _;\n    }\n\n    function uploadSnapshot(\n        address[] calldata users,\n        uint256[] calldata balances\n    ) external onlyOwner {\n        require(\n            users.length == balances.length,\n            \"Arrays must be of equal length\"\n        );\n        // require(users.length <= 125, \"Can only upload up to 125 addresses at a time\");\n\n        // note: should not have more than one user value\n        for (uint256 i = 0; i < users.length; i++) {\n            snapshotBalances[users[i]] += balances[i];\n            totalSnapshotTokens += balances[i];\n        }\n    }\n\n    function lockSnapshot() external onlyOwner {\n        require(!isSnapshotLocked, \"snapshot already locked\");\n\n        snapshotTime = block.timestamp;\n        isSnapshotLocked = true;\n\n        emit AxeSnapshotLock();\n    }\n\n    function freeze() external onlyOwner {\n        require(!isFreezed, \"Contract is already frozen\");\n\n        isFreezed = true;\n\n        emit AxeSnapshotUnlock();\n    }\n\n    function claimETH() external {\n        require(!isFreezed, \"Contract is frozen\");\n        require(isSnapshotLocked, \"Snapshot not yet locked\");\n        require(!hasClaimed[msg.sender], \"You have already claimed your ETH\");\n        require(\n            snapshotBalances[msg.sender] > 0,\n            \"You do not have any AXE tokens in the snapshot\"\n        );\n\n        uint256 claimableAmount = (REVENUE_AMOUNT *\n            snapshotBalances[msg.sender]) / totalSnapshotTokens;\n\n        // prevent reentrancy\n        hasClaimed[msg.sender] = true;\n\n        // see https://ethereum.stackexchange.com/questions/78124/is-transfer-still-safe-after-the-istanbul-update\n        (bool isSuccess, ) = msg.sender.call{value: claimableAmount}(\"\");\n        require(isSuccess, \"Claim amount tranfer failed\");\n\n        emit EthClaim(msg.sender, claimableAmount);\n    }\n\n    // Function to withdraw unclaimed ETH after 7 days\n    function withdrawUnclaimedETH() public onlyOwner after3Days {\n        uint256 amount = address(this).balance;\n        (bool success, ) = msg.sender.call{value: amount}(\"\");\n        require(success, \"Withdraw failed\");\n        emit AdminWithdraw(amount);\n    }\n\n    receive() external payable {}\n}\n"
      }
    },
    "settings": {
      "optimizer": {
        "enabled": true,
        "runs": 500
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "libraries": {}
    }
  }}