Contract 0xd31a5afcf4f2168d0e3a47685c85b2166edf69d9

 

TxHash Block Age From To Value [TxFee]
0x9c5e369e6d35423fdd2794de792562a961383954ffbabaf9b1414b3e16d092ac723188112 secs ago0xba5b0fe13ab1c94439aa57bf9f65230735a10985  IN   0xd31a5afcf4f2168d0e3a47685c85b2166edf69d90 Ether0.000174645
0x28290969417fdb068d230eb8b1d83b44e8100de3388e138dae9b29700cec97ef723181520 mins ago0xe9c7dd98d6a90e56f6b40b9d7da0c2ac6c408446  IN   0xd31a5afcf4f2168d0e3a47685c85b2166edf69d90 Ether0.000279432
0xed7d3453345c92df4fc81e167bb82e04dadb5de0d3c4cd530f8bff78237ab18772316151 hr 31 mins ago0xab36a843b7c76e6d6d09f9ee24dd0b7064454fc4  IN   0xd31a5afcf4f2168d0e3a47685c85b2166edf69d90 Ether0.000174645
0xee652cd167ee3f91cdf285180855edfe811f73e8b792499041662943070157ae72316071 hr 32 mins ago0x6480999cc2417c50fa8d97e3e36ee97d78fffb46  IN   0xd31a5afcf4f2168d0e3a47685c85b2166edf69d90 Ether0.0002270385
0x14540fadaf6b565d13f056f7c3d9b299058ecf8076358015ed08ccf22824e09872314722 hrs 24 mins ago0x264698a32fe38ed89e159321be01444f03c9375e  IN   0xd31a5afcf4f2168d0e3a47685c85b2166edf69d90 Ether0.000174645
0x5fbb10f552119767df15df467af8b11d97011387b4a2a85985ed518cdf9786d572314632 hrs 27 mins ago0x8de55c09f21aa4312d1bcba8cbef2b44eabf7f40  IN   0xd31a5afcf4f2168d0e3a47685c85b2166edf69d90 Ether0.000399429508
0x8c2beedeae7a01d1e8973891b53e9e5b45aeed3ee726d7e92ba7edb50aba75f172314612 hrs 28 mins ago0x874484c939b279e46d47575ba56fe60f84611328  IN   0xd31a5afcf4f2168d0e3a47685c85b2166edf69d90 Ether0.000174645
0x4340b25ef6e35f13f3e522f3ef30036a141e6608c40b966f13dd658a798812a472314412 hrs 36 mins ago0x425f013fb466b2df721f23ac0ba21049d1c6abd7  IN   0xd31a5afcf4f2168d0e3a47685c85b2166edf69d90 Ether0.000174645
0x900d32a3d34c2d1406b0e631123d0a4f1479c00ab4bacfeb40902ae7732ee0e772314252 hrs 41 mins ago0x6452abb82c78b59e89c41882e3815ec02a093bb3  IN   0xd31a5afcf4f2168d0e3a47685c85b2166edf69d90 Ether0.000174645
0x7c961f19f3886c5c77a9a9c6c78d64bb36c087f7f622325b815c394e546bfbe472313133 hrs 22 mins ago0x7adf773f6d58b5891ed2116d353472ca3f0c2ac3  IN   0xd31a5afcf4f2168d0e3a47685c85b2166edf69d90 Ether0.000174645
0x5155205ff54438c93b3e14678d0f713b516e89da6cf083ec68109fd86b31292272311904 hrs 2 mins ago0x83802b6a484b774d8219b114cc98413f55d7015c  IN   0xd31a5afcf4f2168d0e3a47685c85b2166edf69d90 Ether0.0001618325
0xcba09aa4aa60e5538817ee263c3d5239e5ab0440feb2f9e3c8a7e532bf75703a72309715 hrs 14 mins ago0x8aca6db035e1f21c3639b2b72a5fcbc6600ea5af  IN   0xd31a5afcf4f2168d0e3a47685c85b2166edf69d90 Ether0.000104787
0xf95edd54340e7d24a3873a462b9afedf84c7f74bbb132603d35820ecea07efb172309685 hrs 16 mins ago0x4ab5ebd3392bfb40abbaad92e925b77592d12ec9  IN   0xd31a5afcf4f2168d0e3a47685c85b2166edf69d90 Ether0.000174645
0xe4bf61215c7251031be2bc6c35c3576412e9d19d5b81af1ec83e9165d9a98eae72309325 hrs 25 mins ago0x9ddbe1f25a0ce69c073e8fb9c9e56c8483d99a90  IN   0xd31a5afcf4f2168d0e3a47685c85b2166edf69d90 Ether0.000104787
0x005f2cc953858b2fa25d7f0d8a5e18cd67d6a22a2c6a876493f873d2dda8d05c72308345 hrs 59 mins ago0x604c3172007677f18da2984e26c270a8ae2d68ad  IN   0xd31a5afcf4f2168d0e3a47685c85b2166edf69d90 Ether0.000174645
0x767b9051cc4a9b0b1d3e632cc2e5ed1712554d48594231409ae20e8fe4b27c4b72307766 hrs 26 mins ago0x98e32d67361633c38033df273785bdf48b7a5423  IN   0xd31a5afcf4f2168d0e3a47685c85b2166edf69d90 Ether0.000174645
0xbe9b21b730828e08441fecb1a779403e9347b628d331b31f2e44ddcc7e0e960672306827 hrs 3 mins ago0x3cc2d0072107a4c485102a8f84964c839065e63b  IN   0xd31a5afcf4f2168d0e3a47685c85b2166edf69d90 Ether0.000174645
0x2916548c74a7997faac433441f99607a7c11ae412bca2b37cf78c9cea3cd77af72306017 hrs 31 mins ago0xd5853cef02aa2d7ddd787ce812704947a748c755  IN   0xd31a5afcf4f2168d0e3a47685c85b2166edf69d90 Ether0.000069858
0xdb3e89d68b672abe294d6f77edf1fb2b72de393c88c46b649cc219d2d87c491272305207 hrs 59 mins ago0x308e9c99ac194101c971ffcaca897ac943843de8  IN   0xd31a5afcf4f2168d0e3a47685c85b2166edf69d90 Ether0.000104787
0xb05385fcde3332a5d6fe7d2f37041b6a4a886ae5a1fdc00c5d62e22e78f53f3b72304508 hrs 23 mins ago0x53e5bfa3fe947efafd6b8e765e319943e0cb9c5a  IN   0xd31a5afcf4f2168d0e3a47685c85b2166edf69d90 Ether0.000173665
0xc729417bf8f588b18b3edfb12de2465f4f9c4655a6569cd2b90de353b3ce711572304338 hrs 27 mins ago0xe7f1c380fe9293174484d26e2e5087bef1c98927  IN   0xd31a5afcf4f2168d0e3a47685c85b2166edf69d90 Ether0.000323665
0xcdcc0b0a5985294c1846b7149e6b9ddafa0376f8ce2f8b14a3017c42ce491cd072303568 hrs 56 mins ago0x14b687953d315c8928d506bc8e677b80d45ee36a  IN   0xd31a5afcf4f2168d0e3a47685c85b2166edf69d90 Ether0.000323665
0x03f5b8066ef2a0964ad7da67469170a415b6dffc9b55ad2131704d76d0bbba4e72303478 hrs 59 mins ago0x068cfd47ae3e4a96c74b255e02939749434aafba  IN   0xd31a5afcf4f2168d0e3a47685c85b2166edf69d90 Ether0.000174645
0x6e4f1ec5df8f0a2c294789b2f6477bf01682f9e4058386b5045534392503ef3672302569 hrs 29 mins ago0x40a7dc2ac7d5fc35da3a9d99552b18cd91188735  IN   0xd31a5afcf4f2168d0e3a47685c85b2166edf69d90 Ether0.000279432
0xf1b992726979ce6b490e0c09ccf4f81c903a4d15ae95f69ddccc6fbb58e610f172302379 hrs 36 mins ago0xd244a81f4a7df683f32a8a5e0f5f3567c3a4d421  IN   0xd31a5afcf4f2168d0e3a47685c85b2166edf69d90 Ether0.0003213468
[ Download CSV Export 

Internal Transactions as a result of Contract Execution

Parent TxHash Block Age From To Value
Warning: The compiled contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity) Solidity Compiler Bugs.

Contract Source Code Verified (Exact Match)
Contract Name: DailyRewards
Compiler Version: v0.4.24+commit.e67f0147
Optimization Enabled: Yes
Runs (Optimizer):  200


Contract Source Code
pragma solidity ^0.4.24;

// written by garry from Team Chibi Fighters
// find us at https://chibifighters.io
// [email protected]
// version 1.0.0


contract Owned {
    address public owner;
    address public newOwner;

    event OwnershipTransferred(address indexed _from, address indexed _to);

    constructor() public {
        owner = msg.sender;
    }

    modifier onlyOwner {
        require(msg.sender == owner);
        _;
    }

    function transferOwnership(address _newOwner) public onlyOwner {
        newOwner = _newOwner;
    }
    
    function acceptOwnership() public {
        require(msg.sender == newOwner);
        emit OwnershipTransferred(owner, newOwner);
        owner = newOwner;
        newOwner = address(0);
    }
}


interface ERC20Interface {
    function transferFrom(address from, address to, uint tokens) external returns (bool success);
    function transfer(address to, uint tokens) external;
    function balanceOf(address _owner) external view returns (uint256 _balance);
}

interface ERC20InterfaceClassic {
    function transfer(address to, uint tokens) external returns (bool success);
}

contract DailyRewards is Owned {

	event RewardClaimed(
		address indexed buyer,
		uint256 day
	);
	
	// what day the player is on in his reward chain
	mapping (address => uint) private daysInRow;

	// timeout after which row is broken
	mapping (address => uint) private timeout;
	
	// how often the reward can be claimed, e.g. every 24h
	uint waitingTime = 24 hours;
	// window of claiming, if it expires day streak resets to day 1
	uint waitingTimeBuffer = 48 hours;
	
	
	constructor() public {
	    // Explore Chibis and their universe
	    // Off chain battles, real Ether fights, true on chain ownership
	    // Leaderboards, tournaments, roleplay elements, we got it all
	}
	
	
	function requestReward() public returns (uint _days) {
	    require (msg.sender != address(0));
	    require (now > timeout[msg.sender]);
	    
	    // waited too long, reset
	    if (now > timeout[msg.sender] + waitingTimeBuffer) {
	        daysInRow[msg.sender] = 1;    
	    } else {
	        // no limit to being logged in, looking forward to the longest streak
	        daysInRow[msg.sender]++;
	    }
	    
	    timeout[msg.sender] = now + waitingTime;
	    
	    emit RewardClaimed(msg.sender, daysInRow[msg.sender]);
	    
	    return daysInRow[msg.sender];
	}
	
	
	/**
	 * @dev Query stats of next reward, checks for expired time, too
	 **/
	function nextReward() public view returns (uint _day, uint _nextClaimTime, uint _nextClaimExpire) {
	    uint _dayCheck;
	    if (now > timeout[msg.sender] + waitingTimeBuffer) _dayCheck = 1; else _dayCheck = daysInRow[msg.sender] + 1;
	    
	    return (_dayCheck, timeout[msg.sender], timeout[msg.sender] + waitingTimeBuffer);
	}
	
	
	function queryWaitingTime() public view returns (uint _waitingTime) {
	    return waitingTime;
	}
	
	function queryWaitingTimeBuffer() public view returns (uint _waitingTimeBuffer) {
	    return waitingTimeBuffer;
	}
	

	/**
	 * @dev Sets the interval for daily rewards, e.g. 24h = 86400
	 * @param newTime New interval time in seconds
	 **/
	function setWaitingTime(uint newTime) public onlyOwner returns (uint _newWaitingTime) {
	    waitingTime = newTime;
	    return waitingTime;
	}
	
	
	/**
	 * @dev Sets buffer for daily rewards. So user have time to claim it. e.g. 1h = 3600
	 * @param newTime New buffer in seconds
	 **/
	function setWaitingTimeBuffer(uint newTime) public onlyOwner returns (uint _newWaitingTimeBuffer) {
	    waitingTimeBuffer = newTime;
	    return waitingTimeBuffer;
	}


    /**
    * @dev Send Ether to owner
    * @param _address Receiving address
    * @param _amountWei Amount in WEI to send
    **/
    function weiToOwner(address _address, uint _amountWei) public onlyOwner returns (bool) {
        require(_amountWei <= address(this).balance);
        _address.transfer(_amountWei);
        return true;
    }

    function ERC20ToOwner(address _to, uint256 _amount, ERC20Interface _tokenContract) public onlyOwner {
        _tokenContract.transfer(_to, _amount);
    }

    function ERC20ClassicToOwner(address _to, uint256 _amount, ERC20InterfaceClassic _tokenContract) public onlyOwner {
        _tokenContract.transfer(_to, _amount);
    }

}

Contract ABI
[{"constant":false,"inputs":[{"name":"_address","type":"address"},{"name":"_amountWei","type":"uint256"}],"name":"weiToOwner","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_amount","type":"uint256"},{"name":"_tokenContract","type":"address"}],"name":"ERC20ClassicToOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"requestReward","outputs":[{"name":"_days","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"nextReward","outputs":[{"name":"_day","type":"uint256"},{"name":"_nextClaimTime","type":"uint256"},{"name":"_nextClaimExpire","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"newOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_amount","type":"uint256"},{"name":"_tokenContract","type":"address"}],"name":"ERC20ToOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newTime","type":"uint256"}],"name":"setWaitingTimeBuffer","outputs":[{"name":"_newWaitingTimeBuffer","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newTime","type":"uint256"}],"name":"setWaitingTime","outputs":[{"name":"_newWaitingTime","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"queryWaitingTimeBuffer","outputs":[{"name":"_waitingTimeBuffer","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"queryWaitingTime","outputs":[{"name":"_waitingTime","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"buyer","type":"address"},{"indexed":false,"name":"day","type":"uint256"}],"name":"RewardClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"}],"name":"OwnershipTransferred","type":"event"}]

Contract Creation Code
6080604052620151806004556202a30060055534801561001e57600080fd5b5060008054600160a060020a031916331790556106bf806100406000396000f3006080604052600436106100ab5763ffffffff60e060020a6000350416630db5db2681146100b057806328f14573146100e85780634cecac6d146101155780636da4fe261461013c57806379ba50971461016f5780638da5cb5b14610184578063d4ee1d90146101b5578063dea21027146101ca578063e90389bd146101f5578063ebc73e651461020d578063f2fde38b14610225578063f5cb0daa14610246578063f94e08d01461025b575b600080fd5b3480156100bc57600080fd5b506100d4600160a060020a0360043516602435610270565b604080519115158252519081900360200190f35b3480156100f457600080fd5b50610113600160a060020a0360043581169060243590604435166102d6565b005b34801561012157600080fd5b5061012a610381565b60408051918252519081900360200190f35b34801561014857600080fd5b50610151610461565b60408051938452602084019290925282820152519081900360600190f35b34801561017b57600080fd5b506101136104c2565b34801561019057600080fd5b5061019961054a565b60408051600160a060020a039092168252519081900360200190f35b3480156101c157600080fd5b50610199610559565b3480156101d657600080fd5b50610113600160a060020a036004358116906024359060443516610568565b34801561020157600080fd5b5061012a6004356105ff565b34801561021957600080fd5b5061012a600435610620565b34801561023157600080fd5b50610113600160a060020a0360043516610641565b34801561025257600080fd5b5061012a610687565b34801561026757600080fd5b5061012a61068d565b60008054600160a060020a0316331461028857600080fd5b303182111561029657600080fd5b604051600160a060020a0384169083156108fc029084906000818181858888f193505050501580156102cc573d6000803e3d6000fd5b5060019392505050565b600054600160a060020a031633146102ed57600080fd5b80600160a060020a031663a9059cbb84846040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561035057600080fd5b505af1158015610364573d6000803e3d6000fd5b505050506040513d602081101561037a57600080fd5b5050505050565b600033151561038f57600080fd5b3360009081526003602052604090205442116103aa57600080fd5b60055433600090815260036020526040902054014211156103dd57336000908152600260205260409020600190556103f4565b336000908152600260205260409020805460010190555b600454336000818152600360209081526040808320429095019094556002815290839020548351908152925191927f106f923f993c2149d49b4255ff723acafa1f2d94393f561d3eda32ae348f7241929081900390910190a2503360009081526002602052604090205490565b6005543360009081526003602052604081205490918291829182910142111561048c575060016104a1565b50336000908152600260205260409020546001015b33600090815260036020526040902054600554919450925082019050909192565b600154600160a060020a031633146104d957600080fd5b60015460008054604051600160a060020a0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b600054600160a060020a031681565b600154600160a060020a031681565b600054600160a060020a0316331461057f57600080fd5b80600160a060020a031663a9059cbb84846040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050600060405180830381600087803b1580156105e257600080fd5b505af11580156105f6573d6000803e3d6000fd5b50505050505050565b60008054600160a060020a0316331461061757600080fd5b50600581905590565b60008054600160a060020a0316331461063857600080fd5b50600481905590565b600054600160a060020a0316331461065857600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60055490565b600454905600a165627a7a7230582081abc0a122904f0a1cf24731ea26253414f4973919cab68e653d706d63a96ce30029


   Swarm Source:
bzzr://81abc0a122904f0a1cf24731ea26253414f4973919cab68e653d706d63a96ce3
Block Age transaction Difficulty GasUsed Reward
Block Age Uncle Number Difficulty GasUsed Reward
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.