1
1
import "./EIP20.sol " ;
2
2
3
- pragma solidity ^ 0.4.18 ;
3
+ pragma solidity ^ 0.4.21 ;
4
4
5
5
6
6
contract EIP20Factory {
7
7
8
8
mapping (address => address []) public created;
9
9
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
11
11
12
12
function EIP20Factory () public {
13
13
//upon creation of the factory, deploy a EIP20 (parameters are meaningless) and store the bytecode provably.
@@ -32,24 +32,24 @@ contract EIP20Factory {
32
32
}
33
33
return true ;
34
34
}
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
38
38
returns (address ) {
39
39
40
40
EIP20 newToken = (new EIP20 (_initialAmount, _name, _decimals, _symbol));
41
41
created[msg .sender ].push (address (newToken));
42
42
isEIP20[address (newToken)] = true ;
43
43
//the factory will own the created tokens. You must transfer them.
44
- newToken.transfer (msg .sender , _initialAmount);
44
+ newToken.transfer (msg .sender , _initialAmount);
45
45
return address (newToken);
46
46
}
47
47
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
49
49
// any contract can use, lib-style.
50
50
//retrieves the bytecode at a specific address.
51
51
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
53
53
// retrieve the size of the code, this needs assembly
54
54
let size := extcodesize (_addr)
55
55
// allocate output byte array - this could also be done without assembly
0 commit comments