poanetwork / poa-popa

DApp for proof of physical address (PoPA) attestation for validators of POA Network
https://popa.poa.network
GNU General Public License v3.0
24 stars 18 forks source link

(Refactor) use assertion to check keccakIdentifier #148

Closed phahulin closed 6 years ago

phahulin commented 6 years ago

https://github.com/poanetwork/poa-popa/blob/master/blockchain/contracts/ProofOfPhysicalAddress.sol#L123 this condition should (almost) never be true, it's much more likely that keccakIdentifier == 0x0 because of some logical error in code, so it's recommended to replace conditional if (...) { return false } with assertion

assert(keccakIdentifier != 0x0)