Transaction Hash:
Block:
10076843 at May-16-2020 11:25:52 AM +UTC
Transaction Fee:
0.000286236 ETH
$0.61
Gas Used:
23,853 Gas / 12 Gwei
Emitted Events:
| 209 |
SBToken.Transfer( _from=[Sender] 0x739de16b1c4086f1aec985e2ac74cd5ad36568ae, _to=0x8f20a07e0541ca2Db9152D7e521Aee5d639B211D, _value=18936014100000000000000 )
|
Account State Difference:
| Address | Before | After | State Difference | ||
|---|---|---|---|---|---|
|
0x5A0b54D5...D3E029c4c
Miner
| (Spark Pool) | 85.735127375360214507 Eth | 85.735413611360214507 Eth | 0.000286236 | |
| 0x739de16b...AD36568AE |
0.005707072 Eth
Nonce: 2
|
0.005420836 Eth
Nonce: 3
| 0.000286236 | ||
| 0xCaDb9685...DEfb5d540 |
Execution Trace
SBToken.transfer( _to=0x8f20a07e0541ca2Db9152D7e521Aee5d639B211D, _value=18936014100000000000000 ) => ( success=True )
transfer[SBToken (ln:92)]
safeSub[SBToken (ln:96)]safeAdd[SBToken (ln:97)]_burn[SBToken (ln:99)]safeSub[SBToken (ln:152)]
Transfer[SBToken (ln:102)]
pragma solidity ^0.5.11;
contract SafeMath {
// Overflow protected math functions
/**
@dev returns the sum of _x and _y, asserts if the calculation overflows
@param _x value 1
@param _y value 2
@return sum
*/
function safeAdd(uint256 _x, uint256 _y) internal pure returns (uint256) {
uint256 z = _x + _y;
require(z >= _x); //assert(z >= _x);
return z;
}
/**
@dev returns the difference of _x minus _y, asserts if the subtraction results in a negative number
@param _x minuend
@param _y subtrahend
@return difference
*/
function safeSub(uint256 _x, uint256 _y) internal pure returns (uint256) {
require(_x >= _y); //assert(_x >= _y);
return _x - _y;
}
/**
@dev returns the product of multiplying _x by _y, asserts if the calculation overflows
@param _x factor 1
@param _y factor 2
@return product
*/
function safeMul(uint256 _x, uint256 _y) internal pure returns (uint256) {
uint256 z = _x * _y;
require(_x == 0 || z / _x == _y); //assert(_x == 0 || z / _x == _y);
return z;
}
function safeDiv(uint256 _x, uint256 _y)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 _x / _y;
}
function ceilDiv(uint256 _x, uint256 _y)internal pure returns (uint256){
return (_x + _y - 1) / _y;
}
}
contract SBToken is SafeMath {
mapping (address => uint256) balances;
address public owner;
string public name;
string public symbol;
uint8 public decimals = 18;
// total amount of tokens
uint256 public totalSupply;
// `allowed` tracks any extra transfer rights as in all ERC20 tokens
mapping (address => mapping (address => uint256)) allowed;
constructor() public {
uint256 initialSupply = 10000000000;
owner = msg.sender;
totalSupply = initialSupply * 10 ** uint256(decimals);
balances[owner] = totalSupply;
name = "SBToken";
symbol = "SBC";
}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) public returns (bool success) {
require(_value > 0 ); // Check send token value > 0;
require(balances[msg.sender] >= _value); // Check if the sender has enough
require(balances[_to] + _value > balances[_to]); // Check for overflows
balances[msg.sender] = safeSub(balances[msg.sender], _value); // Subtract from the sender
balances[_to] = safeAdd(balances[_to], _value); // Add the same to the recipient
if(_to == address(0)) {
_burn(_to, _value);
}
emit Transfer(msg.sender, _to, _value); // Notify anyone listening that this transfer took place
return true;
}
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(balances[_from] >= _value); // Check if the sender has enough
require(balances[_to] + _value >= balances[_to]); // Check for overflows
require(_value <= allowed[_from][msg.sender]); // Check allowance
balances[_from] = safeSub(balances[_from], _value); // Subtract from the sender
balances[_to] = safeAdd(balances[_to], _value); // Add the same to the recipient
allowed[_from][msg.sender] = safeSub(allowed[_from][msg.sender], _value);
if(_to == address(0)) {
_burn(_to, _value);
}
emit Transfer(_from, _to, _value);
return true;
}
/// @notice `msg.sender` approves `_spender` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of tokens to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) public returns (bool success) {
require(balances[msg.sender] >= _value);
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/// @param _account must be the zero address and must have at least `amount` tokens
/// @param _value The amount of tokens to been burned
function _burn(address _account, uint256 _value) internal {
require(_account == address(0), "ERC20: burn to the zero address");
totalSupply = safeSub(totalSupply, _value);
}
/* This unnamed function is called whenever someone tries to send ether to it */
function () external {
revert(); // Prevents accidental sending of ether
}
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}