WeTrustPlatform / charity-challenge-contracts

Smart contracts for charity challenge
GNU Lesser General Public License v3.0
1 stars 1 forks source link

fix re-entrant bug #8

Closed sihoang closed 5 years ago

sihoang commented 5 years ago

The order of .transfer matters the most. If users address is a smart contract, the transfer method will trigger their default payable method which could do malicious things like calling our claim method again.

Adding nonreentrant modifier is for super conservative in the event of protocol bug like Constantinople https://blog.ethereum.org/2019/01/15/security-alert-ethereum-constantinople-postponement/