Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
openzeppelin-contracts-upgradeable
Commits
2d97b6b4
Commit
2d97b6b4
authored
Jan 31, 2022
by
Francisco Giordano
Browse files
Options
Browse Files
Download
Plain Diff
Merge upstream release-v4.5 into patched/release-v4.5
parents
5a8b8399
863ded1d
6b6e1b5e
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
29 additions
and
59 deletions
+29
-59
docs.yml
.github/workflows/docs.yml
+3
-2
SignatureChecker.sol
contracts/utils/cryptography/SignatureChecker.sol
+10
-6
update-docs-branch.js
scripts/update-docs-branch.js
+11
-11
02-add-missing-mock-arguments.patch
...pts/upgradeable/patch/02-add-missing-mock-arguments.patch
+5
-5
03-remove-erc20votes-chained-init.patch
...upgradeable/patch/03-remove-erc20votes-chained-init.patch
+0
-17
04-remove-erc20votes-comp-chained-init.patch
...deable/patch/04-remove-erc20votes-comp-chained-init.patch
+0
-18
05-fix-governor-initializers.patch
scripts/upgradeable/patch/05-fix-governor-initializers.patch
+0
-0
No files found.
.github/workflows/docs.yml
View file @
2d97b6b4
name
:
Build Docs
on
:
push
:
release-v*
push
:
branches
:
[
release-v*
]
jobs
:
trigger
:
build
:
runs-on
:
ubuntu-latest
steps
:
-
uses
:
actions/checkout@v2
...
...
contracts/utils/cryptography/SignatureChecker.sol
View file @
2d97b6b4
...
...
@@ -8,16 +8,20 @@ import "../Address.sol";
import "../../interfaces/IERC1271.sol";
/**
* @dev Signature verification helper: Provide a single mechanism to verify both private-key (EOA) ECDSA signature and
* ERC1271 contract signatures. Using this instead of ECDSA.recover in your contract will make them compatible with
* smart contract wallets such as Argent and Gnosis.
*
* Note: unlike ECDSA signatures, contract signature's are revocable, and the outcome of this function can thus change
* through time. It could return true at block N and false at block N+1 (or the opposite).
* @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA
* signatures from externally owned accounts (EOAs) as well as ERC1271 signatures from smart contract wallets like
* Argent and Gnosis Safe.
*
* _Available since v4.1._
*/
library SignatureChecker {
/**
* @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the
* signature is validated against that smart contract using ERC1271, otherwise it's validated using `ECDSA.recover`.
*
* NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus
* change through time. It could return true at block N and false at block N+1 (or the opposite).
*/
function isValidSignatureNow(
address signer,
bytes32 hash,
...
...
scripts/update-docs-branch.js
View file @
2d97b6b4
...
...
@@ -5,16 +5,16 @@ const tryRead = cmd => { try { return read(cmd); } catch (e) { return undefined;
const
releaseBranchRegex
=
/^release-v
(?<
version>
(?<
major>
\d
+
)\.(?<
minor>
\d
+
)(?:\.(?<
patch>
\d
+
))?)
$/
;
const
currentBranch
=
read
(
`git rev-parse --abbrev-ref HEAD`
);
const
currentBranch
=
read
(
'git rev-parse --abbrev-ref HEAD'
);
const
match
=
currentBranch
.
match
(
releaseBranchRegex
);
if
(
!
match
)
{
console
.
error
(
`Not currently on a release branch`
);
console
.
error
(
'Not currently on a release branch'
);
process
.
exit
(
1
);
}
if
(
/-.*$/
.
test
(
require
(
'../package.json'
).
version
))
{
console
.
error
(
`Refusing to update docs: prerelease detected`
);
console
.
error
(
'Refusing to update docs: prerelease detected'
);
process
.
exit
(
0
);
}
...
...
@@ -22,7 +22,7 @@ const current = match.groups;
const
docsBranch
=
`docs-v
${
current
.
major
}
.x`
;
// Fetch remotes and find the docs branch if it exists
run
(
`git fetch --all --no-tags`
);
run
(
'git fetch --all --no-tags'
);
const
matchingDocsBranches
=
tryRead
(
`git rev-parse --glob='*/
${
docsBranch
}
'`
);
if
(
!
matchingDocsBranches
)
{
...
...
@@ -32,24 +32,24 @@ if (!matchingDocsBranches) {
const
[
publishedRef
,
...
others
]
=
new
Set
(
matchingDocsBranches
.
split
(
'
\
n'
));
if
(
others
.
length
>
0
)
{
console
.
error
(
`Found conflicting
${
docsBranch
}
branches.\n`
+
`Either local branch is outdated or there are multiple matching remote branches.`
`Found conflicting
${
docsBranch
}
branches.\n`
+
'Either local branch is outdated or there are multiple matching remote branches.'
,
);
process
.
exit
(
1
);
}
const
publishedVersion
=
JSON
.
parse
(
read
(
`git show
${
publishedRef
}
:package.json`
)).
version
;
const
publishedMinor
=
publishedVersion
.
match
(
/
\d
+
\.(?<
minor>
\d
+
)\.\d
+/
).
groups
.
minor
;
if
(
current
.
minor
<
publishedMinor
)
{
console
.
error
(
`Refusing to update docs: newer version is published`
);
console
.
error
(
'Refusing to update docs: newer version is published'
);
process
.
exit
(
0
);
}
run
(
`git checkout --quiet --detach`
);
run
(
'git checkout --quiet --detach'
);
run
(
`git reset --soft
${
publishedRef
}
`
);
run
(
`git checkout
${
docsBranch
}
`
);
}
run
(
`npm run prepare-docs`
);
run
(
`git add -f docs`
);
// --force needed because generated docs files are gitignored
run
(
`git commit -m "Update docs"`
);
run
(
'npm run prepare-docs'
);
run
(
'git add -f docs'
);
// --force needed because generated docs files are gitignored
run
(
'git commit -m "Update docs"'
);
run
(
`git checkout
${
currentBranch
}
`
);
scripts/upgradeable/patch/02-add-missing-mock-arguments.patch
View file @
2d97b6b4
diff --git a/contracts/mocks/MulticallTokenMockUpgradeable.sol b/contracts/mocks/MulticallTokenMockUpgradeable.sol
index
d06c8722..6211da1
f 100644
index
7bd4ae88..7be0c4f
f 100644
--- a/contracts/mocks/MulticallTokenMockUpgradeable.sol
+++ b/contracts/mocks/MulticallTokenMockUpgradeable.sol
@@ -9,7 +9,7 @@ import "../proxy/utils/Initializable.sol";
@@ -8,7 +8,7 @@ import "../proxy/utils/Initializable.sol";
contract MulticallTokenMockUpgradeable is Initializable, ERC20MockUpgradeable, MulticallUpgradeable {
function __MulticallTokenMock_init(uint256 initialBalance) internal onlyInitializing {
__Context_init_unchained();
- __ERC20_init_unchained(name, symbol);
+ __ERC20_init_unchained("MulticallToken", "BCT");
__ERC20Mock_init_unchained("MulticallToken", "BCT", msg.sender, initialBalance);
__Multicall_init_unchained();
__MulticallTokenMock_init_unchained(initialBalance);
}
scripts/upgradeable/patch/03-remove-erc20votes-chained-init.patch
deleted
100644 → 0
View file @
5a8b8399
diff --git a/contracts/token/ERC20/extensions/ERC20VotesUpgradeable.sol b/contracts/token/ERC20/extensions/ERC20VotesUpgradeable.sol
index a7a9af54..0b7f838d 100644
--- a/contracts/token/ERC20/extensions/ERC20VotesUpgradeable.sol
+++ b/contracts/token/ERC20/extensions/ERC20VotesUpgradeable.sol
@@ -24,12 +24,6 @@ import "../../../proxy/utils/Initializable.sol";
* _Available since v4.2._
*/
abstract contract ERC20VotesUpgradeable is Initializable, IVotesUpgradeable, ERC20PermitUpgradeable {
- function __ERC20Votes_init() internal onlyInitializing {
- __Context_init_unchained();
- __EIP712_init_unchained(name, "1");
- __ERC20Votes_init_unchained();
- }
-
function __ERC20Votes_init_unchained() internal onlyInitializing {
}
struct Checkpoint {
scripts/upgradeable/patch/04-remove-erc20votes-comp-chained-init.patch
deleted
100644 → 0
View file @
5a8b8399
diff --git a/contracts/token/ERC20/extensions/ERC20VotesCompUpgradeable.sol b/contracts/token/ERC20/extensions/ERC20VotesCompUpgradeable.sol
index 6f1f8182..0f09ea48 100644
--- a/contracts/token/ERC20/extensions/ERC20VotesCompUpgradeable.sol
+++ b/contracts/token/ERC20/extensions/ERC20VotesCompUpgradeable.sol
@@ -25,13 +25,6 @@ import "../../../proxy/utils/Initializable.sol";
* _Available since v4.2._
*/
abstract contract ERC20VotesCompUpgradeable is Initializable, ERC20VotesUpgradeable {
- function __ERC20VotesComp_init() internal onlyInitializing {
- __Context_init_unchained();
- __EIP712_init_unchained(name, "1");
- __ERC20Votes_init_unchained();
- __ERC20VotesComp_init_unchained();
- }
-
function __ERC20VotesComp_init_unchained() internal onlyInitializing {
}
/**
scripts/upgradeable/patch/05-fix-governor-initializers.patch
View file @
2d97b6b4
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment