forked from OpenZeppelin/openzeppelin-contracts
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into next-v5.0
- Loading branch information
Showing
144 changed files
with
14,296 additions
and
13,263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ coverage: | |
patch: | ||
default: | ||
target: 95% | ||
only_pulls: true | ||
project: | ||
default: | ||
threshold: 1% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: changelog | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- labeled | ||
- unlabeled | ||
|
||
concurrency: | ||
group: changelog-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'ignore-changelog') }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Check diff | ||
run: | | ||
git fetch origin ${{ github.base_ref }} --depth=1 | ||
if git diff --exit-code origin/${{ github.base_ref }} -- CHANGELOG.md ; then | ||
echo 'Missing changelog entry' | ||
exit 1 | ||
fi | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "lib/forge-std"] | ||
path = lib/forge-std | ||
url = https://github.com/foundry-rs/forge-std |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// SPDX-License-Identifier: MIT | ||
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
import "./Ownable.sol"; | ||
|
||
/** | ||
* @dev Contract module which provides access control mechanism, where | ||
* there is an account (an owner) that can be granted exclusive access to | ||
* specific functions. | ||
* | ||
* By default, the owner account will be the one that deploys the contract. This | ||
* can later be changed with {transferOwnership} and {acceptOwnership}. | ||
* | ||
* This module is used through inheritance. It will make available all functions | ||
* from parent (Ownable). | ||
*/ | ||
abstract contract Ownable2Step is Ownable { | ||
address private _pendingOwner; | ||
|
||
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner); | ||
|
||
/** | ||
* @dev Returns the address of the pending owner. | ||
*/ | ||
function pendingOwner() public view virtual returns (address) { | ||
return _pendingOwner; | ||
} | ||
|
||
/** | ||
* @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. | ||
* Can only be called by the current owner. | ||
*/ | ||
function transferOwnership(address newOwner) public virtual override onlyOwner { | ||
_pendingOwner = newOwner; | ||
emit OwnershipTransferStarted(owner(), newOwner); | ||
} | ||
|
||
/** | ||
* @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner. | ||
* Internal function without access restriction. | ||
*/ | ||
function _transferOwnership(address newOwner) internal virtual override { | ||
delete _pendingOwner; | ||
super._transferOwnership(newOwner); | ||
} | ||
|
||
/** | ||
* @dev The new owner accepts the ownership transfer. | ||
*/ | ||
function acceptOwnership() external { | ||
address sender = _msgSender(); | ||
require(pendingOwner() == sender, "Ownable2Step: caller is not the new owner"); | ||
_transferOwnership(sender); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.