ERC-20
Overview
Max Total Supply
97,501,517.8363 BC
Holders
2,306
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 8 Decimals)
Balance
188 BCValue
$0.00Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
TokenERC20
Compiler Version
v0.4.11+commit.68ef5810
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2018-03-16 */ /* Butler coin */ pragma solidity ^0.4.11; contract owned { address public owner; function owned() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner public { owner = newOwner; } } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; } contract TokenERC20 { // Public variables of the token string public name = 'Butler Coin'; string public symbol = 'BC'; uint8 public decimals = 8; // 8 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply = 200000000; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); /** * Constrctor function * * Initializes contract with initial supply tokens to the creator of the contract */ function TokenERC20( uint256 initialSupply, string tokenName, string tokenSymbol ) public { totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens name = tokenName; // Set the name for display purposes symbol = tokenSymbol; // Set the symbol for display purposes } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; Transfer(_from, _to, _value); // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances); } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public { _transfer(msg.sender, _to, _value); } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } /** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */ function burn(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] -= _value; // Subtract from the sender totalSupply -= _value; // Updates totalSupply Burn(msg.sender, _value); return true; } /** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] -= _value; // Subtract from the targeted balance allowance[_from][msg.sender] -= _value; // Subtract from the sender's allowance totalSupply -= _value; // Update totalSupply Burn(_from, _value); return true; } } /******************************************/ /* ADVANCED TOKEN STARTS HERE */ /******************************************/ contract MyAdvancedToken is owned, TokenERC20 { uint256 public sellPrice; uint256 public buyPrice; mapping (address => bool) public frozenAccount; /* This generates a public event on the blockchain that will notify clients */ event FrozenFunds(address target, bool frozen); /* Initializes contract with initial supply tokens to the creator of the contract */ function MyAdvancedToken( uint256 initialSupply, string tokenName, string tokenSymbol ) TokenERC20(initialSupply, tokenName, tokenSymbol) public {} /* Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead require (balanceOf[_from] >= _value); // Check if the sender has enough require (balanceOf[_to] + _value > balanceOf[_to]); // Check for overflows require(!frozenAccount[_from]); // Check if sender is frozen require(!frozenAccount[_to]); // Check if recipient is frozen balanceOf[_from] -= _value; // Subtract from the sender balanceOf[_to] += _value; // Add the same to the recipient Transfer(_from, _to, _value); } /** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */ function burnThis(uint256 _value) internal returns (bool success) { require(balanceOf[this] >= _value); // Check if the sender has enough balanceOf[this] -= _value; // Subtract from the sender totalSupply -= _value; // Updates totalSupply Burn(this, _value); return true; } /// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens /// @param target Address to be frozen /// @param freeze either to freeze it or not function freezeAccount(address target, bool freeze) onlyOwner public { frozenAccount[target] = freeze; FrozenFunds(target, freeze); } /// @notice Allow users to buy tokens for `newBuyPrice` eth and sell tokens for `newSellPrice` eth /// @param newSellPrice Price the users can sell to the contract /// @param newBuyPrice Price users can buy from the contract function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public { sellPrice = newSellPrice; buyPrice = newBuyPrice; } /// @notice Buy tokens from contract by sending ether function buy() payable public { uint amount = msg.value * (10 ** uint256(decimals)) / buyPrice; // calculates the amount require(balanceOf[this] >= amount); // checks if the contract has enough token to sell _transfer(this, msg.sender, amount); // makes the transfers } /// @notice Sell `amount` tokens to contract /// @param amount amount of tokens to be sold function sell(uint256 amount) public { require(this.balance >= amount * sellPrice/( 10 ** uint256(decimals))); // checks if the contract has enough ether to buy _transfer(msg.sender, this, amount); // makes the transfers msg.sender.transfer(amount * sellPrice/( 10 ** uint256(decimals))); // sends ether to the seller. It's important to do this last to avoid recursion attacks } /// @notice withdrawal `amount` eth from contract /// @param amount amount of eth to be withdrawal function withdrawalEth(uint256 amount) onlyOwner public { require(this.balance >= amount); // checks if the contract has enough ether to withdrawal msg.sender.transfer(amount); // sends ether for withdrawal. } /// @notice withdrawal `amount` tokens from contract /// @param amount amount of tokens to be withdrawal function withdrawalToken(uint256 amount) onlyOwner public { require(balanceOf[this] >= amount); _transfer(this, msg.sender, amount); // makes the transfers } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_value","type":"uint256"}],"name":"burn","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_value","type":"uint256"}],"name":"burnFrom","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"},{"name":"_extraData","type":"bytes"}],"name":"approveAndCall","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"inputs":[{"name":"initialSupply","type":"uint256"},{"name":"tokenName","type":"string"},{"name":"tokenSymbol","type":"string"}],"payable":false,"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Burn","type":"event"}]
Contract Creation Code
60a0604052600b60608190527f4275746c657220436f696e000000000000000000000000000000000000000000608090815261003e9160009190610123565b506040805180820190915260028082527f4243000000000000000000000000000000000000000000000000000000000000602090920191825261008391600191610123565b506002805460ff19166008179055630bebc20060035534156100a157fe5b604051610ba5380380610ba58339810160409081528151602083015191830151909291820191015b60025460ff16600a0a83026003819055600160a060020a0333166000908152600460209081526040822092909255835161010592850190610123565b508051610119906001906020840190610123565b505b5050506101c3565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061016457805160ff1916838001178555610191565b82800160010185558215610191579182015b82811115610191578251825591602001919060010190610176565b5b5061019e9291506101a2565b5090565b6101c091905b8082111561019e57600081556001016101a8565b5090565b90565b6109d3806101d26000396000f300606060405236156100b75763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100b9578063095ea7b31461014957806318160ddd1461017c57806323b872dd1461019e578063313ce567146101d757806342966c68146101fd57806370a082311461022457806379cc67901461025257806395d89b4114610285578063a9059cbb14610315578063cae9ca5114610336578063dd62ed3e146103ad575bfe5b34156100c157fe5b6100c96103e1565b60408051602080825283518183015283519192839290830191850190808383821561010f575b80518252602083111561010f57601f1990920191602091820191016100ef565b505050905090810190601f16801561013b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561015157fe5b610168600160a060020a036004351660243561046f565b604080519115158252519081900360200190f35b341561018457fe5b61018c6104a0565b60408051918252519081900360200190f35b34156101a657fe5b610168600160a060020a03600435811690602435166044356104a6565b604080519115158252519081900360200190f35b34156101df57fe5b6101e761051f565b6040805160ff9092168252519081900360200190f35b341561020557fe5b610168600435610528565b604080519115158252519081900360200190f35b341561022c57fe5b61018c600160a060020a03600435166105b5565b60408051918252519081900360200190f35b341561025a57fe5b610168600160a060020a03600435166024356105c7565b604080519115158252519081900360200190f35b341561028d57fe5b6100c96106a7565b60408051602080825283518183015283519192839290830191850190808383821561010f575b80518252602083111561010f57601f1990920191602091820191016100ef565b505050905090810190601f16801561013b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561031d57fe5b610334600160a060020a0360043516602435610734565b005b341561033e57fe5b604080516020600460443581810135601f8101849004840285018401909552848452610168948235600160a060020a031694602480359560649492939190920191819084018382808284375094965061074495505050505050565b604080519115158252519081900360200190f35b34156103b557fe5b61018c600160a060020a036004358116906024351661087e565b60408051918252519081900360200190f35b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104675780601f1061043c57610100808354040283529160200191610467565b820191906000526020600020905b81548152906001019060200180831161044a57829003601f168201915b505050505081565b600160a060020a03338116600090815260056020908152604080832093861683529290522081905560015b92915050565b60035481565b600160a060020a038084166000908152600560209081526040808320339094168352929052908120548211156104dc5760006000fd5b600160a060020a038085166000908152600560209081526040808320339094168352929052208054839003905561051484848461089b565b5060015b9392505050565b60025460ff1681565b600160a060020a0333166000908152600460205260408120548290101561054f5760006000fd5b600160a060020a03331660008181526004602090815260409182902080548690039055600380548690039055815185815291517fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59281900390910190a25060015b919050565b60046020526000908152604090205481565b600160a060020a038216600090815260046020526040812054829010156105ee5760006000fd5b600160a060020a03808416600090815260056020908152604080832033909416835292905220548211156106225760006000fd5b600160a060020a038084166000818152600460209081526040808320805488900390556005825280832033909516835293815290839020805486900390556003805486900390558251858152925191927fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5929081900390910190a25060015b92915050565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104675780601f1061043c57610100808354040283529160200191610467565b820191906000526020600020905b81548152906001019060200180831161044a57829003601f168201915b505050505081565b61073f33838361089b565b5b5050565b600083610751818561046f565b156108755780600160a060020a0316638f4ffcb1338630876040518563ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360008314610815575b80518252602083111561081557601f1990920191602091820191016107f5565b505050905090810190601f1680156108415780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b151561085f57fe5b6102c65a03f1151561086d57fe5b505050600191505b5b509392505050565b600560209081526000928352604080842090915290825290205481565b6000600160a060020a03831615156108b35760006000fd5b600160a060020a038416600090815260046020526040902054829010156108da5760006000fd5b600160a060020a038316600090815260046020526040902054828101116109015760006000fd5b50600160a060020a038083166000818152600460209081526040808320805495891680855282852080548981039091559486905281548801909155815187815291519390950194927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a3600160a060020a038084166000908152600460205260408082205492871682529020540181146109a057fe5b5b505050505600a165627a7a7230582030c2d49ae7f6cc65894853b69f12cef8b354b158263eee7a5f55d0055b2762bd0029000000000000000000000000000000000000000000000000000000000bebc200000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000b4275746c657220436f696e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024243000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x606060405236156100b75763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100b9578063095ea7b31461014957806318160ddd1461017c57806323b872dd1461019e578063313ce567146101d757806342966c68146101fd57806370a082311461022457806379cc67901461025257806395d89b4114610285578063a9059cbb14610315578063cae9ca5114610336578063dd62ed3e146103ad575bfe5b34156100c157fe5b6100c96103e1565b60408051602080825283518183015283519192839290830191850190808383821561010f575b80518252602083111561010f57601f1990920191602091820191016100ef565b505050905090810190601f16801561013b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561015157fe5b610168600160a060020a036004351660243561046f565b604080519115158252519081900360200190f35b341561018457fe5b61018c6104a0565b60408051918252519081900360200190f35b34156101a657fe5b610168600160a060020a03600435811690602435166044356104a6565b604080519115158252519081900360200190f35b34156101df57fe5b6101e761051f565b6040805160ff9092168252519081900360200190f35b341561020557fe5b610168600435610528565b604080519115158252519081900360200190f35b341561022c57fe5b61018c600160a060020a03600435166105b5565b60408051918252519081900360200190f35b341561025a57fe5b610168600160a060020a03600435166024356105c7565b604080519115158252519081900360200190f35b341561028d57fe5b6100c96106a7565b60408051602080825283518183015283519192839290830191850190808383821561010f575b80518252602083111561010f57601f1990920191602091820191016100ef565b505050905090810190601f16801561013b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561031d57fe5b610334600160a060020a0360043516602435610734565b005b341561033e57fe5b604080516020600460443581810135601f8101849004840285018401909552848452610168948235600160a060020a031694602480359560649492939190920191819084018382808284375094965061074495505050505050565b604080519115158252519081900360200190f35b34156103b557fe5b61018c600160a060020a036004358116906024351661087e565b60408051918252519081900360200190f35b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104675780601f1061043c57610100808354040283529160200191610467565b820191906000526020600020905b81548152906001019060200180831161044a57829003601f168201915b505050505081565b600160a060020a03338116600090815260056020908152604080832093861683529290522081905560015b92915050565b60035481565b600160a060020a038084166000908152600560209081526040808320339094168352929052908120548211156104dc5760006000fd5b600160a060020a038085166000908152600560209081526040808320339094168352929052208054839003905561051484848461089b565b5060015b9392505050565b60025460ff1681565b600160a060020a0333166000908152600460205260408120548290101561054f5760006000fd5b600160a060020a03331660008181526004602090815260409182902080548690039055600380548690039055815185815291517fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59281900390910190a25060015b919050565b60046020526000908152604090205481565b600160a060020a038216600090815260046020526040812054829010156105ee5760006000fd5b600160a060020a03808416600090815260056020908152604080832033909416835292905220548211156106225760006000fd5b600160a060020a038084166000818152600460209081526040808320805488900390556005825280832033909516835293815290839020805486900390556003805486900390558251858152925191927fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5929081900390910190a25060015b92915050565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104675780601f1061043c57610100808354040283529160200191610467565b820191906000526020600020905b81548152906001019060200180831161044a57829003601f168201915b505050505081565b61073f33838361089b565b5b5050565b600083610751818561046f565b156108755780600160a060020a0316638f4ffcb1338630876040518563ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360008314610815575b80518252602083111561081557601f1990920191602091820191016107f5565b505050905090810190601f1680156108415780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b151561085f57fe5b6102c65a03f1151561086d57fe5b505050600191505b5b509392505050565b600560209081526000928352604080842090915290825290205481565b6000600160a060020a03831615156108b35760006000fd5b600160a060020a038416600090815260046020526040902054829010156108da5760006000fd5b600160a060020a038316600090815260046020526040902054828101116109015760006000fd5b50600160a060020a038083166000818152600460209081526040808320805495891680855282852080548981039091559486905281548801909155815187815291519390950194927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a3600160a060020a038084166000908152600460205260408082205492871682529020540181146109a057fe5b5b505050505600a165627a7a7230582030c2d49ae7f6cc65894853b69f12cef8b354b158263eee7a5f55d0055b2762bd0029
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000bebc200000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000b4275746c657220436f696e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024243000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : initialSupply (uint256): 200000000
Arg [1] : tokenName (string): Butler Coin
Arg [2] : tokenSymbol (string): BC
-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 000000000000000000000000000000000000000000000000000000000bebc200
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [2] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [3] : 000000000000000000000000000000000000000000000000000000000000000b
Arg [4] : 4275746c657220436f696e000000000000000000000000000000000000000000
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [6] : 4243000000000000000000000000000000000000000000000000000000000000
Swarm Source
bzzr://30c2d49ae7f6cc65894853b69f12cef8b354b158263eee7a5f55d0055b2762bd
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.