truffle-box / react-auth-box

Truffle, Webpack, React, Redux boilerplate with routing and authentication via a smart contract.
https://truffle-box.github.io/
MIT License
176 stars 66 forks source link

Update contracts/Authentication.sol::: #17

Closed DOkwufulueze closed 6 years ago

DOkwufulueze commented 7 years ago

Use Modifier [onlyExistingUser] to ensure that only existing users can login. Use Modifier [onlyValidName] to ensure names are sent when signing up. Use the two modifiers [onlyExisitingUser and onlyValidName] to ensure safe update.

The use of modifiers is to conform to the warning that throw is deprecated in favour of "revert()", "require()", and "assert()".

OnlyOneJMJQ commented 6 years ago

This is great thank you @DOkwufulueze !

Snerken commented 6 years ago

That's all well and good, but how do you change throw to revert(), require() or assert()?

  function killCoin() public returns (bool status) {
    if (msg.sender != minter) throw;
    selfdestruct(minter);
  }

The code won't compile if I replace throw with any of this lot.