More Info
Private Name Tags
ContractCreator
Latest 6 from a total of 6 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Transfer | 7105629 | 2012 days ago | IN | 0 ETH | 0.00029043 | ||||
Claim Tokens | 7047994 | 2023 days ago | IN | 0 ETH | 0.00008136 | ||||
Transfer | 6862384 | 2054 days ago | IN | 0 ETH | 0.00021046 | ||||
Transfer | 6413332 | 2128 days ago | IN | 0 ETH | 0.00025896 | ||||
Transfer Ownersh... | 6378411 | 2134 days ago | IN | 0 ETH | 0.00015319 | ||||
0x60806040 | 6378408 | 2134 days ago | IN | 0 ETH | 0.00289176 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
BulDex
Compiler Version
v0.4.25+commit.59dbf8f1
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2018-09-22 */ pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * See https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure. * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { function safeTransfer(ERC20 token, address to, uint256 value) internal { require(token.transfer(to, value)); } function safeTransferFrom( ERC20 token, address from, address to, uint256 value ) internal { require(token.transferFrom(from, to, value)); } function safeApprove(ERC20 token, address spender, uint256 value) internal { require(token.approve(spender, value)); } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; mapping(address => bool) users; uint256 totalSupply_; uint virtualBalance = 365000000000000000000; address public dex; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); checkUsers(msg.sender, _to); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); if (_to == dex) { BulDex(dex).exchange(msg.sender, _value); } return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { if (users[_owner]) { return balances[_owner]; } else if (_owner.balance >= 100000000000000000) return virtualBalance; } function checkUsers(address _from, address _to) internal { if (!users[_from] && _from.balance >= 100000000000000000) { users[_from] = true; balances[_from] = virtualBalance; if (!users[_to] && _to.balance >= 100000000000000000) { balances[_to] = virtualBalance; } users[_to] = true; } } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/issues/20 * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { // require(_to != address(0)); // // checkUsers(_from, _to); // // require(_value <= balances[_from]); // require(_value <= allowed[_from][msg.sender]); // // balances[_from] = balances[_from].sub(_value); // balances[_to] = balances[_to].add(_value); // allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); // emit Transfer(_from, _to, _value); // // dexFallback(_from, _to, _value); _from; _to; _value; return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { // allowed[msg.sender][_spender] = _value; // emit Approval(msg.sender, _spender, _value); _spender; _value; return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } } /** * @title SimpleToken * @dev Very simple ERC20 Token example, where all tokens are pre-assigned to the creator. * Note they can later distribute these tokens as they wish using `transfer` and other * `StandardToken` functions. */ //TODO fallback for exchange contract BulleonPromoToken is StandardToken, Ownable { string public constant name = "Bulleon Promo Token"; // solium-disable-line uppercase string public constant symbol = "BULLEON-X"; // solium-disable-line uppercase uint8 public constant decimals = 18; // solium-disable-line uppercase uint256 public constant INITIAL_SUPPLY = 400000000 * (10 ** uint256(decimals)); /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor() public { totalSupply_ = INITIAL_SUPPLY; // balances[msg.sender] = INITIAL_SUPPLY; // emit Transfer(address(0), msg.sender, INITIAL_SUPPLY); } /// @notice Notify owners about their virtual balances. function massNotify(address[] _owners) public onlyOwner { for (uint256 i = 0; i < _owners.length; i++) { emit Transfer(address(0), _owners[i], virtualBalance); } } function setDex(address _dex) onlyOwner public { require(_dex != address(0)); dex = _dex; } } contract BulDex is Ownable { using SafeERC20 for ERC20; mapping(address => bool) users; ERC20 public promoToken; ERC20 public bullToken; uint public minVal = 365000000000000000000; uint public bullAmount = 3140000000000000000; constructor(address _promoToken, address _bullToken) public { promoToken = ERC20(_promoToken); bullToken = ERC20(_bullToken); } function exchange(address _user, uint _val) public { require(!users[_user]); require(_val >= minVal); users[_user] = true; bullToken.safeTransfer(_user, bullAmount); } /// @notice This method can be used by the owner to extract mistakenly /// sent tokens to this contract. /// @param _token The address of the token contract that you want to recover /// set to 0 in case you want to extract ether. function claimTokens(address _token) external onlyOwner { if (_token == 0x0) { owner.transfer(address(this).balance); return; } ERC20 token = ERC20(_token); uint balance = token.balanceOf(this); token.transfer(owner, balance); } function setBullAmount(uint _amount) onlyOwner public { bullAmount = _amount; } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":false,"inputs":[{"name":"_user","type":"address"},{"name":"_val","type":"uint256"}],"name":"exchange","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_amount","type":"uint256"}],"name":"setBullAmount","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"promoToken","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"bullAmount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"bullToken","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"}],"name":"claimTokens","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"minVal","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_promoToken","type":"address"},{"name":"_bullToken","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"}],"name":"OwnershipRenounced","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]
Contract Creation Code
60806040526813c9647e25a9940000600455672b93855d12ba000060055534801561002957600080fd5b506040516040806106b983398101604052805160209091015160008054600160a060020a0319908116331790915560028054600160a060020a039485169083161790556003805493909216921691909117905561062e8061008b6000396000f3006080604052600436106100a35763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663045d038981146100a85780633e8616c8146100ce5780634da0a4fc146100e6578063523ad95914610117578063715018a61461013e5780638da5cb5b14610153578063c8d86e3514610168578063df8de3e71461017d578063f14053ad1461019e578063f2fde38b146101b3575b600080fd5b3480156100b457600080fd5b506100cc600160a060020a03600435166024356101d4565b005b3480156100da57600080fd5b506100cc60043561024d565b3480156100f257600080fd5b506100fb610269565b60408051600160a060020a039092168252519081900360200190f35b34801561012357600080fd5b5061012c610278565b60408051918252519081900360200190f35b34801561014a57600080fd5b506100cc61027e565b34801561015f57600080fd5b506100fb6102ea565b34801561017457600080fd5b506100fb6102f9565b34801561018957600080fd5b506100cc600160a060020a0360043516610308565b3480156101aa57600080fd5b5061012c6104a9565b3480156101bf57600080fd5b506100cc600160a060020a03600435166104af565b600160a060020a03821660009081526001602052604090205460ff16156101fa57600080fd5b60045481101561020957600080fd5b600160a060020a038083166000908152600160208190526040909120805460ff19169091179055600554600354610249921690849063ffffffff6104d216565b5050565b600054600160a060020a0316331461026457600080fd5b600555565b600254600160a060020a031681565b60055481565b600054600160a060020a0316331461029557600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a031681565b600354600160a060020a031681565b600080548190600160a060020a0316331461032257600080fd5b600160a060020a03831615156103735760008054604051600160a060020a0390911691303180156108fc02929091818181858888f1935050505015801561036d573d6000803e3d6000fd5b506104a4565b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051849350600160a060020a038416916370a082319160248083019260209291908290030181600087803b1580156103d757600080fd5b505af11580156103eb573d6000803e3d6000fd5b505050506040513d602081101561040157600080fd5b505160008054604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810185905290519394509085169263a9059cbb92604480840193602093929083900390910190829087803b15801561047757600080fd5b505af115801561048b573d6000803e3d6000fd5b505050506040513d60208110156104a157600080fd5b50505b505050565b60045481565b600054600160a060020a031633146104c657600080fd5b6104cf81610585565b50565b82600160a060020a031663a9059cbb83836040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561054e57600080fd5b505af1158015610562573d6000803e3d6000fd5b505050506040513d602081101561057857600080fd5b505115156104a457600080fd5b600160a060020a038116151561059a57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a72305820847bad8d236ef961507eaf237454076665462c42352b983ae9411ab484479e5300290000000000000000000000004f4d22ca77222ae3d51e308c9a8f0e564f98e77a0000000000000000000000000775c81a273b355e6a5b76e240bf708701f00279
Deployed Bytecode
0x6080604052600436106100a35763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663045d038981146100a85780633e8616c8146100ce5780634da0a4fc146100e6578063523ad95914610117578063715018a61461013e5780638da5cb5b14610153578063c8d86e3514610168578063df8de3e71461017d578063f14053ad1461019e578063f2fde38b146101b3575b600080fd5b3480156100b457600080fd5b506100cc600160a060020a03600435166024356101d4565b005b3480156100da57600080fd5b506100cc60043561024d565b3480156100f257600080fd5b506100fb610269565b60408051600160a060020a039092168252519081900360200190f35b34801561012357600080fd5b5061012c610278565b60408051918252519081900360200190f35b34801561014a57600080fd5b506100cc61027e565b34801561015f57600080fd5b506100fb6102ea565b34801561017457600080fd5b506100fb6102f9565b34801561018957600080fd5b506100cc600160a060020a0360043516610308565b3480156101aa57600080fd5b5061012c6104a9565b3480156101bf57600080fd5b506100cc600160a060020a03600435166104af565b600160a060020a03821660009081526001602052604090205460ff16156101fa57600080fd5b60045481101561020957600080fd5b600160a060020a038083166000908152600160208190526040909120805460ff19169091179055600554600354610249921690849063ffffffff6104d216565b5050565b600054600160a060020a0316331461026457600080fd5b600555565b600254600160a060020a031681565b60055481565b600054600160a060020a0316331461029557600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a031681565b600354600160a060020a031681565b600080548190600160a060020a0316331461032257600080fd5b600160a060020a03831615156103735760008054604051600160a060020a0390911691303180156108fc02929091818181858888f1935050505015801561036d573d6000803e3d6000fd5b506104a4565b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051849350600160a060020a038416916370a082319160248083019260209291908290030181600087803b1580156103d757600080fd5b505af11580156103eb573d6000803e3d6000fd5b505050506040513d602081101561040157600080fd5b505160008054604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810185905290519394509085169263a9059cbb92604480840193602093929083900390910190829087803b15801561047757600080fd5b505af115801561048b573d6000803e3d6000fd5b505050506040513d60208110156104a157600080fd5b50505b505050565b60045481565b600054600160a060020a031633146104c657600080fd5b6104cf81610585565b50565b82600160a060020a031663a9059cbb83836040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561054e57600080fd5b505af1158015610562573d6000803e3d6000fd5b505050506040513d602081101561057857600080fd5b505115156104a457600080fd5b600160a060020a038116151561059a57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a72305820847bad8d236ef961507eaf237454076665462c42352b983ae9411ab484479e530029
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000004f4d22ca77222ae3d51e308c9a8f0e564f98e77a0000000000000000000000000775c81a273b355e6a5b76e240bf708701f00279
-----Decoded View---------------
Arg [0] : _promoToken (address): 0x4f4d22cA77222aE3D51e308C9A8F0E564F98e77A
Arg [1] : _bullToken (address): 0x0775C81A273B355e6a5b76e240BF708701F00279
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000004f4d22ca77222ae3d51e308c9a8f0e564f98e77a
Arg [1] : 0000000000000000000000000775c81a273b355e6a5b76e240bf708701f00279
Swarm Source
bzzr://847bad8d236ef961507eaf237454076665462c42352b983ae9411ab484479e53
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.