When I'm trying to deploy contracts that contain assert
and require
using truffle I receive
Error: Undeclared identifier.
e.g:
pragma solidity ^0.4.8;
contract Owned{
address public owner = msg.sender;
modifier onlyOwner(){
assert(msg.sender == owner);
_;
}
function kill() onlyOwner{
require(msg.sender ==owner);
suicide(owner);
}
}
I know that in the past truffle created its own assert.sol
but surely they've updated it to be consistent with Solidity, and it doesn't explain why require
also fail.
I'll highly appreciate any thoughts on how to overcome this issue.