Contract 0x48c295FE2E2e765C0d858B3970DdD0520aC1aee7

Contract Overview

Balance:
0 BNB

Token:
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xe735a73dd2ad604a943d9c9d3da31046b461484a2dc81430316eea8dcd11e167Buy Ticket103717542021-07-07 2:13:11146 days 18 hrs ago0xc666a2d73dd26ef496e75fd9cfc41ed02d7c2127 IN  0x48c295fe2e2e765c0d858b3970ddd0520ac1aee70 BNB0.00096826
0xe715c7abeb97142a675d18b4361070d77232aabba78e43468207d72a7d1ef0acBuy Ticket101337062021-06-28 16:41:13155 days 4 hrs ago0xc666a2d73dd26ef496e75fd9cfc41ed02d7c2127 IN  0x48c295fe2e2e765c0d858b3970ddd0520ac1aee70 BNB0.00100944
0x77b04b3dd8bf1eb3c7da3056b8f2ddd78a86e79c3ba84272653b88c432e809a7Pick Winner101336882021-06-28 16:40:19155 days 4 hrs ago0xc666a2d73dd26ef496e75fd9cfc41ed02d7c2127 IN  0x48c295fe2e2e765c0d858b3970ddd0520ac1aee70 BNB0.00091619
0x46716320144e8cd799984d2d489892f39fccd124132ef6b71f5d5c5633ee54b6Pick Winner101336762021-06-28 16:39:43155 days 4 hrs ago0xc666a2d73dd26ef496e75fd9cfc41ed02d7c2127 IN  0x48c295fe2e2e765c0d858b3970ddd0520ac1aee70 BNB0.00073287
0x117ae44e3a314dd21fac3878d446c7f2fcbce811ec71638136fad09473c79c16Buy Ticket98703872021-06-19 13:15:01164 days 7 hrs ago0xc666a2d73dd26ef496e75fd9cfc41ed02d7c2127 IN  0x48c295fe2e2e765c0d858b3970ddd0520ac1aee70 BNB0.00109079
0x471423b96da10f14c7a34531df1c178b53c736d7bc505271d13d7edf8596ac3bPick Winner98201002021-06-17 19:20:40166 days 1 hr ago0xc666a2d73dd26ef496e75fd9cfc41ed02d7c2127 IN  0x48c295fe2e2e765c0d858b3970ddd0520ac1aee70 BNB0.00091619
0x508e398755a7bf48616c88b88de27c28306b39e0d075ee921773d0cc7e3e4de2Pick Winner98200852021-06-17 19:19:55166 days 1 hr ago0xc666a2d73dd26ef496e75fd9cfc41ed02d7c2127 IN  0x48c295fe2e2e765c0d858b3970ddd0520ac1aee70 BNB0.00073287
0x4f8a7f0de6cd0769bc66ff2e153c3a34111aef83d9fddb3fcf17564435d7cf2bBuy Ticket97604352021-06-15 17:37:11168 days 3 hrs ago0xc666a2d73dd26ef496e75fd9cfc41ed02d7c2127 IN  0x48c295fe2e2e765c0d858b3970ddd0520ac1aee70 BNB0.00109079
0x8b48c1ac275209922840e9bb86d4269879516b2aa94aa2fa8b89ccec2b17372ePick Winner97324332021-06-14 18:17:04169 days 2 hrs ago0xc666a2d73dd26ef496e75fd9cfc41ed02d7c2127 IN  0x48c295fe2e2e765c0d858b3970ddd0520ac1aee70 BNB0.00091619
0x902b843a173b5e7bf3cb348cebf995f78153abe38a0a5c582803fd55c050b723Pick Winner97324202021-06-14 18:16:25169 days 2 hrs ago0xc666a2d73dd26ef496e75fd9cfc41ed02d7c2127 IN  0x48c295fe2e2e765c0d858b3970ddd0520ac1aee70 BNB0.00073287
0x8fcccfa32bb470d7dff2b0cc6ad05603fc6c8ed19a90b07f6ff4d8195383e5e2Buy Ticket96819052021-06-13 0:10:40170 days 20 hrs ago0xc666a2d73dd26ef496e75fd9cfc41ed02d7c2127 IN  0x48c295fe2e2e765c0d858b3970ddd0520ac1aee70 BNB0.00096826
0x27a17750f7ea4aad14e65a5d39732fe8e91188c8410b104ab0f96467e4e0ae7bBuy Ticket96749872021-06-12 18:24:46171 days 2 hrs ago0xc666a2d73dd26ef496e75fd9cfc41ed02d7c2127 IN  0x48c295fe2e2e765c0d858b3970ddd0520ac1aee70 BNB0.00109079
0x0cf18856fb12b2d067b9702aabf7ec1d51b0c02c2bedd82eb88e6e97a106f473Pick Winner96642162021-06-12 9:26:13171 days 11 hrs ago0xf3cb8cb6170fa64ea20dfe4d46762fb4d9bb23f4 IN  0x48c295fe2e2e765c0d858b3970ddd0520ac1aee70 BNB0.0009832
0x2654d9ceab3160d198046c563c39ab6583e3d5a4645d22947931a88ca94b4a73Pick Winner96642072021-06-12 9:25:46171 days 11 hrs ago0xf3cb8cb6170fa64ea20dfe4d46762fb4d9bb23f4 IN  0x48c295fe2e2e765c0d858b3970ddd0520ac1aee70 BNB0.00073287
0x6fec38336e24b1094ed23af932acc70bcae9aec5481469c3a909e9a2979a96d4Buy Ticket96639162021-06-12 9:11:13171 days 11 hrs ago0xf3cb8cb6170fa64ea20dfe4d46762fb4d9bb23f4 IN  0x48c295fe2e2e765c0d858b3970ddd0520ac1aee70 BNB0.00088691
0xe944ed4e8a0c4744b10f960a9622cfa74a8767d1fc58322fb9090960b6982da0Buy Ticket96639052021-06-12 9:10:40171 days 11 hrs ago0xf36db493eb9efde843416c155e41af7871864c81 IN  0x48c295fe2e2e765c0d858b3970ddd0520ac1aee70 BNB0.00100944
0xaa4970381db26d938a1a54c7440a315dbcf33a42b3081940d5c3d37fded0d962Pick Winner96636132021-06-12 8:56:04171 days 11 hrs ago0x06c0313ea7e4f02d5a3077b292f104aecfbd5404 IN  0x48c295fe2e2e765c0d858b3970ddd0520ac1aee70 BNB0.00100019
0x862274e7de827066e01da74e847332f1ffecbc3cabe6fb74565b41d04d9bf918Pick Winner96635922021-06-12 8:55:01171 days 11 hrs ago0x06c0313ea7e4f02d5a3077b292f104aecfbd5404 IN  0x48c295fe2e2e765c0d858b3970ddd0520ac1aee70 BNB0.00103287
0x092e895263d209576aa6507e33bc29d51d47bf4009a3b99942f346fa2b6ab337Buy Ticket96635432021-06-12 8:52:34171 days 12 hrs ago0xf36db493eb9efde843416c155e41af7871864c81 IN  0x48c295fe2e2e765c0d858b3970ddd0520ac1aee70 BNB0.00088691
0x22553a67fb73b09e148700e3d52044bba6c066c05ab31efee4ae4665081280e4Buy Ticket96635102021-06-12 8:50:55171 days 12 hrs ago0xf3cb8cb6170fa64ea20dfe4d46762fb4d9bb23f4 IN  0x48c295fe2e2e765c0d858b3970ddd0520ac1aee70 BNB0.00124079
0x73476e62b5a5656429c23b9a4d320e383c41c17331f9372f3fc54feb39dafed7Buy Ticket96634322021-06-12 8:47:01171 days 12 hrs ago0xf3cb8cb6170fa64ea20dfe4d46762fb4d9bb23f4 IN  0x48c295fe2e2e765c0d858b3970ddd0520ac1aee70 BNB0.00025599
0xe525bd10bccd007d5b3f27f35aa11550803f0a459f15a1992e1f13e9d4e42b370x6080604096633262021-06-12 8:41:43171 days 12 hrs ago0xf36db493eb9efde843416c155e41af7871864c81 IN  Contract Creation0 BNB0.03569132
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xe735a73dd2ad604a943d9c9d3da31046b461484a2dc81430316eea8dcd11e167103717542021-07-07 2:13:11146 days 18 hrs ago 0x48c295fe2e2e765c0d858b3970ddd0520ac1aee7 0x3ca8e2aa9cd5b4680a213b341d525a37abab7a240 BNB
0xe735a73dd2ad604a943d9c9d3da31046b461484a2dc81430316eea8dcd11e167103717542021-07-07 2:13:11146 days 18 hrs ago 0x48c295fe2e2e765c0d858b3970ddd0520ac1aee7 0x3ca8e2aa9cd5b4680a213b341d525a37abab7a240 BNB
0xe735a73dd2ad604a943d9c9d3da31046b461484a2dc81430316eea8dcd11e167103717542021-07-07 2:13:11146 days 18 hrs ago 0x48c295fe2e2e765c0d858b3970ddd0520ac1aee7 0x3ca8e2aa9cd5b4680a213b341d525a37abab7a240 BNB
0xe715c7abeb97142a675d18b4361070d77232aabba78e43468207d72a7d1ef0ac101337062021-06-28 16:41:13155 days 4 hrs ago 0x48c295fe2e2e765c0d858b3970ddd0520ac1aee7 0x3ca8e2aa9cd5b4680a213b341d525a37abab7a240 BNB
0xe715c7abeb97142a675d18b4361070d77232aabba78e43468207d72a7d1ef0ac101337062021-06-28 16:41:13155 days 4 hrs ago 0x48c295fe2e2e765c0d858b3970ddd0520ac1aee7 0x3ca8e2aa9cd5b4680a213b341d525a37abab7a240 BNB
0xe715c7abeb97142a675d18b4361070d77232aabba78e43468207d72a7d1ef0ac101337062021-06-28 16:41:13155 days 4 hrs ago 0x48c295fe2e2e765c0d858b3970ddd0520ac1aee7 0x3ca8e2aa9cd5b4680a213b341d525a37abab7a240 BNB
0x77b04b3dd8bf1eb3c7da3056b8f2ddd78a86e79c3ba84272653b88c432e809a7101336882021-06-28 16:40:19155 days 4 hrs ago 0x48c295fe2e2e765c0d858b3970ddd0520ac1aee7 0x3ca8e2aa9cd5b4680a213b341d525a37abab7a240 BNB
0x77b04b3dd8bf1eb3c7da3056b8f2ddd78a86e79c3ba84272653b88c432e809a7101336882021-06-28 16:40:19155 days 4 hrs ago 0x48c295fe2e2e765c0d858b3970ddd0520ac1aee7 0x3ca8e2aa9cd5b4680a213b341d525a37abab7a240 BNB
0x77b04b3dd8bf1eb3c7da3056b8f2ddd78a86e79c3ba84272653b88c432e809a7101336882021-06-28 16:40:19155 days 4 hrs ago 0x48c295fe2e2e765c0d858b3970ddd0520ac1aee7 0x3ca8e2aa9cd5b4680a213b341d525a37abab7a240 BNB
0x77b04b3dd8bf1eb3c7da3056b8f2ddd78a86e79c3ba84272653b88c432e809a7101336882021-06-28 16:40:19155 days 4 hrs ago 0x48c295fe2e2e765c0d858b3970ddd0520ac1aee7 0x3ca8e2aa9cd5b4680a213b341d525a37abab7a240 BNB
0x46716320144e8cd799984d2d489892f39fccd124132ef6b71f5d5c5633ee54b6101336762021-06-28 16:39:43155 days 4 hrs ago 0x48c295fe2e2e765c0d858b3970ddd0520ac1aee7 0x3ca8e2aa9cd5b4680a213b341d525a37abab7a240 BNB
0x117ae44e3a314dd21fac3878d446c7f2fcbce811ec71638136fad09473c79c1698703872021-06-19 13:15:01164 days 7 hrs ago 0x48c295fe2e2e765c0d858b3970ddd0520ac1aee7 0x3ca8e2aa9cd5b4680a213b341d525a37abab7a240 BNB
0x117ae44e3a314dd21fac3878d446c7f2fcbce811ec71638136fad09473c79c1698703872021-06-19 13:15:01164 days 7 hrs ago 0x48c295fe2e2e765c0d858b3970ddd0520ac1aee7 0x3ca8e2aa9cd5b4680a213b341d525a37abab7a240 BNB
0x117ae44e3a314dd21fac3878d446c7f2fcbce811ec71638136fad09473c79c1698703872021-06-19 13:15:01164 days 7 hrs ago 0x48c295fe2e2e765c0d858b3970ddd0520ac1aee7 0x3ca8e2aa9cd5b4680a213b341d525a37abab7a240 BNB
0x471423b96da10f14c7a34531df1c178b53c736d7bc505271d13d7edf8596ac3b98201002021-06-17 19:20:40166 days 1 hr ago 0x48c295fe2e2e765c0d858b3970ddd0520ac1aee7 0x3ca8e2aa9cd5b4680a213b341d525a37abab7a240 BNB
0x471423b96da10f14c7a34531df1c178b53c736d7bc505271d13d7edf8596ac3b98201002021-06-17 19:20:40166 days 1 hr ago 0x48c295fe2e2e765c0d858b3970ddd0520ac1aee7 0x3ca8e2aa9cd5b4680a213b341d525a37abab7a240 BNB
0x471423b96da10f14c7a34531df1c178b53c736d7bc505271d13d7edf8596ac3b98201002021-06-17 19:20:40166 days 1 hr ago 0x48c295fe2e2e765c0d858b3970ddd0520ac1aee7 0x3ca8e2aa9cd5b4680a213b341d525a37abab7a240 BNB
0x471423b96da10f14c7a34531df1c178b53c736d7bc505271d13d7edf8596ac3b98201002021-06-17 19:20:40166 days 1 hr ago 0x48c295fe2e2e765c0d858b3970ddd0520ac1aee7 0x3ca8e2aa9cd5b4680a213b341d525a37abab7a240 BNB
0x508e398755a7bf48616c88b88de27c28306b39e0d075ee921773d0cc7e3e4de298200852021-06-17 19:19:55166 days 1 hr ago 0x48c295fe2e2e765c0d858b3970ddd0520ac1aee7 0x3ca8e2aa9cd5b4680a213b341d525a37abab7a240 BNB
0x4f8a7f0de6cd0769bc66ff2e153c3a34111aef83d9fddb3fcf17564435d7cf2b97604352021-06-15 17:37:11168 days 3 hrs ago 0x48c295fe2e2e765c0d858b3970ddd0520ac1aee7 0x3ca8e2aa9cd5b4680a213b341d525a37abab7a240 BNB
0x4f8a7f0de6cd0769bc66ff2e153c3a34111aef83d9fddb3fcf17564435d7cf2b97604352021-06-15 17:37:11168 days 3 hrs ago 0x48c295fe2e2e765c0d858b3970ddd0520ac1aee7 0x3ca8e2aa9cd5b4680a213b341d525a37abab7a240 BNB
0x4f8a7f0de6cd0769bc66ff2e153c3a34111aef83d9fddb3fcf17564435d7cf2b97604352021-06-15 17:37:11168 days 3 hrs ago 0x48c295fe2e2e765c0d858b3970ddd0520ac1aee7 0x3ca8e2aa9cd5b4680a213b341d525a37abab7a240 BNB
0x8b48c1ac275209922840e9bb86d4269879516b2aa94aa2fa8b89ccec2b17372e97324332021-06-14 18:17:04169 days 2 hrs ago 0x48c295fe2e2e765c0d858b3970ddd0520ac1aee7 0x3ca8e2aa9cd5b4680a213b341d525a37abab7a240 BNB
0x8b48c1ac275209922840e9bb86d4269879516b2aa94aa2fa8b89ccec2b17372e97324332021-06-14 18:17:04169 days 2 hrs ago 0x48c295fe2e2e765c0d858b3970ddd0520ac1aee7 0x3ca8e2aa9cd5b4680a213b341d525a37abab7a240 BNB
0x8b48c1ac275209922840e9bb86d4269879516b2aa94aa2fa8b89ccec2b17372e97324332021-06-14 18:17:04169 days 2 hrs ago 0x48c295fe2e2e765c0d858b3970ddd0520ac1aee7 0x3ca8e2aa9cd5b4680a213b341d525a37abab7a240 BNB
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Daffle

Compiler Version
v0.5.17+commit.d19bba13

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 1 : Daffle.sol
/**
 *Submitted for verification at Etherscan.io on 2020-04-05
*/

/*

***The Daffle***


The Daffle is a game built on top of the Deverything token (https://shuffle.monster/).
Players can buy tickets with SHUF tokens. Each week a winner is randomly picked. 

*/

pragma solidity ^0.5.17;

contract ERC20Token {
  function totalSupply() public view returns(uint);
  function balanceOf(address tokenOwner) public view returns(uint balance);
  function allowance(address tokenOwner, address spender) public view returns(uint remaining);
  function transfer(address to, uint tokens) public returns(bool success);
  function approve(address spender, uint tokens) public returns(bool success);
  function transferFrom(address from, address to, uint tokens) public returns(bool success);
}

contract Ownable {
    address public owner;
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    constructor() public {
      owner = msg.sender;
    }
    
    modifier onlyOwner() {
      require(msg.sender == owner);
      _;
    }
    
    function transferOwnership(address newOwner) public onlyOwner {
      require(newOwner != address(0));
      emit OwnershipTransferred(owner, newOwner);
      owner = newOwner;
    }
}

contract Daffle is Ownable {
    using SafeMath for uint256;
    
    struct Order {
        uint48 position;
        uint48 size;
        address owner;
    }
    
    mapping(uint256 => Order[]) TicketBook;
    address private constant ZERO_ADDRESS = 0x0000000000000000000000000000000000000000;
    address public constant shufAddress = 0x3CA8E2Aa9cd5b4680a213B341d525A37AbaB7a24; //TODO bsctest deverything
    address public constant devAddress = 0xC666A2d73Dd26Ef496E75fD9CFC41eD02D7C2127;
    ERC20Token public constant shuf = ERC20Token(shufAddress);
    // UniswapExchangeInterface private constant UniShuf = UniswapExchangeInterface(0xD99D1c33F9fC3444f8101754aBC46c52416550D1); //TODO
    // UniswapFactoryInterface private constant UniFactory = UniswapFactoryInterface(0x6725F303b657a9451d8BA641348b6761A6CC7a17); //TODO
    // Gastoken private constant gastoken = Gastoken(0x0000000000b3F879cb30FE243b4Dfee438691c04);
    uint256 public RaffleNo = 1;
    uint256 public NextRaffle = 1586112779;

    uint256 public TicketPrice = 5*10**18;
    uint256 public PickerReward = 10*10**18;
    uint256 public minTickets = 50;
    uint256 public RafflePerc = 10;
    uint256 public devFeePerc = 10;
    uint256 public dappDivsPerc = 0;
    address public dappAddress;


    uint256 public nextTicketPrice = 5*10**18;
    uint256 public nextPickerReward = 10*10**18;
    uint256 public nextminTickets = 50;
    uint256 public nextRafflePerc = 10;
    uint256 public nextDevFeePerc = 10;
    uint256 public nextdappDivsPerc = 0;
    address public nextdappAddress;

    uint256 public random_seed = 0;
    bool    public raffle_closed = false;

    event Ticket(uint256 raffle, address indexed addr, uint256 amount);
    event Winner(uint256 raffle, address indexed addr, uint256 amount, uint256 win_ticket);
    event RaffleClosed(uint256 raffle, uint256 block_number);
    event TicketPriceChanged(uint256 previousticketprice, uint256 newticketprice);
    event PickerRewardChanged(uint256 previouspickerReward, uint256 newpickerreward);
    event minTicketsChanged(uint256 previousminTickets,uint256 newmintickets);
    event RafflePercChanged(uint256 previousRafflePerc, uint256 newRafflePerc);
    event DevFeePercChanged(uint256 previousDevFeePerc, uint256 newDevFeePerc);
    event dappDivsPercChanged(uint256 previousdappDivs,uint256 newdappDivs);
    event dappAddressChanged(address previousdappAddress, address newdappAddress);


    function TicketsOfAddress(address addr) public view returns (uint256 total_tickets) {
        uint256 _tt=0;
        for(uint256 i = 0; i<TicketBook[RaffleNo].length; i++){
            if (TicketBook[RaffleNo][i].owner == addr)
                _tt=_tt.add(TicketBook[RaffleNo][i].size);
        }
        return _tt;
    }

    function Stats() public view returns (uint256 raffle_number, uint48 total_tickets, uint256 balance, uint256 next_raffle, uint256 ticket_price, bool must_pick_winner, uint256 picker_reward, uint256 min_tickets,uint256 next_ticket_price,uint256 next_picker_reward,uint256 next_min_tickets, bool is_raffle_closed,uint256 raffle_perc,uint256 dapp_divs_perf ){
        bool mustPickWinner;
        uint48 TotalTickets= _find_curr_position();
        if (now>NextRaffle && TotalTickets>minTickets)
            mustPickWinner = true;
        else
            mustPickWinner = false;
        return (RaffleNo, TotalTickets, shuf.balanceOf(address(this)), NextRaffle, TicketPrice, mustPickWinner, PickerReward, minTickets, nextTicketPrice, nextPickerReward, nextminTickets, raffle_closed,RafflePerc,dappDivsPerc );
    }
    
    function BuyTicket(uint48 tickets) external returns(bool success){
        require(msg.sender == tx.origin, "Only hoomans");
        require(tickets > 0);
        uint256 bill = uint256(tickets).mul(TicketPrice);
        require(shuf.allowance(msg.sender, address(this))>=bill, "Contract not approved");
        require(shuf.balanceOf(msg.sender)>=bill, "Not enough SHUF balance.");
        uint48 TotalTickets = _find_curr_position();
        if (now>NextRaffle){
            //requires to pick a winner or extends duration if not enough participants
            require(TotalTickets<=minTickets,"A winner has to be picked first");
            NextRaffle = NextRaffle.add((((now.sub(NextRaffle)).div(20 minutes)).add(1)).mul(20 minutes));
        }
        
        require(shuf.transferFrom(msg.sender, address(this), bill));
        pushTickets(tickets, TotalTickets);
        return true;
    }
    
    
    // function BuyTicketEth(uint48 tickets) external payable returns(bool success){
    //     require(msg.sender == tx.origin, "Only hoomans");
    //     require(tickets>0);
    //     uint256 bill = uint256(tickets).mul(TicketPrice).mul(100).div(98);
    //     uint256 ethBill = UniShuf.getEthToTokenOutputPrice(bill);
    //     require(msg.value>=ethBill, "Not enough eth.");
    //     uint48 TotalTickets = _find_curr_position();
    //     if (now>NextRaffle){
    //         //requires to pick a winner or extends duration if not enough participants
    //         require(TotalTickets<=minTickets,"A winner has to be picked first");
    //         NextRaffle = NextRaffle.add((((now.sub(NextRaffle)).div(20 minutes)).add(1)).mul(20 minutes));
    //     }
    //     require(UniShuf.ethToTokenTransferOutput.value(ethBill)(bill, now, address(this))==ethBill);
    //     if (msg.value>ethBill){
    //         msg.sender.transfer(msg.value-ethBill);
    //     }
    //     pushTickets(tickets, TotalTickets);
    //     return true;
    // }
    
    // function BuyTicketUniswap(uint48 tickets, address tokenAddress, uint256 maxtokens) external returns(bool success){
    //     require(msg.sender == tx.origin, "Only hoomans");
    //     require(tickets>0);
    //     ERC20Token token = ERC20Token(tokenAddress);
    //     address tokenExchange = UniFactory.getExchange(tokenAddress);
    //     require(tokenAddress != ZERO_ADDRESS, "Token not found");
    //     UniswapExchangeInterface UniToken = UniswapExchangeInterface(tokenExchange);
    //     uint256 bill = uint256(tickets).mul(TicketPrice).mul(100).div(98);

    //     uint256 ethBill = UniShuf.getEthToTokenOutputPrice(bill);
    //     uint256 tokenBill = UniToken.getTokenToEthOutputPrice(ethBill);
    //     require(tokenBill<=maxtokens);
    //     require(token.allowance(msg.sender,address(this))>=tokenBill, "Contract not approved");
    //     uint48 TotalTickets = _find_curr_position();
    //     if (now>NextRaffle){
    //         //requires to pick a winner or extends duration if not enough participants
    //         require(TotalTickets<=minTickets,"A winner has to be picked first");
    //         NextRaffle = NextRaffle.add((((now.sub(NextRaffle)).div(20 minutes)).add(1)).mul(20 minutes));
    //     }
    //     uint256 contract_shuf_balance = shuf.balanceOf(address(this));
    //     require(token.transferFrom(msg.sender, address(this), tokenBill));
    //     if (token.allowance(address(this), tokenExchange) < tokenBill) {
	// 		token.approve(tokenExchange, uint256(-1));
	// 	}
    //     require(UniToken.tokenToTokenTransferOutput(bill, tokenBill, ethBill, now, address(this), shufAddress) == tokenBill);
    //     require(shuf.balanceOf(address(this))>=contract_shuf_balance.add(bill.sub(divRound(bill,100).mul(2))));
    //     pushTickets(tickets, TotalTickets);
    //     return true;
    // }
    
    function pushTickets(uint48 tickets,uint48 TotalTickets) internal returns(bool success){
        Order memory t;
        t.size=tickets;
        t.owner=msg.sender;
        t.position=TotalTickets+tickets;
        require(t.position>=TotalTickets);
        TicketBook[RaffleNo].push(t);
        emit Ticket(RaffleNo, msg.sender, tickets);
        return true;
    }
   
    function pickWinner() external returns(bool success) {
        uint256 gaslimit = gasleft();
        require(msg.sender == tx.origin, "Only hoomans");
        require(now>NextRaffle, "It's not time to pick a winner yet");
        uint256 Totaltickets =_find_curr_position();
        require(Totaltickets>minTickets,  "Not enough tickets to pick a winner");
        
        //Close the Raffle
        if (raffle_closed == false){
            raffle_closed = true;
            random_seed = block.number;
            emit RaffleClosed(RaffleNo, random_seed);
            shuf.transfer(msg.sender, PickerReward);
            // gastoken.freeUpTo((gaslimit - gasleft() + 14154) / 41130);
            return true;
        }
        
        require(random_seed<block.number);
        uint256 winningticket = _random(Totaltickets);
        address winner = _find_winner(winningticket);
        
        //reset Raffle
        RaffleNo=RaffleNo.add(1);
        NextRaffle = NextRaffle.add((((now.sub(NextRaffle)).div(20 minutes)).add(1)).mul(20 minutes));
        raffle_closed = false;
        
        //reward caller
        shuf.transfer(msg.sender, PickerReward);

        //calculate reward
        uint256 reward = shuf.balanceOf(address(this));

        //send dapp divs
        if(dappDivsPerc>0){
            uint256 divs = reward.mul(dappDivsPerc).div(100);
            shuf.transfer(dappAddress, divs);
            reward = reward.sub(divs);
        }

        //dev fee
        uint256 devFee = reward.mul(devFeePerc).div(100);
        shuf.transfer(devAddress, devFee);

        //reward winner
        reward = reward.sub(reward.mul(RafflePerc).div(100)).sub(devFee);
        shuf.transfer(winner,reward);
        emit Winner(RaffleNo, winner, reward, winningticket);

        
        //check for changes
        if(nextTicketPrice!=TicketPrice){
            uint256 oldticketPrice=TicketPrice;
            TicketPrice = nextTicketPrice;
            emit TicketPriceChanged(oldticketPrice, TicketPrice);
        }
        if(nextPickerReward!=PickerReward){
            uint256 oldpickerReward=PickerReward;
            PickerReward = nextPickerReward;
            emit PickerRewardChanged(oldpickerReward, PickerReward);
        }
        if(nextminTickets!=minTickets){
            uint256 oldminTickets=minTickets;
            minTickets = nextminTickets;
            emit minTicketsChanged(oldminTickets, minTickets);
        }
        if(nextRafflePerc!=RafflePerc){
            uint256 oldRafflePerc = RafflePerc;
            RafflePerc = nextRafflePerc;
            emit RafflePercChanged(oldRafflePerc, RafflePerc);
        }
        if(nextDevFeePerc!=devFeePerc){
            uint256 oldDevFeePerc = devFeePerc;
            devFeePerc = nextDevFeePerc;
            emit DevFeePercChanged(oldDevFeePerc, devFeePerc);
        }
        if(nextdappDivsPerc!=dappDivsPerc){
            uint256 olddappDivsPerc = dappDivsPerc;
            dappDivsPerc = nextdappDivsPerc;
            emit dappDivsPercChanged(olddappDivsPerc, dappDivsPerc);
        }
         if(dappAddress!=dappAddress){
            address olddappAddress = dappAddress;
            dappAddress = nextdappAddress;
            emit dappAddressChanged(olddappAddress, dappAddress);
        }
        // gastoken.freeUpTo((gaslimit - gasleft() + 14154) / 41130);
        return true;
    }
    
    function _find_curr_position() internal view returns(uint48 curr_position){
        uint256 TotalOrders = TicketBook[RaffleNo].length;
        uint48 Totaltickets=(TotalOrders>0)?TicketBook[RaffleNo][TotalOrders.sub(1)].position:0;
        return Totaltickets;
    }
    
     function _find_winner(uint256 winning_ticket)  internal view returns(address winner){
    //search for the winner using binary search
        uint256 L=0;
        uint256 R=TicketBook[RaffleNo].length.sub(1);
        uint256 raffleno=RaffleNo;
        
        while(L <= R){
            uint256 m = (L.add(R)).div(2);
            Order memory Am = TicketBook[raffleno][m];
            if(Am.position<winning_ticket)
                L=m.add(1);
            else if(Am.position-Am.size>=winning_ticket)
                R=m.sub(1);
            else
                return Am.owner;
        }
        return address(this);
    }
    
    function setTicketPrice(uint256 newticketprice) external onlyOwner {
        nextTicketPrice= newticketprice;
    }
    
    function setPickerReward(uint256 newpickerreward) external onlyOwner {
        nextPickerReward = newpickerreward;
    }
    
    function setminTickets(uint256 newmintickets) external onlyOwner {
        nextminTickets = newmintickets;
    }

    function setRafflePerc(uint256 newRafflePerc) external onlyOwner {
        nextRafflePerc= newRafflePerc;
    }

    function setDevFeePerc(uint256 newDevFeePerc) external onlyOwner {
        nextDevFeePerc = newDevFeePerc;
    }

    function setdappDivsPerc(uint256 newdappDivsPerc) external onlyOwner {
        nextdappDivsPerc= newdappDivsPerc;
    }

    function setdappAddress(address newdappAddress) external onlyOwner {
        nextdappAddress= newdappAddress;
    }
  
    function _random(uint256 Totaltickets) internal view returns (uint256) {
        return uint256(uint256(keccak256(abi.encodePacked(blockhash(random_seed), RaffleNo)))%Totaltickets).add(1);
    }

    function divRound(uint256 x, uint256 y) internal pure returns (uint256) {
        require(y != 0, "Div by zero");
        uint256 r = x / y;
        if (x % y != 0) {
            r = r + 1;
        }
        return r;
    }    
}

library SafeMath {

    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }
    
     function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

     function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        uint256 c = a / b;
 
        return c;
    }
}

// interface UniswapExchangeInterface {
//     function getEthToTokenOutputPrice(uint256 tokens_bought) external view returns (uint256 eth_sold);
//     function getTokenToEthOutputPrice(uint256 eth_bought) external view returns (uint256 tokens_sold);
//     function ethToTokenTransferOutput(uint256 tokens_bought, uint256 deadline, address recipient) external payable returns (uint256  eth_sold);
//     function tokenToTokenTransferOutput(uint256 tokens_bought, uint256 max_tokens_sold, uint256 max_eth_sold, uint256 deadline,
//     address recipient, address token_addr) external returns (uint256  tokens_sold);
// }

// contract UniswapFactoryInterface {
//     function getExchange(address token) external view returns (address exchange);
// }

// interface Gastoken {
//     function freeUpTo(uint256 value) external returns (uint256 freed);
// }

Settings
{
  "remappings": [],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "evmVersion": "istanbul",
  "libraries": {},
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"previousDevFeePerc","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newDevFeePerc","type":"uint256"}],"name":"DevFeePercChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"previouspickerReward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newpickerreward","type":"uint256"}],"name":"PickerRewardChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"raffle","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"block_number","type":"uint256"}],"name":"RaffleClosed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"previousRafflePerc","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newRafflePerc","type":"uint256"}],"name":"RafflePercChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"raffle","type":"uint256"},{"indexed":true,"internalType":"address","name":"addr","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Ticket","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"previousticketprice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newticketprice","type":"uint256"}],"name":"TicketPriceChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"raffle","type":"uint256"},{"indexed":true,"internalType":"address","name":"addr","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"win_ticket","type":"uint256"}],"name":"Winner","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousdappAddress","type":"address"},{"indexed":false,"internalType":"address","name":"newdappAddress","type":"address"}],"name":"dappAddressChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"previousdappDivs","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newdappDivs","type":"uint256"}],"name":"dappDivsPercChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"previousminTickets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newmintickets","type":"uint256"}],"name":"minTicketsChanged","type":"event"},{"constant":false,"inputs":[{"internalType":"uint48","name":"tickets","type":"uint48"}],"name":"BuyTicket","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"NextRaffle","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"PickerReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"RaffleNo","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"RafflePerc","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"Stats","outputs":[{"internalType":"uint256","name":"raffle_number","type":"uint256"},{"internalType":"uint48","name":"total_tickets","type":"uint48"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"next_raffle","type":"uint256"},{"internalType":"uint256","name":"ticket_price","type":"uint256"},{"internalType":"bool","name":"must_pick_winner","type":"bool"},{"internalType":"uint256","name":"picker_reward","type":"uint256"},{"internalType":"uint256","name":"min_tickets","type":"uint256"},{"internalType":"uint256","name":"next_ticket_price","type":"uint256"},{"internalType":"uint256","name":"next_picker_reward","type":"uint256"},{"internalType":"uint256","name":"next_min_tickets","type":"uint256"},{"internalType":"bool","name":"is_raffle_closed","type":"bool"},{"internalType":"uint256","name":"raffle_perc","type":"uint256"},{"internalType":"uint256","name":"dapp_divs_perf","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"TicketPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"TicketsOfAddress","outputs":[{"internalType":"uint256","name":"total_tickets","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"dappAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"dappDivsPerc","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"devAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"devFeePerc","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"minTickets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"nextDevFeePerc","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"nextPickerReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"nextRafflePerc","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"nextTicketPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"nextdappAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"nextdappDivsPerc","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"nextminTickets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"pickWinner","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"raffle_closed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"random_seed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"newDevFeePerc","type":"uint256"}],"name":"setDevFeePerc","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"newpickerreward","type":"uint256"}],"name":"setPickerReward","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"newRafflePerc","type":"uint256"}],"name":"setRafflePerc","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"newticketprice","type":"uint256"}],"name":"setTicketPrice","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"newdappAddress","type":"address"}],"name":"setdappAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"newdappDivsPerc","type":"uint256"}],"name":"setdappDivsPerc","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"newmintickets","type":"uint256"}],"name":"setminTickets","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"shuf","outputs":[{"internalType":"contract ERC20Token","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"shufAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]

60806040526001600255635e8a290b600355674563918244f400006004819055678ac7230489e80000600581905560326006819055600a6007819055600881905560006009819055600b94909455600c92909255600d55600e819055600f55601081905560128190556013805460ff1916905580546001600160a01b03191633179055611a7f806100916000396000f3fe608060405234801561001057600080fd5b50600436106102065760003560e01c8063a08265251161011a578063c7a34f9e116100ad578063eb5370d01161007c578063eb5370d014610422578063eff5291914610485578063f2fde38b1461048d578063f46be5ee146104b3578063f53b0937146104bb57610206565b8063c7a34f9e1461042a578063c984aaaf14610432578063d578bd641461043a578063e0710ef51461046057610206565b8063b30ee42a116100e9578063b30ee42a146103f5578063b42d907d146103fd578063c111c55914610405578063c4ea66dc1461042257610206565b8063a08265251461038d578063a5a2dade146103b3578063b0ba5dcf146103bb578063b1873d74146103d857610206565b806353a488661161019d5780636ea0338b1161016c5780636ea0338b146102ee5780636f36ef34146102f65780638da5cb5b146102fe57806393998821146103065780639e229c361461030e57610206565b806353a48866146102a5578063542c4f14146102ad5780635d495aea146102b5578063677ef855146102d157610206565b80631835b89d116101d95780631835b89d146102545780631a721b7b146102715780633ad10ef61461029557806353321c881461029d57610206565b806302b955cc1461020b57806305053eef14610225578063159816501461022d5780631828b2541461024c575b600080fd5b6102136104c3565b60408051918252519081900360200190f35b6102136104c9565b61024a6004803603602081101561024357600080fd5b50356104cf565b005b6102136104eb565b61024a6004803603602081101561026a57600080fd5b50356104f1565b61027961050d565b604080516001600160a01b039092168252519081900360200190f35b61027961051c565b610213610534565b61021361053a565b610213610540565b6102bd610546565b604080519115158252519081900360200190f35b61024a600480360360208110156102e757600080fd5b5035610d87565b610213610da3565b610213610da9565b610279610daf565b610213610dbe565b610316610dc4565b604080519e8f5265ffffffffffff909d1660208f01528d8d019b909b5260608d019990995260808c019790975294151560a08b015260c08a019390935260e089019190915261010088015261012087015261014086015215156101608501526101808401526101a083015251908190036101c00190f35b610213600480360360208110156103a357600080fd5b50356001600160a01b0316610eff565b610213610fc2565b61024a600480360360208110156103d157600080fd5b5035610fc8565b61024a600480360360208110156103ee57600080fd5b5035610fe4565b610213611000565b610279611006565b61024a6004803603602081101561041b57600080fd5b5035611015565b610279611031565b6102bd611049565b610213611052565b61024a6004803603602081101561045057600080fd5b50356001600160a01b0316611058565b6102bd6004803603602081101561047657600080fd5b503565ffffffffffff16611091565b6102136113fc565b61024a600480360360208110156104a357600080fd5b50356001600160a01b0316611402565b610213611487565b61021361148d565b60085481565b600d5481565b6000546001600160a01b031633146104e657600080fd5b600b55565b600b5481565b6000546001600160a01b0316331461050857600080fd5b600d55565b600a546001600160a01b031681565b73c666a2d73dd26ef496e75fd9cfc41ed02d7c212781565b60045481565b600e5481565b60025481565b6000805a905033321461058f576040805162461bcd60e51b815260206004820152600c60248201526b4f6e6c7920686f6f6d616e7360a01b604482015290519081900360640190fd5b60035442116105cf5760405162461bcd60e51b81526004018080602001828103825260228152602001806119e56022913960400191505060405180910390fd5b60006105d9611493565b65ffffffffffff16905060065481116106235760405162461bcd60e51b8152600401808060200182810382526023815260200180611a286023913960400191505060405180910390fd5b60135460ff16610714576013805460ff1916600117905543601281905560025460408051918252602082019290925281517f2bd3d30947506c7122360988393aeb63a8d6ced5195942b7a1bf2966ee3b6eba929181900390910190a16005546040805163a9059cbb60e01b8152336004820152602481019290925251733ca8e2aa9cd5b4680a213b341d525a37abab7a249163a9059cbb9160448083019260209291908290030181600087803b1580156106dc57600080fd5b505af11580156106f0573d6000803e3d6000fd5b505050506040513d602081101561070657600080fd5b5060019350610d8492505050565b436012541061072257600080fd5b600061072d826114fe565b9050600061073a82611557565b60025490915061075190600163ffffffff61168616565b6002819055506107b36107a46104b0610798600161078c6104b0610780600354426116e790919063ffffffff16565b9063ffffffff61172916565b9063ffffffff61168616565b9063ffffffff61176b16565b6003549063ffffffff61168616565b6003556013805460ff191690556005546040805163a9059cbb60e01b8152336004820152602481019290925251733ca8e2aa9cd5b4680a213b341d525a37abab7a249163a9059cbb9160448083019260209291908290030181600087803b15801561081d57600080fd5b505af1158015610831573d6000803e3d6000fd5b505050506040513d602081101561084757600080fd5b5050604080516370a0823160e01b81523060048201529051600091733ca8e2aa9cd5b4680a213b341d525a37abab7a24916370a0823191602480820192602092909190829003018186803b15801561089e57600080fd5b505afa1580156108b2573d6000803e3d6000fd5b505050506040513d60208110156108c857600080fd5b50516009549091501561099c5760006108f160646107806009548561176b90919063ffffffff16565b600a546040805163a9059cbb60e01b81526001600160a01b0390921660048301526024820183905251919250733ca8e2aa9cd5b4680a213b341d525a37abab7a249163a9059cbb916044808201926020929091908290030181600087803b15801561095b57600080fd5b505af115801561096f573d6000803e3d6000fd5b505050506040513d602081101561098557600080fd5b506109989050828263ffffffff6116e716565b9150505b60006109b860646107806008548561176b90919063ffffffff16565b6040805163a9059cbb60e01b815273c666a2d73dd26ef496e75fd9cfc41ed02d7c21276004820152602481018390529051919250733ca8e2aa9cd5b4680a213b341d525a37abab7a249163a9059cbb916044808201926020929091908290030181600087803b158015610a2a57600080fd5b505af1158015610a3e573d6000803e3d6000fd5b505050506040513d6020811015610a5457600080fd5b5050600754610a94908290610a8890610a7b9060649061078090889063ffffffff61176b16565b859063ffffffff6116e716565b9063ffffffff6116e716565b6040805163a9059cbb60e01b81526001600160a01b0386166004820152602481018390529051919350733ca8e2aa9cd5b4680a213b341d525a37abab7a249163a9059cbb916044808201926020929091908290030181600087803b158015610afb57600080fd5b505af1158015610b0f573d6000803e3d6000fd5b505050506040513d6020811015610b2557600080fd5b50506002546040805191825260208201849052818101869052516001600160a01b038516917f0747ab2ac74ec95954e98cea8fc4b09755205627c287492552ef5428beec693d919081900360600190a2600454600b5414610bcb5760048054600b5491829055604080518281526020810193909352805191927f82a40b2eb2e166a9a513e909894042d026f115051ab5c019f766ba8b33c28f3f929081900390910190a1505b600554600c5414610c215760058054600c5491829055604080518281526020810193909352805191927f793c7219ae11369ceb39199cf669c15d12058223d622012355d47a3d26353b77929081900390910190a1505b600654600d5414610c775760068054600d5491829055604080518281526020810193909352805191927fb83db2e6264b85136f332460836b9bdef5190cab2a03fc1f4dc6c903147f04ac929081900390910190a1505b600754600e5414610ccd5760078054600e5491829055604080518281526020810193909352805191927fc6f0373cc9402cd5507abe1de931b763d2a824f20b6e2400fdfe00999ab95793929081900390910190a1505b600854600f5414610d235760088054600f5491829055604080518281526020810193909352805191927f19c370f91de3c81236193908bc20cce07be4438ce661d290977ad139cb9b4a57929081900390910190a1505b60095460105414610d79576009805460105491829055604080518281526020810193909352805191927f3e49545fa8aa7960b6cea2ce8d8ef800020af973b7856192edbf3cfc1ae2e153929081900390910190a1505b600196505050505050505b90565b6000546001600160a01b03163314610d9e57600080fd5b600f55565b60035481565b600c5481565b6000546001600160a01b031681565b60125481565b600080600080600080600080600080600080600080600080610de4611493565b905060035442118015610e0057506006548165ffffffffffff16115b15610e0e5760019150610e13565b600091505b600254604080516370a0823160e01b815230600482015290518391733ca8e2aa9cd5b4680a213b341d525a37abab7a24916370a0823191602480820192602092909190829003018186803b158015610e6a57600080fd5b505afa158015610e7e573d6000803e3d6000fd5b505050506040513d6020811015610e9457600080fd5b810190808051906020019092919050505060035460045486600554600654600b54600c54600d54601360009054906101000a900460ff166007546009549f509f509f509f509f509f509f509f509f509f509f509f509f509f505050909192939495969798999a9b9c9d565b600080805b600254600090815260016020526040902054811015610fb957836001600160a01b03166001600060025481526020019081526020016000208281548110610f4757fe5b600091825260209091200154600160601b90046001600160a01b03161415610fb157610fae6001600060025481526020019081526020016000208281548110610f8c57fe5b6000918252602090912001548390600160301b900465ffffffffffff16611686565b91505b600101610f04565b5090505b919050565b60055481565b6000546001600160a01b03163314610fdf57600080fd5b601055565b6000546001600160a01b03163314610ffb57600080fd5b600e55565b60095481565b6011546001600160a01b031681565b6000546001600160a01b0316331461102c57600080fd5b600c55565b733ca8e2aa9cd5b4680a213b341d525a37abab7a2481565b60135460ff1681565b60065481565b6000546001600160a01b0316331461106f57600080fd5b601180546001600160a01b0319166001600160a01b0392909216919091179055565b60003332146110d6576040805162461bcd60e51b815260206004820152600c60248201526b4f6e6c7920686f6f6d616e7360a01b604482015290519081900360640190fd5b60008265ffffffffffff16116110eb57600080fd5b600061110a6004548465ffffffffffff1661176b90919063ffffffff16565b60408051636eb1769f60e11b815233600482015230602482015290519192508291733ca8e2aa9cd5b4680a213b341d525a37abab7a249163dd62ed3e916044808301926020929190829003018186803b15801561116657600080fd5b505afa15801561117a573d6000803e3d6000fd5b505050506040513d602081101561119057600080fd5b505110156111dd576040805162461bcd60e51b815260206004820152601560248201527410dbdb9d1c9858dd081b9bdd08185c1c1c9bdd9959605a1b604482015290519081900360640190fd5b604080516370a0823160e01b815233600482015290518291733ca8e2aa9cd5b4680a213b341d525a37abab7a24916370a0823191602480820192602092909190829003018186803b15801561123157600080fd5b505afa158015611245573d6000803e3d6000fd5b505050506040513d602081101561125b57600080fd5b505110156112b0576040805162461bcd60e51b815260206004820152601860248201527f4e6f7420656e6f75676820534855462062616c616e63652e0000000000000000604482015290519081900360640190fd5b60006112ba611493565b9050600354421115611352576006548165ffffffffffff161115611325576040805162461bcd60e51b815260206004820152601f60248201527f412077696e6e65722068617320746f206265207069636b656420666972737400604482015290519081900360640190fd5b61134e6107a46104b0610798600161078c6104b0610780600354426116e790919063ffffffff16565b6003555b604080516323b872dd60e01b8152336004820152306024820152604481018490529051733ca8e2aa9cd5b4680a213b341d525a37abab7a24916323b872dd9160648083019260209291908290030181600087803b1580156113b257600080fd5b505af11580156113c6573d6000803e3d6000fd5b505050506040513d60208110156113dc57600080fd5b50516113e757600080fd5b6113f184826117c4565b506001949350505050565b60075481565b6000546001600160a01b0316331461141957600080fd5b6001600160a01b03811661142c57600080fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60105481565b600f5481565b60025460009081526001602052604081205481816114b25760006114f7565b6002546000908152600160208190526040909120906114d890849063ffffffff6116e716565b815481106114e257fe5b60009182526020909120015465ffffffffffff165b9250505090565b60006115516001836012544060025460405160200180838152602001828152602001925050506040516020818303038152906040528051906020012060001c8161154457fe5b069063ffffffff61168616565b92915050565b60025460009081526001602081905260408220548291829161157e9163ffffffff6116e716565b6002549091505b81831161167c5760006115a36002610780868663ffffffff61168616565b90506115ad6119c4565b60008381526001602052604090208054839081106115c757fe5b600091825260209182902060408051606081018252929091015465ffffffffffff808216808552600160301b830490911694840194909452600160601b90046001600160a01b03169082015291508711156116345761162d82600163ffffffff61168616565b9450611675565b86816020015182600001510365ffffffffffff16106116655761165e82600163ffffffff6116e716565b9350611675565b604001519450610fbd9350505050565b5050611585565b5030949350505050565b6000828201838110156116e0576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b60006116e083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506118c8565b60006116e083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061195f565b60008261177a57506000611551565b8282028284828161178757fe5b04146116e05760405162461bcd60e51b8152600401808060200182810382526021815260200180611a076021913960400191505060405180910390fd5b60006117ce6119c4565b65ffffffffffff8085166020830152336040830152838501811680835290841611156117f957600080fd5b60028054600090815260016020818152604080842080549384018155845292819020855192018054868301518786015165ffffffffffff1990921665ffffffffffff958616176bffffffffffff0000000000001916600160301b91861691909102176bffffffffffffffffffffffff16600160601b6001600160a01b03909216919091021790559254825190815290871692810192909252805133927f3c36e67c3f579fe7620e59ddf49621fe45c2a2388c9dcb1a3a97219d76fddceb92908290030190a25060019392505050565b600081848411156119575760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561191c578181015183820152602001611904565b50505050905090810190601f1680156119495780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836119ae5760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561191c578181015183820152602001611904565b5060008385816119ba57fe5b0495945050505050565b60408051606081018252600080825260208201819052918101919091529056fe49742773206e6f742074696d6520746f207069636b20612077696e6e657220796574536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774e6f7420656e6f756768207469636b65747320746f207069636b20612077696e6e6572a265627a7a723158200e9426b58c3dd118c19caf8bd199cd7d806d0a3a1f384bbb1bc15168004e6f1464736f6c63430005110032

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading