Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions contracts/erc20_tutorial.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.18;
pragma solidity ^0.4.24;

// ----------------------------------------------------------------------------
// '0Fucks' token contract
Expand Down Expand Up @@ -74,7 +74,7 @@ contract Owned {

event OwnershipTransferred(address indexed _from, address indexed _to);

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

Expand All @@ -88,7 +88,7 @@ contract Owned {
}
function acceptOwnership() public {
require(msg.sender == newOwner);
OwnershipTransferred(owner, newOwner);
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
newOwner = address(0);
}
Expand All @@ -112,13 +112,13 @@ contract FucksToken is ERC20Interface, Owned, SafeMath {
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
function FucksToken() public {
constructor() public {
symbol = "0FUCKS";
name = "0 Fucks Token";
decimals = 18;
_totalSupply = 100000000000000000000000000;
balances[0x5A86f0cafD4ef3ba4f0344C138afcC84bd1ED222] = _totalSupply;
Transfer(address(0), 0x5A86f0cafD4ef3ba4f0344C138afcC84bd1ED222, _totalSupply);
emit Transfer(address(0), 0x5A86f0cafD4ef3ba4f0344C138afcC84bd1ED222, _totalSupply);
}


Expand Down Expand Up @@ -146,7 +146,7 @@ contract FucksToken is ERC20Interface, Owned, SafeMath {
function transfer(address to, uint tokens) public returns (bool success) {
balances[msg.sender] = safeSub(balances[msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
Transfer(msg.sender, to, tokens);
emit Transfer(msg.sender, to, tokens);
return true;
}

Expand All @@ -161,7 +161,7 @@ contract FucksToken is ERC20Interface, Owned, SafeMath {
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
emit Approval(msg.sender, spender, tokens);
return true;
}

Expand All @@ -179,7 +179,7 @@ contract FucksToken is ERC20Interface, Owned, SafeMath {
balances[from] = safeSub(balances[from], tokens);
allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
Transfer(from, to, tokens);
emit Transfer(from, to, tokens);
return true;
}

Expand All @@ -200,7 +200,7 @@ contract FucksToken is ERC20Interface, Owned, SafeMath {
// ------------------------------------------------------------------------
function approveAndCall(address spender, uint tokens, bytes data) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
emit Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data);
return true;
}
Expand Down