Address Contract Partially Verified
Address
0x20910e5b5f087f6439DFcB0ddA4e27d1014Ac2b8
Balance
0 ETH
Nonce
1
Code Size
4762 bytes
Creator
0x1FcD5492...1De8 at tx 0x70116bf2...ae0f05
Last Active
Indexed Transactions
135 (10,656,497 → 10,695,526)
Gas Used (indexed)
456,188
Contract Bytecode
4762 bytes
0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c806379cc679011610104578063a9059cbb116100a2578063dd62ed3e11610071578063dd62ed3e146106e1578063e816d97f1461070f578063f26c159f14610735578063f2fde38b1461075b576101cf565b8063a9059cbb146105a8578063b414d4b6146105d4578063bf620a45146105fa578063cae9ca5114610626576101cf565b80638f32d59b116100de5780638f32d59b146104cc578063905295e3146104d457806395d89b41146104fa578063a3895fff14610502576101cf565b806379cc6790146104745780638456cb59146104a05780638da5cb5b146104a8576101cf565b80635353a2d81161017157806370a082311161014b57806370a08231146103fa578063715018a614610420578063718ccce91461042857806374eb9b681461044e576101cf565b80635353a2d81461032657806353cc2fae146103cc5780635c975abb146103f2576101cf565b806323b872dd116101ad57806323b872dd146102ab578063313ce567146102e15780633f4ba83a146102ff57806342966c6814610309576101cf565b806306fdde03146101d4578063095ea7b31461025157806318160ddd14610291575b600080fd5b6101dc610781565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102165781810151838201526020016101fe565b50505050905090810190601f1680156102435780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61027d6004803603604081101561026757600080fd5b506001600160a01b03813516906020013561080f565b604080519115158252519081900360200190f35b610299610875565b60408051918252519081900360200190f35b61027d600480360360608110156102c157600080fd5b506001600160a01b0381358116916020810135909116906040013561087b565b6102e96108e9565b6040805160ff9092168252519081900360200190f35b6103076108f2565b005b61027d6004803603602081101561031f57600080fd5b503561095e565b6103076004803603602081101561033c57600080fd5b81019060208101813564010000000081111561035757600080fd5b82018360208201111561036957600080fd5b8035906020019184600183028401116401000000008311171561038b57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506109e2945050505050565b610307600480360360208110156103e257600080fd5b50356001600160a01b0316610a0a565b61027d610a79565b6102996004803603602081101561041057600080fd5b50356001600160a01b0316610a8a565b610307610a9c565b6102996004803603602081101561043e57600080fd5b50356001600160a01b0316610af7565b61027d6004803603602081101561046457600080fd5b50356001600160a01b0316610b09565b61027d6004803603604081101561048a57600080fd5b506001600160a01b038135169060200135610b26565b610307610c0e565b6104b0610c81565b604080516001600160a01b039092168252519081900360200190f35b61027d610c90565b610307600480360360208110156104ea57600080fd5b50356001600160a01b0316610ca1565b6101dc610d0b565b6103076004803603602081101561051857600080fd5b81019060208101813564010000000081111561053357600080fd5b82018360208201111561054557600080fd5b8035906020019184600183028401116401000000008311171561056757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610d65945050505050565b61027d600480360360408110156105be57600080fd5b506001600160a01b038135169060200135610d89565b61027d600480360360208110156105ea57600080fd5b50356001600160a01b0316610d9f565b6103076004803603604081101561061057600080fd5b506001600160a01b038135169060200135610db4565b61027d6004803603606081101561063c57600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561066c57600080fd5b82018360208201111561067e57600080fd5b803590602001918460018302840111640100000000831117156106a057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610e2a945050505050565b610299600480360360408110156106f757600080fd5b506001600160a01b0381358116916020013516610f32565b61027d6004803603602081101561072557600080fd5b50356001600160a01b0316610f4f565b6103076004803603602081101561074b57600080fd5b50356001600160a01b0316610f6d565b6103076004803603602081101561077157600080fd5b50356001600160a01b0316610fe0565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108075780601f106107dc57610100808354040283529160200191610807565b820191906000526020600020905b8154815290600101906020018083116107ea57829003601f168201915b505050505081565b3360008181526005602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60035481565b6001600160a01b03831660009081526005602090815260408083203384529091528120546108af908363ffffffff610ffd16565b6001600160a01b03851660009081526005602090815260408083203384529091529020556108de848484611012565b5060015b9392505050565b60025460ff1681565b6108fa610c90565b61090357600080fd5b600654600160a01b900460ff1661091957600080fd5b60068054600160a01b60ff02191690556040805133815290517f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa9181900360200190a1565b3360009081526004602052604081205461097e908363ffffffff610ffd16565b336000908152600460205260409020556003546109a1908363ffffffff610ffd16565b60035560408051838152905133917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2506001919050565b6109ea610c90565b6109f357600080fd5b8051610a069060009060208401906111d6565b5050565b610a12610c90565b610a1b57600080fd5b6001600160a01b0381166000818152600760209081526040808320805460ff1916905580519384529083019190915280517fd16a7a4ba83c78a07676c543502e8155f633ecd3c35abb1da51bcbf129758b0f9281900390910190a150565b600654600160a01b900460ff165b90565b60046020526000908152604090205481565b610aa4610c90565b610aad57600080fd5b6006546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600680546001600160a01b0319169055565b60086020526000908152604090205481565b6001600160a01b0316600090815260086020526040902054421090565b6001600160a01b038216600090815260046020526040812054610b4f908363ffffffff610ffd16565b6001600160a01b0384166000908152600460209081526040808320939093556005815282822033835290522054610b8c908363ffffffff610ffd16565b6001600160a01b0384166000908152600560209081526040808320338452909152902055600354610bc3908363ffffffff610ffd16565b6003556040805183815290516001600160a01b038516917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a250600192915050565b610c16610c90565b610c1f57600080fd5b600654600160a01b900460ff1615610c3657600080fd5b60068054600160a01b60ff021916600160a01b1790556040805133815290517f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2589181900360200190a1565b6006546001600160a01b031690565b6006546001600160a01b0316331490565b610ca9610c90565b610cb257600080fd5b6001600160a01b038116600081815260086020908152604080832083905580519384529083019190915280517fd54d19172fb86c7b0ec92bd53717c37c4e77dd87775bae11a52816120905a2fa9281900390910190a150565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108075780601f106107dc57610100808354040283529160200191610807565b610d6d610c90565b610d7657600080fd5b8051610a069060019060208401906111d6565b6000610d96338484611012565b50600192915050565b60076020526000908152604090205460ff1681565b610dbc610c90565b610dc557600080fd5b428111610dd157600080fd5b6001600160a01b0382166000818152600860209081526040918290208490558151928352820183905280517fd54d19172fb86c7b0ec92bd53717c37c4e77dd87775bae11a52816120905a2fa9281900390910190a15050565b600083610e37818561080f565b15610f2a57604051600160e01b638f4ffcb102815233600482018181526024830187905230604484018190526080606485019081528751608486015287516001600160a01b03871695638f4ffcb195948b94938b939192909160a490910190602085019080838360005b83811015610eb9578181015183820152602001610ea1565b50505050905090810190601f168015610ee65780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610f0857600080fd5b505af1158015610f1c573d6000803e3d6000fd5b5050505060019150506108e2565b509392505050565b600560209081526000928352604080842090915290825290205481565b6001600160a01b031660009081526007602052604090205460ff1690565b610f75610c90565b610f7e57600080fd5b6001600160a01b038116600081815260076020908152604091829020805460ff1916600190811790915582519384529083015280517fd16a7a4ba83c78a07676c543502e8155f633ecd3c35abb1da51bcbf129758b0f9281900390910190a150565b610fe8610c90565b610ff157600080fd5b610ffa81611155565b50565b60008282111561100c57600080fd5b50900390565b600654600160a01b900460ff161561102957600080fd5b6001600160a01b03821661103c57600080fd5b6001600160a01b03831660009081526007602052604090205460ff161561106257600080fd5b6001600160a01b03821660009081526007602052604090205460ff161561108857600080fd5b61109183610b09565b1561109b57600080fd5b6001600160a01b0383166000908152600460205260409020546110c4908263ffffffff610ffd16565b6001600160a01b0380851660009081526004602052604080822093909355908416815220546110f9908263ffffffff6111c416565b6001600160a01b0380841660008181526004602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6001600160a01b03811661116857600080fd5b6006546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600680546001600160a01b0319166001600160a01b0392909216919091179055565b6000828201838110156108e257600080fd5b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061121757805160ff1916838001178555611244565b82800160010185558215611244579182015b82811115611244578251825591602001919060010190611229565b50611250929150611254565b5090565b610a8791905b80821115611250576000815560010161125a56fea165627a7a723058205330cf6e0c426c4680fe4f6e2fe61dd69861c0a78b6a7e3e049f724912f9cc7e0029
Verified Source Code Partial Match
Compiler: v0.5.6+commit.b259423e
EVM: petersburg
Optimization: Yes (200 runs)
BananaToken.sol 426 lines
pragma solidity >=0.4.22 <0.6.0;
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring '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;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes calldata _extraData) external; }
/**
* @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 private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
_owner = msg.sender;
emit OwnershipTransferred(address(0), _owner);
}
/**
* @return the address of the owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(isOwner());
_;
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns (bool) {
return 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 OwnershipTransferred(_owner, address(0));
_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 Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable{
event Paused(address account);
event Unpaused(address account);
bool private _paused;
constructor () internal {
_paused = false;
}
/**
* @return true if the contract is paused, false otherwise.
*/
function paused() public view returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!_paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(_paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() public onlyOwner whenNotPaused {
_paused = true;
emit Paused(msg.sender);
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() public onlyOwner whenPaused {
_paused = false;
emit Unpaused(msg.sender);
}
}
contract ERC20Token{
using SafeMath for uint256;
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// 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 generates a public event on the blockchain that will notify clients
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
/**
* Constructor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
constructor(uint256 initialSupply,string memory tokenName,string memory 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 != address(0x0));
balanceOf[_from] = balanceOf[_from].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
emit Transfer(_from, _to, _value);
}
/**
* 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 returns (bool success) {
_transfer(msg.sender, _to, _value);
return true;
}
/**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` on 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) {
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value);
_transfer(_from, _to, _value);
return true;
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens on 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;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens on 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 memory _extraData)
public
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, address(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) {
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); // Subtract from the sender
totalSupply = totalSupply.sub(_value); // Updates totalSupply
emit 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) {
balanceOf[_from] = balanceOf[_from].sub(_value); // Subtract from the targeted balance
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); // Subtract from the sender's allowance
totalSupply = totalSupply.sub(_value); // Update totalSupply
emit Burn(_from, _value);
return true;
}
}
contract BananaToken is ERC20Token, Ownable,Pausable{
mapping (address => bool) public frozenAccount;
mapping(address => uint256) public lockedAccount;
event FreezeAccount(address account, bool frozen);
event LockAccount(address account,uint256 unlockTime);
constructor() ERC20Token(5000000000,"Banana","BNA") public {
}
/**
* Freeze Account
*/
function freezeAccount(address account) onlyOwner public {
frozenAccount[account] = true;
emit FreezeAccount(account, true);
}
/**
* unFreeze Account
*/
function unFreezeAccount(address account) onlyOwner public{
frozenAccount[account] = false;
emit FreezeAccount(account, false);
}
/**
* lock Account, if account is locked, fund can only transfer in but not transfer out.
* Can not unlockAccount, if need unlock account , pls call unlockAccount interface
*/
function lockAccount(address account, uint256 unlockTime) onlyOwner public{
require(unlockTime > now);
lockedAccount[account] = unlockTime;
emit LockAccount(account,unlockTime);
}
/**
* unlock Account
*/
function unlockAccount(address account) onlyOwner public{
lockedAccount[account] = 0;
emit LockAccount(account,0);
}
function changeName(string memory newName) public onlyOwner {
name = newName;
}
function changeSymbol(string memory newSymbol) public onlyOwner{
symbol = newSymbol;
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint _value) internal whenNotPaused {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != address(0x0));
//if account is frozen, then fund can not be transfer in or out.
require(!frozenAccount[_from]);
require(!frozenAccount[_to]);
//if account is locked, then fund can only transfer in but can not transfer out.
require(!isAccountLocked(_from));
balanceOf[_from] = balanceOf[_from].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
emit Transfer(_from, _to, _value);
}
function isAccountLocked(address account) public view returns (bool) {
return lockedAccount[account] > now;
}
function isAccountFrozen(address account) public view returns (bool){
return frozenAccount[account];
}
}
Read Contract
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
frozenAccount 0xb414d4b6 → bool
isAccountFrozen 0xe816d97f → bool
isAccountLocked 0x74eb9b68 → bool
isOwner 0x8f32d59b → bool
lockedAccount 0x718ccce9 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
paused 0x5c975abb → bool
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
Write Contract 16 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address _spender
uint256 _value
returns: bool
approveAndCall 0xcae9ca51
address _spender
uint256 _value
bytes _extraData
returns: bool
burn 0x42966c68
uint256 _value
returns: bool
burnFrom 0x79cc6790
address _from
uint256 _value
returns: bool
changeName 0x5353a2d8
string newName
changeSymbol 0xa3895fff
string newSymbol
freezeAccount 0xf26c159f
address account
lockAccount 0xbf620a45
address account
uint256 unlockTime
pause 0x8456cb59
No parameters
renounceOwnership 0x715018a6
No parameters
transfer 0xa9059cbb
address _to
uint256 _value
returns: bool
transferFrom 0x23b872dd
address _from
address _to
uint256 _value
returns: bool
transferOwnership 0xf2fde38b
address newOwner
unFreezeAccount 0x53cc2fae
address account
unlockAccount 0x905295e3
address account
unpause 0x3f4ba83a
No parameters
Top Interactions
| Address | Txns | Sent | Received |
|---|---|---|---|
| 0x506E1da4...f0A8 | 4 | 4 | |
| 0x167A9333...6476 | 2 | 2 | |
| 0x67FCCBED...6190 | 1 | 1 | |
| 0x3e9AFaA4...7Ecb | 1 | 1 | |
| 0x4503D0a4...5D85 | 1 | 1 | |
| 0xbf569c64...8d15 | 1 | 1 |
Recent Transactions
|
| Hash | Block | Age | From/To | Value | |
|---|---|---|---|---|---|
| 0xa73b3172...2494a6 | 10,695,526 | IN | 0x3e9AFaA4...7Ecb | 0 ETH | |
| 0xd9b7f968...64fdcb | 10,694,692 | IN | 0xbf569c64...8d15 | 0 ETH | |
| 0x34dd530c...d34149 | 10,694,668 | IN | 0x67FCCBED...6190 | 0 ETH | |
| 0xb67ef210...7320fd | 10,691,661 | IN | 0x167A9333...6476 | 0 ETH | |
| 0xd7fabdd9...20286c | 10,657,411 | IN | 0x506E1da4...f0A8 | 0 ETH | |
| 0x607732da...5f5610 | 10,657,203 | IN | 0x167A9333...6476 | 0 ETH | |
| 0x2622e696...87bd60 | 10,656,536 | IN | 0x4503D0a4...5D85 | 0 ETH | |
| 0xebf021e3...898d0b | 10,656,502 | IN | 0x506E1da4...f0A8 | 0 ETH | |
| 0x7e6c9fdb...cd34f9 | 10,656,497 | IN | 0x506E1da4...f0A8 | 0 ETH | |
| 0x7e0b00d0...c3c205 | 10,656,497 | IN | 0x506E1da4...f0A8 | 0 ETH |