This line of code changes state when a new owner is set, but remix still wants to me to mark the declaration with view
, which reads from the contract.
Why is that?
pragma solidity ^0.8.7;
function setOwner(address _newOwner) external onlyOwner {
require(_newOwner != address(0), "invalid address");
owner == _newOwner;
}
View causes me to not be able to properly set (change) state.