transmissions11 / solmate

Modern, opinionated, and gas optimized building blocks for smart contract development.
GNU Affero General Public License v3.0
3.93k stars 645 forks source link

Fixed initial state of 'locked' in ReentrancyGuard for compatibility with proxy contracts #376

Closed guvenemirhan closed 1 year ago

guvenemirhan commented 1 year ago

Description

in the ReentrancyGuard contract, 'locked' is set to = 1. However, when used with proxy contracts, 'locked' is initialized with 0. This leads to "REENTRANCY" error.

Checklist

Ensure you completed all of the steps below before submitting your pull request:

Pull requests with an incomplete checklist will be thrown out.