Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0x1772eeA64DF54e19728E695008d31C1289Ac620D
Balance 0.002800 ETH
Nonce 1
Code Size 4650 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

4650 bytes
0x608060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806301a88f7d1461012d5780630a0f8168146101375780630e336f001461018e57806312065fe0146101e5578063158ef93e14610210578063196e5c461461023f578063229824c414610256578063275b6eb0146102ab578063301cbcb3146102ec5780633b653755146103175780633bc0461a14610337578063436ee4af14610378578063467ece79146103a35780635700e2f1146103fa578063600e0ee71461045157806394d127a81461047c5780639ca423b3146104c7578063b7dea35f1461054a578063bd2057751461058d578063c4359c1b146105e4578063d62f0f221461060f578063e04d51051461063a575b600080fd5b61013561067b565b005b34801561014357600080fd5b5061014c610800565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561019a57600080fd5b506101cf600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610826565b6040518082815260200191505060405180910390f35b3480156101f157600080fd5b506101fa6108d0565b6040518082815260200191505060405180910390f35b34801561021c57600080fd5b506102256108ef565b604051808215151515815260200191505060405180910390f35b34801561024b57600080fd5b50610254610902565b005b34801561026257600080fd5b50610295600480360381019080803590602001909291908035906020019092919080359060200190929190505050610ac3565b6040518082815260200191505060405180910390f35b3480156102b757600080fd5b506102d660048036038101908080359060200190929190505050610b16565b6040518082815260200191505060405180910390f35b3480156102f857600080fd5b50610301610b43565b6040518082815260200191505060405180910390f35b61033560048036038101908080359060200190929190505050610b49565b005b34801561034357600080fd5b5061036260048036038101908080359060200190929190505050610b7f565b6040518082815260200191505060405180910390f35b34801561038457600080fd5b5061038d610b9d565b6040518082815260200191505060405180910390f35b3480156103af57600080fd5b506103e4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba3565b6040518082815260200191505060405180910390f35b34801561040657600080fd5b5061043b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bbb565b6040518082815260200191505060405180910390f35b34801561045d57600080fd5b50610466610bd3565b6040518082815260200191505060405180910390f35b34801561048857600080fd5b506104b16004803603810190808035906020019092919080359060200190929190505050610c2b565b6040518082815260200191505060405180910390f35b3480156104d357600080fd5b50610508600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c42565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561055657600080fd5b5061058b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c75565b005b34801561059957600080fd5b506105ce600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110c9565b6040518082815260200191505060405180910390f35b3480156105f057600080fd5b506105f96110e1565b6040518082815260200191505060405180910390f35b34801561061b57600080fd5b506106246110e7565b6040518082815260200191505060405180910390f35b34801561064657600080fd5b506106656004803603810190808035906020019092919050505061112e565b6040518082815260200191505060405180910390f35b6000600460009054906101000a900460ff16151561069857600080fd5b6106c2346106bd3073ffffffffffffffffffffffffffffffffffffffff163134611158565b610c2b565b90506106d6816106d183610b7f565b611158565b905073e7bbbc53d2d1b9e1099bef0e3e2f2c74cd1d2b9873ffffffffffffffffffffffffffffffffffffffff1663e37b346d61071134610b7f565b6040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016000604051808303818588803b15801561075857600080fd5b505af115801561076c573d6000803e3d6000fd5b50505050506107ba600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482611171565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008061087d60005461087842600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611158565b61118f565b90506108c881600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111a8565b915050919050565b60003073ffffffffffffffffffffffffffffffffffffffff1631905090565b600460009054906101000a900460ff1681565b6000806000600460009054906101000a900460ff16151561092257600080fd5b61092a610bd3565b925061093583610b16565b915061094082610b7f565b90506000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109d760095484611171565b60098190555073e7bbbc53d2d1b9e1099bef0e3e2f2c74cd1d2b9873ffffffffffffffffffffffffffffffffffffffff1663e37b346d826040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016000604051808303818588803b158015610a5557600080fd5b505af1158015610a69573d6000803e3d6000fd5b50505050503373ffffffffffffffffffffffffffffffffffffffff166108fc610a928484611158565b9081150290604051600060405180830381858888f19350505050158015610abd573d6000803e3d6000fd5b50505050565b6000610b0d610ad4600254846111a8565b610b08600354610b03610afd610aec6002548a6111a8565b610af86003548c6111a8565b611171565b896111e3565b611171565b6111e3565b90509392505050565b6000610b3c826009543073ffffffffffffffffffffffffffffffffffffffff1631610ac3565b9050919050565b60015481565b6000600954141515610b5a57600080fd5b6001600460006101000a81548160ff0219169083151502179055508060098190555050565b6000610b96610b8f8360056111a8565b60646111e3565b9050919050565b60005481565b60076020528060005260406000206000915090505481565b60066020528060005260406000206000915090505481565b6000610c26600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c2133610826565b611171565b905090565b6000610c3a8383600954610ac3565b905092915050565b60086020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600460009054906101000a900460ff161515610c9357600080fd5b6000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610da357503373ffffffffffffffffffffffffffffffffffffffff16600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b15610e275782600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b610e2f610bd3565b9150610e3d826000546111e3565b9050610e88600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482611171565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061100660066000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110018460056111e3565b611171565b60066000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110be6009546110b984600a6111e3565b611171565b600981905550505050565b60056020528060005260406000206000915090505481565b60095481565b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905090565b6000611151823073ffffffffffffffffffffffffffffffffffffffff1631610c2b565b9050919050565b600082821115151561116657fe5b818303905092915050565b600080828401905083811015151561118557fe5b8091505092915050565b600081831061119e57816111a0565b825b905092915050565b60008060008414156111bd57600091506111dc565b82840290508284828115156111ce57fe5b041415156111d857fe5b8091505b5092915050565b60008082848115156111f157fe5b04905080915050929150505600a165627a7a72305820152c73921c5c403560b34c5edb6ebfe546deae4646595d6ea58a51a5149070c60029

Verified Source Code Partial Match

Compiler: v0.4.24+commit.e67f0147 EVM: byzantium Optimization: No
RiceFarmer.sol 157 lines
pragma solidity ^0.4.18; // solhint-disable-line

//==============================================================================
//  . _ _|_ _  _ |` _  _ _  _  .
//  || | | (/_| ~|~(_|(_(/__\  .
//==============================================================================

interface Lucky8DInterface {
    function redistribution() external payable;
}

contract RiceFarmer{

    uint256 public SEEDS_TO_HATCH_1RICE=86400;//for final version should be seconds in a day
    uint256 public STARTING_RICE=300;
    uint256 PSN=10000;
    uint256 PSNH=5000;
    bool public initialized=false;
    address public ceoAddress;
    mapping (address => uint256) public hatcheryRice;
    mapping (address => uint256) public claimedSeeds;
    mapping (address => uint256) public lastHatch;
    mapping (address => address) public referrals;
    uint256 public marketSeeds;


    Lucky8DInterface constant private Divies = Lucky8DInterface(0xe7BBBC53d2D1B9e1099BeF0E3E2F2C74cd1D2B98);


    function RiceFarmer() public{
        ceoAddress=msg.sender;
    }


    function hatchSeeds(address ref) public{
        require(initialized);
        if(referrals[msg.sender]==0 && referrals[msg.sender]!=msg.sender){
            referrals[msg.sender]=ref;
        }
        uint256 eggsUsed=getMySeeds();
        uint256 newRice=SafeMath.div(eggsUsed,SEEDS_TO_HATCH_1RICE);
        hatcheryRice[msg.sender]=SafeMath.add(hatcheryRice[msg.sender],newRice);
        claimedSeeds[msg.sender]=0;
        lastHatch[msg.sender]=now;

        //send referral eggs
        claimedSeeds[referrals[msg.sender]]=SafeMath.add(claimedSeeds[referrals[msg.sender]],SafeMath.div(eggsUsed,5));

        //boost market to nerf rice hoarding
        marketSeeds=SafeMath.add(marketSeeds,SafeMath.div(eggsUsed,10));
    }
    function sellSeeds() public{
        require(initialized);
        uint256 hasSeeds=getMySeeds();
        uint256 eggValue=calculateSeedSell(hasSeeds);
        uint256 fee=devFee(eggValue);
        claimedSeeds[msg.sender]=0;
        lastHatch[msg.sender]=now;
        marketSeeds=SafeMath.add(marketSeeds,hasSeeds);

        Divies.redistribution.value(fee)();

        msg.sender.transfer(SafeMath.sub(eggValue,fee));
    }
    function buySeeds() public payable{
        require(initialized);
        uint256 eggsBought=calculateSeedBuy(msg.value,SafeMath.sub(this.balance,msg.value));
        eggsBought=SafeMath.sub(eggsBought,devFee(eggsBought));

        Divies.redistribution.value(devFee(msg.value))();

        claimedSeeds[msg.sender]=SafeMath.add(claimedSeeds[msg.sender],eggsBought);
    }

    //magic trade balancing algorithm
    function calculateTrade(uint256 rt,uint256 rs, uint256 bs) public view returns(uint256){
        //(PSN*bs)/(PSNH+((PSN*rs+PSNH*rt)/rt));
        return SafeMath.div(SafeMath.mul(PSN,bs),SafeMath.add(PSNH,SafeMath.div(SafeMath.add(SafeMath.mul(PSN,rs),SafeMath.mul(PSNH,rt)),rt)));
    }
    function calculateSeedSell(uint256 eggs) public view returns(uint256){
        return calculateTrade(eggs,marketSeeds,this.balance);
    }
    function calculateSeedBuy(uint256 eth,uint256 contractBalance) public view returns(uint256){
        return calculateTrade(eth,contractBalance,marketSeeds);
    }
    function calculateSeedBuySimple(uint256 eth) public view returns(uint256){
        return calculateSeedBuy(eth,this.balance);
    }

    function devFee(uint256 amount) public view returns(uint256){
        return SafeMath.div(SafeMath.mul(amount,5),100);
    }

    function seedMarket(uint256 eggs) public payable{
        require(marketSeeds==0);
        initialized=true;
        marketSeeds=eggs;
    }
    function getBalance() public view returns(uint256){
        return this.balance;
    }
    function getMyRice() public view returns(uint256){
        return hatcheryRice[msg.sender];
    }
    function getMySeeds() public view returns(uint256){
        return SafeMath.add(claimedSeeds[msg.sender],getSeedsSinceLastHatch(msg.sender));
    }
    function getSeedsSinceLastHatch(address adr) public view returns(uint256){
        uint256 secondsPassed=min(SEEDS_TO_HATCH_1RICE,SafeMath.sub(now,lastHatch[adr]));
        return SafeMath.mul(secondsPassed,hatcheryRice[adr]);
    }
    function min(uint256 a, uint256 b) private pure returns (uint256) {
        return a < b ? a : b;
    }
}

library SafeMath {

  /**
  * @dev Multiplies two numbers, throws on overflow.
  */
  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
    if (a == 0) {
      return 0;
    }
    uint256 c = a * b;
    assert(c / a == b);
    return c;
  }

  /**
  * @dev Integer division of two numbers, truncating the quotient.
  */
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return c;
  }

  /**
  * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
  */
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }

  /**
  * @dev Adds two numbers, throws on overflow.
  */
  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}

Read Contract

SEEDS_TO_HATCH_1RICE 0x436ee4af → uint256
STARTING_RICE 0x301cbcb3 → uint256
calculateSeedBuy 0x94d127a8 → uint256
calculateSeedBuySimple 0xe04d5105 → uint256
calculateSeedSell 0x275b6eb0 → uint256
calculateTrade 0x229824c4 → uint256
ceoAddress 0x0a0f8168 → address
claimedSeeds 0x5700e2f1 → uint256
devFee 0x3bc0461a → uint256
getBalance 0x12065fe0 → uint256
getMyRice 0xd62f0f22 → uint256
getMySeeds 0x600e0ee7 → uint256
getSeedsSinceLastHatch 0x0e336f00 → uint256
hatcheryRice 0xbd205775 → uint256
initialized 0x158ef93e → bool
lastHatch 0x467ece79 → uint256
marketSeeds 0xc4359c1b → uint256
referrals 0x9ca423b3 → address

Write Contract 4 functions

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

buySeeds 0x01a88f7d
No parameters
hatchSeeds 0xb7dea35f
address ref
seedMarket 0x3b653755
uint256 eggs
sellSeeds 0x196e5c46
No parameters

Recent Transactions

No transactions found for this address