Contract Overview
Balance: 0 Ether
Ether Value: $0
Transactions: 4 txns
Misc:
Address Watch: Add To Watch List
Contract Creator: 0x85af40781a0ed2bd0a50861a28fb36619938a4c8at txn 0x0384b537f0897ff6586421ea9f8993cdcdf4b568500da944c273990d46db8459
 Latest 4 txns

TxHash Age From To Value [TxFee]
0x9f08855ce043e2230ac20437f28f03a54a9ec573ff033356f977e9aaac8725f0181 days 3 hrs ago0xb04b473418b6f09e5a1f809ae2d01f14211e03ff  IN   0xdf70ed874e30bfb85602d02d75d74660118142460 Ether0.000047058
0x0075e0472b1d614a940195ca67e84e2c0592857afb457fef7886e0efda5dfdfb181 days 3 hrs ago0x85af40781a0ed2bd0a50861a28fb36619938a4c8  IN   0xdf70ed874e30bfb85602d02d75d74660118142460 Ether0.00043597
0x8ba8e02b3fee3ba0a192c2b4abd284a252a4b925f3ee457a8e0337b6435cb338181 days 3 hrs ago0x85af40781a0ed2bd0a50861a28fb36619938a4c8  IN   0xdf70ed874e30bfb85602d02d75d74660118142460 Ether0.00043902
0x0384b537f0897ff6586421ea9f8993cdcdf4b568500da944c273990d46db8459181 days 3 hrs ago0x85af40781a0ed2bd0a50861a28fb36619938a4c8  IN    Contract Creation0 Ether0.0096387
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
View All
ParentTxHash Block Age From To Value
Warning: The Compiled Contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity) SolidityCompiler Bugs.

Contract Source Code Verified (Exact Match)
Contract Name: BF
Compiler Text: v0.4.23+commit.124ca40d
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity ^0.4.23;

library SafeMath {

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

    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a / b;
        return c;
    }

    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        assert(b <= a);
        return a - b;
    }

    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        assert(c >= a);
        return c;
    }
}

contract Ownable {
    address public owner;
    address public manager;
    address public behalfer;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
    event SetManager(address indexed _manager);

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

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

    modifier onlyManager() {
        require(msg.sender == manager);
        _;
    }

    modifier onlyBehalfer() {
        require(msg.sender == behalfer);
        _;
    }

    function setManager(address _manager) public onlyOwner returns (bool) {
        manager = _manager;
        return true;
    }

    function setBehalfer(address _behalfer) public onlyOwner returns (bool) {
        behalfer = _behalfer;
        return true;
    }

    function transferOwnership(address newOwner) public onlyOwner {
        require(newOwner != address(0));
        emit OwnershipTransferred(owner, newOwner);
        owner = newOwner;
    }
}

contract Pausable is Ownable {
    event Pause();
    event Unpause();

    bool public paused = false;

    modifier whenNotPaused() {
        require(!paused);
        _;
    }

    modifier whenPaused() {
        require(paused);
        _;
    }

    function pause() onlyOwner whenNotPaused public {
        paused = true;
        emit Pause();
    }

    function unpause() onlyOwner whenPaused public {
        paused = false;
        emit Unpause();
    }
}

contract BasicBF is Pausable {
    using SafeMath for uint256;

    mapping(address => uint256) public balances;
    // match -> team -> amount
    mapping(uint256 => mapping(uint256 => uint256)) public betMatchBalances;
    // match -> team -> user -> amount
    mapping(uint256 => mapping(uint256 => mapping(address => uint256))) public betMatchRecords;

    event Withdraw(address indexed user, uint256 indexed amount);
    event WithdrawOwner(address indexed user, uint256 indexed amount);
    event Issue(uint256 indexed matchNo, uint256 indexed teamNo, address indexed user, uint256 amount);
    event BetMatch(address indexed user, uint256 indexed matchNo, uint256 indexed teamNo, uint256 amount);
    event BehalfBet(address indexed user, uint256 indexed matchNo, uint256 indexed teamNo, uint256 amount);
}

contract BF is BasicBF {
    constructor () public {}

    function betMatch(uint256 _matchNo, uint256 _teamNo) public whenNotPaused payable returns (bool) {
        uint256 amount = msg.value;
        betMatchRecords[_matchNo][_teamNo][msg.sender] = betMatchRecords[_matchNo][_teamNo][msg.sender].add(amount);
        betMatchBalances[_matchNo][_teamNo] = betMatchBalances[_matchNo][_teamNo].add(amount);
        balances[this] = balances[this].add(amount);
        emit BetMatch(msg.sender, _matchNo, _teamNo, amount);
        return true;
    }

    function behalfBet(address _user, uint256 _matchNo, uint256 _teamNo) public whenNotPaused onlyBehalfer payable returns (bool) {
        uint256 amount = msg.value;
        betMatchRecords[_matchNo][_teamNo][_user] = betMatchRecords[_matchNo][_teamNo][_user].add(amount);
        betMatchBalances[_matchNo][_teamNo] = betMatchBalances[_matchNo][_teamNo].add(amount);
        balances[this] = balances[this].add(amount);
        emit BehalfBet(_user, _matchNo, _teamNo, amount);
        return true;
    }

    function issue(uint256 _matchNo, uint256 _teamNo, address[] _addrLst, uint256[] _amtLst) public whenNotPaused onlyManager returns (bool) {
        require(_addrLst.length == _amtLst.length);
        for (uint i = 0; i < _addrLst.length; i++) {
            balances[_addrLst[i]] = balances[_addrLst[i]].add(_amtLst[i]);
            balances[this] = balances[this].sub(_amtLst[i]);
            emit Issue(_matchNo, _teamNo, _addrLst[i], _amtLst[i]);
        }
        return true;
    }

    function withdraw(uint256 _value) public whenNotPaused returns (bool) {
        require(_value <= balances[msg.sender]);
        balances[msg.sender] = balances[msg.sender].sub(_value);
        msg.sender.transfer(_value);
        emit Withdraw(msg.sender, _value);
        return true;
    }

    function withdrawOwner(uint256 _value) public onlyManager returns (bool) {
        require(_value <= balances[this]);
        balances[this] = balances[this].sub(_value);
        msg.sender.transfer(_value);
        emit WithdrawOwner(msg.sender, _value);
        return true;
    }

    function() public payable {}
}

    Contract ABI  
[{"constant":true,"inputs":[{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"","type":"address"}],"name":"betMatchRecords","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_behalfer","type":"address"}],"name":"setBehalfer","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balances","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_matchNo","type":"uint256"},{"name":"_teamNo","type":"uint256"}],"name":"betMatch","outputs":[{"name":"","type":"bool"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_value","type":"uint256"}],"name":"withdraw","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_user","type":"address"},{"name":"_matchNo","type":"uint256"},{"name":"_teamNo","type":"uint256"}],"name":"behalfBet","outputs":[{"name":"","type":"bool"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[],"name":"unpause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"manager","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"behalfer","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_value","type":"uint256"}],"name":"withdrawOwner","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"pause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_matchNo","type":"uint256"},{"name":"_teamNo","type":"uint256"},{"name":"_addrLst","type":"address[]"},{"name":"_amtLst","type":"uint256[]"}],"name":"issue","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"},{"name":"","type":"uint256"}],"name":"betMatchBalances","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_manager","type":"address"}],"name":"setManager","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"user","type":"address"},{"indexed":true,"name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"user","type":"address"},{"indexed":true,"name":"amount","type":"uint256"}],"name":"WithdrawOwner","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"matchNo","type":"uint256"},{"indexed":true,"name":"teamNo","type":"uint256"},{"indexed":true,"name":"user","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"Issue","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"user","type":"address"},{"indexed":true,"name":"matchNo","type":"uint256"},{"indexed":true,"name":"teamNo","type":"uint256"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"BetMatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"user","type":"address"},{"indexed":true,"name":"matchNo","type":"uint256"},{"indexed":true,"name":"teamNo","type":"uint256"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"BehalfBet","type":"event"},{"anonymous":false,"inputs":[],"name":"Pause","type":"event"},{"anonymous":false,"inputs":[],"name":"Unpause","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_manager","type":"address"}],"name":"SetManager","type":"event"}]

  Contract Creation Code Switch To Opcodes View
60806040526002805460a060020a60ff021916905534801561002057600080fd5b5060008054600160a060020a033316600160a060020a0319909116179055610cf98061004d6000396000f3006080604052600436106100f05763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305da2e2981146100f25780630894bdf21461012b57806327e235e3146101605780632a9fabd2146101815780632e1a7d4d1461018f57806332af5858146101a75780633f4ba83a146101c1578063481c6a75146101d65780634ac9f0d7146102075780635c975abb1461021c5780636ef98b21146102315780638456cb591461024957806386e4993c1461025e5780638da5cb5b146102f5578063b83bcb251461030a578063d0ebdbe714610325578063f2fde38b14610346575b005b3480156100fe57600080fd5b50610119600435602435600160a060020a0360443516610367565b60408051918252519081900360200190f35b34801561013757600080fd5b5061014c600160a060020a036004351661038a565b604080519115158252519081900360200190f35b34801561016c57600080fd5b50610119600160a060020a03600435166103d8565b61014c6004356024356103ea565b34801561019b57600080fd5b5061014c600435610548565b61014c600160a060020a0360043516602435604435610636565b3480156101cd57600080fd5b506100f06107b0565b3480156101e257600080fd5b506101eb61082c565b60408051600160a060020a039092168252519081900360200190f35b34801561021357600080fd5b506101eb61083b565b34801561022857600080fd5b5061014c61084a565b34801561023d57600080fd5b5061014c60043561085a565b34801561025557600080fd5b506100f0610950565b34801561026a57600080fd5b50604080516020600460443581810135838102808601850190965280855261014c958335956024803596369695606495939492019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a9989019892975090820195509350839250850190849080828437509497506109d19650505050505050565b34801561030157600080fd5b506101eb610b95565b34801561031657600080fd5b50610119600435602435610ba4565b34801561033157600080fd5b5061014c600160a060020a0360043516610bc1565b34801561035257600080fd5b506100f0600160a060020a0360043516610c0d565b600560209081526000938452604080852082529284528284209052825290205481565b6000805433600160a060020a039081169116146103a657600080fd5b5060028054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff199091161790556001919050565b60036020526000908152604090205481565b600254600090819060a060020a900460ff161561040657600080fd5b5060008381526005602090815260408083208584528252808320600160a060020a03331684529091529020543490610444908263ffffffff610ca516565b60008581526005602090815260408083208784528252808320600160a060020a03331684528252808320939093558682526004815282822086835290522054610493908263ffffffff610ca516565b6000858152600460209081526040808320878452825280832093909355600160a060020a03301682526003905220546104d2908263ffffffff610ca516565b6003600030600160a060020a0316600160a060020a0316815260200190815260200160002081905550828433600160a060020a03167f6af9d726d7bfbb4b58ac2aed9d7662192a025d21200c888d76829f81710fcaa7846040518082815260200191505060405180910390a45060019392505050565b60025460009060a060020a900460ff161561056257600080fd5b600160a060020a03331660009081526003602052604090205482111561058757600080fd5b600160a060020a0333166000908152600360205260409020546105b0908363ffffffff610cbb16565b600160a060020a033316600081815260036020526040808220939093559151909184156108fc02918591818181858888f193505050501580156105f7573d6000803e3d6000fd5b506040518290600160a060020a033316907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a942436490600090a3506001919050565b600254600090819060a060020a900460ff161561065257600080fd5b60025433600160a060020a0390811691161461066d57600080fd5b5060008381526005602090815260408083208584528252808320600160a060020a038816845290915290205434906106ab908263ffffffff610ca516565b60008581526005602090815260408083208784528252808320600160a060020a038a16845282528083209390935586825260048152828220868352905220546106fa908263ffffffff610ca516565b6000858152600460209081526040808320878452825280832093909355600160a060020a0330168252600390522054610739908263ffffffff610ca516565b6003600030600160a060020a0316600160a060020a0316815260200190815260200160002081905550828486600160a060020a03167f17d368964333245b2ec20db5703f0a26c6509ec257e2ff1d78c70081f739420b846040518082815260200191505060405180910390a4506001949350505050565b60005433600160a060020a039081169116146107cb57600080fd5b60025460a060020a900460ff1615156107e357600080fd5b6002805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b600154600160a060020a031681565b600254600160a060020a031681565b60025460a060020a900460ff1681565b60015460009033600160a060020a0390811691161461087857600080fd5b600160a060020a03301660009081526003602052604090205482111561089d57600080fd5b600160a060020a0330166000908152600360205260409020546108c6908363ffffffff610cbb16565b600160a060020a03308116600090815260036020526040808220939093559151339091169184156108fc02918591818181858888f19350505050158015610911573d6000803e3d6000fd5b506040518290600160a060020a033316907ff3cbf530df3c2f520d13109c1f04fac3bb55c63f85b155c9b656f933635b720190600090a3506001919050565b60005433600160a060020a0390811691161461096b57600080fd5b60025460a060020a900460ff161561098257600080fd5b6002805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600254600090819060a060020a900460ff16156109ed57600080fd5b60015433600160a060020a03908116911614610a0857600080fd5b8251845114610a1657600080fd5b5060005b8351811015610b8957610a7f8382815181101515610a3457fe5b90602001906020020151600360008785815181101515610a5057fe5b6020908102909101810151600160a060020a03168252810191909152604001600020549063ffffffff610ca516565b600360008684815181101515610a9157fe5b6020908102909101810151600160a060020a03168252810191909152604001600020558251610af790849083908110610ac657fe5b6020908102909101810151600160a060020a033016600090815260039092526040909120549063ffffffff610cbb16565b600160a060020a0330166000908152600360205260409020558351849082908110610b1e57fe5b90602001906020020151600160a060020a031685877fd31bf93619c765c0e3a81874d765d6b875be84e80732a723e96f716648b6d4258685815181101515610b6257fe5b906020019060200201516040518082815260200191505060405180910390a4600101610a1a565b50600195945050505050565b600054600160a060020a031681565b600460209081526000928352604080842090915290825290205481565b6000805433600160a060020a03908116911614610bdd57600080fd5b5060018054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff19909116178155919050565b60005433600160a060020a03908116911614610c2857600080fd5b600160a060020a0381161515610c3d57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082820183811015610cb457fe5b9392505050565b600082821115610cc757fe5b509003905600a165627a7a7230582089f970ea69f5f6b9d64914e2bbaeb9161d03e51da3374a89862b1af52e95ef210029

   Swarm Source:
bzzr://89f970ea69f5f6b9d64914e2bbaeb9161d03e51da3374a89862b1af52e95ef21

 

View All
Block Age transaction Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.