From 5dab2021c0c04ac2fcc0025bbd30f3246d2c57f3 Mon Sep 17 00:00:00 2001 From: Ricardo Guilherme Schmidt <3esmit@gmail.com> Date: Sun, 13 May 2018 02:47:51 -0300 Subject: [PATCH 1/4] update to latest solc --- contracts/deploy/DelegatedCall.sol | 6 +++++- contracts/deploy/Factory.sol | 4 ++-- contracts/deploy/Instance.sol | 2 +- contracts/deploy/InstanceStorage.sol | 3 ++- contracts/deploy/UpdatableInstance.sol | 4 ++-- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/contracts/deploy/DelegatedCall.sol b/contracts/deploy/DelegatedCall.sol index 861f751..8612147 100644 --- a/contracts/deploy/DelegatedCall.sol +++ b/contracts/deploy/DelegatedCall.sol @@ -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 */ contract DelegatedCall { + + constructor() internal { + + } /** * @dev delegates the call of this function */ diff --git a/contracts/deploy/Factory.sol b/contracts/deploy/Factory.sol index 4ba811f..52c0707 100644 --- a/contracts/deploy/Factory.sol +++ b/contracts/deploy/Factory.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.17; +pragma solidity ^0.4.23; import "../common/Controlled.sol"; @@ -19,7 +19,7 @@ contract Factory is Controlled { uint256 latestUpdate; address latestKernel; - function Factory(address _kernel) + constructor(address _kernel) public { _setKernel(_kernel); diff --git a/contracts/deploy/Instance.sol b/contracts/deploy/Instance.sol index 6243711..967bb5f 100644 --- a/contracts/deploy/Instance.sol +++ b/contracts/deploy/Instance.sol @@ -10,7 +10,7 @@ import "./DelegatedCall.sol"; */ contract Instance is InstanceStorage, DelegatedCall { - function Instance(address _kernel) public { + constructor(address _kernel) public { kernel = _kernel; } diff --git a/contracts/deploy/InstanceStorage.sol b/contracts/deploy/InstanceStorage.sol index ba84f64..df766b3 100644 --- a/contracts/deploy/InstanceStorage.sol +++ b/contracts/deploy/InstanceStorage.sol @@ -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) address public kernel; // protected zone end + constructor() internal { } } \ No newline at end of file diff --git a/contracts/deploy/UpdatableInstance.sol b/contracts/deploy/UpdatableInstance.sol index 60f6d0a..9427c5b 100644 --- a/contracts/deploy/UpdatableInstance.sol +++ b/contracts/deploy/UpdatableInstance.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.17; +pragma solidity ^0.4.23; import "./Instance.sol"; @@ -12,7 +12,7 @@ contract UpdatableInstance is Instance { event InstanceUpdated(address oldKernel, address newKernel); - function UpdatableInstance(address _kernel) + constructor(address _kernel) Instance(_kernel) public { From ddf7dd916f5ff364a9c4ea3949c4077f9c071d1f Mon Sep 17 00:00:00 2001 From: Ricardo Guilherme Schmidt <3esmit@gmail.com> Date: Sun, 13 May 2018 02:48:14 -0300 Subject: [PATCH 2/4] no auto deploy of factory or instances --- config/contracts.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/config/contracts.json b/config/contracts.json index 3ebb190..c8d9536 100644 --- a/config/contracts.json +++ b/config/contracts.json @@ -15,6 +15,15 @@ ], "gas": "auto", "contracts": { + "Factory": { + "deploy": false + }, + "Instance": { + "deploy": false + }, + "UpdatableInstance": { + "deploy": false + } } } } From 87dbdbef39381acc9fb4e1d358fd8c77dda155a0 Mon Sep 17 00:00:00 2001 From: Ricardo Guilherme Schmidt <3esmit@gmail.com> Date: Sun, 13 May 2018 06:17:39 -0300 Subject: [PATCH 3/4] missing emit --- contracts/deploy/UpdatableInstance.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/deploy/UpdatableInstance.sol b/contracts/deploy/UpdatableInstance.sol index 9427c5b..0cbb6f2 100644 --- a/contracts/deploy/UpdatableInstance.sol +++ b/contracts/deploy/UpdatableInstance.sol @@ -21,7 +21,7 @@ contract UpdatableInstance is Instance { function updateUpdatableInstance(address _kernel) external { require(msg.sender == address(this)); - InstanceUpdated(kernel, _kernel); + emit InstanceUpdated(kernel, _kernel); kernel = _kernel; } From 2f13c0e3214c8f8dbd55eaf2c180c24a0ec426ef Mon Sep 17 00:00:00 2001 From: Ricardo Guilherme Schmidt <3esmit@gmail.com> Date: Tue, 15 May 2018 08:56:13 -0300 Subject: [PATCH 4/4] add instance factory contracts to readme --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fc827f3..c767e1f 100644 --- a/README.md +++ b/README.md @@ -14,4 +14,6 @@ Usage: | Contract | Deploy | Test | UI | | -------------------------------------- | ------ | ---- | --- | | token/TestToken | Yes | Yes | Yes | -| token/ERC20Token | No | Yes | Yes | \ No newline at end of file +| token/ERC20Token | No | Yes | Yes | +| deploy/Instance | No | No | No | +| deploy/Factory | No | No | No | \ No newline at end of file