diff options
Diffstat (limited to 'test/compilationTests/corion/multiOwner.sol')
-rw-r--r-- | test/compilationTests/corion/multiOwner.sol | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/test/compilationTests/corion/multiOwner.sol b/test/compilationTests/corion/multiOwner.sol index 9aae0ebd..efda554a 100644 --- a/test/compilationTests/corion/multiOwner.sol +++ b/test/compilationTests/corion/multiOwner.sol @@ -3,16 +3,16 @@ pragma solidity ^0.4.11; import "./safeMath.sol"; contract multiOwner is safeMath { - + mapping(address => bool) public owners; uint256 public ownerCount; mapping(bytes32 => address[]) public doDB; - + /* Constructor */ - function multiOwner(address[] newOwners) { + constructor(address[] memory newOwners) public { for ( uint256 a=0 ; a<newOwners.length ; a++ ) { _addOwner(newOwners[a]); } @@ -21,12 +21,12 @@ contract multiOwner is safeMath { Externals */ function insertOwner(address addr) external { - if ( insertAndCheckDo(calcDoHash("insertOwner", sha3(addr))) ) { + if ( insertAndCheckDo(calcDoHash("insertOwner", keccak256(abi.encodePacked(addr)))) ) { _addOwner(addr); } } function dropOwner(address addr) external { - if ( insertAndCheckDo(calcDoHash("dropOwner", sha3(addr))) ) { + if ( insertAndCheckDo(calcDoHash("dropOwner", keccak256(abi.encodePacked(addr)))) ) { _delOwner(addr); } } @@ -38,13 +38,13 @@ contract multiOwner is safeMath { /* Constants */ - function ownersForChange() public constant returns (uint256 owners) { + function ownersForChange() public view returns (uint256 owners) { return ownerCount * 75 / 100; } - function calcDoHash(string job, bytes32 data) public constant returns (bytes32 hash) { - return sha3(job, data); + function calcDoHash(string memory job, bytes32 data) public pure returns (bytes32 hash) { + return keccak256(abi.encodePacked(job, data)); } - function validDoHash(bytes32 doHash) public constant returns (bool valid) { + function validDoHash(bytes32 doHash) public view returns (bool valid) { return doDB[doHash].length > 0; } /* |