mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #4481 from ethereum/disallow-throw
[BREAKING] Deprecate the throw statement
This commit is contained in:
@@ -125,26 +125,26 @@ contract GlobalRegistrar is Registrar, AuctionSystem {
|
||||
emit Changed(_name);
|
||||
if (previousOwner != 0x0000000000000000000000000000000000000000) {
|
||||
if (!record.owner.send(auction.sumOfBids - auction.highestBid / 100))
|
||||
throw;
|
||||
revert();
|
||||
} else {
|
||||
if (!auction.highestBidder.send(auction.highestBid - auction.secondHighestBid))
|
||||
throw;
|
||||
revert();
|
||||
}
|
||||
}
|
||||
|
||||
function reserve(string _name) external payable {
|
||||
if (bytes(_name).length == 0)
|
||||
throw;
|
||||
revert();
|
||||
bool needAuction = requiresAuction(_name);
|
||||
if (needAuction)
|
||||
{
|
||||
if (now < m_toRecord[_name].renewalDate)
|
||||
throw;
|
||||
revert();
|
||||
bid(_name, msg.sender, msg.value);
|
||||
} else {
|
||||
Record storage record = m_toRecord[_name];
|
||||
if (record.owner != 0x0000000000000000000000000000000000000000)
|
||||
throw;
|
||||
revert();
|
||||
m_toRecord[_name].owner = msg.sender;
|
||||
emit Changed(_name);
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ contract FixedFeeRegistrar is Registrar {
|
||||
function disown(string memory _name, address _refund) onlyrecordowner(_name) public {
|
||||
delete m_recordData[uint(keccak256(bytes(_name))) / 8];
|
||||
if (!_refund.send(c_fee))
|
||||
throw;
|
||||
revert();
|
||||
emit Changed(_name);
|
||||
}
|
||||
function transfer(string memory _name, address _newOwner) onlyrecordowner(_name) public {
|
||||
|
||||
Reference in New Issue
Block a user