Commit 2d97b6b4 by Francisco Giordano

Merge upstream release-v4.5 into patched/release-v4.5

name: Build Docs
on:
push: release-v*
push:
branches: [release-v*]
jobs:
trigger:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
......
......@@ -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,
......
......@@ -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}`);
diff --git a/contracts/mocks/MulticallTokenMockUpgradeable.sol b/contracts/mocks/MulticallTokenMockUpgradeable.sol
index d06c8722..6211da1f 100644
index 7bd4ae88..7be0c4ff 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);
}
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 {
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 {
}
/**
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment