Skip to content
This repository was archived by the owner on Jul 14, 2025. It is now read-only.

Commit fdf687c

Browse files
simondlrmaurelian
authored andcommitted
Bumped pragmas & added emit
1 parent eefd92e commit fdf687c

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

contracts/eip20/EIP20.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ contract EIP20 is EIP20Interface {
4040
require(balances[msg.sender] >= _value);
4141
balances[msg.sender] -= _value;
4242
balances[_to] += _value;
43-
Transfer(msg.sender, _to, _value);
43+
emit Transfer(msg.sender, _to, _value); //solhint-disable-line indent, no-unused-vars
4444
return true;
4545
}
4646

@@ -52,7 +52,7 @@ contract EIP20 is EIP20Interface {
5252
if (allowance < MAX_UINT256) {
5353
allowed[_from][msg.sender] -= _value;
5454
}
55-
Transfer(_from, _to, _value);
55+
emit Transfer(_from, _to, _value); //solhint-disable-line indent, no-unused-vars
5656
return true;
5757
}
5858

@@ -62,11 +62,11 @@ contract EIP20 is EIP20Interface {
6262

6363
function approve(address _spender, uint256 _value) public returns (bool success) {
6464
allowed[msg.sender][_spender] = _value;
65-
Approval(msg.sender, _spender, _value);
65+
emit Approval(msg.sender, _spender, _value); //solhint-disable-line indent, no-unused-vars
6666
return true;
6767
}
6868

6969
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
7070
return allowed[_owner][_spender];
71-
}
71+
}
7272
}

contracts/eip20/EIP20Factory.sol

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import "./EIP20.sol";
22

3-
pragma solidity ^0.4.18;
3+
pragma solidity ^0.4.21;
44

55

66
contract EIP20Factory {
77

88
mapping(address => address[]) public created;
99
mapping(address => bool) public isEIP20; //verify without having to do a bytecode check.
10-
bytes public EIP20ByteCode; // solhint-disable-line var-name-mixedcase
10+
bytes public EIP20ByteCode; // solhint-disable-line var-name-mixedcase
1111

1212
function EIP20Factory() public {
1313
//upon creation of the factory, deploy a EIP20 (parameters are meaningless) and store the bytecode provably.
@@ -32,24 +32,24 @@ contract EIP20Factory {
3232
}
3333
return true;
3434
}
35-
36-
function createEIP20(uint256 _initialAmount, string _name, uint8 _decimals, string _symbol)
37-
public
35+
36+
function createEIP20(uint256 _initialAmount, string _name, uint8 _decimals, string _symbol)
37+
public
3838
returns (address) {
3939

4040
EIP20 newToken = (new EIP20(_initialAmount, _name, _decimals, _symbol));
4141
created[msg.sender].push(address(newToken));
4242
isEIP20[address(newToken)] = true;
4343
//the factory will own the created tokens. You must transfer them.
44-
newToken.transfer(msg.sender, _initialAmount);
44+
newToken.transfer(msg.sender, _initialAmount);
4545
return address(newToken);
4646
}
4747

48-
//for now, keeping this internal. Ideally there should also be a live version of this that
48+
//for now, keeping this internal. Ideally there should also be a live version of this that
4949
// any contract can use, lib-style.
5050
//retrieves the bytecode at a specific address.
5151
function codeAt(address _addr) internal view returns (bytes outputCode) {
52-
assembly { // solhint-disable-line no-inline-assembly
52+
assembly { // solhint-disable-line no-inline-assembly
5353
// retrieve the size of the code, this needs assembly
5454
let size := extcodesize(_addr)
5555
// allocate output byte array - this could also be done without assembly

contracts/eip20/EIP20Interface.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Abstract contract for the full ERC 20 Token standard
22
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
3-
pragma solidity ^0.4.18;
3+
pragma solidity ^0.4.21;
44

55

66
contract EIP20Interface {
@@ -44,7 +44,7 @@ contract EIP20Interface {
4444
/// @return Amount of remaining tokens allowed to spent
4545
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
4646

47-
// solhint-disable-next-line no-simple-event-func-name
48-
event Transfer(address indexed _from, address indexed _to, uint256 _value);
47+
// solhint-disable-next-line no-simple-event-func-name
48+
event Transfer(address indexed _from, address indexed _to, uint256 _value);
4949
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
5050
}

0 commit comments

Comments
 (0)