TokenMarketNet/smart-contracts

check condition first, then change state

Opened this issue · 1 comments

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?