Update docs
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts (last updated v4.7.0) (security/PullPayment.sol)
|
||||
// OpenZeppelin Contracts (last updated v4.8.0) (security/PullPayment.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
@ -7,7 +7,7 @@ import "../utils/escrow/Escrow.sol";
|
||||
|
||||
/**
|
||||
* @dev Simple implementation of a
|
||||
* https://consensys.github.io/smart-contract-best-practices/recommendations/#favor-pull-over-push-for-external-calls[pull-payment]
|
||||
* https://consensys.github.io/smart-contract-best-practices/development-recommendations/general/external-calls/#favor-pull-over-push-for-external-calls[pull-payment]
|
||||
* strategy, where the paying contract doesn't interact directly with the
|
||||
* receiver account, which must withdraw its payments itself.
|
||||
*
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)
|
||||
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
@ -48,14 +48,20 @@ abstract contract ReentrancyGuard {
|
||||
* `private` function that does the actual work.
|
||||
*/
|
||||
modifier nonReentrant() {
|
||||
// On the first call to nonReentrant, _notEntered will be true
|
||||
_nonReentrantBefore();
|
||||
_;
|
||||
_nonReentrantAfter();
|
||||
}
|
||||
|
||||
function _nonReentrantBefore() private {
|
||||
// On the first call to nonReentrant, _status will be _NOT_ENTERED
|
||||
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
|
||||
|
||||
// Any calls to nonReentrant after this point will fail
|
||||
_status = _ENTERED;
|
||||
}
|
||||
|
||||
_;
|
||||
|
||||
function _nonReentrantAfter() private {
|
||||
// By storing the original value once again, a refund is triggered (see
|
||||
// https://eips.ethereum.org/EIPS/eip-2200)
|
||||
_status = _NOT_ENTERED;
|
||||
|
||||
Reference in New Issue
Block a user