diff --git a/contracts/deploy/DelayedUpdatableInstance.sol b/contracts/deploy/DelayedUpdatableInstance.sol index 3ff6b0f..405a999 100644 --- a/contracts/deploy/DelayedUpdatableInstance.sol +++ b/contracts/deploy/DelayedUpdatableInstance.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.17; +pragma solidity ^0.4.21; import "./DelayedUpdatableInstanceStorage.sol"; import "./DelegatedCall.sol"; @@ -22,42 +22,56 @@ contract DelayedUpdatableInstance is DelayedUpdatableInstanceStorage, DelegatedC * @dev delegatecall everything (but declared functions) to `_target()` * @notice Verify `kernel()` code to predict behavior */ - function () external delegated { + function () + external + delegated + { //all goes to kernel } + function updateRequestUpdatableInstance( + address _kernel + ) + external + { + require(msg.sender == address(this)); + uint activation = block.timestamp + 30 days; + update = Update(_kernel, activation); + emit UpdateRequested(_kernel, activation); + } + + function updateConfirmUpdatableInstance( + address _kernel + ) + external + { + require(msg.sender == address(this)); + Update memory pending = update; + require(pending.kernel == _kernel); + require(pending.activation < block.timestamp); + kernel = pending.kernel; + delete update; + emit UpdateConfirmed(kernel, pending.kernel); + } + + function updateCancelUpdatableInstance() + external + { + require(msg.sender == address(this)); + delete update; + } + /** * @dev returns configured kernel * @return kernel address */ function targetDelegatedCall() internal - constant + view returns(address) { return kernel; } - function updateRequestUpdatableInstance(address _kernel) external { - require(msg.sender == address(this)); - uint activation = block.timestamp + 30 days; - update = Update(_kernel, activation); - UpdateRequested(_kernel, activation); - } - - function updateConfirmUpdatableInstance(address _kernel) external { - require(msg.sender == address(this)); - Update memory pending = update; - require(pending.kernel == _kernel); - require(pending.activation < block.timestamp); - kernel = pending.kernel; - delete update; - UpdateConfirmed(kernel, pending.kernel); - } - - function updateCancelUpdatableInstance() external { - require(msg.sender == address(this)); - delete update; - } } \ No newline at end of file diff --git a/contracts/identity/ERC725.sol b/contracts/identity/ERC725.sol index 17af37a..696d50d 100644 --- a/contracts/identity/ERC725.sol +++ b/contracts/identity/ERC725.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.18; +pragma solidity ^0.4.21; contract ERC725 { @@ -19,9 +19,9 @@ contract ERC725 { bytes32 key; } - function getKey(bytes32 _key, uint256 _purpose) public constant returns(uint256 purpose, uint256 keyType, bytes32 key); - function getKeyPurpose(bytes32 _key) public constant returns(uint256[] purpose); - function getKeysByPurpose(uint256 _purpose) public constant returns(bytes32[] keys); + function getKey(bytes32 _key, uint256 _purpose) public view returns(uint256 purpose, uint256 keyType, bytes32 key); + function getKeyPurpose(bytes32 _key) public view returns(uint256[] purpose); + function getKeysByPurpose(uint256 _purpose) public view returns(bytes32[] keys); function addKey(bytes32 _key, uint256 _purpose, uint256 _keyType) public returns (bool success); function removeKey(bytes32 _key, uint256 _purpose) public returns (bool success); function execute(address _to, uint256 _value, bytes _data) public returns (uint256 executionId); diff --git a/contracts/identity/ERC735.sol b/contracts/identity/ERC735.sol index 2109d28..8891552 100644 --- a/contracts/identity/ERC735.sol +++ b/contracts/identity/ERC735.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.18; +pragma solidity ^0.4.21; contract ERC735 { @@ -16,8 +16,8 @@ contract ERC735 { string uri; } - function getClaim(bytes32 _claimId) public constant returns(uint256 claimType, uint256 scheme, address issuer, bytes signature, bytes data, string uri); - function getClaimIdsByType(uint256 _claimType) public constant returns(bytes32[] claimIds); + function getClaim(bytes32 _claimId) public view returns(uint256 claimType, uint256 scheme, address issuer, bytes signature, bytes data, string uri); + function getClaimIdsByType(uint256 _claimType) public view returns(bytes32[] claimIds); function addClaim(uint256 _claimType, uint256 _scheme, address _issuer, bytes _signature, bytes _data, string _uri) public returns (bytes32 claimRequestId); function removeClaim(bytes32 _claimId) public returns (bool success); } \ No newline at end of file diff --git a/contracts/identity/Identity.sol b/contracts/identity/Identity.sol index ceea2a9..962c442 100644 --- a/contracts/identity/Identity.sol +++ b/contracts/identity/Identity.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.17; +pragma solidity ^0.4.21; import "./ERC725.sol"; import "./ERC735.sol"; @@ -283,7 +283,7 @@ contract Identity is ERC725, ERC735 { uint256 _purpose ) public - constant + view returns(uint256 purpose, uint256 keyType, bytes32 key) { Key storage myKey = keys[keccak256(_key, _purpose)]; @@ -292,7 +292,7 @@ contract Identity is ERC725, ERC735 { function isKeyPurpose(bytes32 _key, uint256 _purpose) public - constant + view returns (bool) { return keys[keccak256(_key, _purpose)].purpose == _purpose; @@ -300,7 +300,7 @@ contract Identity is ERC725, ERC735 { function getKeyPurpose(bytes32 _key) public - constant + view returns(uint256[] purpose) { @@ -337,7 +337,7 @@ contract Identity is ERC725, ERC735 { function getKeysByPurpose(uint256 _purpose) public - constant + view returns(bytes32[]) { return keysByPurpose[_purpose]; @@ -345,7 +345,7 @@ contract Identity is ERC725, ERC735 { function getClaim(bytes32 _claimId) public - constant + view returns( uint256 claimType, uint256 scheme, @@ -361,7 +361,7 @@ contract Identity is ERC725, ERC735 { function getClaimIdsByType(uint256 _claimType) public - constant + view returns(bytes32[] claimIds) { return claimsByType[_claimType];