I've just downloaded Mist 0.9.0 and I tried to compile a new contract but it does not let me do it with this error:
"throw" is deprecated in favour of "revert()", "require()" and "assert()".
throw;
^---^
In this code caused by the modifier onlyOwner:
/*
* Ownable
*
* Base contract with an owner.
* Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.
*/
contract Ownable {
address public owner;
function Ownable() {
owner = msg.sender;
}
modifier onlyOwner() {
if (msg.sender != owner) {
throw;
}
_;
}
function transferOwnership(address newOwner) onlyOwner {
if (newOwner != address(0)) {
owner = newOwner;
}
}
}
I'm not a Solidity developer, is it correct this edit?
modifier onlyOwner() {
require (msg.sender != owner);
_;
}
require(msg.sender == owner);. – Ismael Sep 10 '17 at 17:36