mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Update external contracts in compilationTests (to support strict address literals)
This commit is contained in:
parent
98c9ca2575
commit
3ee3018bf6
@ -50,7 +50,7 @@ contract MultiSigWallet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
modifier transactionExists(uint transactionId) {
|
modifier transactionExists(uint transactionId) {
|
||||||
if (transactions[transactionId].destination == 0)
|
if (transactions[transactionId].destination == address(0))
|
||||||
throw;
|
throw;
|
||||||
_;
|
_;
|
||||||
}
|
}
|
||||||
@ -74,7 +74,7 @@ contract MultiSigWallet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
modifier notNull(address _address) {
|
modifier notNull(address _address) {
|
||||||
if (_address == 0)
|
if (_address == address(0))
|
||||||
throw;
|
throw;
|
||||||
_;
|
_;
|
||||||
}
|
}
|
||||||
@ -107,7 +107,7 @@ contract MultiSigWallet {
|
|||||||
validRequirement(_owners.length, _required)
|
validRequirement(_owners.length, _required)
|
||||||
{
|
{
|
||||||
for (uint i=0; i<_owners.length; i++) {
|
for (uint i=0; i<_owners.length; i++) {
|
||||||
if (isOwner[_owners[i]] || _owners[i] == 0)
|
if (isOwner[_owners[i]] || _owners[i] == address(0))
|
||||||
throw;
|
throw;
|
||||||
isOwner[_owners[i]] = true;
|
isOwner[_owners[i]] = true;
|
||||||
}
|
}
|
||||||
|
@ -162,7 +162,7 @@ contract ico is safeMath {
|
|||||||
interest_s memory _idb;
|
interest_s memory _idb;
|
||||||
address _addr = beneficiary;
|
address _addr = beneficiary;
|
||||||
uint256 _to = (block.number - startBlock) / interestBlockDelay;
|
uint256 _to = (block.number - startBlock) / interestBlockDelay;
|
||||||
if ( _addr == 0x00 ) { _addr = msg.sender; }
|
if ( _addr == address(0x00) ) { _addr = msg.sender; }
|
||||||
|
|
||||||
require( block.number > icoDelay );
|
require( block.number > icoDelay );
|
||||||
require( ! aborted );
|
require( ! aborted );
|
||||||
@ -257,7 +257,7 @@ contract ico is safeMath {
|
|||||||
@premiumContractAddr Address of the corion premium token contract
|
@premiumContractAddr Address of the corion premium token contract
|
||||||
*/
|
*/
|
||||||
require( msg.sender == owner );
|
require( msg.sender == owner );
|
||||||
require( tokenAddr == 0x00 && premiumAddr == 0x00 );
|
require( tokenAddr == address(0x00) && premiumAddr == address(0x00) );
|
||||||
tokenAddr = tokenContractAddr;
|
tokenAddr = tokenContractAddr;
|
||||||
premiumAddr = premiumContractAddr;
|
premiumAddr = premiumContractAddr;
|
||||||
}
|
}
|
||||||
@ -281,7 +281,7 @@ contract ico is safeMath {
|
|||||||
If they call the contract without any function then this process will be taken place.
|
If they call the contract without any function then this process will be taken place.
|
||||||
*/
|
*/
|
||||||
require( isICO() );
|
require( isICO() );
|
||||||
require( buy(msg.sender, 0x00) );
|
require( buy(msg.sender, address(0x00)) );
|
||||||
}
|
}
|
||||||
|
|
||||||
function buy(address beneficiaryAddress, address affilateAddress) payable returns (bool success) {
|
function buy(address beneficiaryAddress, address affilateAddress) payable returns (bool success) {
|
||||||
@ -300,9 +300,9 @@ contract ico is safeMath {
|
|||||||
@affilateAddress The address of the person who offered who will get the referral reward. It can not be equal with the beneficiaryAddress.
|
@affilateAddress The address of the person who offered who will get the referral reward. It can not be equal with the beneficiaryAddress.
|
||||||
*/
|
*/
|
||||||
require( isICO() );
|
require( isICO() );
|
||||||
if ( beneficiaryAddress == 0x00) { beneficiaryAddress = msg.sender; }
|
if ( beneficiaryAddress == address(0x00)) { beneficiaryAddress = msg.sender; }
|
||||||
if ( beneficiaryAddress == affilateAddress ) {
|
if ( beneficiaryAddress == affilateAddress ) {
|
||||||
affilateAddress = 0x00;
|
affilateAddress = address(0x00);
|
||||||
}
|
}
|
||||||
uint256 _value = msg.value;
|
uint256 _value = msg.value;
|
||||||
if ( beneficiaryAddress.balance < 0.2 ether ) {
|
if ( beneficiaryAddress.balance < 0.2 ether ) {
|
||||||
@ -317,7 +317,7 @@ contract ico is safeMath {
|
|||||||
totalMint = safeAdd(totalMint, _reward);
|
totalMint = safeAdd(totalMint, _reward);
|
||||||
require( foundationAddress.send(_value * 10 / 100) );
|
require( foundationAddress.send(_value * 10 / 100) );
|
||||||
uint256 extra;
|
uint256 extra;
|
||||||
if ( affilateAddress != 0x00 && ( brought[affilateAddress].eth > 0 || interestDB[affilateAddress][0].amount > 0 ) ) {
|
if ( affilateAddress != address(0x00) && ( brought[affilateAddress].eth > 0 || interestDB[affilateAddress][0].amount > 0 ) ) {
|
||||||
affiliate[affilateAddress].weight = safeAdd(affiliate[affilateAddress].weight, _reward);
|
affiliate[affilateAddress].weight = safeAdd(affiliate[affilateAddress].weight, _reward);
|
||||||
extra = affiliate[affilateAddress].weight;
|
extra = affiliate[affilateAddress].weight;
|
||||||
uint256 rate;
|
uint256 rate;
|
||||||
|
@ -123,7 +123,7 @@ contract module {
|
|||||||
|
|
||||||
@ret This is the module handler address or not
|
@ret This is the module handler address or not
|
||||||
*/
|
*/
|
||||||
if ( moduleHandlerAddress == 0x00 ) { return true; }
|
if ( moduleHandlerAddress == address(0x00) ) { return true; }
|
||||||
if ( moduleStatus != status.Connected ) { return false; }
|
if ( moduleStatus != status.Connected ) { return false; }
|
||||||
return addr == moduleHandlerAddress;
|
return addr == moduleHandlerAddress;
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
|||||||
require( success && ! found );
|
require( success && ! found );
|
||||||
(success, found, id) = getModuleIDByHash(input.name);
|
(success, found, id) = getModuleIDByHash(input.name);
|
||||||
require( success && ! found );
|
require( success && ! found );
|
||||||
(success, found, id) = getModuleIDByAddress(0x00);
|
(success, found, id) = getModuleIDByAddress(address(0x00));
|
||||||
require( success );
|
require( success );
|
||||||
if ( ! found ) {
|
if ( ! found ) {
|
||||||
id = modules.length;
|
id = modules.length;
|
||||||
@ -92,7 +92,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
|||||||
*/
|
*/
|
||||||
(bool _success, bool _found, uint256 _id) = getModuleIDByName(name);
|
(bool _success, bool _found, uint256 _id) = getModuleIDByName(name);
|
||||||
if ( _success && _found ) { return (true, true, modules[_id].addr); }
|
if ( _success && _found ) { return (true, true, modules[_id].addr); }
|
||||||
return (true, false, 0x00);
|
return (true, false, address(0x00));
|
||||||
}
|
}
|
||||||
function getModuleIDByHash(bytes32 hashOfName) public constant returns( bool success, bool found, uint256 id ) {
|
function getModuleIDByHash(bytes32 hashOfName) public constant returns( bool success, bool found, uint256 id ) {
|
||||||
/*
|
/*
|
||||||
|
@ -20,7 +20,7 @@ contract ownedDB {
|
|||||||
|
|
||||||
@bool Owner has called the contract or not
|
@bool Owner has called the contract or not
|
||||||
*/
|
*/
|
||||||
if ( owner == 0x00 ) {
|
if ( owner == address(0x00) ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return owner == msg.sender;
|
return owner == msg.sender;
|
||||||
|
@ -53,7 +53,7 @@ contract premium is module, safeMath {
|
|||||||
@genesisValue Array of the balance of the genesis addresses
|
@genesisValue Array of the balance of the genesis addresses
|
||||||
*/
|
*/
|
||||||
super.registerModuleHandler(moduleHandler);
|
super.registerModuleHandler(moduleHandler);
|
||||||
require( dbAddress != 0x00 );
|
require( dbAddress != address(0x00) );
|
||||||
db = ptokenDB(dbAddress);
|
db = ptokenDB(dbAddress);
|
||||||
if ( ! forReplace ) {
|
if ( ! forReplace ) {
|
||||||
require( db.replaceOwner(this) );
|
require( db.replaceOwner(this) );
|
||||||
@ -273,7 +273,7 @@ contract premium is module, safeMath {
|
|||||||
@to For who?
|
@to For who?
|
||||||
@amount Amount
|
@amount Amount
|
||||||
*/
|
*/
|
||||||
require( from != 0x00 && to != 0x00 && to != 0xa636a97578d26a3b76b060bbc18226d954cf3757 );
|
require( from != address(0x00) && to != address(0x00) && to != 0xa636A97578d26A3b76B060Bbc18226d954cf3757 );
|
||||||
require( ( ! isICO) || genesis[from] );
|
require( ( ! isICO) || genesis[from] );
|
||||||
require( db.decrease(from, amount) );
|
require( db.decrease(from, amount) );
|
||||||
require( db.increase(to, amount) );
|
require( db.increase(to, amount) );
|
||||||
|
@ -161,7 +161,7 @@ contract provider is module, safeMath, announcementTypes {
|
|||||||
if ( schellingRound == 0 ) {
|
if ( schellingRound == 0 ) {
|
||||||
schellingRound = currentSchellingRound;
|
schellingRound = currentSchellingRound;
|
||||||
}
|
}
|
||||||
if ( clients[addr].providerAddress != 0 ) {
|
if ( clients[addr].providerAddress != address(0x00) ) {
|
||||||
ProviderAddress = clients[addr].providerAddress;
|
ProviderAddress = clients[addr].providerAddress;
|
||||||
ProviderHeight = clients[addr].providerHeight;
|
ProviderHeight = clients[addr].providerHeight;
|
||||||
ConnectedOn = clients[addr].providerConnected;
|
ConnectedOn = clients[addr].providerConnected;
|
||||||
@ -233,7 +233,7 @@ contract provider is module, safeMath, announcementTypes {
|
|||||||
@admin The admin’s address
|
@admin The admin’s address
|
||||||
*/
|
*/
|
||||||
require( ! providers[msg.sender].data[providers[msg.sender].currentHeight].valid );
|
require( ! providers[msg.sender].data[providers[msg.sender].currentHeight].valid );
|
||||||
require( clients[msg.sender].providerAddress == 0x00 );
|
require( clients[msg.sender].providerAddress == address(0x00) );
|
||||||
require( ! checkICO() );
|
require( ! checkICO() );
|
||||||
if ( priv ) {
|
if ( priv ) {
|
||||||
require( getTokenBalance(msg.sender) >= minFundsForPrivate );
|
require( getTokenBalance(msg.sender) >= minFundsForPrivate );
|
||||||
@ -245,7 +245,7 @@ contract provider is module, safeMath, announcementTypes {
|
|||||||
providers[msg.sender].currentHeight++;
|
providers[msg.sender].currentHeight++;
|
||||||
uint256 currHeight = providers[msg.sender].currentHeight;
|
uint256 currHeight = providers[msg.sender].currentHeight;
|
||||||
providers[msg.sender].data[currHeight].valid = true;
|
providers[msg.sender].data[currHeight].valid = true;
|
||||||
if ( admin == 0x00 ) {
|
if ( admin == address(0x00) ) {
|
||||||
providers[msg.sender].data[currHeight].admin = msg.sender;
|
providers[msg.sender].data[currHeight].admin = msg.sender;
|
||||||
} else {
|
} else {
|
||||||
providers[msg.sender].data[currHeight].admin = admin;
|
providers[msg.sender].data[currHeight].admin = admin;
|
||||||
@ -288,7 +288,7 @@ contract provider is module, safeMath, announcementTypes {
|
|||||||
require( providers[addr].data[currHeight].valid );
|
require( providers[addr].data[currHeight].valid );
|
||||||
require( checkCorrectRate(providers[addr].data[currHeight].priv, rate) );
|
require( checkCorrectRate(providers[addr].data[currHeight].priv, rate) );
|
||||||
require( providers[addr].data[currHeight].admin == msg.sender || msg.sender == addr );
|
require( providers[addr].data[currHeight].admin == msg.sender || msg.sender == addr );
|
||||||
if ( admin != 0x00 ) {
|
if ( admin != address(0x00) ) {
|
||||||
require( msg.sender == addr );
|
require( msg.sender == addr );
|
||||||
providers[addr].data[currHeight].admin = admin;
|
providers[addr].data[currHeight].admin = admin;
|
||||||
}
|
}
|
||||||
@ -419,7 +419,7 @@ contract provider is module, safeMath, announcementTypes {
|
|||||||
*/
|
*/
|
||||||
uint256 currHeight = providers[provider].currentHeight;
|
uint256 currHeight = providers[provider].currentHeight;
|
||||||
require( ! providers[msg.sender].data[currHeight].valid );
|
require( ! providers[msg.sender].data[currHeight].valid );
|
||||||
require( clients[msg.sender].providerAddress == 0x00 );
|
require( clients[msg.sender].providerAddress == address(0x00) );
|
||||||
require( providers[provider].data[currHeight].valid );
|
require( providers[provider].data[currHeight].valid );
|
||||||
if ( providers[provider].data[currHeight].priv ) {
|
if ( providers[provider].data[currHeight].priv ) {
|
||||||
require( providers[provider].data[currHeight].allowedUsers[msg.sender] &&
|
require( providers[provider].data[currHeight].allowedUsers[msg.sender] &&
|
||||||
@ -446,7 +446,7 @@ contract provider is module, safeMath, announcementTypes {
|
|||||||
It is only possible to disconnect those providers who were connected by us before.
|
It is only possible to disconnect those providers who were connected by us before.
|
||||||
*/
|
*/
|
||||||
address provider = clients[msg.sender].providerAddress;
|
address provider = clients[msg.sender].providerAddress;
|
||||||
require( provider != 0x0 );
|
require( provider != address(0x00) );
|
||||||
uint256 currHeight = clients[msg.sender].providerHeight;
|
uint256 currHeight = clients[msg.sender].providerHeight;
|
||||||
bool providerHasClosed = false;
|
bool providerHasClosed = false;
|
||||||
if ( providers[provider].data[currHeight].close > 0 ) {
|
if ( providers[provider].data[currHeight].close > 0 ) {
|
||||||
@ -479,7 +479,7 @@ contract provider is module, safeMath, announcementTypes {
|
|||||||
if ( providers[addr].data[providers[addr].currentHeight].valid ) {
|
if ( providers[addr].data[providers[addr].currentHeight].valid ) {
|
||||||
uint256 a;
|
uint256 a;
|
||||||
(reward, a) = getProviderReward(addr, 0);
|
(reward, a) = getProviderReward(addr, 0);
|
||||||
} else if ( clients[addr].providerAddress != 0x0 ) {
|
} else if ( clients[addr].providerAddress != address(0x00) ) {
|
||||||
reward = getClientReward(0);
|
reward = getClientReward(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -504,14 +504,14 @@ contract provider is module, safeMath, announcementTypes {
|
|||||||
address _beneficiary = beneficiary;
|
address _beneficiary = beneficiary;
|
||||||
address _provider = provider;
|
address _provider = provider;
|
||||||
if ( _limit == 0 ) { _limit = gasProtectMaxRounds; }
|
if ( _limit == 0 ) { _limit = gasProtectMaxRounds; }
|
||||||
if ( _beneficiary == 0x00 ) { _beneficiary = msg.sender; }
|
if ( _beneficiary == address(0x00) ) { _beneficiary = msg.sender; }
|
||||||
if ( _provider == 0x00 ) { _provider = msg.sender; }
|
if ( _provider == address(0x00) ) { _provider = msg.sender; }
|
||||||
uint256 clientReward;
|
uint256 clientReward;
|
||||||
uint256 providerReward;
|
uint256 providerReward;
|
||||||
if ( providers[_provider].data[providers[_provider].currentHeight].valid ) {
|
if ( providers[_provider].data[providers[_provider].currentHeight].valid ) {
|
||||||
require( providers[_provider].data[providers[_provider].currentHeight].admin == msg.sender || msg.sender == _provider );
|
require( providers[_provider].data[providers[_provider].currentHeight].admin == msg.sender || msg.sender == _provider );
|
||||||
(providerReward, clientReward) = getProviderReward(_provider, _limit);
|
(providerReward, clientReward) = getProviderReward(_provider, _limit);
|
||||||
} else if ( clients[msg.sender].providerAddress != 0x00 ) {
|
} else if ( clients[msg.sender].providerAddress != address(0x00) ) {
|
||||||
clientReward = getClientReward(_limit);
|
clientReward = getClientReward(_limit);
|
||||||
} else {
|
} else {
|
||||||
throw;
|
throw;
|
||||||
@ -745,7 +745,7 @@ contract provider is module, safeMath, announcementTypes {
|
|||||||
@value Rate of the change.
|
@value Rate of the change.
|
||||||
@neg ype of the change. If it is TRUE then the balance has been decreased if it is FALSE then it has been increased.
|
@neg ype of the change. If it is TRUE then the balance has been decreased if it is FALSE then it has been increased.
|
||||||
*/
|
*/
|
||||||
if ( clients[addr].providerAddress != 0 ) {
|
if ( clients[addr].providerAddress != address(0x00) ) {
|
||||||
checkFloatingSupply(clients[addr].providerAddress, providers[clients[addr].providerAddress].currentHeight, ! neg, value);
|
checkFloatingSupply(clients[addr].providerAddress, providers[clients[addr].providerAddress].currentHeight, ! neg, value);
|
||||||
if (clients[addr].lastSupplyID != currentSchellingRound) {
|
if (clients[addr].lastSupplyID != currentSchellingRound) {
|
||||||
clients[addr].supply[currentSchellingRound] = TEMath(clients[addr].supply[clients[addr].lastSupplyID], value, neg);
|
clients[addr].supply[currentSchellingRound] = TEMath(clients[addr].supply[clients[addr].lastSupplyID], value, neg);
|
||||||
|
@ -37,7 +37,7 @@ contract schellingDB is safeMath, schellingVars {
|
|||||||
*/
|
*/
|
||||||
address private owner;
|
address private owner;
|
||||||
function replaceOwner(address newOwner) external returns(bool) {
|
function replaceOwner(address newOwner) external returns(bool) {
|
||||||
require( owner == 0x00 || msg.sender == owner );
|
require( owner == address(0x00) || msg.sender == owner );
|
||||||
owner = newOwner;
|
owner = newOwner;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -407,7 +407,7 @@ contract schelling is module, announcementTypes, schellingVars {
|
|||||||
uint256 funds = getFunds(msg.sender);
|
uint256 funds = getFunds(msg.sender);
|
||||||
|
|
||||||
address _beneficiary = msg.sender;
|
address _beneficiary = msg.sender;
|
||||||
if (beneficiary != 0x0) { _beneficiary = beneficiary; }
|
if (beneficiary != address(0x00)) { _beneficiary = beneficiary; }
|
||||||
uint256 reward;
|
uint256 reward;
|
||||||
require( voter.rewards > 0 );
|
require( voter.rewards > 0 );
|
||||||
require( voter.status == voterStatus.base );
|
require( voter.status == voterStatus.base );
|
||||||
|
@ -63,9 +63,9 @@ contract token is safeMath, module, announcementTypes {
|
|||||||
@genesisValue Array of balance of genesis addresses
|
@genesisValue Array of balance of genesis addresses
|
||||||
*/
|
*/
|
||||||
super.registerModuleHandler(moduleHandler);
|
super.registerModuleHandler(moduleHandler);
|
||||||
require( dbAddr != 0x00 );
|
require( dbAddr != address(0x00) );
|
||||||
require( icoContractAddr != 0x00 );
|
require( icoContractAddr != address(0x00) );
|
||||||
require( exchangeContractAddress != 0x00 );
|
require( exchangeContractAddress != address(0x00) );
|
||||||
db = tokenDB(dbAddr);
|
db = tokenDB(dbAddr);
|
||||||
icoAddr = icoContractAddr;
|
icoAddr = icoContractAddr;
|
||||||
exchangeAddress = exchangeContractAddress;
|
exchangeAddress = exchangeContractAddress;
|
||||||
@ -325,7 +325,7 @@ contract token is safeMath, module, announcementTypes {
|
|||||||
require( success );
|
require( success );
|
||||||
require( db.balanceOf(from) >= amount + _fee );
|
require( db.balanceOf(from) >= amount + _fee );
|
||||||
}
|
}
|
||||||
require( from != 0x00 && to != 0x00 && to != 0xa636a97578d26a3b76b060bbc18226d954cf3757 );
|
require( from != address(0x00) && to != address(0x00) && to != 0xa636A97578d26A3b76B060Bbc18226d954cf3757 );
|
||||||
require( ( ! isICO) || genesis[from] );
|
require( ( ! isICO) || genesis[from] );
|
||||||
require( db.decrease(from, amount) );
|
require( db.decrease(from, amount) );
|
||||||
require( db.increase(to, amount) );
|
require( db.increase(to, amount) );
|
||||||
@ -374,7 +374,7 @@ contract token is safeMath, module, announcementTypes {
|
|||||||
address _schellingAddr;
|
address _schellingAddr;
|
||||||
(_success, _found, _schellingAddr) = moduleHandler(moduleHandlerAddress).getModuleAddressByName('Schelling');
|
(_success, _found, _schellingAddr) = moduleHandler(moduleHandlerAddress).getModuleAddressByName('Schelling');
|
||||||
require( _success );
|
require( _success );
|
||||||
if ( _schellingAddr != 0x00 && _found) {
|
if ( _schellingAddr != address(0x00) && _found) {
|
||||||
require( db.decrease(owner, _forSchelling) );
|
require( db.decrease(owner, _forSchelling) );
|
||||||
require( db.increase(_schellingAddr, _forSchelling) );
|
require( db.increase(_schellingAddr, _forSchelling) );
|
||||||
_burn(owner, _forBurn);
|
_burn(owner, _forBurn);
|
||||||
@ -424,7 +424,7 @@ contract token is safeMath, module, announcementTypes {
|
|||||||
@value Quantity
|
@value Quantity
|
||||||
*/
|
*/
|
||||||
require( db.increase(owner, value) );
|
require( db.increase(owner, value) );
|
||||||
require( moduleHandler(moduleHandlerAddress).broadcastTransfer(0x00, owner, value) );
|
require( moduleHandler(moduleHandlerAddress).broadcastTransfer(address(0x00), owner, value) );
|
||||||
if ( isICO ) {
|
if ( isICO ) {
|
||||||
require( ico(icoAddr).setInterestDB(owner, db.balanceOf(owner)) );
|
require( ico(icoAddr).setInterestDB(owner, db.balanceOf(owner)) );
|
||||||
}
|
}
|
||||||
@ -453,7 +453,7 @@ contract token is safeMath, module, announcementTypes {
|
|||||||
@value Quantity
|
@value Quantity
|
||||||
*/
|
*/
|
||||||
require( db.decrease(owner, value) );
|
require( db.decrease(owner, value) );
|
||||||
require( moduleHandler(moduleHandlerAddress).broadcastTransfer(owner, 0x00, value) );
|
require( moduleHandler(moduleHandlerAddress).broadcastTransfer(owner, address(0x00), value) );
|
||||||
Burn(owner, value);
|
Burn(owner, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ contract Event {
|
|||||||
public
|
public
|
||||||
{
|
{
|
||||||
// Validate input
|
// Validate input
|
||||||
require(address(_collateralToken) != 0 && address(_oracle) != 0 && outcomeCount >= 2);
|
require(address(_collateralToken) != address(0) && address(_oracle) != address(0) && outcomeCount >= 2);
|
||||||
collateralToken = _collateralToken;
|
collateralToken = _collateralToken;
|
||||||
oracle = _oracle;
|
oracle = _oracle;
|
||||||
// Create an outcome token for each outcome
|
// Create an outcome token for each outcome
|
||||||
|
@ -37,7 +37,7 @@ contract EventFactory {
|
|||||||
{
|
{
|
||||||
bytes32 eventHash = keccak256(collateralToken, oracle, outcomeCount);
|
bytes32 eventHash = keccak256(collateralToken, oracle, outcomeCount);
|
||||||
// Event should not exist yet
|
// Event should not exist yet
|
||||||
require(address(categoricalEvents[eventHash]) == 0);
|
require(address(categoricalEvents[eventHash]) == address(0));
|
||||||
// Create event
|
// Create event
|
||||||
eventContract = new CategoricalEvent(
|
eventContract = new CategoricalEvent(
|
||||||
collateralToken,
|
collateralToken,
|
||||||
@ -65,7 +65,7 @@ contract EventFactory {
|
|||||||
{
|
{
|
||||||
bytes32 eventHash = keccak256(collateralToken, oracle, lowerBound, upperBound);
|
bytes32 eventHash = keccak256(collateralToken, oracle, lowerBound, upperBound);
|
||||||
// Event should not exist yet
|
// Event should not exist yet
|
||||||
require(address(scalarEvents[eventHash]) == 0);
|
require(address(scalarEvents[eventHash]) == address(0));
|
||||||
// Create event
|
// Create event
|
||||||
eventContract = new ScalarEvent(
|
eventContract = new ScalarEvent(
|
||||||
collateralToken,
|
collateralToken,
|
||||||
|
@ -81,9 +81,9 @@ contract Campaign {
|
|||||||
public
|
public
|
||||||
{
|
{
|
||||||
// Validate input
|
// Validate input
|
||||||
require( address(_eventContract) != 0
|
require( address(_eventContract) != address(0)
|
||||||
&& address(_marketFactory) != 0
|
&& address(_marketFactory) != address(0)
|
||||||
&& address(_marketMaker) != 0
|
&& address(_marketMaker) != address(0)
|
||||||
&& _fee < FEE_RANGE
|
&& _fee < FEE_RANGE
|
||||||
&& _funding > 0
|
&& _funding > 0
|
||||||
&& now < _deadline);
|
&& now < _deadline);
|
||||||
|
@ -42,7 +42,7 @@ contract StandardMarket is Market {
|
|||||||
public
|
public
|
||||||
{
|
{
|
||||||
// Validate inputs
|
// Validate inputs
|
||||||
require(address(_eventContract) != 0 && address(_marketMaker) != 0 && _fee < FEE_RANGE);
|
require(address(_eventContract) != address(0) && address(_marketMaker) != address(0) && _fee < FEE_RANGE);
|
||||||
creator = _creator;
|
creator = _creator;
|
||||||
createdAtBlock = block.number;
|
createdAtBlock = block.number;
|
||||||
eventContract = _eventContract;
|
eventContract = _eventContract;
|
||||||
|
@ -36,7 +36,7 @@ contract FutarchyOracleFactory {
|
|||||||
function FutarchyOracleFactory(EventFactory _eventFactory)
|
function FutarchyOracleFactory(EventFactory _eventFactory)
|
||||||
public
|
public
|
||||||
{
|
{
|
||||||
require(address(_eventFactory) != 0);
|
require(address(_eventFactory) != address(0));
|
||||||
eventFactory = _eventFactory;
|
eventFactory = _eventFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ contract MajorityOracle is Oracle {
|
|||||||
require(_oracles.length > 2);
|
require(_oracles.length > 2);
|
||||||
for (uint i = 0; i < _oracles.length; i++)
|
for (uint i = 0; i < _oracles.length; i++)
|
||||||
// Oracle address cannot be null
|
// Oracle address cannot be null
|
||||||
require(address(_oracles[i]) != 0);
|
require(address(_oracles[i]) != address(0));
|
||||||
oracles = _oracles;
|
oracles = _oracles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,8 +57,8 @@ contract UltimateOracle is Oracle {
|
|||||||
public
|
public
|
||||||
{
|
{
|
||||||
// Validate inputs
|
// Validate inputs
|
||||||
require( address(_forwardedOracle) != 0
|
require( address(_forwardedOracle) != address(0)
|
||||||
&& address(_collateralToken) != 0
|
&& address(_collateralToken) != address(0)
|
||||||
&& _spreadMultiplier >= 2
|
&& _spreadMultiplier >= 2
|
||||||
&& _challengePeriod > 0
|
&& _challengePeriod > 0
|
||||||
&& _challengeAmount > 0
|
&& _challengeAmount > 0
|
||||||
|
@ -48,7 +48,7 @@ contract Bounty is PullPayment, Destructible {
|
|||||||
*/
|
*/
|
||||||
function claim(Target target) {
|
function claim(Target target) {
|
||||||
address researcher = researchers[target];
|
address researcher = researchers[target];
|
||||||
if (researcher == 0) {
|
if (researcher == address(0)) {
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
// Check Target contract invariants
|
// Check Target contract invariants
|
||||||
|
@ -67,7 +67,7 @@ contract MultisigWallet is Multisig, Shareable, DayLimit {
|
|||||||
}
|
}
|
||||||
// determine our operation hash.
|
// determine our operation hash.
|
||||||
_r = keccak256(msg.data, block.number);
|
_r = keccak256(msg.data, block.number);
|
||||||
if (!confirm(_r) && txs[_r].to == 0) {
|
if (!confirm(_r) && txs[_r].to == address(0)) {
|
||||||
txs[_r].to = _to;
|
txs[_r].to = _to;
|
||||||
txs[_r].value = _value;
|
txs[_r].value = _value;
|
||||||
txs[_r].data = _data;
|
txs[_r].data = _data;
|
||||||
@ -81,7 +81,7 @@ contract MultisigWallet is Multisig, Shareable, DayLimit {
|
|||||||
* @param _h The transaction hash to approve.
|
* @param _h The transaction hash to approve.
|
||||||
*/
|
*/
|
||||||
function confirm(bytes32 _h) onlymanyowners(_h) returns (bool) {
|
function confirm(bytes32 _h) onlymanyowners(_h) returns (bool) {
|
||||||
if (txs[_h].to != 0) {
|
if (txs[_h].to != address(0)) {
|
||||||
if (!txs[_h].to.call.value(txs[_h].value)(txs[_h].data)) {
|
if (!txs[_h].to.call.value(txs[_h].value)(txs[_h].data)) {
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ contract Crowdsale {
|
|||||||
require(_startBlock >= block.number);
|
require(_startBlock >= block.number);
|
||||||
require(_endBlock >= _startBlock);
|
require(_endBlock >= _startBlock);
|
||||||
require(_rate > 0);
|
require(_rate > 0);
|
||||||
require(_wallet != 0x0);
|
require(_wallet != address(0x0));
|
||||||
|
|
||||||
token = createTokenContract();
|
token = createTokenContract();
|
||||||
startBlock = _startBlock;
|
startBlock = _startBlock;
|
||||||
@ -67,7 +67,7 @@ contract Crowdsale {
|
|||||||
|
|
||||||
// low level token purchase function
|
// low level token purchase function
|
||||||
function buyTokens(address beneficiary) payable {
|
function buyTokens(address beneficiary) payable {
|
||||||
require(beneficiary != 0x0);
|
require(beneficiary != address(0x0));
|
||||||
require(validPurchase());
|
require(validPurchase());
|
||||||
|
|
||||||
uint256 weiAmount = msg.value;
|
uint256 weiAmount = msg.value;
|
||||||
|
@ -23,7 +23,7 @@ contract RefundVault is Ownable {
|
|||||||
event Refunded(address indexed beneficiary, uint256 weiAmount);
|
event Refunded(address indexed beneficiary, uint256 weiAmount);
|
||||||
|
|
||||||
function RefundVault(address _wallet) {
|
function RefundVault(address _wallet) {
|
||||||
require(_wallet != 0x0);
|
require(_wallet != address(0x0));
|
||||||
wallet = _wallet;
|
wallet = _wallet;
|
||||||
state = State.Active;
|
state = State.Active;
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,6 @@ contract Claimable is Ownable {
|
|||||||
*/
|
*/
|
||||||
function claimOwnership() onlyPendingOwner {
|
function claimOwnership() onlyPendingOwner {
|
||||||
owner = pendingOwner;
|
owner = pendingOwner;
|
||||||
pendingOwner = 0x0;
|
pendingOwner = address(0x0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ contract DelayedClaimable is Claimable {
|
|||||||
if ((block.number > end) || (block.number < start))
|
if ((block.number > end) || (block.number < start))
|
||||||
throw;
|
throw;
|
||||||
owner = pendingOwner;
|
owner = pendingOwner;
|
||||||
pendingOwner = 0x0;
|
pendingOwner = address(0x0);
|
||||||
end = 0;
|
end = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user