merge 000-instance-factory

This commit is contained in:
Ricardo Guilherme Schmidt 2018-05-22 07:44:49 -03:00
commit f021b36058
7 changed files with 26 additions and 10 deletions

View File

@ -14,4 +14,6 @@ Usage:
| Contract | Deploy | Test | UI | | Contract | Deploy | Test | UI |
| -------------------------------------- | ------ | ---- | --- | | -------------------------------------- | ------ | ---- | --- |
| token/TestToken | Yes | Yes | Yes | | token/TestToken | Yes | Yes | Yes |
| token/ERC20Token | No | Yes | Yes | | token/ERC20Token | No | Yes | Yes |
| deploy/Instance | No | No | No |
| deploy/Factory | No | No | No |

View File

@ -23,7 +23,16 @@
}, },
"MiniMeTokenFactory": { "MiniMeTokenFactory": {
"deploy": true "deploy": true
} },
"Factory": {
"deploy": false
},
"Instance": {
"deploy": false
},
"UpdatableInstance": {
"deploy": false
}
} }
} }
} }

View File

@ -1,4 +1,4 @@
pragma solidity ^0.4.21; pragma solidity ^0.4.23;
/** /**
@ -8,6 +8,10 @@ pragma solidity ^0.4.21;
* Important to avoid overwriting wrong storage pointers is that never define storage to this contract * Important to avoid overwriting wrong storage pointers is that never define storage to this contract
*/ */
contract DelegatedCall { contract DelegatedCall {
constructor() internal {
}
/** /**
* @dev delegates the call of this function * @dev delegates the call of this function
*/ */

View File

@ -1,4 +1,4 @@
pragma solidity ^0.4.17; pragma solidity ^0.4.23;
import "../common/Controlled.sol"; import "../common/Controlled.sol";
@ -19,7 +19,7 @@ contract Factory is Controlled {
uint256 latestUpdate; uint256 latestUpdate;
address latestKernel; address latestKernel;
function Factory(address _kernel) constructor(address _kernel)
public public
{ {
_setKernel(_kernel); _setKernel(_kernel);

View File

@ -10,7 +10,7 @@ import "./DelegatedCall.sol";
*/ */
contract Instance is InstanceStorage, DelegatedCall { contract Instance is InstanceStorage, DelegatedCall {
function Instance(address _kernel) public { constructor(address _kernel) public {
kernel = _kernel; kernel = _kernel;
} }

View File

@ -1,4 +1,4 @@
pragma solidity ^0.4.17; pragma solidity ^0.4.23;
/** /**
@ -12,4 +12,5 @@ contract InstanceStorage {
// protected zone start (InstanceStorage vars) // protected zone start (InstanceStorage vars)
address public kernel; address public kernel;
// protected zone end // protected zone end
constructor() internal { }
} }

View File

@ -1,4 +1,4 @@
pragma solidity ^0.4.17; pragma solidity ^0.4.23;
import "./Instance.sol"; import "./Instance.sol";
@ -12,7 +12,7 @@ contract UpdatableInstance is Instance {
event InstanceUpdated(address oldKernel, address newKernel); event InstanceUpdated(address oldKernel, address newKernel);
function UpdatableInstance(address _kernel) constructor(address _kernel)
Instance(_kernel) Instance(_kernel)
public public
{ {
@ -21,7 +21,7 @@ contract UpdatableInstance is Instance {
function updateUpdatableInstance(address _kernel) external { function updateUpdatableInstance(address _kernel) external {
require(msg.sender == address(this)); require(msg.sender == address(this));
InstanceUpdated(kernel, _kernel); emit InstanceUpdated(kernel, _kernel);
kernel = _kernel; kernel = _kernel;
} }