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 {
}
/**
diff --git a/contracts/governance/compatibility/GovernorCompatibilityBravoUpgradeable.sol b/contracts/governance/compatibility/GovernorCompatibilityBravoUpgradeable.sol
index 1f6895a6..86518b84 100644
--- a/contracts/governance/compatibility/GovernorCompatibilityBravoUpgradeable.sol
+++ b/contracts/governance/compatibility/GovernorCompatibilityBravoUpgradeable.sol
@@ -21,7 +21,6 @@ abstract contract GovernorCompatibilityBravoUpgradeable is Initializable, IGover
function __GovernorCompatibilityBravo_init() internal onlyInitializing {
__Context_init_unchained();
__ERC165_init_unchained();
- __EIP712_init_unchained(name_, version());
__IGovernor_init_unchained();
__IGovernorTimelock_init_unchained();
__IGovernorCompatibilityBravo_init_unchained();
diff --git a/contracts/governance/extensions/GovernorCountingSimpleUpgradeable.sol b/contracts/governance/extensions/GovernorCountingSimpleUpgradeable.sol
index 4873166b..6a88e6b4 100644
--- a/contracts/governance/extensions/GovernorCountingSimpleUpgradeable.sol
+++ b/contracts/governance/extensions/GovernorCountingSimpleUpgradeable.sol
@@ -14,7 +14,6 @@ abstract contract GovernorCountingSimpleUpgradeable is Initializable, GovernorUp
function __GovernorCountingSimple_init() internal onlyInitializing {
__Context_init_unchained();
__ERC165_init_unchained();
- __EIP712_init_unchained(name_, version());
__IGovernor_init_unchained();
__GovernorCountingSimple_init_unchained();
}
diff --git a/contracts/governance/extensions/GovernorTimelockCompoundUpgradeable.sol b/contracts/governance/extensions/GovernorTimelockCompoundUpgradeable.sol
index c6ed355a..9236c546 100644
--- a/contracts/governance/extensions/GovernorTimelockCompoundUpgradeable.sol
+++ b/contracts/governance/extensions/GovernorTimelockCompoundUpgradeable.sol
@@ -96,7 +96,6 @@ abstract contract GovernorTimelockCompoundUpgradeable is Initializable, IGoverno
function __GovernorTimelockCompound_init(ICompoundTimelockUpgradeable timelockAddress) internal onlyInitializing {
__Context_init_unchained();
__ERC165_init_unchained();
- __EIP712_init_unchained(name_, version());
__IGovernor_init_unchained();
__IGovernorTimelock_init_unchained();
__GovernorTimelockCompound_init_unchained(timelockAddress);
diff --git a/contracts/governance/extensions/GovernorTimelockControlUpgradeable.sol b/contracts/governance/extensions/GovernorTimelockControlUpgradeable.sol
index 3d6a5de5..ad5f505e 100644
--- a/contracts/governance/extensions/GovernorTimelockControlUpgradeable.sol
+++ b/contracts/governance/extensions/GovernorTimelockControlUpgradeable.sol
@@ -33,7 +33,6 @@ abstract contract GovernorTimelockControlUpgradeable is Initializable, IGovernor
function __GovernorTimelockControl_init(TimelockControllerUpgradeable timelockAddress) internal onlyInitializing {
__Context_init_unchained();
__ERC165_init_unchained();
- __EIP712_init_unchained(name_, version());
__IGovernor_init_unchained();
__IGovernorTimelock_init_unchained();
__GovernorTimelockControl_init_unchained(timelockAddress);
diff --git a/contracts/governance/extensions/GovernorVotesCompUpgradeable.sol b/contracts/governance/extensions/GovernorVotesCompUpgradeable.sol
index cc83b3ed..5398f15b 100644
--- a/contracts/governance/extensions/GovernorVotesCompUpgradeable.sol
+++ b/contracts/governance/extensions/GovernorVotesCompUpgradeable.sol
@@ -17,7 +17,6 @@ abstract contract GovernorVotesCompUpgradeable is Initializable, GovernorUpgrade
function __GovernorVotesComp_init(ERC20VotesCompUpgradeable token_) internal onlyInitializing {
__Context_init_unchained();
__ERC165_init_unchained();
- __EIP712_init_unchained(name_, version());
__IGovernor_init_unchained();
__GovernorVotesComp_init_unchained(token_);
}
diff --git a/contracts/governance/extensions/GovernorVotesQuorumFractionUpgradeable.sol b/contracts/governance/extensions/GovernorVotesQuorumFractionUpgradeable.sol
index 5d7a88bc..39f97903 100644
--- a/contracts/governance/extensions/GovernorVotesQuorumFractionUpgradeable.sol
+++ b/contracts/governance/extensions/GovernorVotesQuorumFractionUpgradeable.sol
@@ -19,7 +19,6 @@ abstract contract GovernorVotesQuorumFractionUpgradeable is Initializable, Gover
function __GovernorVotesQuorumFraction_init(uint256 quorumNumeratorValue) internal onlyInitializing {
__Context_init_unchained();
__ERC165_init_unchained();
- __EIP712_init_unchained(name_, version());
__IGovernor_init_unchained();
__GovernorVotesQuorumFraction_init_unchained(quorumNumeratorValue);
}
diff --git a/contracts/governance/extensions/GovernorVotesUpgradeable.sol b/contracts/governance/extensions/GovernorVotesUpgradeable.sol
index cdfd0ae7..48408d9c 100644
--- a/contracts/governance/extensions/GovernorVotesUpgradeable.sol
+++ b/contracts/governance/extensions/GovernorVotesUpgradeable.sol
@@ -18,7 +18,6 @@ abstract contract GovernorVotesUpgradeable is Initializable, GovernorUpgradeable
function __GovernorVotes_init(IVotesUpgradeable tokenAddress) internal onlyInitializing {
__Context_init_unchained();
__ERC165_init_unchained();
- __EIP712_init_unchained(name_, version());
__IGovernor_init_unchained();
__GovernorVotes_init_unchained(tokenAddress);
}
diff --git a/contracts/governance/extensions/GovernorProposalThresholdUpgradeable.sol b/contracts/governance/extensions/GovernorProposalThresholdUpgradeable.sol
index c66ebc16..3bba9501 100644
--- a/contracts/governance/extensions/GovernorProposalThresholdUpgradeable.sol
+++ b/contracts/governance/extensions/GovernorProposalThresholdUpgradeable.sol
@@ -14,7 +14,6 @@ abstract contract GovernorProposalThresholdUpgradeable is Initializable, Governo
function __GovernorProposalThreshold_init() internal onlyInitializing {
__Context_init_unchained();
__ERC165_init_unchained();
- __EIP712_init_unchained(name_, version());
__IGovernor_init_unchained();
__GovernorProposalThreshold_init_unchained();
}
diff --git a/contracts/governance/extensions/GovernorSettingsUpgradeable.sol b/contracts/governance/extensions/GovernorSettingsUpgradeable.sol
index fbbb5ec1..06e8b9dd 100644
--- a/contracts/governance/extensions/GovernorSettingsUpgradeable.sol
+++ b/contracts/governance/extensions/GovernorSettingsUpgradeable.sol
@@ -30,7 +30,6 @@ abstract contract GovernorSettingsUpgradeable is Initializable, GovernorUpgradea
) internal onlyInitializing {
__Context_init_unchained();
__ERC165_init_unchained();
- __EIP712_init_unchained(name_, version());
__IGovernor_init_unchained();
__GovernorSettings_init_unchained(initialVotingDelay, initialVotingPeriod, initialProposalThreshold);
}
diff --git a/contracts/mocks/wizard/MyGovernor1Upgradeable.sol b/contracts/mocks/wizard/MyGovernor1Upgradeable.sol
index df6ccdaf..db9998ed 100644
index 66662e9e..c53c6479 100644
--- a/contracts/mocks/wizard/MyGovernor1Upgradeable.sol
+++ b/contracts/mocks/wizard/MyGovernor1Upgradeable.sol
@@ -18,7 +18,7 @@ contract MyGovernor1Upgradeable is
@@ -16,7 +16,7 @@ contract MyGovernor1Upgradeable is
GovernorCountingSimpleUpgradeable
{
function __MyGovernor1_init(IVotesUpgradeable _token, TimelockControllerUpgradeable _timelock) internal onlyInitializing {
__Context_init_unchained();
__ERC165_init_unchained();
- __EIP712_init_unchained(name_, version());
+ __EIP712_init_unchained("MyGovernor", version());
__IGovernor_init_unchained();
__IGovernorTimelock_init_unchained();
__Governor_init_unchained("MyGovernor");
__GovernorTimelockControl_init_unchained(_timelock);
__GovernorVotes_init_unchained(_token);
diff --git a/contracts/mocks/wizard/MyGovernor2Upgradeable.sol b/contracts/mocks/wizard/MyGovernor2Upgradeable.sol
index b07261a4..4ec9b6ce 100644
index 63bc024c..0f854226 100644
--- a/contracts/mocks/wizard/MyGovernor2Upgradeable.sol
+++ b/contracts/mocks/wizard/MyGovernor2Upgradeable.sol
@@ -20,7 +20,7 @@ contract MyGovernor2Upgradeable is
@@ -18,7 +18,7 @@ contract MyGovernor2Upgradeable is
GovernorCountingSimpleUpgradeable
{
function __MyGovernor2_init(IVotesUpgradeable _token, TimelockControllerUpgradeable _timelock) internal onlyInitializing {
__Context_init_unchained();
__ERC165_init_unchained();
- __EIP712_init_unchained(name_, version());
+ __EIP712_init_unchained("MyGovernor", version());
__IGovernor_init_unchained();
__IGovernorTimelock_init_unchained();
__Governor_init_unchained("MyGovernor");
__GovernorTimelockControl_init_unchained(_timelock);
__GovernorVotes_init_unchained(_token);
diff --git a/contracts/mocks/wizard/MyGovernor3Upgradeable.sol b/contracts/mocks/wizard/MyGovernor3Upgradeable.sol
index 223ccb94..e05b6ce7 100644
index 27a8411c..2f59b8e5 100644
--- a/contracts/mocks/wizard/MyGovernor3Upgradeable.sol
+++ b/contracts/mocks/wizard/MyGovernor3Upgradeable.sol
@@ -18,7 +18,7 @@ contract MyGovernorUpgradeable is
@@ -16,7 +16,7 @@ contract MyGovernorUpgradeable is
GovernorVotesQuorumFractionUpgradeable
{
function __MyGovernor_init(IVotesUpgradeable _token, TimelockControllerUpgradeable _timelock) internal onlyInitializing {
__Context_init_unchained();
__ERC165_init_unchained();
- __EIP712_init_unchained(name_, version());
+ __EIP712_init_unchained("MyGovernor", version());
__IGovernor_init_unchained();
__IGovernorTimelock_init_unchained();
__IGovernorCompatibilityBravo_init_unchained();
diff --git a/contracts/governance/extensions/GovernorPreventLateQuorumUpgradeable.sol b/contracts/governance/extensions/GovernorPreventLateQuorumUpgradeable.sol
index 9b48de71..c28f3b50 100644
--- a/contracts/governance/extensions/GovernorPreventLateQuorumUpgradeable.sol
+++ b/contracts/governance/extensions/GovernorPreventLateQuorumUpgradeable.sol
@@ -38,7 +38,6 @@ abstract contract GovernorPreventLateQuorumUpgradeable is Initializable, Governo
function __GovernorPreventLateQuorum_init(uint64 initialVoteExtension) internal onlyInitializing {
__Context_init_unchained();
__ERC165_init_unchained();
- __EIP712_init_unchained(name_, version());
__IGovernor_init_unchained();
__GovernorPreventLateQuorum_init_unchained(initialVoteExtension);
}
__Governor_init_unchained("MyGovernor");
__GovernorTimelockControl_init_unchained(_timelock);
__GovernorVotes_init_unchained(_token);
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