Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0x8831532476943Ce0D75b91d23dD3a7c419f2F6Bf
Balance 0.039694 ETH
Nonce 1
Code Size 2773 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

2773 bytes
0x6080604052600436106100f5575f3560e01c806375e2305a11610089578063d0b7480611610058578063d0b74806146102fc578063e1f1c4a714610310578063ebec47ac14610325578063f7b888ef1461034557610105565b806375e2305a146102725780638988504914610287578063b1bc5ffe146102b2578063bdc78928146102e757610105565b80634107d9cb116100c55780634107d9cb146102235780636180c609146102385780636b2bc8fa1461024c5780636f9fb98a1461026057610105565b8062a6acaa1461010e5780630342b7c51461015957806307ea4c01146101985780630d6ea6a91461020e57610105565b36610105576101033461035a565b005b6101033461035a565b348015610119575f5ffd5b5073b5bd14bd1653988ef4781938584aa42df73c8a2b5f5260046020525f516020610a405f395f51905f52545b6040519081526020015b60405180910390f35b348015610164575f5ffd5b5061018073b5bd14bd1653988ef4781938584aa42df73c8a2b81565b6040516001600160a01b039091168152602001610150565b3480156101a3575f5ffd5b5060015460046020525f516020610a405f395f51905f52545f516020610a805f395f51905f525f525f516020610a605f395f51905f525460025460035447604080519687526020870195909552938501929092526060840152608083015260a082015260c001610150565b348015610219575f5ffd5b5061014660025481565b34801561022e575f5ffd5b5061014660015481565b348015610243575f5ffd5b50610146610535565b348015610257575f5ffd5b50610103610581565b34801561026b575f5ffd5b5047610146565b34801561027d575f5ffd5b5061014661232881565b348015610292575f5ffd5b506101466102a13660046109af565b60046020525f908152604090205481565b3480156102bd575f5ffd5b505f516020610a805f395f51905f525f5260046020525f516020610a605f395f51905f5254610146565b3480156102f2575f5ffd5b506101466103e881565b348015610307575f5ffd5b5061010361077d565b34801561031b575f5ffd5b5061014661271081565b348015610330575f5ffd5b506101805f516020610a805f395f51905f5281565b348015610350575f5ffd5b5061014660035481565b5f81116103a55760405162461bcd60e51b81526020600482015260146024820152734e6f2045544820746f206469737472696275746560601b60448201526064015b60405180910390fd5b8060015f8282546103b691906109f0565b909155505f90506127106103cc6103e884610a09565b6103d69190610a20565b90505f6127106103e861232885610a09565b6103f29190610a20565b73b5bd14bd1653988ef4781938584aa42df73c8a2b5f90815260046020525f516020610a405f395f51905f52805492935084929091906104339084906109f0565b90915550505f516020610a805f395f51905f525f90815260046020525f516020610a605f395f51905f52805483929061046d9084906109f0565b90915550506001546040805185815260208101929092527f39c136841841422152763c531ae69f372cde0962447a12b77af301db07a1611d910160405180910390a160046020525f516020610a405f395f51905f52545f516020610a805f395f51905f525f525f516020610a605f395f51905f52546001546040517f33a9e5064cde0e23e17620f5186dbc127306864069276a5b80b24ffc5481cb4a9361052893909290919283526020830191909152604082015260600190565b60405180910390a1505050565b60046020525f516020610a605f395f51905f525473b5bd14bd1653988ef4781938584aa42df73c8a2b5f9081525f516020610a405f395f51905f5254909161057c916109f0565b905090565b610589610987565b335f516020610a805f395f51905f52146105e55760405162461bcd60e51b815260206004820152601760248201527f4f6e6c792057414c4c45545f422063616e20636c61696d000000000000000000604482015260640161039c565b5f516020610a805f395f51905f525f5260046020525f516020610a605f395f51905f5254806106485760405162461bcd60e51b815260206004820152600f60248201526e4e6f2045544820746f20636c61696d60881b604482015260640161039c565b5f516020610a805f395f51905f525f90815260046020525f516020610a605f395f51905f52819055600380548392906106829084906109f0565b90915550506040515f905f516020610a805f395f51905f529083908381818185875af1925050503d805f81146106d3576040519150601f19603f3d011682016040523d82523d5f602084013e6106d8565b606091505b505090508061071f5760405162461bcd60e51b8152602060048201526013602482015272115512081d1c985b9cd9995c8819985a5b1959606a1b604482015260640161039c565b6003546040515f516020610a805f395f51905f52917f4710f532bc8d1309948999011d519bb1885679b87ed364d9a77cbe6cb680c9a79161076891868252602082015260400190565b60405180910390a2505061077b60015f55565b565b610785610987565b3373b5bd14bd1653988ef4781938584aa42df73c8a2b146107e85760405162461bcd60e51b815260206004820152601760248201527f4f6e6c792057414c4c45545f412063616e20636c61696d000000000000000000604482015260640161039c565b73b5bd14bd1653988ef4781938584aa42df73c8a2b5f5260046020525f516020610a405f395f51905f5254806108525760405162461bcd60e51b815260206004820152600f60248201526e4e6f2045544820746f20636c61696d60881b604482015260640161039c565b73b5bd14bd1653988ef4781938584aa42df73c8a2b5f90815260046020525f516020610a405f395f51905f52819055600280548392906108939084906109f0565b90915550506040515f9073b5bd14bd1653988ef4781938584aa42df73c8a2b9083908381818185875af1925050503d805f81146108eb576040519150601f19603f3d011682016040523d82523d5f602084013e6108f0565b606091505b50509050806109375760405162461bcd60e51b8152602060048201526013602482015272115512081d1c985b9cd9995c8819985a5b1959606a1b604482015260640161039c565b60025460405173b5bd14bd1653988ef4781938584aa42df73c8a2b917f4710f532bc8d1309948999011d519bb1885679b87ed364d9a77cbe6cb680c9a79161076891868252602082015260400190565b60025f54036109a957604051633ee5aeb560e01b815260040160405180910390fd5b60025f55565b5f602082840312156109bf575f5ffd5b81356001600160a01b03811681146109d5575f5ffd5b9392505050565b634e487b7160e01b5f52601160045260245ffd5b80820180821115610a0357610a036109dc565b92915050565b8082028115828204841417610a0357610a036109dc565b5f82610a3a57634e487b7160e01b5f52601260045260245ffd5b50049056fea9a54b447d5fda03a1587d4f516cfe3c2c6daf55d7036e2384d8b2305e57d5ef7323ede005b6f61c628ab528c49a9a9921c20a0ae41c0a9ee1c48e4fff8b3f8f0000000000000000000000005d3e5db8977ae681ea52aac538d1be53b077ee67a26469706673582212209b03606346f8450f2ee43fb06748f4912663a0569c2ccc6deb24bf64def81faf64736f6c634300081e0033

Verified Source Code Full Match

Compiler: v0.8.30+commit.73712a01 EVM: prague Optimization: Yes (200 runs)
TaxDistributor.sol 128 lines
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";

contract TaxDistribution is ReentrancyGuard {
    // Hardcoded wallet addresses for claiming
    address public constant WALLET_A = 0xb5Bd14bD1653988eF4781938584aa42df73c8A2B; // 10%
    address public constant WALLET_B = 0x5d3E5Db8977AE681Ea52AAC538d1bE53b077EE67; // 90%
    
    // Distribution percentages (in basis points for precision)
    uint256 public constant WALLET_A_PERCENTAGE = 1000; // 10% = 1000 basis points
    uint256 public constant WALLET_B_PERCENTAGE = 9000; // 90% = 9000 basis points
    uint256 public constant BASIS_POINTS = 10000; // 100% = 10000 basis points
    
    // Tracking variables
    uint256 public totalAccumulated;
    uint256 public totalClaimedA;
    uint256 public totalClaimedB;
    
    // Claimable amounts for each wallet
    mapping(address => uint256) public claimableAmount;
    
    // Events
    event ETHReceived(uint256 amount, uint256 totalAccumulated);
    event ETHClaimed(address indexed wallet, uint256 amount, uint256 totalClaimed);
    event DistributionUpdated(uint256 amountA, uint256 amountB, uint256 totalAccumulated);
    
    constructor() {
        // Contract is ready to receive ETH
    }
    
    // Receive ETH and distribute to claimable amounts
    receive() external payable {
        _distributeETH(msg.value);
    }
    
    // Fallback function to handle ETH sent with data
    fallback() external payable {
        _distributeETH(msg.value);
    }
    
    // Internal function to distribute received ETH
    function _distributeETH(uint256 amount) internal {
        require(amount > 0, "No ETH to distribute");
        
        totalAccumulated += amount;
        
        // Calculate distribution amounts
        uint256 amountA = (amount * WALLET_A_PERCENTAGE) / BASIS_POINTS;
        uint256 amountB = (amount * WALLET_B_PERCENTAGE) / BASIS_POINTS;
        
        // Add to claimable amounts
        claimableAmount[WALLET_A] += amountA;
        claimableAmount[WALLET_B] += amountB;
        
        emit ETHReceived(amount, totalAccumulated);
        emit DistributionUpdated(claimableAmount[WALLET_A], claimableAmount[WALLET_B], totalAccumulated);
    }
    
    // Function for WALLET_A to claim their 10%
    function claimA() external nonReentrant {
        require(msg.sender == WALLET_A, "Only WALLET_A can claim");
        
        uint256 amount = claimableAmount[WALLET_A];
        require(amount > 0, "No ETH to claim");
        
        claimableAmount[WALLET_A] = 0;
        totalClaimedA += amount;
        
        (bool success, ) = WALLET_A.call{value: amount}("");
        require(success, "ETH transfer failed");
        
        emit ETHClaimed(WALLET_A, amount, totalClaimedA);
    }
    
    // Function for WALLET_B to claim their 90%
    function claimB() external nonReentrant {
        require(msg.sender == WALLET_B, "Only WALLET_B can claim");
        
        uint256 amount = claimableAmount[WALLET_B];
        require(amount > 0, "No ETH to claim");
        
        claimableAmount[WALLET_B] = 0;
        totalClaimedB += amount;
        
        (bool success, ) = WALLET_B.call{value: amount}("");
        require(success, "ETH transfer failed");
        
        emit ETHClaimed(WALLET_B, amount, totalClaimedB);
    }
    
    // View functions for getting distribution info
    function getClaimableAmountA() external view returns (uint256) {
        return claimableAmount[WALLET_A];
    }
    
    function getClaimableAmountB() external view returns (uint256) {
        return claimableAmount[WALLET_B];
    }
    
    function getTotalClaimable() external view returns (uint256) {
        return claimableAmount[WALLET_A] + claimableAmount[WALLET_B];
    }
    
    function getDistributionInfo() external view returns (
        uint256 totalAcc,
        uint256 claimableA,
        uint256 claimableB,
        uint256 claimedA,
        uint256 claimedB,
        uint256 contractBalance
    ) {
        return (
            totalAccumulated,
            claimableAmount[WALLET_A],
            claimableAmount[WALLET_B],
            totalClaimedA,
            totalClaimedB,
            address(this).balance
        );
    }
    
    // Emergency function to check contract balance
    function getContractBalance() external view returns (uint256) {
        return address(this).balance;
    }
}
ReentrancyGuard.sol 87 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,
 * consider using {ReentrancyGuardTransient} instead.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant NOT_ENTERED = 1;
    uint256 private constant ENTERED = 2;

    uint256 private _status;

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    constructor() {
        _status = NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be NOT_ENTERED
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

        // Any calls to nonReentrant after this point will fail
        _status = ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == ENTERED;
    }
}

Read Contract

BASIS_POINTS 0xe1f1c4a7 → uint256
WALLET_A 0x0342b7c5 → address
WALLET_A_PERCENTAGE 0xbdc78928 → uint256
WALLET_B 0xebec47ac → address
WALLET_B_PERCENTAGE 0x75e2305a → uint256
claimableAmount 0x89885049 → uint256
getClaimableAmountA 0x00a6acaa → uint256
getClaimableAmountB 0xb1bc5ffe → uint256
getContractBalance 0x6f9fb98a → uint256
getDistributionInfo 0x07ea4c01 → uint256, uint256, uint256, uint256, uint256, uint256
getTotalClaimable 0x6180c609 → uint256
totalAccumulated 0x4107d9cb → uint256
totalClaimedA 0x0d6ea6a9 → uint256
totalClaimedB 0xf7b888ef → uint256

Write Contract 2 functions

These functions modify contract state and require a wallet transaction to execute.

claimA 0xd0b74806
No parameters
claimB 0x6b2bc8fa
No parameters

Recent Transactions

No transactions found for this address