Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
cd07e1b
Remove cross-chain contracts
Amxx May 16, 2023
42b3aef
Remove Escrow & PullPayment contracts
Amxx May 16, 2023
ff68a57
Remove ERC777
Amxx May 16, 2023
18e63a7
Update documentation's nav
Amxx May 16, 2023
64bf67c
add changeset
Amxx May 16, 2023
aeb12fa
Remove the Timer libary
Amxx May 16, 2023
0ea8756
Remove deprecated draft-xxx files.
Amxx May 16, 2023
3344612
Remove getters with error strings
Amxx May 16, 2023
5624e52
Remove SafeERC20.safeApprove
Amxx May 16, 2023
0a3ccc2
Remove AccessControl._setupRole
Amxx May 16, 2023
f3e4e14
Remove deprecated getters in Proxy & deprecated error code in ECDSA
Amxx May 16, 2023
a06d55f
Remove GovernorProposalThreshold
Amxx May 16, 2023
a949b62
Remove ERC1820Implementer
Amxx May 16, 2023
6831f92
fix lint
Amxx May 16, 2023
7b385c6
remove tests for ERC1820Implementer
Amxx May 16, 2023
cd0407f
fix test/urils/Create2.test.js dependency on ERC1820Implementer
Amxx May 16, 2023
edc27fe
remove deprecated and duplicate storage
Amxx May 16, 2023
69c5dee
Remove Checkpoints.History
Amxx May 17, 2023
c974e7f
Remove SafeMath.sol and move tryXxx function to Math.sol
Amxx May 17, 2023
d39ab48
re-add PullPayment (with immutable ownership of the Escrow)
Amxx May 17, 2023
b2be20e
Revert "re-add PullPayment (with immutable ownership of the Escrow)"
Amxx May 17, 2023
f714926
Update "_Available since" for tryXxx operations
Amxx May 19, 2023
15639d7
Apply suggestions from code review
Amxx May 19, 2023
e519bc3
Update Math.test.js
Amxx May 19, 2023
2cd0d41
cleanup EnumerableMap.test.js
Amxx May 19, 2023
815bf2a
cleanup Checkpoints tests
Amxx May 19, 2023
a19eb6a
retreive checkpoint sizes from the generation scripts
Amxx May 19, 2023
d0e778f
fix foundry test
Amxx May 19, 2023
932ae59
Fix upgradeable.patch
Amxx May 19, 2023
b9991cc
Update .changeset/selfish-queens-rest.md
Amxx May 19, 2023
4d11483
add missing await
frangio May 19, 2023
32b6b60
Remove SignedSafeMath library and tests
Amxx May 19, 2023
e21211b
remove mention to SafeMath in SafeCast
Amxx May 19, 2023
9456fce
Update test/utils/Create2.test.js
Amxx May 19, 2023
2d2e8fa
Update test/utils/Checkpoints.test.js
frangio May 19, 2023
9193cea
remove mention of safemath from template
frangio May 19, 2023
41732d3
remove ERC-1820 docs and move interfaces
frangio May 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove deprecated and duplicate storage
  • Loading branch information
Amxx committed May 16, 2023
commit edc27feb01f0d01596bf69839ab76f565ee0cdfc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ abstract contract GovernorCompatibilityBravo is IGovernorTimelock, IGovernorComp
}

struct ProposalDetails {
address proposer;
address[] targets;
uint256[] values;
string[] signatures;
Expand Down Expand Up @@ -56,7 +55,7 @@ abstract contract GovernorCompatibilityBravo is IGovernorTimelock, IGovernorComp
string memory description
) public virtual override(IGovernor, Governor) returns (uint256) {
// Stores the proposal details (if not already present) and executes the propose logic from the core.
_storeProposal(_msgSender(), targets, values, new string[](calldatas.length), calldatas, description);
_storeProposal(targets, values, new string[](calldatas.length), calldatas, description);
return super.propose(targets, values, calldatas, description);
}

Expand All @@ -75,7 +74,7 @@ abstract contract GovernorCompatibilityBravo is IGovernorTimelock, IGovernorComp
// after the full proposal is stored, so the store operation included in the fallback will be skipped. Here we
// call `propose` and not `super.propose` to make sure if a child contract override `propose`, whatever code
// is added there is also executed when calling this alternative interface.
_storeProposal(_msgSender(), targets, values, signatures, calldatas, description);
_storeProposal(targets, values, signatures, calldatas, description);
return propose(targets, values, _encodeCalldata(signatures, calldatas), description);
}

Expand Down Expand Up @@ -132,7 +131,7 @@ abstract contract GovernorCompatibilityBravo is IGovernorTimelock, IGovernorComp
bytes32 descriptionHash
) public virtual override(IGovernor, Governor) returns (uint256) {
uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);
address proposer = _proposalDetails[proposalId].proposer;
address proposer = proposalProposer(proposalId);

require(
_msgSender() == proposer || getVotes(proposer, clock() - 1) < proposalThreshold(),
Expand Down Expand Up @@ -182,7 +181,6 @@ abstract contract GovernorCompatibilityBravo is IGovernorTimelock, IGovernorComp
* @dev Store proposal metadata (if not already present) for later lookup.
*/
function _storeProposal(
address proposer,
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
Expand All @@ -194,7 +192,6 @@ abstract contract GovernorCompatibilityBravo is IGovernorTimelock, IGovernorComp

ProposalDetails storage details = _proposalDetails[proposalId];
if (details.descriptionHash == bytes32(0)) {
details.proposer = proposer;
details.targets = targets;
details.values = values;
details.signatures = signatures;
Expand Down Expand Up @@ -228,12 +225,12 @@ abstract contract GovernorCompatibilityBravo is IGovernorTimelock, IGovernorComp
)
{
id = proposalId;
proposer = proposalProposer(proposalId);
eta = proposalEta(proposalId);
startBlock = proposalSnapshot(proposalId);
endBlock = proposalDeadline(proposalId);

ProposalDetails storage details = _proposalDetails[proposalId];
proposer = details.proposer;
forVotes = details.forVotes;
againstVotes = details.againstVotes;
abstainVotes = details.abstainVotes;
Expand Down
16 changes: 1 addition & 15 deletions contracts/governance/extensions/GovernorVotesQuorumFraction.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import "../../utils/math/SafeCast.sol";
abstract contract GovernorVotesQuorumFraction is GovernorVotes {
using Checkpoints for Checkpoints.Trace224;

uint256 private _quorumNumerator; // DEPRECATED in favor of _quorumNumeratorHistory

/// @custom:oz-retyped-from Checkpoints.History
Checkpoints.Trace224 private _quorumNumeratorHistory;

Expand All @@ -38,7 +36,7 @@ abstract contract GovernorVotesQuorumFraction is GovernorVotes {
* @dev Returns the current quorum numerator. See {quorumDenominator}.
*/
function quorumNumerator() public view virtual returns (uint256) {
return _quorumNumeratorHistory._checkpoints.length == 0 ? _quorumNumerator : _quorumNumeratorHistory.latest();
return _quorumNumeratorHistory.latest();
}

/**
Expand All @@ -47,9 +45,6 @@ abstract contract GovernorVotesQuorumFraction is GovernorVotes {
function quorumNumerator(uint256 timepoint) public view virtual returns (uint256) {
// If history is empty, fallback to old storage
uint256 length = _quorumNumeratorHistory._checkpoints.length;
if (length == 0) {
return _quorumNumerator;
}

// Optimistic search, check the latest checkpoint
Checkpoints.Checkpoint224 memory latest = _quorumNumeratorHistory._checkpoints[length - 1];
Expand Down Expand Up @@ -105,15 +100,6 @@ abstract contract GovernorVotesQuorumFraction is GovernorVotes {
);

uint256 oldQuorumNumerator = quorumNumerator();

// Make sure we keep track of the original numerator in contracts upgraded from a version without checkpoints.
if (oldQuorumNumerator != 0 && _quorumNumeratorHistory._checkpoints.length == 0) {
_quorumNumeratorHistory._checkpoints.push(
Checkpoints.Checkpoint224({_key: 0, _value: SafeCast.toUint224(oldQuorumNumerator)})
);
}

// Set new quorum for future proposals
_quorumNumeratorHistory.push(SafeCast.toUint32(clock()), SafeCast.toUint224(newQuorumNumerator));

emit QuorumNumeratorUpdated(oldQuorumNumerator, newQuorumNumerator);
Expand Down
8 changes: 0 additions & 8 deletions contracts/token/ERC20/extensions/ERC20Permit.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712, Nonces {
// solhint-disable-next-line var-name-mixedcase
bytes32 private constant _PERMIT_TYPEHASH =
keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
/**
* @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.
* However, to ensure consistency with the upgradeable transpiler, we will continue
* to reserve a slot.
* @custom:oz-renamed-from _PERMIT_TYPEHASH
*/
// solhint-disable-next-line var-name-mixedcase
bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;

/**
* @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `"1"`.
Expand Down