0
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)

What is the purpose of this line?

https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/ownership/Ownable.sol

1 Answer 1

1

This line defines an event which can be emitted after something takes place. Clients can then listen for this event and react when it happens. http://solidity.readthedocs.io/en/develop/contracts.html#events

3
  • Is it necessary for the ownership of a contract to be transferred? Or is it just an extra functionality? Mar 12, 2018 at 17:01
  • No.. smart contracts can't be edited once deployed. So its good to put it in there just in case. Mar 12, 2018 at 20:08
  • But we can still change the owner address without the event. What do you mean? Mar 13, 2018 at 0:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.