mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Update external contract in compilationTests to not use deprecated sha3
This commit is contained in:
parent
9de45383d8
commit
d39917fd0d
@ -54,11 +54,11 @@ contract moduleHandler is multiOwner, announcementTypes {
|
|||||||
require( owners[msg.sender] );
|
require( owners[msg.sender] );
|
||||||
require( modules.length == 0 );
|
require( modules.length == 0 );
|
||||||
foundationAddress = foundation;
|
foundationAddress = foundation;
|
||||||
addModule( modules_s(Token, sha3('Token'), false, false), ! forReplace);
|
addModule( modules_s(Token, keccak256('Token'), false, false), ! forReplace);
|
||||||
addModule( modules_s(Premium, sha3('Premium'), false, false), ! forReplace);
|
addModule( modules_s(Premium, keccak256('Premium'), false, false), ! forReplace);
|
||||||
addModule( modules_s(Publisher, sha3('Publisher'), false, true), ! forReplace);
|
addModule( modules_s(Publisher, keccak256('Publisher'), false, true), ! forReplace);
|
||||||
addModule( modules_s(Schelling, sha3('Schelling'), false, true), ! forReplace);
|
addModule( modules_s(Schelling, keccak256('Schelling'), false, true), ! forReplace);
|
||||||
addModule( modules_s(Provider, sha3('Provider'), true, true), ! forReplace);
|
addModule( modules_s(Provider, keccak256('Provider'), true, true), ! forReplace);
|
||||||
}
|
}
|
||||||
function addModule(modules_s input, bool call) internal {
|
function addModule(modules_s input, bool call) internal {
|
||||||
/*
|
/*
|
||||||
@ -117,7 +117,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
|||||||
@id Index of module.
|
@id Index of module.
|
||||||
@found Was there any result or not.
|
@found Was there any result or not.
|
||||||
*/
|
*/
|
||||||
bytes32 _name = sha3(name);
|
bytes32 _name = keccak256(name);
|
||||||
for ( uint256 a=0 ; a<modules.length ; a++ ) {
|
for ( uint256 a=0 ; a<modules.length ; a++ ) {
|
||||||
if ( modules[a].name == _name ) {
|
if ( modules[a].name == _name ) {
|
||||||
return (true, true, a);
|
return (true, true, a);
|
||||||
@ -151,9 +151,9 @@ contract moduleHandler is multiOwner, announcementTypes {
|
|||||||
*/
|
*/
|
||||||
var (_success, _found, _id) = getModuleIDByAddress(msg.sender);
|
var (_success, _found, _id) = getModuleIDByAddress(msg.sender);
|
||||||
require( _success );
|
require( _success );
|
||||||
if ( ! ( _found && modules[_id].name == sha3('Publisher') )) {
|
if ( ! ( _found && modules[_id].name == keccak256('Publisher') )) {
|
||||||
require( block.number < debugModeUntil );
|
require( block.number < debugModeUntil );
|
||||||
if ( ! insertAndCheckDo(calcDoHash("replaceModule", sha3(name, addr, callCallback))) ) {
|
if ( ! insertAndCheckDo(calcDoHash("replaceModule", keccak256(name, addr, callCallback))) ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -169,7 +169,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
|||||||
|
|
||||||
function callReplaceCallback(string moduleName, address newModule) external returns (bool success) {
|
function callReplaceCallback(string moduleName, address newModule) external returns (bool success) {
|
||||||
require( block.number < debugModeUntil );
|
require( block.number < debugModeUntil );
|
||||||
if ( ! insertAndCheckDo(calcDoHash("callReplaceCallback", sha3(moduleName, newModule))) ) {
|
if ( ! insertAndCheckDo(calcDoHash("callReplaceCallback", keccak256(moduleName, newModule))) ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
var (_success, _found, _id) = getModuleIDByName(moduleName);
|
var (_success, _found, _id) = getModuleIDByName(moduleName);
|
||||||
@ -190,13 +190,13 @@ contract moduleHandler is multiOwner, announcementTypes {
|
|||||||
*/
|
*/
|
||||||
var (_success, _found, _id) = getModuleIDByAddress(msg.sender);
|
var (_success, _found, _id) = getModuleIDByAddress(msg.sender);
|
||||||
require( _success );
|
require( _success );
|
||||||
if ( ! ( _found && modules[_id].name == sha3('Publisher') )) {
|
if ( ! ( _found && modules[_id].name == keccak256('Publisher') )) {
|
||||||
require( block.number < debugModeUntil );
|
require( block.number < debugModeUntil );
|
||||||
if ( ! insertAndCheckDo(calcDoHash("newModule", sha3(name, addr, schellingEvent, transferEvent))) ) {
|
if ( ! insertAndCheckDo(calcDoHash("newModule", keccak256(name, addr, schellingEvent, transferEvent))) ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
addModule( modules_s(addr, sha3(name), schellingEvent, transferEvent), true);
|
addModule( modules_s(addr, keccak256(name), schellingEvent, transferEvent), true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
function dropModule(string name, bool callCallback) external returns (bool success) {
|
function dropModule(string name, bool callCallback) external returns (bool success) {
|
||||||
@ -209,9 +209,9 @@ contract moduleHandler is multiOwner, announcementTypes {
|
|||||||
*/
|
*/
|
||||||
var (_success, _found, _id) = getModuleIDByAddress(msg.sender);
|
var (_success, _found, _id) = getModuleIDByAddress(msg.sender);
|
||||||
require( _success );
|
require( _success );
|
||||||
if ( ! ( _found && modules[_id].name == sha3('Publisher') )) {
|
if ( ! ( _found && modules[_id].name == keccak256('Publisher') )) {
|
||||||
require( block.number < debugModeUntil );
|
require( block.number < debugModeUntil );
|
||||||
if ( ! insertAndCheckDo(calcDoHash("replaceModule", sha3(name, callCallback))) ) {
|
if ( ! insertAndCheckDo(calcDoHash("replaceModule", keccak256(name, callCallback))) ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -226,7 +226,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
|||||||
|
|
||||||
function callDisableCallback(string moduleName) external returns (bool success) {
|
function callDisableCallback(string moduleName) external returns (bool success) {
|
||||||
require( block.number < debugModeUntil );
|
require( block.number < debugModeUntil );
|
||||||
if ( ! insertAndCheckDo(calcDoHash("callDisableCallback", sha3(moduleName))) ) {
|
if ( ! insertAndCheckDo(calcDoHash("callDisableCallback", keccak256(moduleName))) ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
var (_success, _found, _id) = getModuleIDByName(moduleName);
|
var (_success, _found, _id) = getModuleIDByName(moduleName);
|
||||||
@ -248,7 +248,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
|||||||
@bool Was the function successfull?
|
@bool Was the function successfull?
|
||||||
*/
|
*/
|
||||||
var (_success, _found, _id) = getModuleIDByAddress(msg.sender);
|
var (_success, _found, _id) = getModuleIDByAddress(msg.sender);
|
||||||
require( _success && _found && modules[_id].name == sha3('Token') );
|
require( _success && _found && modules[_id].name == keccak256('Token') );
|
||||||
for ( uint256 a=0 ; a<modules.length ; a++ ) {
|
for ( uint256 a=0 ; a<modules.length ; a++ ) {
|
||||||
if ( modules[a].transferEvent && abstractModule(modules[a].addr).isActive() ) {
|
if ( modules[a].transferEvent && abstractModule(modules[a].addr).isActive() ) {
|
||||||
require( abstractModule(modules[a].addr).transferEvent(from, to, value) );
|
require( abstractModule(modules[a].addr).transferEvent(from, to, value) );
|
||||||
@ -267,7 +267,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
|||||||
@bool Was the function successfull?
|
@bool Was the function successfull?
|
||||||
*/
|
*/
|
||||||
var (_success, _found, _id) = getModuleIDByAddress(msg.sender);
|
var (_success, _found, _id) = getModuleIDByAddress(msg.sender);
|
||||||
require( _success && _found && modules[_id].name == sha3('Schelling') );
|
require( _success && _found && modules[_id].name == keccak256('Schelling') );
|
||||||
for ( uint256 a=0 ; a<modules.length ; a++ ) {
|
for ( uint256 a=0 ; a<modules.length ; a++ ) {
|
||||||
if ( modules[a].schellingEvent && abstractModule(modules[a].addr).isActive() ) {
|
if ( modules[a].schellingEvent && abstractModule(modules[a].addr).isActive() ) {
|
||||||
require( abstractModule(modules[a].addr).newSchellingRoundEvent(roundID, reward) );
|
require( abstractModule(modules[a].addr).newSchellingRoundEvent(roundID, reward) );
|
||||||
@ -287,9 +287,9 @@ contract moduleHandler is multiOwner, announcementTypes {
|
|||||||
*/
|
*/
|
||||||
var (_success, _found, _id) = getModuleIDByAddress(msg.sender);
|
var (_success, _found, _id) = getModuleIDByAddress(msg.sender);
|
||||||
require( _success );
|
require( _success );
|
||||||
if ( ! ( _found && modules[_id].name == sha3('Publisher') )) {
|
if ( ! ( _found && modules[_id].name == keccak256('Publisher') )) {
|
||||||
require( block.number < debugModeUntil );
|
require( block.number < debugModeUntil );
|
||||||
if ( ! insertAndCheckDo(calcDoHash("replaceModuleHandler", sha3(newHandler))) ) {
|
if ( ! insertAndCheckDo(calcDoHash("replaceModuleHandler", keccak256(newHandler))) ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -353,7 +353,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
|||||||
@success Was the function successfull?
|
@success Was the function successfull?
|
||||||
*/
|
*/
|
||||||
var (_success, _found, _id) = getModuleIDByAddress(msg.sender);
|
var (_success, _found, _id) = getModuleIDByAddress(msg.sender);
|
||||||
require( _success && _found && modules[_id].name == sha3('Provider') );
|
require( _success && _found && modules[_id].name == keccak256('Provider') );
|
||||||
(_success, _found, _id) = getModuleIDByName('Token');
|
(_success, _found, _id) = getModuleIDByName('Token');
|
||||||
require( _success && _found );
|
require( _success && _found );
|
||||||
require( token(modules[_id].addr).mint(to, value) );
|
require( token(modules[_id].addr).mint(to, value) );
|
||||||
@ -385,7 +385,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
|||||||
@success Was the function successfull?
|
@success Was the function successfull?
|
||||||
*/
|
*/
|
||||||
var (_success, _found, _id) = getModuleIDByAddress(msg.sender);
|
var (_success, _found, _id) = getModuleIDByAddress(msg.sender);
|
||||||
require( _success && _found && modules[_id].name == sha3('Provider') );
|
require( _success && _found && modules[_id].name == keccak256('Provider') );
|
||||||
(_success, _found, _id) = getModuleIDByName('Token');
|
(_success, _found, _id) = getModuleIDByName('Token');
|
||||||
require( _success && _found );
|
require( _success && _found );
|
||||||
require( token(modules[_id].addr).processTransactionFee(from, value) );
|
require( token(modules[_id].addr).processTransactionFee(from, value) );
|
||||||
@ -400,7 +400,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
|||||||
@success Was the function successfull?
|
@success Was the function successfull?
|
||||||
*/
|
*/
|
||||||
var (_success, _found, _id) = getModuleIDByAddress(msg.sender);
|
var (_success, _found, _id) = getModuleIDByAddress(msg.sender);
|
||||||
require( _success && _found && modules[_id].name == sha3('Schelling') );
|
require( _success && _found && modules[_id].name == keccak256('Schelling') );
|
||||||
(_success, _found, _id) = getModuleIDByName('Token');
|
(_success, _found, _id) = getModuleIDByName('Token');
|
||||||
require( _success && _found );
|
require( _success && _found );
|
||||||
require( token(modules[_id].addr).burn(from, value) );
|
require( token(modules[_id].addr).burn(from, value) );
|
||||||
@ -417,9 +417,9 @@ contract moduleHandler is multiOwner, announcementTypes {
|
|||||||
*/
|
*/
|
||||||
var (_success, _found, _id) = getModuleIDByAddress(msg.sender);
|
var (_success, _found, _id) = getModuleIDByAddress(msg.sender);
|
||||||
require( _success );
|
require( _success );
|
||||||
if ( ! ( _found && modules[_id].name == sha3('Publisher') )) {
|
if ( ! ( _found && modules[_id].name == keccak256('Publisher') )) {
|
||||||
require( block.number < debugModeUntil );
|
require( block.number < debugModeUntil );
|
||||||
if ( ! insertAndCheckDo(calcDoHash("configureModule", sha3(moduleName, aType, value))) ) {
|
if ( ! insertAndCheckDo(calcDoHash("configureModule", keccak256(moduleName, aType, value))) ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -437,7 +437,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
|||||||
*/
|
*/
|
||||||
require( owners[msg.sender] );
|
require( owners[msg.sender] );
|
||||||
if ( forever ) {
|
if ( forever ) {
|
||||||
if ( ! insertAndCheckDo(calcDoHash("freezing", sha3(forever))) ) {
|
if ( ! insertAndCheckDo(calcDoHash("freezing", keccak256(forever))) ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,12 +21,12 @@ contract multiOwner is safeMath {
|
|||||||
Externals
|
Externals
|
||||||
*/
|
*/
|
||||||
function insertOwner(address addr) external {
|
function insertOwner(address addr) external {
|
||||||
if ( insertAndCheckDo(calcDoHash("insertOwner", sha3(addr))) ) {
|
if ( insertAndCheckDo(calcDoHash("insertOwner", keccak256(addr))) ) {
|
||||||
_addOwner(addr);
|
_addOwner(addr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function dropOwner(address addr) external {
|
function dropOwner(address addr) external {
|
||||||
if ( insertAndCheckDo(calcDoHash("dropOwner", sha3(addr))) ) {
|
if ( insertAndCheckDo(calcDoHash("dropOwner", keccak256(addr))) ) {
|
||||||
_delOwner(addr);
|
_delOwner(addr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -42,7 +42,7 @@ contract multiOwner is safeMath {
|
|||||||
return ownerCount * 75 / 100;
|
return ownerCount * 75 / 100;
|
||||||
}
|
}
|
||||||
function calcDoHash(string job, bytes32 data) public constant returns (bytes32 hash) {
|
function calcDoHash(string job, bytes32 data) public constant returns (bytes32 hash) {
|
||||||
return sha3(job, data);
|
return keccak256(job, data);
|
||||||
}
|
}
|
||||||
function validDoHash(bytes32 doHash) public constant returns (bool valid) {
|
function validDoHash(bytes32 doHash) public constant returns (bool valid) {
|
||||||
return doDB[doHash].length > 0;
|
return doDB[doHash].length > 0;
|
||||||
|
@ -335,7 +335,7 @@ contract schelling is module, announcementTypes, schellingVars {
|
|||||||
|
|
||||||
require( voter.status == voterStatus.afterPrepareVote );
|
require( voter.status == voterStatus.afterPrepareVote );
|
||||||
require( voter.roundID < currentRound );
|
require( voter.roundID < currentRound );
|
||||||
if ( sha3(vote) == voter.hash ) {
|
if ( keccak256(vote) == voter.hash ) {
|
||||||
delete voter.hash;
|
delete voter.hash;
|
||||||
if (round.blockHeight+roundBlockDelay/2 >= block.number) {
|
if (round.blockHeight+roundBlockDelay/2 >= block.number) {
|
||||||
if ( bytes(vote)[0] == aboveChar ) {
|
if ( bytes(vote)[0] == aboveChar ) {
|
||||||
|
@ -196,7 +196,7 @@ contract MilestoneTracker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// @notice `onlyDonor` Approves the proposed milestone list
|
/// @notice `onlyDonor` Approves the proposed milestone list
|
||||||
/// @param _hashProposals The sha3() of the proposed milestone list's
|
/// @param _hashProposals The keccak256() of the proposed milestone list's
|
||||||
/// bytecode; this confirms that the `donor` knows the set of milestones
|
/// bytecode; this confirms that the `donor` knows the set of milestones
|
||||||
/// they are approving
|
/// they are approving
|
||||||
function acceptProposedMilestones(bytes32 _hashProposals
|
function acceptProposedMilestones(bytes32 _hashProposals
|
||||||
@ -205,7 +205,7 @@ contract MilestoneTracker {
|
|||||||
uint i;
|
uint i;
|
||||||
|
|
||||||
if (!changingMilestones) throw;
|
if (!changingMilestones) throw;
|
||||||
if (sha3(proposedMilestones) != _hashProposals) throw;
|
if (keccak256(proposedMilestones) != _hashProposals) throw;
|
||||||
|
|
||||||
// Cancel all the unfinished milestones
|
// Cancel all the unfinished milestones
|
||||||
for (i=0; i<milestones.length; i++) {
|
for (i=0; i<milestones.length; i++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user