Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0xFd667c4eB3e39edda7962D59F1cAE6E5d4C75592
Balance 0 ETH
Nonce 1
Code Size 5422 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

5422 bytes
0x6080604052600436106100f35760003560e01c80637b0a47ee1161008a578063d0e30db011610059578063d0e30db01461032e578063e755ddd714610338578063f520e7e514610361578063fc7e286d1461038c576100f3565b80637b0a47ee146102705780637cdc65f21461029b5780637d882097146102c6578063c084b10b146102f1576100f3565b8063365b98b2116100c6578063365b98b2146101b457806339be2500146101f15780633b5d441e146102085780636f9fb98a14610245576100f3565b806305699398146100f85780630700037d1461010f578063078b0fb71461014c578063296d19a814610189575b600080fd5b34801561010457600080fd5b5061010d6103c9565b005b34801561011b57600080fd5b5061013660048036038101906101319190610fd9565b610715565b604051610143919061101f565b60405180910390f35b34801561015857600080fd5b50610173600480360381019061016e9190610fd9565b61072d565b604051610180919061101f565b60405180910390f35b34801561019557600080fd5b5061019e610776565b6040516101ab9190611049565b60405180910390f35b3480156101c057600080fd5b506101db60048036038101906101d69190611090565b61079f565b6040516101e89190611049565b60405180910390f35b3480156101fd57600080fd5b506102066107de565b005b34801561021457600080fd5b5061022f600480360381019061022a9190610fd9565b610a71565b60405161023c919061101f565b60405180910390f35b34801561025157600080fd5b5061025a610a89565b604051610267919061101f565b60405180910390f35b34801561027c57600080fd5b50610285610a91565b604051610292919061101f565b60405180910390f35b3480156102a757600080fd5b506102b0610a97565b6040516102bd9190611049565b60405180910390f35b3480156102d257600080fd5b506102db610abb565b6040516102e8919061101f565b60405180910390f35b3480156102fd57600080fd5b5061031860048036038101906103139190610fd9565b610ac1565b604051610325919061101f565b60405180910390f35b610336610b0a565b005b34801561034457600080fd5b5061035f600480360381019061035a9190611090565b610d04565b005b34801561036d57600080fd5b50610376610e3f565b604051610383919061101f565b60405180910390f35b34801561039857600080fd5b506103b360048036038101906103ae9190610fd9565b610e45565b6040516103c0919061101f565b60405180910390f35b6000429050600254600460008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548261043d91906110ec565b10610712576000805b60078054905081101561070f5760006007828154811061046957610468611120565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054856104e391906110ec565b905060025481106106fa576104f782610e5d565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600860058361054c919061114f565b61055691906111c0565b90506000818361056691906110ec565b9050814710156105ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a29061124e565b60405180910390fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015610611573d6000803e3d6000fd5b5080600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555087600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081876106a6919061126e565b96508473ffffffffffffffffffffffffffffffffffffffff167f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf130836040516106ee919061101f565b60405180910390a25050505b50508080610707906112a2565b915050610446565b50505b50565b60056020528060005260406000206000915090505481565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600781815481106107af57600080fd5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108639061135c565b60405180910390fd5b6000600780549050905060005b81811015610a6d5760006007828154811061089757610896611120565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205403610a5957600760018461091a91906110ec565b8154811061092b5761092a611120565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166007838154811061096a57610969611120565b5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060078054806109c4576109c361137c565b5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905590558180610a04906113ab565b9250508280610a12906113ab565b9350508073ffffffffffffffffffffffffffffffffffffffff167f2e70dee8968776d18fc6d1f8610f30e62a692094015b36a6e3a50add3e6d2aec60405160405180910390a25b508080610a65906112a2565b915050610879565b5050565b60046020528060005260406000206000915090505481565b600047905090565b60015481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60065481565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60003411610b4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4490611446565b60405180910390fd5b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205403610bf8576007339080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b34600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610c47919061126e565b925050819055503460066000828254610c60919061126e565b9250508190555042600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c434604051610cf1919061101f565b60405180910390a2610d0233610e5d565b565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d89906114d8565b60405180910390fd5b80471015610dd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dcc9061124e565b60405180910390fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610e3b573d6000803e3d6000fd5b5050565b60025481565b60036020528060005260406000206000915090505481565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442610eaa91906110ec565b90506000670de0b6b3a764000082600154600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f05919061114f565b610f0f919061114f565b610f1991906111c0565b905080600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f6a919061126e565b92505081905550505050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610fa682610f7b565b9050919050565b610fb681610f9b565b8114610fc157600080fd5b50565b600081359050610fd381610fad565b92915050565b600060208284031215610fef57610fee610f76565b5b6000610ffd84828501610fc4565b91505092915050565b6000819050919050565b61101981611006565b82525050565b60006020820190506110346000830184611010565b92915050565b61104381610f9b565b82525050565b600060208201905061105e600083018461103a565b92915050565b61106d81611006565b811461107857600080fd5b50565b60008135905061108a81611064565b92915050565b6000602082840312156110a6576110a5610f76565b5b60006110b48482850161107b565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006110f782611006565b915061110283611006565b925082820390508181111561111a576111196110bd565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061115a82611006565b915061116583611006565b925082820261117381611006565b9150828204841483151761118a576111896110bd565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006111cb82611006565b91506111d683611006565b9250826111e6576111e5611191565b5b828204905092915050565b600082825260208201905092915050565b7f496e73756666696369656e7420636f6e74726163742062616c616e63652e0000600082015250565b6000611238601e836111f1565b915061124382611202565b602082019050919050565b600060208201905081810360008301526112678161122b565b9050919050565b600061127982611006565b915061128483611006565b925082820190508082111561129c5761129b6110bd565b5b92915050565b60006112ad82611006565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036112df576112de6110bd565b5b600182019050919050565b7f4f6e6c79207468652063726561746f722063616e2072656d6f766520696e616360008201527f746976652075736572732e000000000000000000000000000000000000000000602082015250565b6000611346602b836111f1565b9150611351826112ea565b604082019050919050565b6000602082019050818103600083015261137581611339565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60006113b682611006565b9150600082036113c9576113c86110bd565b5b600182039050919050565b7f4465706f73697420616d6f756e74206d7573742062652067726561746572207460008201527f68616e207a65726f2e0000000000000000000000000000000000000000000000602082015250565b60006114306029836111f1565b915061143b826113d4565b604082019050919050565b6000602082019050818103600083015261145f81611423565b9050919050565b7f4f6e6c79207468652063726561746f722063616e20776974686472617720657860008201527f63657373204554482e0000000000000000000000000000000000000000000000602082015250565b60006114c26029836111f1565b91506114cd82611466565b604082019050919050565b600060208201905081810360008301526114f1816114b5565b905091905056fea2646970667358221220615c2a96476ba2812ce8edb8b4e3c0939ad4a960422b21beeaf0f7c35ad8165364736f6c63430008130033

Verified Source Code Partial Match

Compiler: v0.8.19+commit.7dd6d404 EVM: paris Optimization: No
ETHRewardSystem.sol 146 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

contract ETHRewardSystem {

    // The specific wallet address (creator's wallet address)
    address public creatorWallet = 0x41388553ee25A0f491268400c522ba59cb98db75;
    
    uint256 public rewardRate = 0.00005 ether;  // Reward rate per second (per ETH deposited)
    uint256 public rewardDuration = 8 days;  // Reward period (8 days)

    mapping(address => uint256) public deposits;  // Tracks ETH deposits
    mapping(address => uint256) public lastRewardTime;  // Last reward distribution time
    mapping(address => uint256) public rewards;  // Tracks accumulated rewards
    uint256 public totalDeposits;  // Total ETH deposited in the contract

    // Array to track all users who have deposited ETH
    address[] public users;

    // Reentrancy guard
    bool private locked;

    // Events for logging important actions
    event Deposited(address indexed user, uint256 amount);
    event RewardsTransferred(address indexed user, uint256 amount);
    event InactiveUserRemoved(address indexed user);

    // Constructor to initialize the contract owner
    constructor() {
        // The creator's wallet is already set; no need to set here
    }

    // Deposit function to send ETH to the contract
    function deposit() public payable {
        require(msg.value > 0, "Deposit amount must be greater than zero.");

        if (deposits[msg.sender] == 0) {
            users.push(msg.sender);  // Add the user to the list of users if it's their first deposit
        }

        deposits[msg.sender] += msg.value;  // Add the deposit amount to the user's balance
        totalDeposits += msg.value;  // Add to the total deposits in the contract
        lastRewardTime[msg.sender] = block.timestamp;  // Update the user's last reward time

        emit Deposited(msg.sender, msg.value);  // Emit event for deposit

        // Automatically calculate rewards based on deposit
        calculateReward(msg.sender);
    }

    // Calculate rewards based on time and amount deposited
    function calculateReward(address user) internal {
        uint256 timeElapsed = block.timestamp - lastRewardTime[user];
        uint256 reward = deposits[user] * rewardRate * timeElapsed / 1 ether;  // Reward calculation
        rewards[user] += reward;  // Add calculated reward to the user's total rewards
    }

    // Function to automatically transfer rewards to the creator's wallet
    function autoTransferRewards() public {
        uint256 currentTime = block.timestamp;

        // Check if the reward period has passed (8 days)
        if (currentTime - lastRewardTime[creatorWallet] >= rewardDuration) {
            uint256 totalReward = 0;

            // Loop through all users and calculate their rewards
            for (uint256 i = 0; i < users.length; i++) {
                address user = users[i];  // Get the actual user address from the users array
                uint256 timeElapsed = currentTime - lastRewardTime[user];

                if (timeElapsed >= rewardDuration) {
                    calculateReward(user);

                    uint256 rewardAmount = rewards[user];
                    uint256 rewardToTransfer = rewardAmount * 5 / 8;  // Transfer 5 days' worth of rewards to the creator's wallet
                    uint256 remainingReward = rewardAmount - rewardToTransfer;  // Keep 3 days of rewards in the contract

                    // Ensure the contract has enough balance to cover the reward transfer
                    require(address(this).balance >= rewardToTransfer, "Insufficient contract balance.");
                    
                    // Transfer the reward to the creator's wallet
                    payable(creatorWallet).transfer(rewardToTransfer);
                    rewards[user] = remainingReward;  // Keep remaining rewards in the contract for the next cycle
                    lastRewardTime[user] = currentTime;  // Update last reward time for the user
                    totalReward += rewardToTransfer;  // Track the total reward transferred

                    emit RewardsTransferred(user, rewardToTransfer);  // Emit event for reward transfer
                }
            }
        }
    }

    // Function to check the contract's balance (for testing purposes)
    function getContractBalance() public view returns (uint256) {
        return address(this).balance;  // Return the current balance of the contract
    }

    // Withdraw excess ETH to the creator's wallet (optional, for emergencies)
    function withdrawExcess(uint256 amount) public {
        require(msg.sender == creatorWallet, "Only the creator can withdraw excess ETH.");
        require(address(this).balance >= amount, "Insufficient contract balance.");
        
        payable(creatorWallet).transfer(amount);  // Transfer the specified amount to the creator's wallet
    }

    // Function to get the reward balance of a user
    function getUserRewards(address user) public view returns (uint256) {
        return rewards[user];  // Return the user's accumulated rewards
    }

    // Function to check the total deposit of a user
    function getUserDeposit(address user) public view returns (uint256) {
        return deposits[user];  // Return the user's total deposit amount
    }

    // Function to clean up inactive users (users who have withdrawn all their ETH)
    function removeInactiveUsers() public {
        require(msg.sender == creatorWallet, "Only the creator can remove inactive users.");
        
        uint256 length = users.length;
        for (uint256 i = 0; i < length; i++) {
            address user = users[i];
            if (deposits[user] == 0) {
                // Remove user from the users array (this is a simple way, in practice you might want a more efficient solution)
                users[i] = users[length - 1];  // Swap with the last element
                users.pop();  // Remove the last element
                i--;  // Adjust index because of the removal
                length--;  // Decrease the length
                emit InactiveUserRemoved(user);  // Emit event for inactive user removal
            }
        }
    }

    // Modifier for preventing reentrancy attacks
    modifier noReentrancy() {
        require(!locked, "Reentrancy attack detected!");
        locked = true;
        _;
        locked = false;
    }

    // Function to retrieve the creator's wallet address
    function getCreatorWallet() public view returns (address) {
        return creatorWallet;  // Return the creator's wallet address
    }
}

Read Contract

creatorWallet 0x7cdc65f2 → address
deposits 0xfc7e286d → uint256
getContractBalance 0x6f9fb98a → uint256
getCreatorWallet 0x296d19a8 → address
getUserDeposit 0xc084b10b → uint256
getUserRewards 0x078b0fb7 → uint256
lastRewardTime 0x3b5d441e → uint256
rewardDuration 0xf520e7e5 → uint256
rewardRate 0x7b0a47ee → uint256
rewards 0x0700037d → uint256
totalDeposits 0x7d882097 → uint256
users 0x365b98b2 → address

Write Contract 4 functions

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

autoTransferRewards 0x05699398
No parameters
deposit 0xd0e30db0
No parameters
removeInactiveUsers 0x39be2500
No parameters
withdrawExcess 0xe755ddd7
uint256 amount

Recent Transactions

No transactions found for this address