Skip to content

Commit dcbd8d6

Browse files
authored
Merge pull request #14 from morenoh149/hm-update-sol-0.4.24
Update to solidity 0.4.24
2 parents 72ff260 + 01825e6 commit dcbd8d6

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

contracts/erc20_tutorial.sol

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pragma solidity ^0.4.18;
1+
pragma solidity ^0.4.24;
22

33
// ----------------------------------------------------------------------------
44
// '0Fucks' token contract
@@ -74,7 +74,7 @@ contract Owned {
7474

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

77-
function Owned() public {
77+
constructor() public {
7878
owner = msg.sender;
7979
}
8080

@@ -88,7 +88,7 @@ contract Owned {
8888
}
8989
function acceptOwnership() public {
9090
require(msg.sender == newOwner);
91-
OwnershipTransferred(owner, newOwner);
91+
emit OwnershipTransferred(owner, newOwner);
9292
owner = newOwner;
9393
newOwner = address(0);
9494
}
@@ -112,13 +112,13 @@ contract FucksToken is ERC20Interface, Owned, SafeMath {
112112
// ------------------------------------------------------------------------
113113
// Constructor
114114
// ------------------------------------------------------------------------
115-
function FucksToken() public {
115+
constructor() public {
116116
symbol = "0FUCKS";
117117
name = "0 Fucks Token";
118118
decimals = 18;
119119
_totalSupply = 100000000000000000000000000;
120120
balances[0x5A86f0cafD4ef3ba4f0344C138afcC84bd1ED222] = _totalSupply;
121-
Transfer(address(0), 0x5A86f0cafD4ef3ba4f0344C138afcC84bd1ED222, _totalSupply);
121+
emit Transfer(address(0), 0x5A86f0cafD4ef3ba4f0344C138afcC84bd1ED222, _totalSupply);
122122
}
123123

124124

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

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

@@ -179,7 +179,7 @@ contract FucksToken is ERC20Interface, Owned, SafeMath {
179179
balances[from] = safeSub(balances[from], tokens);
180180
allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens);
181181
balances[to] = safeAdd(balances[to], tokens);
182-
Transfer(from, to, tokens);
182+
emit Transfer(from, to, tokens);
183183
return true;
184184
}
185185

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

0 commit comments

Comments
 (0)