smart-contracts
smart-contracts copied to clipboard
check condition first, then change state
https://github.com/TokenMarketNet/ico/blob/master/contracts/CrowdsaleBase.sol#L250
I believe that the check that if the contract is finalizeAgent should be done first and only then to modify state variable
function setFinalizeAgent(FinalizeAgent addr) onlyOwner {
require(addr.isFinalizeAgent());
finalizeAgent = addr;
}
Why does it matter, if the tx is being reverted if the check fails?