Contract Overview
ETH Balance: 51.328125 Ether ($2,542.80)
Mined:  0
No Of Transactions: 166 txns + 15 internalTxns
  Latest 25 txns from a total Of 166 transactions View All

TxHash Block Age From To Value [TxFee]
0xe46666678e66af4e3b9f3036da36c23fe0736b1ceafce54fc2d1e7b9d1d28b8433874014 days 4 hrs ago0xffe139a786e06e41cc694065e1c87996f4895832  IN   0x15dbdb25f870f21eaf9105e68e249e0426dae9160 Ether0.00058828
0xd5d42dd466e1e8ed40a24e576d3945e3b6d269fa82ac7ee4412ce761caa1bf2e327745722 days 12 hrs ago0xe22d9cd3a8bcf9cbf2e094b185548d6894b7ebe1  IN   0x15dbdb25f870f21eaf9105e68e249e0426dae9160 Ether0.00522404
0x815b7607265ba98b2e931ed1805a3112a6313c9318b5f670b8c12899b470fb3a327600522 days 18 hrs ago0xe22d9cd3a8bcf9cbf2e094b185548d6894b7ebe1  IN   0x15dbdb25f870f21eaf9105e68e249e0426dae9160 Ether0.0056565
0xc9162a23781ed69718ed5c6714727af180450a51cbb186d2a181da6d42cedbf4327598922 days 18 hrs ago0xe22d9cd3a8bcf9cbf2e094b185548d6894b7ebe1  IN   0x15dbdb25f870f21eaf9105e68e249e0426dae9160 Ether0.0056565
0x8cfc81ae5148432632578544f81717012423667e6645e3b89ae49b40cc321d25327595522 days 18 hrs ago0xe22d9cd3a8bcf9cbf2e094b185548d6894b7ebe1  IN   0x15dbdb25f870f21eaf9105e68e249e0426dae9160 Ether0.0056565
0x9a39e6048185b8cb80a2289b33cb66f250245bc1b4bfb26514c9ef4a4ca97673327592822 days 18 hrs ago0xe22d9cd3a8bcf9cbf2e094b185548d6894b7ebe1  IN   0x15dbdb25f870f21eaf9105e68e249e0426dae9160 Ether0.003
0xa99815f737630bcdd62491aaccc8639fcb162210ce0c49a8932b577f7fe012f4327574122 days 19 hrs ago0xd7ebf8200c5b2a1d9d74c655b0d7949802cc4bdf  IN   0x15dbdb25f870f21eaf9105e68e249e0426dae9160 Ether0.0004015
0x1e585fc7898f00b52702f610529a00a99a3fefc0b6be28aeda05516e87eef290327574122 days 19 hrs ago0x9af5ba5a5566ba95afc13e790d80440f407aa1a8  IN   0x15dbdb25f870f21eaf9105e68e249e0426dae9160 Ether0.0004015
0x28c65f32064df39a09868b147dd41b25a8a48dd67e50c2bb3f2eac41c8e9ca3b327572222 days 19 hrs ago0xe22d9cd3a8bcf9cbf2e094b185548d6894b7ebe1  IN   0x15dbdb25f870f21eaf9105e68e249e0426dae91612 Ether0.00989858
0x499082d47425465a1e0a5570b3b872ce7e12e45052461c688c6fe02310fecc81327569622 days 19 hrs ago0xd7ebf8200c5b2a1d9d74c655b0d7949802cc4bdf  IN   0x15dbdb25f870f21eaf9105e68e249e0426dae9160 Ether0.0004015
0x4439bd16f8ab57243d8ff9c0037d5c3b6d0c24d08d3eea002ec1f8127b78f0e0327569622 days 19 hrs ago0x9af5ba5a5566ba95afc13e790d80440f407aa1a8  IN   0x15dbdb25f870f21eaf9105e68e249e0426dae9160 Ether0.0004015
0x5a49078af1aac7e2ba7719fec946d607d90bbd5a2da925c416ecc1a6b6aa6167327566822 days 19 hrs ago0xe22d9cd3a8bcf9cbf2e094b185548d6894b7ebe1  IN   0x15dbdb25f870f21eaf9105e68e249e0426dae91616 Ether0.01280154
0xfa6483f1c88902fc0d9971dfe7383858c24c2384f417389ecefea83a40295dff327558022 days 20 hrs ago0x396b7e8e5265eec342fa92661e03cacf93da725b  IN   0x15dbdb25f870f21eaf9105e68e249e0426dae9160 Ether0.005
0x118df1ca32e81a8577054193af3e59db153b11a67f961344648d76434c495d4a327557022 days 20 hrs ago0xe22d9cd3a8bcf9cbf2e094b185548d6894b7ebe1  IN   0x15dbdb25f870f21eaf9105e68e249e0426dae9160 Ether0.00599865
0x3e883589007398727938a178d4d6c353d25059f3d2ed9b95c185cdf7d51a85b3327555822 days 20 hrs ago0xd7ebf8200c5b2a1d9d74c655b0d7949802cc4bdf  IN   0x15dbdb25f870f21eaf9105e68e249e0426dae9160 Ether0.00100375
0xacdfed127d7cb7d54e9007096f4f82210efe57a2088da53f3de058c52dc32cef327554522 days 20 hrs ago0x9af5ba5a5566ba95afc13e790d80440f407aa1a8  IN   0x15dbdb25f870f21eaf9105e68e249e0426dae9160 Ether0.00100375
0x4e08d23ba2bac5d5051e7661529194a5749e21c4dd3a6f43e8b24ead868ec4d6327550922 days 20 hrs ago0x9af5ba5a5566ba95afc13e790d80440f407aa1a8  IN   0x15dbdb25f870f21eaf9105e68e249e0426dae9168 Ether0.01642235
0x3630018dfa51f56b8394a28159e9d49c3ed8643580569f0c2fbf39cc6e8c69a6327505322 days 22 hrs ago0x56a985d770ff9d5b98b2078aa869499696808e1a  IN   0x15dbdb25f870f21eaf9105e68e249e0426dae9160 Ether0.0153504
0xc027e980c4493eb9d308d47bf9c09f410dc4accafb90e53276c007be41760318327464722 days 23 hrs ago0x9af5ba5a5566ba95afc13e790d80440f407aa1a8  IN   0x15dbdb25f870f21eaf9105e68e249e0426dae9160 Ether0.01678515
0x67aab9110fd523c7b4d57533467402759abccd4dae3561bca187d5bc8fb08801327458622 days 23 hrs ago0x9af5ba5a5566ba95afc13e790d80440f407aa1a8  IN   0x15dbdb25f870f21eaf9105e68e249e0426dae9160 Ether0.0179367
0xeeaff07a529fc7c63127b7b37f302d5f84c9b28577bb118ecc5da725071b2ba0327201623 days 10 hrs ago0xd49ce932e09c22ea8ad9a4ea641a7b5292278116  IN   0x15dbdb25f870f21eaf9105e68e249e0426dae9161 Ether0.0057673
0x9172e1493e0f99393b1cd8527a41b18bb64e903505c2bbcae0acc8648d6c6f6a327196223 days 10 hrs ago0xd49ce932e09c22ea8ad9a4ea641a7b5292278116  IN   0x15dbdb25f870f21eaf9105e68e249e0426dae9160 Ether0.00599865
0x32cd730caa43d7310a5b5ba523b66f3c2952bf1a59966a88f0efb76ac6cf1756327138423 days 12 hrs ago0x9af5ba5a5566ba95afc13e790d80440f407aa1a8  IN   0x15dbdb25f870f21eaf9105e68e249e0426dae9160 Ether0.00656112
0xdee4946a5366eddb19aea76f04113b6c0ab5f78e42edf83f940a6b51c37f7286327135923 days 12 hrs ago0x9af5ba5a5566ba95afc13e790d80440f407aa1a8  IN   0x15dbdb25f870f21eaf9105e68e249e0426dae9160 Ether0.00882712
0x7e06f649e9897f0ce0823614a336e1300a9533e822e278114b875d6fc14527fb327133923 days 12 hrs ago0x9af5ba5a5566ba95afc13e790d80440f407aa1a8  IN   0x15dbdb25f870f21eaf9105e68e249e0426dae9160 Ether0.00749132

[Download: CSV Export ]    
 Internal Transactions as a result of Contract Execution
  Latest 15 Internal Transactions

ParentTxHash Block Age From To Value
0xa99815f737630bcdd62491aaccc8639fcb162210ce0c49a8932b577f7fe012f4327574122 days 19 hrs ago0x15dbdb25f870f21eaf9105e68e249e0426dae9160xd7ebf8200c5b2a1d9d74c655b0d7949802cc4bdf3 Ether
0x1e585fc7898f00b52702f610529a00a99a3fefc0b6be28aeda05516e87eef290327574122 days 19 hrs ago0x15dbdb25f870f21eaf9105e68e249e0426dae9160x9af5ba5a5566ba95afc13e790d80440f407aa1a86 Ether
0x499082d47425465a1e0a5570b3b872ce7e12e45052461c688c6fe02310fecc81327569622 days 19 hrs ago0x15dbdb25f870f21eaf9105e68e249e0426dae9160xd7ebf8200c5b2a1d9d74c655b0d7949802cc4bdf4 Ether
0x4439bd16f8ab57243d8ff9c0037d5c3b6d0c24d08d3eea002ec1f8127b78f0e0327569622 days 19 hrs ago0x15dbdb25f870f21eaf9105e68e249e0426dae9160x9af5ba5a5566ba95afc13e790d80440f407aa1a88 Ether
0x3e883589007398727938a178d4d6c353d25059f3d2ed9b95c185cdf7d51a85b3327555822 days 20 hrs ago0x15dbdb25f870f21eaf9105e68e249e0426dae9160xd7ebf8200c5b2a1d9d74c655b0d7949802cc4bdf16.5 Ether
0xacdfed127d7cb7d54e9007096f4f82210efe57a2088da53f3de058c52dc32cef327554522 days 20 hrs ago0x15dbdb25f870f21eaf9105e68e249e0426dae9160x9af5ba5a5566ba95afc13e790d80440f407aa1a84 Ether
0xf1571a8ee3e24c0c893c713d5654db1e6c4261cc24d5bf193406c5f7c981cc2f303377862 days 21 hrs ago0x15dbdb25f870f21eaf9105e68e249e0426dae9160xfbfe8ee0be2a31774ea1913d49f2ba77fefc77924.5 Ether
0x21fb41122a3e8c5d125d68e058e051497ca334b4c52120744b4be2a6e0df8c5e300643967 days 10 hrs ago0x15dbdb25f870f21eaf9105e68e249e0426dae9160xf51f08910ec370db5977cff3d01df4dfb06bfbe14.625 Ether
0xcdf61b5a5ef98bbb6cfaaffca033798915b2f671d4c5af2a65b2e55d66cbce10290471184 days 4 hrs ago0x15dbdb25f870f21eaf9105e68e249e0426dae9160xcce2c5442aba0969ee894e6d14eceac2c27d78ae0.0625 Ether
0xccc588765e2ad9d47ea4cfda4f5ffa7a9fd1146330837ba828830890abe836b7290454084 days 5 hrs ago0x15dbdb25f870f21eaf9105e68e249e0426dae9160x8e9192956b8dbc1caf573006830384838616f9840.03125 Ether
0xb465b6b1a4d65faabe98ff519955bb97e0929084404e8c8782894462f98aeacd290454084 days 5 hrs ago0x15dbdb25f870f21eaf9105e68e249e0426dae9160x3ab930a126f588cefd2ffd5909209c5341dcf8aa0.125 Ether
0x838f193d184cfaa34f35ede4893d8f406bb00b9741c8775ebbbd899802281910290454084 days 5 hrs ago0x15dbdb25f870f21eaf9105e68e249e0426dae9160x017a79b55db0cab6d9ff00c95971f3bc9fa833c70.015625 Ether
0x4184572941bb6683604b71e7be0eee483cc33c5507ab0d94e31626617ff54256290454084 days 5 hrs ago0x15dbdb25f870f21eaf9105e68e249e0426dae9160x9d35caff93b1f6ab8f762832e267f5d0ecdba2380.25 Ether
0x2c05001fcfdfeb192527c001668c5aaa35d2d228fb8856e076fc8d0799f6b66b290454084 days 5 hrs ago0x15dbdb25f870f21eaf9105e68e249e0426dae9160x542d458166249fb127dafaff9da6b663c013165d0.5 Ether
0xda976514ac56b6fb1bb23b97d9392fd6e22ec9843f1687c86f5fa03fc87252b12806685100 days 9 hrs ago0x15dbdb25f870f21eaf9105e68e249e0426dae9160x241ea87511b3eda4435379581fd61e1674af63250.0625 Ether
Contract Source Code Verified
Contract Name: MillionEther
Compiler Version: v0.4.2+commit.af6afb04
Optimization Enabled: Yes
Online Solidity Editor:  Click To View



  Contract Source Code   Find Similiar Contracts
/*
MillionEther smart contract - decentralized advertising platform.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

pragma solidity ^0.4.2;

contract MillionEther {

    address private admin;

    // Users
    uint private numUsers = 0;
    struct User {
        address referal;
        uint8 handshakes;
        uint balance;
        uint32 activationTime;
        bool banned;
        uint userID;
        bool refunded;
        uint investments;
    }
    mapping(address => User) private users;
    mapping(uint => address) private userAddrs;

    // Blocks. Blocks are 10x10 pixel areas. There are 10 000 blocks.
    uint16 private blocksSold = 0;
    uint private numNewStatus = 0;
    struct Block {
        address landlord;
        uint imageID;
        uint sellPrice;
    }
    Block[101][101] private blocks; 

    // Images
    uint private numImages = 0;
    struct Image {
        uint8 fromX;
        uint8 fromY;
        uint8 toX;
        uint8 toY;
        string imageSourceUrl;
        string adUrl;
        string adText;
    }
    mapping(uint => Image) private images;

    // Contract settings and security
    uint public charityBalance = 0;
    address public charityAddress;
    uint8 private refund_percent = 0;
    uint private totalWeiInvested = 0; //1 024 000 Ether max
    bool private setting_stopped = false;
    bool private setting_refundMode = false;
    uint32 private setting_delay = 3600;
    uint private setting_imagePlacementPriceInWei = 0;

    // Events
    event NewUser(uint ID, address newUser, address invitedBy, uint32 activationTime);
    event NewAreaStatus (uint ID, uint8 fromX, uint8 fromY, uint8 toX, uint8 toY, uint price);
    event NewImage(uint ID, uint8 fromX, uint8 fromY, uint8 toX, uint8 toY, string imageSourceUrl, string adUrl, string adText);


// ** INITIALIZE ** //

    function MillionEther () {
        admin = msg.sender;
        users[admin].referal = admin;
        users[admin].handshakes = 0;
        users[admin].activationTime = uint32(now);
        users[admin].userID = 0;
        userAddrs[0] = admin;
        userAddrs[numUsers] = admin;
    }


// ** FUNCTION MODIFIERS (PERMISSIONS) ** //

    modifier onlyAdmin {
        if (msg.sender != admin) throw;
        _;
    }

    modifier onlyWhenInvitedBy (address someUser) {
        if (users[msg.sender].referal != address(0x0)) throw;   //user already exists
        if (users[someUser].referal == address(0x0)) throw;     //referral does not exist
        if (now < users[someUser].activationTime) throw;        //referral is not active yet
        _;
    }

    modifier onlySignedIn {
        if (users[msg.sender].referal == address(0x0)) throw;   //user does not exist
        _;
    }

    modifier onlyForSale (uint8 _x, uint8 _y) {
        if (blocks[_x][_y].landlord != address(0x0) && blocks[_x][_y].sellPrice == 0) throw;
        _;
    }

    modifier onlyWithin100x100Area (uint8 _fromX, uint8 _fromY, uint8 _toX, uint8 _toY) {
        if ((_fromX < 1) || (_fromY < 1)  || (_toX > 100) || (_toY > 100)) throw;
        _;
    }    

    modifier onlyByLandlord (uint8 _x, uint8 _y) {
        if (msg.sender != admin) {
            if (blocks[_x][_y].landlord != msg.sender) throw;
        }
        _;
    }

    modifier noBannedUsers {
        if (users[msg.sender].banned == true) throw;
        _;
    }

    modifier stopInEmergency { 
        if (msg.sender != admin) {
            if (setting_stopped) throw; 
        }
        _;
    }

    modifier onlyInRefundMode { 
        if (!setting_refundMode) throw;
        _;
    }


// ** USER SIGN IN ** //

    function getActivationTime (uint _currentLevel, uint _setting_delay) private constant returns (uint32) {
        return uint32(now + _setting_delay * (2**(_currentLevel-1)));
    }

    function signIn (address referal) 
        public 
        stopInEmergency ()
        onlyWhenInvitedBy (referal) 
        returns (uint) 
    {
        numUsers++;
        // get user's referral handshakes and increase by one
        uint8 currentLevel = users[referal].handshakes + 1;
        users[msg.sender].referal = referal;
        users[msg.sender].handshakes = currentLevel;
        // 1,2,4,8,16,32,64 hours for activation depending on number of handshakes (if setting delay = 1 hour)
        users[msg.sender].activationTime = getActivationTime (currentLevel, setting_delay); 
        users[msg.sender].refunded = false;
        users[msg.sender].userID = numUsers;
        userAddrs[numUsers] = msg.sender;
        NewUser(numUsers, msg.sender, referal, users[msg.sender].activationTime);
        return numUsers;
    }


 // ** BUY AND SELL BLOCKS ** //

    function getBlockPrice (uint8 fromX, uint8 fromY, uint blocksSold) private constant returns (uint) {
        if (blocks[fromX][fromY].landlord == address(0x0)) { 
                // when buying at initial sale price doubles every 1000 blocks sold
                return 1 ether * (2 ** (blocksSold/1000));
            } else {
                // when the block is already bought and landlord have set a sell price
                return blocks[fromX][fromY].sellPrice;
            }
        }

    function buyBlock (uint8 x, uint8 y) 
        private  
        onlyForSale (x, y) 
        returns (uint)
    {
        uint blockPrice;
        blockPrice = getBlockPrice(x, y, blocksSold);
        // Buy at initial sale
        if (blocks[x][y].landlord == address(0x0)) {
            blocksSold += 1;  
            totalWeiInvested += blockPrice;
        // Buy from current landlord and pay him or her the blockPrice
        } else {
            users[blocks[x][y].landlord].balance += blockPrice;  
        }
        blocks[x][y].landlord = msg.sender;
        return blockPrice;
    }

    // buy an area of blocks at coordinates [fromX, fromY, toX, toY]
    function buyBlocks (uint8 fromX, uint8 fromY, uint8 toX, uint8 toY) 
        public
        payable
        stopInEmergency ()
        onlySignedIn () 
        onlyWithin100x100Area (fromX, fromY, toX, toY)
        returns (uint) 
    {   
        // Put funds to buyerBalance
        if (users[msg.sender].balance + msg.value < users[msg.sender].balance) throw; //checking for overflow
        uint previousWeiInvested = totalWeiInvested;
        uint buyerBalance = users[msg.sender].balance + msg.value;

        // perform buyBlock for coordinates [fromX, fromY, toX, toY] and withdraw funds
        uint purchasePrice;
        for (uint8 ix=fromX; ix<=toX; ix++) {
            for (uint8 iy=fromY; iy<=toY; iy++) {
                purchasePrice = buyBlock (ix,iy);
                if (buyerBalance < purchasePrice) throw;
                buyerBalance -= purchasePrice;
            }
        }
        // update user balance
        users[msg.sender].balance = buyerBalance;
        // user's total investments are used for refunds calculations in emergency
        users[msg.sender].investments += totalWeiInvested - previousWeiInvested;
        // pay rewards to the referral chain starting from the current user referral
        payOut (totalWeiInvested - previousWeiInvested, users[msg.sender].referal);
        numNewStatus += 1;
        // fire new area status event (0 sell price means the area is not for sale)
        NewAreaStatus (numNewStatus, fromX, fromY, toX, toY, 0);
        return purchasePrice;
    }


    //Mark block for sale (set a sell price)
    function sellBlock (uint8 x, uint8 y, uint sellPrice) 
        private
        onlyByLandlord (x, y) 
    {
        blocks[x][y].sellPrice = sellPrice;
    }

    // sell an area of blocks at coordinates [fromX, fromY, toX, toY]
    function sellBlocks (uint8 fromX, uint8 fromY, uint8 toX, uint8 toY, uint priceForEachBlockInWei) 
        public 
        stopInEmergency ()
        onlyWithin100x100Area (fromX, fromY, toX, toY) 
        returns (bool) 
    {
        if (priceForEachBlockInWei == 0) throw;
        for (uint8 ix=fromX; ix<=toX; ix++) {
            for (uint8 iy=fromY; iy<=toY; iy++) {
                sellBlock (ix, iy, priceForEachBlockInWei);
            }
        }
        numNewStatus += 1;
        // fire NewAreaStatus event
        NewAreaStatus (numNewStatus, fromX, fromY, toX, toY, priceForEachBlockInWei);
        return true;
    }


// ** ASSIGNING IMAGES ** //
    
    function chargeForImagePlacement () private {
        if (users[msg.sender].balance + msg.value < users[msg.sender].balance) throw; //check for overflow`
        uint buyerBalance = users[msg.sender].balance + msg.value;
        if (buyerBalance < setting_imagePlacementPriceInWei) throw;
        buyerBalance -= setting_imagePlacementPriceInWei;
        users[admin].balance += setting_imagePlacementPriceInWei;
        users[msg.sender].balance = buyerBalance;
    }

    // every block has its own image id assigned
    function assignImageID (uint8 x, uint8 y, uint _imageID) 
        private
        onlyByLandlord (x, y) 
    {
        blocks[x][y].imageID = _imageID;
    }

    // place new ad to user owned area
    function placeImage (uint8 fromX, uint8 fromY, uint8 toX, uint8 toY, string imageSourceUrl, string adUrl, string adText) 
        public 
        payable
        stopInEmergency ()
        noBannedUsers ()
        onlyWithin100x100Area (fromX, fromY, toX, toY)
        returns (uint) 
    {
        chargeForImagePlacement();
        numImages++;
        for (uint8 ix=fromX; ix<=toX; ix++) {
            for (uint8 iy=fromY; iy<=toY; iy++) {
                assignImageID (ix, iy, numImages);
            }
        }
        images[numImages].fromX = fromX;
        images[numImages].fromY = fromY;
        images[numImages].toX = toX;
        images[numImages].toY = toY;
        images[numImages].imageSourceUrl = imageSourceUrl;
        images[numImages].adUrl = adUrl;
        images[numImages].adText = adText;
        NewImage(numImages, fromX, fromY, toX, toY, imageSourceUrl, adUrl, adText);
        return numImages;
    }





// ** PAYOUTS ** //

    // reward the chain of referrals, admin and charity
    function payOut (uint _amount, address referal) private {
        address iUser = referal;
        address nextUser;
        uint totalPayed = 0;
        for (uint8 i = 1; i < 7; i++) {                 // maximum 6 handshakes from the buyer 
            users[iUser].balance += _amount / (2**i);   // with every handshake far from the buyer reward halves:
            totalPayed += _amount / (2**i);             // 50%, 25%, 12.5%, 6.25%, 3.125%, 1.5625%
            if (iUser == admin) { break; }              // breaks at admin
            nextUser = users[iUser].referal;
            iUser = nextUser;
        }
        goesToCharity(_amount - totalPayed);            // the rest goes to charity
    }

    // charity is the same type of user as everyone else
    function goesToCharity (uint amount) private {
        // if no charityAddress is set yet funds go to charityBalance (see further)
        if (charityAddress == address(0x0)) {
            charityBalance += amount;
        } else {
            users[charityAddress].balance += amount;
        }
    }

    // withdraw funds (no external calls for safety)
    function withdrawAll () 
        public
        stopInEmergency () 
    {
        uint withdrawAmount = users[msg.sender].balance;
        users[msg.sender].balance = 0;
        if (!msg.sender.send(withdrawAmount)) {
            users[msg.sender].balance = withdrawAmount;
        }
    }


 // ** GET INFO (CONSTANT FUNCTIONS)** //

    //USERS
    function getUserInfo (address userAddress) public constant returns (
        address referal,
        uint8 handshakes,
        uint balance,
        uint32 activationTime,
        bool banned,
        uint userID,
        bool refunded,
        uint investments
    ) {
        referal = users[userAddress].referal; 
        handshakes = users[userAddress].handshakes; 
        balance = users[userAddress].balance; 
        activationTime = users[userAddress].activationTime; 
        banned = users[userAddress].banned; 
        userID = users[userAddress].userID;
        refunded = users[userAddress].refunded; 
        investments = users[userAddress].investments;
    }

    function getUserAddressByID (uint userID) 
        public constant returns (address userAddress) 
    {
        return userAddrs[userID];
    }
    
    function getMyInfo() 
        public constant returns(uint balance, uint32 activationTime) 
    {   
        return (users[msg.sender].balance, users[msg.sender].activationTime);
    }

    //BLOCKS
    function getBlockInfo(uint8 x, uint8 y) 
        public constant returns (address landlord, uint imageID, uint sellPrice) 
    {
        return (blocks[x][y].landlord, blocks[x][y].imageID, blocks[x][y].sellPrice);
    }

    function getAreaPrice (uint8 fromX, uint8 fromY, uint8 toX, uint8 toY)
        public
        constant
        onlyWithin100x100Area (fromX, fromY, toX, toY)
        returns (uint) 
    {
        uint blockPrice;
        uint totalPrice = 0;
        uint16 iblocksSold = blocksSold;
        for (uint8 ix=fromX; ix<=toX; ix++) {
            for (uint8 iy=fromY; iy<=toY; iy++) {
                blockPrice = getBlockPrice(ix,iy,iblocksSold);
                if (blocks[ix][iy].landlord == address(0x0)) { 
                        iblocksSold += 1; 
                    }
                if (blockPrice == 0) { 
                    return 0; // not for sale
                    } 
                totalPrice += blockPrice;
            }
        }
        return totalPrice;
    }

    //IMAGES
    function getImageInfo(uint imageID) 
        public constant returns (uint8 fromX, uint8 fromY, uint8 toX, uint8 toY, string imageSourceUrl, string adUrl, string adText)
    {
        Image i = images[imageID];
        return (i.fromX, i.fromY, i.toX, i.toY, i.imageSourceUrl, i.adUrl, i.adText);
    }

    //CONTRACT STATE
    function getStateInfo () public constant returns (
        uint _numUsers, 
        uint16 _blocksSold, 
        uint _totalWeiInvested, 
        uint _numImages, 
        uint _setting_imagePlacementPriceInWei,
        uint _numNewStatus,
        uint32 _setting_delay
    ){
        return (numUsers, blocksSold, totalWeiInvested, numImages, setting_imagePlacementPriceInWei, numNewStatus, setting_delay);
    }


// ** ADMIN ** //

    function adminContractSecurity (address violator, bool banViolator, bool pauseContract, bool refundInvestments)
        public 
        onlyAdmin () 
    {
        //freeze/unfreeze user
        if (violator != address(0x0)) {
            users[violator].banned = banViolator;
        }
        //pause/resume contract 
        setting_stopped = pauseContract;

        //terminate contract, refund investments
        if (refundInvestments) {
            setting_refundMode = refundInvestments;
            refund_percent = uint8((this.balance*100)/totalWeiInvested);
        }
    }

    function adminContractSettings (uint32 newDelayInSeconds, address newCharityAddress, uint newImagePlacementPriceInWei)
        public 
        onlyAdmin () 
    {   
        // setting_delay affects user activation time.
        if (newDelayInSeconds > 0) setting_delay = newDelayInSeconds;
        // when the charityAddress is set charityBalance immediately transfered to it's balance 
        if (newCharityAddress != address(0x0)) {
            if (users[newCharityAddress].referal == address(0x0)) throw;
            charityAddress = newCharityAddress;
            users[charityAddress].balance += charityBalance;
            charityBalance = 0;
        }
        // at deploy is set to 0, but may be needed to support off-chain infrastructure
        setting_imagePlacementPriceInWei = newImagePlacementPriceInWei;
    }

    // escape path - withdraw funds at emergency.
    function emergencyRefund () 
        public
        onlyInRefundMode () 
    {
        if (!users[msg.sender].refunded) {
            uint totalInvested = users[msg.sender].investments;
            uint availableForRefund = (totalInvested*refund_percent)/100;
            users[msg.sender].investments -= availableForRefund;
            users[msg.sender].refunded = true;
            if (!msg.sender.send(availableForRefund)) {
                users[msg.sender].investments = totalInvested;
                users[msg.sender].refunded = false;
            }
        }
    }

    function () {
        throw;
    }

}

  Contract ABI  
[{"constant":false,"inputs":[{"name":"newDelayInSeconds","type":"uint32"},{"name":"newCharityAddress","type":"address"},{"name":"newImagePlacementPriceInWei","type":"uint256"}],"name":"adminContractSettings","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"emergencyRefund","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"fromX","type":"uint8"},{"name":"fromY","type":"uint8"},{"name":"toX","type":"uint8"},{"name":"toY","type":"uint8"},{"name":"priceForEachBlockInWei","type":"uint256"}],"name":"sellBlocks","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"fromX","type":"uint8"},{"name":"fromY","type":"uint8"},{"name":"toX","type":"uint8"},{"name":"toY","type":"uint8"}],"name":"getAreaPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"x","type":"uint8"},{"name":"y","type":"uint8"}],"name":"getBlockInfo","outputs":[{"name":"landlord","type":"address"},{"name":"imageID","type":"uint256"},{"name":"sellPrice","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"fromX","type":"uint8"},{"name":"fromY","type":"uint8"},{"name":"toX","type":"uint8"},{"name":"toY","type":"uint8"},{"name":"imageSourceUrl","type":"string"},{"name":"adUrl","type":"string"},{"name":"adText","type":"string"}],"name":"placeImage","outputs":[{"name":"","type":"uint256"}],"payable":true,"type":"function"},{"constant":false,"inputs":[{"name":"fromX","type":"uint8"},{"name":"fromY","type":"uint8"},{"name":"toX","type":"uint8"},{"name":"toY","type":"uint8"}],"name":"buyBlocks","outputs":[{"name":"","type":"uint256"}],"payable":true,"type":"function"},{"constant":true,"inputs":[{"name":"userAddress","type":"address"}],"name":"getUserInfo","outputs":[{"name":"referal","type":"address"},{"name":"handshakes","type":"uint8"},{"name":"balance","type":"uint256"},{"name":"activationTime","type":"uint32"},{"name":"banned","type":"bool"},{"name":"userID","type":"uint256"},{"name":"refunded","type":"bool"},{"name":"investments","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"userID","type":"uint256"}],"name":"getUserAddressByID","outputs":[{"name":"userAddress","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"getMyInfo","outputs":[{"name":"balance","type":"uint256"},{"name":"activationTime","type":"uint32"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"getStateInfo","outputs":[{"name":"_numUsers","type":"uint256"},{"name":"_blocksSold","type":"uint16"},{"name":"_totalWeiInvested","type":"uint256"},{"name":"_numImages","type":"uint256"},{"name":"_setting_imagePlacementPriceInWei","type":"uint256"},{"name":"_numNewStatus","type":"uint256"},{"name":"_setting_delay","type":"uint32"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"withdrawAll","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"referal","type":"address"}],"name":"signIn","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"imageID","type":"uint256"}],"name":"getImageInfo","outputs":[{"name":"fromX","type":"uint8"},{"name":"fromY","type":"uint8"},{"name":"toX","type":"uint8"},{"name":"toY","type":"uint8"},{"name":"imageSourceUrl","type":"string"},{"name":"adUrl","type":"string"},{"name":"adText","type":"string"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"charityBalance","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"charityAddress","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"violator","type":"address"},{"name":"banViolator","type":"bool"},{"name":"pauseContract","type":"bool"},{"name":"refundInvestments","type":"bool"}],"name":"adminContractSecurity","outputs":[],"payable":false,"type":"function"},{"inputs":[],"type":"constructor"},{"payable":false,"type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"ID","type":"uint256"},{"indexed":false,"name":"newUser","type":"address"},{"indexed":false,"name":"invitedBy","type":"address"},{"indexed":false,"name":"activationTime","type":"uint32"}],"name":"NewUser","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"ID","type":"uint256"},{"indexed":false,"name":"fromX","type":"uint8"},{"indexed":false,"name":"fromY","type":"uint8"},{"indexed":false,"name":"toX","type":"uint8"},{"indexed":false,"name":"toY","type":"uint8"},{"indexed":false,"name":"price","type":"uint256"}],"name":"NewAreaStatus","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"ID","type":"uint256"},{"indexed":false,"name":"fromX","type":"uint8"},{"indexed":false,"name":"fromY","type":"uint8"},{"indexed":false,"name":"toX","type":"uint8"},{"indexed":false,"name":"toY","type":"uint8"},{"indexed":false,"name":"imageSourceUrl","type":"string"},{"indexed":false,"name":"adUrl","type":"string"},{"indexed":false,"name":"adText","type":"string"}],"name":"NewImage","type":"event"}]

  Contract Creation Code Switch To Opcodes View
6060604052600060018190556004805461ffff191690556005819055617791819055617793819055617794805460a060020a60ff02191690556177958190556177968054630e10000065ffffffffffff199091161790556177975560008054600160a060020a03199081163317808355600160a060020a0390811680845260026020818152604080872080548716909417909355855484168652828620805460a060020a60ff0219169055855484168652828620909101805463ffffffff1916421790558454831685528185206003908101869055855491527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff8054851691909316908117909255600154845290922080549091169091179055611c0e806101276000396000f3606060405236156100cf5760e060020a60003504630e6b0afc81146100dc57806316bfe25c1461010957806335e49e5f1461012d5780634a00dc38146101715780634abfbbe3146101d057806359ae6e341461027a57806359b95f5a1461037b5780636386c1c7146103bd57806374774370146104625780637daa10ce146104a057806380c81c16146104e4578063853828b61461054d5780638fa9e55c1461057e57806395f22405146105b457806399b8a3f014610684578063afcf2fc414610693578063e9b0c0e1146106ab575b34610002576106da610002565b34610002576106da600435602435604435600054600160a060020a03908116339091161461087f57610002565b34610002576106da617796546000908190610100900460ff16151561092957610002565b34610002576106dc6004356024356044356064356084356000805481908190600160a060020a039081163390911614610a25576177965460ff1615610a2557610002565b34610002576106f06004356024356044356064356000600060006000600060008989898960018460ff1610806101aa575060018360ff16105b806101b8575060648260ff16115b806101c6575060648160ff16115b15610b8657610002565b346100025761070260043560243560008080600660ff861660658110156100025761012f020160ff85166065811015610002576003020160005054600160a060020a0316600660ff871660658110156100025761012f020160ff86166065811015610002576003020160005060010154600660ff881660658110156100025761012f020160ff87166065811015610002576003020160005060020154919450925090509250925092565b604080516020608435600481810135601f81018490048402850184019095528484526106f094813594602480359560443595606435959460a4949391909101918190840183828082843750506040805160209735808a0135601f81018a90048a0283018a0190935282825296989760c4979196506024919091019450909250829150840183828082843750506040805160209735808a0135601f81018a90048a0283018a0190935282825296989760e49791965060249190910194509092508291508401838280828437509496505050505050506000805481908190600160a060020a039081163390911614610cab576177965460ff1615610cab57610002565b6106f06004356024356044356064356000805481908190819081908190600160a060020a039081163390911614611272576177965460ff161561127257610002565b3461000257600160a060020a0360048035821660009081526002602081815260409283902060018101548154938201546003830154968301546005909301548651988616895260a060020a90950460ff908116948901949094528786019190915263ffffffff81166060880152640100000000900482161515608087015260a086019490945292909216151560c084015260e083019190915251908190036101000190f35b3461000257600435600090815260036020526040902054600160a060020a03165b60408051600160a060020a03929092168252519081900360200190f35b3461000257600160a060020a0333166000908152600260208181526040928390206001810154920154835192835263ffffffff169082015281519081900390910190f35b3461000257600454617797546001546005546177955460408051617791546177965495825261ffff9097166020820152808201929092526060820195909552608081019390935260a083015262010000900463ffffffff1660c082015290519081900360e00190f35b34610002576106da60008054600160a060020a039081163390911614611560576177965460ff161561156057610002565b34610002576106f0600435600080548190600160a060020a0390811633909116146115d4576177965460ff16156115d457610002565b346100025761072b60043560408051602081810183526000808352835180830185528181528451808401865282815286835261779284528583208054600182810180548a5160029382161561010090810260001901909216849004601f81018b90048b0282018b01909c528b8152979a8b9a8b9a8b9a919998979660ff8181169795820481169662010000830482169663010000009093049091169490939189019260038a01929185918301828280156117d05780601f106117a5576101008083540402835291602001916117d0565b34610002576106f06177935481565b346100025761048361779454600160a060020a031681565b34610002576106da60043560243560443560643560005433600160a060020a0390811691161461190f57610002565b005b604080519115158252519081900360200190f35b60408051918252519081900360200190f35b60408051600160a060020a03949094168452602084019290925282820152519081900360600190f35b604051808860ff1681526020018760ff1681526020018660ff1681526020018560ff1681526020018060200180602001806020018481038452878181518152602001915080519060200190808383829060006004602084601f0104600302600f01f150905090810190601f1680156107b75780820380516001836020036101000a031916815260200191505b508481038352868181518152602001915080519060200190808383829060006004602084601f0104600302600f01f150905090810190601f1680156108105780820380516001836020036101000a031916815260200191505b508481038252858181518152602001915080519060200190808383829060006004602084601f0104600302600f01f150905090810190601f1680156108695780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390f35b60008363ffffffff1611156108a657617796805465ffffffff000019166201000085021790555b600160a060020a03821660001461092157600160a060020a0382811660009081526002602052604081205490911614156108df57610002565b6177948054600160a060020a0319168317908190556177938054600160a060020a03929092166000908152600260205260408120600101805493909301909255555b617797555050565b33600160a060020a031660009081526002602052604090206004015460ff161515610a21575050604060008181206004810180546005909201805461779454606460a060020a90910460ff1682020480820390925560ff19939093166001179091559251909291600160a060020a0333169183156108fc0291849190818181858888f193505050501515610a2157816002600050600033600160a060020a031681526020019081526020016000206000506005016000508190555060006002600050600033600160a060020a0316815260200190815260200160002060005060040160006101000a81548160ff021916908302179055505b5050565b8787878760018460ff161080610a3e575060018360ff16105b80610a4c575060648260ff16115b80610a5a575060648160ff16115b15610a6457610002565b8760001415610a7257610002565b8b95505b60ff8a811690871611610af8578a94505b60ff89811690861611610b6e57610b7a86868a60005483908390600160a060020a0390811633909116146119b15733600160a060020a0316600660ff841660658110156100025761012f020160ff83166065811015610002576003020154600160a060020a0316146119b157610002565b60058054600101908190556040805191825260ff8e811660208401528d8116838301528c811660608401528b16608083015260a082018a9052517f46cffffd9f27bb4e759b47d034705eda06243dd60eb47be11a2c9b02ae16b89d9181900360c00190a15060019b9a5050505050505050505050565b60019590950194610a76565b60019490940193610a87565b6004546000985061ffff1696508d95505b60ff8c811690871611610bc4578c94505b60ff8b811690861611610bd957610be586868961ffff16610c4b565b8799505b505050505050505050949350505050565b60019590950194610b97565b98506000600660ff881660658110156100025761012f020160ff87166065811015610002576003020160005054600160a060020a03161415610c2957600196909601955b8860001415610c9b5760009950610bc8565b600454611abc908790879061ffff165b600080600660ff861660658110156100025761012f020160ff85166065811015610002576003020154600160a060020a031614156119e557506103e8810460020a670de0b6b3a764000002611a11565b9688019660019490940193610ba8565b33600160a060020a031660009081526002602081905260409091200154640100000000900460ff16151560011415610ce257610002565b8989898960018460ff161080610cfb575060018360ff16105b80610d09575060648260ff16115b80610d17575060648160ff16115b15610d2157610002565b610d4e33600160a060020a03166000908152600260205260408120600101543481011015611a1857610002565b617791805460010190558d95505b60ff8c811690871611610de4578c94505b60ff8b811690861611610f5057610f5c86866177916000505460005483908390600160a060020a039081163390911614611a885733600160a060020a0316600660ff841660658110156100025761012f020160ff83166065811015610002576003020154600160a060020a031614611a8857610002565b8d617792600050600061779160005054815260200190815260200160002060005060000160006101000a81548160ff021916908302179055508c617792600050600061779160005054815260200190815260200160002060005060000160016101000a81548160ff021916908302179055508b617792600050600061779160005054815260200190815260200160002060005060000160026101000a81548160ff021916908302179055508a617792600050600061779160005054815260200190815260200160002060005060000160036101000a81548160ff021916908302179055508961779260005060006177916000505481526020019081526020016000206000506001016000509080519060200190828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610f6857805160ff19168380011785555b50610f989291505b808211156110035760008155600101610f3c565b60019590950194610d5c565b60019490940193610d6d565b82800160010185558215610f34579182015b82811115610f34578251826000505591602001919060010190610f7a565b5050617791546000908152617792602090815260408220600290810180548d518286529484902091946001821615610100026000190190911692909204601f9081018490048201938e019083901061100757805160ff19168380011785555b50611037929150610f3c565b5090565b82800160010185558215610ff7579182015b82811115610ff7578251826000505591602001919060010190611019565b50506177915460009081526177926020908152604082208a516003909101805481855293839020909360026001821615610100026000190190911604601f9081018490048201938d01908390106110a157805160ff19168380011785555b506110d1929150610f3c565b82800160010185558215611095579182015b828111156110955782518260005055916020019190600101906110b3565b50507f542d3e34836f8b331e8441364480130cf7077e9b6ae9dab76dc285dd3961b0a6617791600050548f8f8f8f8f8f8f604051808981526020018860ff1681526020018760ff1681526020018660ff1681526020018560ff1681526020018060200180602001806020018481038452878181518152602001915080519060200190808383829060006004602084601f0104600302600f01f150905090810190601f1680156111945780820380516001836020036101000a031916815260200191505b508481038352868181518152602001915080519060200190808383829060006004602084601f0104600302600f01f150905090810190601f1680156111ed5780820380516001836020036101000a031916815260200191505b508481038252858181518152602001915080519060200190808383829060006004602084601f0104600302600f01f150905090810190601f1680156112465780820380516001836020036101000a031916815260200191505b509b50505050505050505050505060405180910390a15050617791549c9b505050505050505050505050565b600160a060020a03338116600090815260026020526040812054909116141561129a57610002565b8989898960018460ff1610806112b3575060018360ff16105b806112c1575060648260ff16115b806112cf575060648160ff16115b156112d957610002565b33600160a060020a0316600090815260026020526040902060010154348101101561130357610002565b6177955433600160a060020a0316600090815260026020526040902060010154909950340197508d95505b60ff8c8116908716116113c6578c94505b60ff8b8116908616116114a8576114b48686600080838382600660ff841660658110156100025761012f020160ff83166065811015610002576003020154600160a060020a0316148015906113bc5750600660ff831660658110156100025761012f020160ff821660658110156100025760030201600201546000145b15610c3b57610002565b33600160a060020a039081166000908152600260205260409020600181018a90556177958054600583018054918e90039190910190555490546114d492918c900391168060008060015b60078160ff16101561147f578060020a60ff1686811561000257600160a060020a0386166000908152600260208190526040909120600101805493909204909201905581900a60ff168681156100025760005491900490920191600160a060020a039081169085161415611bb6575b611bdf82870361779454600160a060020a031660001415611be7576177938054820190556115d1565b6001959095019461132e565b9650868810156114c357610002565b96869003966001949094019361133f565b600160056000828282505401925050819055507f46cffffd9f27bb4e759b47d034705eda06243dd60eb47be11a2c9b02ae16b89d6005600050548f8f8f8f6000604051808781526020018660ff1681526020018560ff1681526020018460ff1681526020018360ff168152602001828152602001965050505050505060405180910390a1869950610bc8565b5033600160a060020a0316600081815260026020526040808220600101805490839055905190929183156108fc02918491818181858888f1935050505015156115d157806002600050600033600160a060020a03168152602001908152602001600020600050600101600050819055505b50565b600160a060020a03338116600090815260026020526040812054859216146115fb57610002565b600160a060020a03818116600090815260026020526040812054909116141561162357610002565b600160a060020a0381166000908152600260208190526040909120015463ffffffff1642101561165257610002565b6001805481018155600160a060020a03858116600090815260026020819052604080832054339490941683529091208054600160a060020a031916881774ff0000000000000000000000000000000000000000191660a060020a9384900460ff908116909501938402179055617796549194509184166000190190910a6201000090910463ffffffff1602420133600160a060020a038181166000818152600260208181526040808420808401805463ffffffff1916909917895560048101805460ff1916905560018054600392830181905586529083528185208054600160a060020a03191690981790975595549284905290815294548451918252948101919091529087168183015263ffffffff929092166060830152517f9d35dcac34f1dc50826c04b0cf8282b0764ff89463320a8401c9add280b92ebd9181900360800190a160016000505492505050919050565b820191906000526020600020905b8154815290600101906020018083116117b357829003601f168201915b5050604080518754602060026001831615610100026000190190921691909104601f81018290048202830182019093528282529598509487945090925084019050828280156118605780601f1061183557610100808354040283529160200191611860565b820191906000526020600020905b81548152906001019060200180831161184357829003601f168201915b5050845460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152959750869450925084019050828280156118ee5780601f106118c3576101008083540402835291602001916118ee565b820191906000526020600020905b8154815290600101906020018083116118d157829003601f168201915b50505050509050975097509750975097509750975050919395979092949650565b600160a060020a03841660001461195457600160a060020a0384166000908152600260208190526040909120018054640100000000850264ff00000000199091161790555b617796805460ff19168317905580156119ab57617796805461ff00191661010083021790556177955430600160a060020a0316316064028115610002570461779460146101000a81548160ff021916908302179055505b50505050565b82600660ff871660658110156100025761012f020160ff861660658110156100025760030201600050600201555050505050565b600660ff851660658110156100025761012f020160ff8416606581101561000257600302016002015490505b9392505050565b5033600160a060020a031660009081526002602052604090206001015461779754349190910190811015611a4b57610002565b6177975460008054600160a060020a0390811682526002602052604080832060019081018054860190553392909216835290912091909203910155565b82600660ff871660658110156100025761012f020160ff861660658110156100025760030201600050600101555050505050565b92506000600660ff881660658110156100025761012f020160ff87166065811015610002576003020160005054600160a060020a03161415611b1c576004805461ffff19811661ffff909116600101179055617795805484019055611b6e565b8260026000600660ff8a1660658110156100025761012f020160ff89166065811015610002576003020160005054600160a060020a031681526020810191909152604001600020600101805490910190555b33600660ff881660658110156100025761012f020160ff8716606581101561000257600302016000508054600160a060020a0319169091179055919250829150505092915050565b600160a060020a0393841660009081526002602052604090205490931692839250600101611410565b505050505050565b61779454600160a060020a031660009081526002602052604090206001018054820190555056
View All
Block Age txn Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward