Commit 40c69246 by github-actions

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

parents 89dcc77d db58acea
# Changelog
## Unreleased
* `Ownable`: add an internal `_transferOwnership(address)`. ([#2568](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/#2568))
* `AccessControl`: add internal `_grantRole(bytes32,address)` and `_revokeRole(bytes32,address)`. ([#2568](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/#2568))
* `AccessControl`: mark `_setupRole(bytes32,address)` as deprecated in favor of `_grantRole(bytes32,address)`. ([#2568](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/#2568))
* `EIP712`: cache `address(this)` to immutable storage to avoid potential issues if a vanilla contract is used in a delegatecall context. ([#2852](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/#2852))
## 4.4.0
* `Ownable`: add an internal `_transferOwnership(address)`. ([#2568](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2568))
* `AccessControl`: add internal `_grantRole(bytes32,address)` and `_revokeRole(bytes32,address)`. ([#2568](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2568))
* `AccessControl`: mark `_setupRole(bytes32,address)` as deprecated in favor of `_grantRole(bytes32,address)`. ([#2568](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2568))
* `EIP712`: cache `address(this)` to immutable storage to avoid potential issues if a vanilla contract is used in a delegatecall context. ([#2852](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2852))
* Add internal `_setApprovalForAll` to `ERC721` and `ERC1155`. ([#2834](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2834))
* `Governor`: shift vote start and end by one block to better match Compound's GovernorBravo and prevent voting at the Governor level if the voting snapshot is not ready. ([#2892](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2892))
* `GovernorSettings`: a new governor module that manages voting settings updatable through governance actions. ([#2904](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2904))
* `PaymentSplitter`: now supports ERC20 assets in addition to Ether. ([#2858](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2858))
* `ECDSA`: add a variant of `toEthSignedMessageHash` for arbitrary length message hashing. ([#2865](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2865))
* `MerkleProof`: add a `processProof` function that returns the rebuilt root hash given a leaf and a proof. ([#2841](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2841))
* `VestingWallet`: new contract that handles the vesting of Ether and ERC20 tokens following a customizable vesting schedule. ([#2748](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2748))
* `Governor`: enable receiving Ether when a Timelock contract is not used. ([#2748](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2748))
* `GovernorTimelockCompound`: fix ability to use Ether stored in the Timelock contract. ([#2748](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2748))
## 4.3.2 (2021-09-14)
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (access/AccessControl.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (access/AccessControlEnumerable.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (access/IAccessControl.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (access/IAccessControlEnumerable.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (access/Ownable.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (finance/PaymentSplitter.sol)
pragma solidity ^0.8.0;
import "../token/ERC20/utils/SafeERC20.sol";
import "../utils/Address.sol";
import "../utils/Context.sol";
......@@ -17,10 +19,15 @@ import "../utils/Context.sol";
* `PaymentSplitter` follows a _pull payment_ model. This means that payments are not automatically forwarded to the
* accounts but kept in this contract, and the actual transfer is triggered as a separate step by calling the {release}
* function.
*
* NOTE: This contract assumes that ERC20 tokens will behave similarly to native tokens (Ether). Rebasing tokens, and
* tokens that apply fees during transfers, are likely to not be supported as expected. If in doubt, we encourage you
* to run tests before sending real value to this contract.
*/
contract PaymentSplitter is Context {
event PayeeAdded(address account, uint256 shares);
event PaymentReleased(address to, uint256 amount);
event ERC20PaymentReleased(IERC20 indexed token, address to, uint256 amount);
event PaymentReceived(address from, uint256 amount);
uint256 private _totalShares;
......@@ -30,6 +37,9 @@ contract PaymentSplitter is Context {
mapping(address => uint256) private _released;
address[] private _payees;
mapping(IERC20 => uint256) private _erc20TotalReleased;
mapping(IERC20 => mapping(address => uint256)) private _erc20Released;
/**
* @dev Creates an instance of `PaymentSplitter` where each account in `payees` is assigned the number of shares at
* the matching position in the `shares` array.
......@@ -74,6 +84,14 @@ contract PaymentSplitter is Context {
}
/**
* @dev Getter for the total amount of `token` already released. `token` should be the address of an IERC20
* contract.
*/
function totalReleased(IERC20 token) public view returns (uint256) {
return _erc20TotalReleased[token];
}
/**
* @dev Getter for the amount of shares held by an account.
*/
function shares(address account) public view returns (uint256) {
......@@ -88,6 +106,14 @@ contract PaymentSplitter is Context {
}
/**
* @dev Getter for the amount of `token` tokens already released to a payee. `token` should be the address of an
* IERC20 contract.
*/
function released(IERC20 token, address account) public view returns (uint256) {
return _erc20Released[token][account];
}
/**
* @dev Getter for the address of the payee number `index`.
*/
function payee(uint256 index) public view returns (address) {
......@@ -101,19 +127,51 @@ contract PaymentSplitter is Context {
function release(address payable account) public virtual {
require(_shares[account] > 0, "PaymentSplitter: account has no shares");
uint256 totalReceived = address(this).balance + _totalReleased;
uint256 payment = (totalReceived * _shares[account]) / _totalShares - _released[account];
uint256 totalReceived = address(this).balance + totalReleased();
uint256 payment = _pendingPayment(account, totalReceived, released(account));
require(payment != 0, "PaymentSplitter: account is not due payment");
_released[account] = _released[account] + payment;
_totalReleased = _totalReleased + payment;
_released[account] += payment;
_totalReleased += payment;
Address.sendValue(account, payment);
emit PaymentReleased(account, payment);
}
/**
* @dev Triggers a transfer to `account` of the amount of `token` tokens they are owed, according to their
* percentage of the total shares and their previous withdrawals. `token` must be the address of an IERC20
* contract.
*/
function release(IERC20 token, address account) public virtual {
require(_shares[account] > 0, "PaymentSplitter: account has no shares");
uint256 totalReceived = token.balanceOf(address(this)) + totalReleased(token);
uint256 payment = _pendingPayment(account, totalReceived, released(token, account));
require(payment != 0, "PaymentSplitter: account is not due payment");
_erc20Released[token][account] += payment;
_erc20TotalReleased[token] += payment;
SafeERC20.safeTransfer(token, account, payment);
emit ERC20PaymentReleased(token, account, payment);
}
/**
* @dev internal logic for computing the pending payment of an `account` given the token historical balances and
* already released amounts.
*/
function _pendingPayment(
address account,
uint256 totalReceived,
uint256 alreadyReleased
) private view returns (uint256) {
return (totalReceived * _shares[account]) / _totalShares - alreadyReleased;
}
/**
* @dev Add a new payee to the contract.
* @param account The address of the payee to add.
* @param shares_ The number of shares owned by the payee.
......
......@@ -3,8 +3,18 @@
[.readme-notice]
NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/finance
This directory includes primitives for financial systems. We currently only offer the {PaymentSplitter} contract, but we want to grow this directory so we welcome ideas.
This directory includes primitives for financial systems:
== PaymentSplitter
- {PaymentSplitter} allows to split Ether and ERC20 payments among a group of accounts. The sender does not need to be
aware that the assets will be split in this way, since it is handled transparently by the contract. The split can be
in equal parts or in any other arbitrary proportion.
- {VestingWallet} handles the vesting of Ether and ERC20 tokens for a given beneficiary. Custody of multiple tokens can
be given to this contract, which will release the token to the beneficiary following a given, customizable, vesting
schedule.
== Contracts
{{PaymentSplitter}}
{{VestingWallet}}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (finance/VestingWallet.sol)
pragma solidity ^0.8.0;
import "../token/ERC20/utils/SafeERC20.sol";
import "../utils/Address.sol";
import "../utils/Context.sol";
import "../utils/math/Math.sol";
/**
* @title VestingWallet
* @dev This contract handles the vesting of Eth and ERC20 tokens for a given beneficiary. Custody of multiple tokens
* can be given to this contract, which will release the token to the beneficiary following a given vesting schedule.
* The vesting schedule is customizable through the {vestedAmount} function.
*
* Any token transferred to this contract will follow the vesting schedule as if they were locked from the beginning.
* Consequently, if the vesting has already started, any amount of tokens sent to this contract will (at least partly)
* be immediately releasable.
*/
contract VestingWallet is Context {
event EtherReleased(uint256 amount);
event ERC20Released(address token, uint256 amount);
uint256 private _released;
mapping(address => uint256) private _erc20Released;
address private immutable _beneficiary;
uint64 private immutable _start;
uint64 private immutable _duration;
/**
* @dev Set the beneficiary, start timestamp and vesting duration of the vesting wallet.
*/
constructor(
address beneficiaryAddress,
uint64 startTimestamp,
uint64 durationSeconds
) {
require(beneficiaryAddress != address(0), "VestingWallet: beneficiary is zero address");
_beneficiary = beneficiaryAddress;
_start = startTimestamp;
_duration = durationSeconds;
}
/**
* @dev The contract should be able to receive Eth.
*/
receive() external payable virtual {}
/**
* @dev Getter for the beneficiary address.
*/
function beneficiary() public view virtual returns (address) {
return _beneficiary;
}
/**
* @dev Getter for the start timestamp.
*/
function start() public view virtual returns (uint256) {
return _start;
}
/**
* @dev Getter for the vesting duration.
*/
function duration() public view virtual returns (uint256) {
return _duration;
}
/**
* @dev Amount of eth already released
*/
function released() public view virtual returns (uint256) {
return _released;
}
/**
* @dev Amount of token already released
*/
function released(address token) public view virtual returns (uint256) {
return _erc20Released[token];
}
/**
* @dev Release the native token (ether) that have already vested.
*
* Emits a {TokensReleased} event.
*/
function release() public virtual {
uint256 releasable = vestedAmount(uint64(block.timestamp)) - released();
_released += releasable;
emit EtherReleased(releasable);
Address.sendValue(payable(beneficiary()), releasable);
}
/**
* @dev Release the tokens that have already vested.
*
* Emits a {TokensReleased} event.
*/
function release(address token) public virtual {
uint256 releasable = vestedAmount(token, uint64(block.timestamp)) - released(token);
_erc20Released[token] += releasable;
emit ERC20Released(token, releasable);
SafeERC20.safeTransfer(IERC20(token), beneficiary(), releasable);
}
/**
* @dev Calculates the amount of ether that has already vested. Default implementation is a linear vesting curve.
*/
function vestedAmount(uint64 timestamp) public view virtual returns (uint256) {
return _vestingSchedule(address(this).balance + released(), timestamp);
}
/**
* @dev Calculates the amount of tokens that has already vested. Default implementation is a linear vesting curve.
*/
function vestedAmount(address token, uint64 timestamp) public view virtual returns (uint256) {
return _vestingSchedule(IERC20(token).balanceOf(address(this)) + released(token), timestamp);
}
/**
* @dev Virtual implementation of the vesting formula. This returns the amout vested, as a function of time, for
* an asset given its total historical allocation.
*/
function _vestingSchedule(uint256 totalAllocation, uint64 timestamp) internal view virtual returns (uint256) {
if (timestamp < start()) {
return 0;
} else if (timestamp > start() + duration()) {
return totalAllocation;
} else {
return (totalAllocation * (timestamp - start())) / duration();
}
}
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (governance/Governor.sol)
pragma solidity ^0.8.0;
......@@ -115,9 +116,9 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor {
return ProposalState.Executed;
} else if (proposal.canceled) {
return ProposalState.Canceled;
} else if (proposal.voteStart.isPending()) {
} else if (proposal.voteStart.getDeadline() >= block.number) {
return ProposalState.Pending;
} else if (proposal.voteEnd.isPending()) {
} else if (proposal.voteEnd.getDeadline() >= block.number) {
return ProposalState.Active;
} else if (proposal.voteEnd.isExpired()) {
return
......@@ -144,6 +145,13 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor {
}
/**
* @dev Part of the Governor Bravo's interface: _"The number of votes required in order for a voter to become a proposer"_.
*/
function proposalThreshold() public view virtual returns (uint256) {
return 0;
}
/**
* @dev Amount of votes already cast passes the threshold limit.
*/
function _quorumReached(uint256 proposalId) internal view virtual returns (bool);
......@@ -174,6 +182,11 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor {
bytes[] memory calldatas,
string memory description
) public virtual override returns (uint256) {
require(
getVotes(msg.sender, block.number - 1) >= proposalThreshold(),
"GovernorCompatibilityBravo: proposer votes below proposal threshold"
);
uint256 proposalId = hashProposal(targets, values, calldatas, keccak256(bytes(description)));
require(targets.length == values.length, "Governor: invalid proposal length");
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (governance/IGovernor.sol)
pragma solidity ^0.8.0;
......@@ -73,7 +74,7 @@ abstract contract IGovernor is IERC165 {
*
* There are 2 standard keys: `support` and `quorum`.
*
* - `support=bravo` refers to the vote options 0 = For, 1 = Against, 2 = Abstain, as in `GovernorBravo`.
* - `support=bravo` refers to the vote options 0 = Against, 1 = For, 2 = Abstain, as in `GovernorBravo`.
* - `quorum=bravo` means that only For votes are counted towards quorum.
* - `quorum=for,abstain` means that both For and Abstain votes are counted towards quorum.
*
......@@ -103,28 +104,31 @@ abstract contract IGovernor is IERC165 {
/**
* @notice module:core
* @dev block number used to retrieve user's votes and quorum.
* @dev Block number used to retrieve user's votes and quorum. As per Compound's Comp and OpenZeppelin's
* ERC20Votes, the snapshot is performed at the end of this block. Hence, voting for this proposal starts at the
* beginning of the following block.
*/
function proposalSnapshot(uint256 proposalId) public view virtual returns (uint256);
/**
* @notice module:core
* @dev timestamp at which votes close.
* @dev Block number at which votes close. Votes close at the end of this block, so it is possible to cast a vote
* during this block.
*/
function proposalDeadline(uint256 proposalId) public view virtual returns (uint256);
/**
* @notice module:user-config
* @dev delay, in number of block, between the proposal is created and the vote starts. This can be increassed to
* @dev Delay, in number of block, between the proposal is created and the vote starts. This can be increassed to
* leave time for users to buy voting power, of delegate it, before the voting of a proposal starts.
*/
function votingDelay() public view virtual returns (uint256);
/**
* @notice module:user-config
* @dev delay, in number of blocks, between the vote start and vote ends.
* @dev Delay, in number of blocks, between the vote start and vote ends.
*
* Note: the {votingDelay} can delay the start of the vote. This must be considered when setting the voting
* NOTE: The {votingDelay} can delay the start of the vote. This must be considered when setting the voting
* duration compared to the voting delay.
*/
function votingPeriod() public view virtual returns (uint256);
......
......@@ -40,7 +40,7 @@ Other extensions can customize the behavior or interface in multiple ways.
* {GovernorCompatibilityBravo}: Extends the interface to be fully `GovernorBravo`-compatible. Note that events are compatible regardless of whether this extension is included or not.
* {GovernorProposalThreshold}: Restricts proposals to delegates with a minimum voting power.
* {GovernorSettings}: Manages some of the settings (voting delay, voting period duration, and proposal threshold) in a way that can be updated through a governance proposal, without requiering an upgrade.
In addition to modules and extensions, the core contract requires a few virtual functions to be implemented to your particular specifications:
......@@ -72,10 +72,14 @@ NOTE: Functions of the `Governor` contract do not include access control. If you
{{GovernorTimelockCompound}}
{{GovernorProposalThreshold}}
{{GovernorSettings}}
{{GovernorCompatibilityBravo}}
=== Deprecated
{{GovernorProposalThreshold}}
== Timelock
In a governance system, the {TimelockController} contract is in carge of introducing a delay between a proposal and its execution. It can be used with or without a {Governor}.
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (governance/TimelockController.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (governance/compatibility/GovernorCompatibilityBravo.sol)
pragma solidity ^0.8.0;
import "../../utils/Counters.sol";
import "../../utils/math/SafeCast.sol";
import "../extensions/IGovernorTimelock.sol";
import "../extensions/GovernorProposalThreshold.sol";
import "../Governor.sol";
import "./IGovernorCompatibilityBravo.sol";
......@@ -19,12 +19,7 @@ import "./IGovernorCompatibilityBravo.sol";
*
* _Available since v4.3._
*/
abstract contract GovernorCompatibilityBravo is
IGovernorTimelock,
IGovernorCompatibilityBravo,
Governor,
GovernorProposalThreshold
{
abstract contract GovernorCompatibilityBravo is IGovernorTimelock, IGovernorCompatibilityBravo, Governor {
using Counters for Counters.Counter;
using Timers for Timers.BlockNumber;
......@@ -63,7 +58,7 @@ abstract contract GovernorCompatibilityBravo is
uint256[] memory values,
bytes[] memory calldatas,
string memory description
) public virtual override(IGovernor, Governor, GovernorProposalThreshold) returns (uint256) {
) public virtual override(IGovernor, Governor) returns (uint256) {
_storeProposal(_msgSender(), targets, values, new string[](calldatas.length), calldatas, description);
return super.propose(targets, values, calldatas, description);
}
......@@ -170,16 +165,6 @@ abstract contract GovernorCompatibilityBravo is
// ==================================================== Views =====================================================
/**
* @dev Part of the Governor Bravo's interface: _"The number of votes required in order for a voter to become a proposer"_.
*/
function proposalThreshold()
public
view
virtual
override(IGovernorCompatibilityBravo, GovernorProposalThreshold)
returns (uint256);
/**
* @dev See {IGovernorCompatibilityBravo-proposals}.
*/
function proposals(uint256 proposalId)
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (governance/compatibility/IGovernorCompatibilityBravo.sol)
pragma solidity ^0.8.0;
......@@ -110,9 +111,4 @@ abstract contract IGovernorCompatibilityBravo is IGovernor {
* @dev Part of the Governor Bravo's interface: _"Gets the receipt for a voter on a given proposal"_.
*/
function getReceipt(uint256 proposalId, address voter) public view virtual returns (Receipt memory);
/**
* @dev Part of the Governor Bravo's interface: _"The number of votes required in order for a voter to become a proposer"_.
*/
function proposalThreshold() public view virtual returns (uint256);
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (governance/extensions/GovernorCountingSimple.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (governance/extensions/GovernorProposalThreshold.sol)
pragma solidity ^0.8.0;
......@@ -8,27 +9,15 @@ import "../Governor.sol";
* @dev Extension of {Governor} for proposal restriction to token holders with a minimum balance.
*
* _Available since v4.3._
* _Deprecated since v4.4._
*/
abstract contract GovernorProposalThreshold is Governor {
/**
* @dev See {IGovernor-propose}.
*/
function propose(
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
string memory description
) public virtual override returns (uint256) {
require(
getVotes(msg.sender, block.number - 1) >= proposalThreshold(),
"GovernorCompatibilityBravo: proposer votes below proposal threshold"
);
return super.propose(targets, values, calldatas, description);
}
/**
* @dev Part of the Governor Bravo's interface: _"The number of votes required in order for a voter to become a proposer"_.
*/
function proposalThreshold() public view virtual returns (uint256);
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (governance/extensions/GovernorSettings.sol)
pragma solidity ^0.8.0;
import "../Governor.sol";
/**
* @dev Extension of {Governor} for settings updatable through governance.
*
* _Available since v4.4._
*/
abstract contract GovernorSettings is Governor {
uint256 private _votingDelay;
uint256 private _votingPeriod;
uint256 private _proposalThreshold;
event VotingDelaySet(uint256 oldVotingDelay, uint256 newVotingDelay);
event VotingPeriodSet(uint256 oldVotingPeriod, uint256 newVotingPeriod);
event ProposalThresholdSet(uint256 oldProposalThreshold, uint256 newProposalThreshold);
/**
* @dev Initialize the governance parameters.
*/
constructor(
uint256 initialVotingDelay,
uint256 initialVotingPeriod,
uint256 initialProposalThreshold
) {
_setVotingDelay(initialVotingDelay);
_setVotingPeriod(initialVotingPeriod);
_setProposalThreshold(initialProposalThreshold);
}
/**
* @dev See {IGovernor-votingDelay}.
*/
function votingDelay() public view virtual override returns (uint256) {
return _votingDelay;
}
/**
* @dev See {IGovernor-votingPeriod}.
*/
function votingPeriod() public view virtual override returns (uint256) {
return _votingPeriod;
}
/**
* @dev See {Governor-proposalThreshold}.
*/
function proposalThreshold() public view virtual override returns (uint256) {
return _proposalThreshold;
}
/**
* @dev Update the voting delay. This operation can only be performed through a governance proposal.
*
* Emits a {VotingDelaySet} event.
*/
function setVotingDelay(uint256 newVotingDelay) public onlyGovernance {
_setVotingDelay(newVotingDelay);
}
/**
* @dev Update the voting period. This operation can only be performed through a governance proposal.
*
* Emits a {VotingPeriodSet} event.
*/
function setVotingPeriod(uint256 newVotingPeriod) public onlyGovernance {
_setVotingPeriod(newVotingPeriod);
}
/**
* @dev Update the proposal threshold. This operation can only be performed through a governance proposal.
*
* Emits a {ProposalThresholdSet} event.
*/
function setProposalThreshold(uint256 newProposalThreshold) public onlyGovernance {
_setProposalThreshold(newProposalThreshold);
}
/**
* @dev Internal setter for the the voting delay.
*
* Emits a {VotingDelaySet} event.
*/
function _setVotingDelay(uint256 newVotingDelay) internal virtual {
emit VotingDelaySet(_votingDelay, newVotingDelay);
_votingDelay = newVotingDelay;
}
/**
* @dev Internal setter for the the voting period.
*
* Emits a {VotingPeriodSet} event.
*/
function _setVotingPeriod(uint256 newVotingPeriod) internal virtual {
// voting period must be at least one block long
require(newVotingPeriod > 0, "GovernorSettings: voting period too low");
emit VotingPeriodSet(_votingPeriod, newVotingPeriod);
_votingPeriod = newVotingPeriod;
}
/**
* @dev Internal setter for the the proposal threshold.
*
* Emits a {ProposalThresholdSet} event.
*/
function _setProposalThreshold(uint256 newProposalThreshold) internal virtual {
emit ProposalThresholdSet(_proposalThreshold, newProposalThreshold);
_proposalThreshold = newProposalThreshold;
}
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (governance/extensions/GovernorTimelockCompound.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (governance/extensions/GovernorTimelockControl.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (governance/extensions/GovernorVotes.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (governance/extensions/GovernorVotesComp.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (governance/extensions/GovernorVotesQuorumFraction.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (governance/extensions/IGovernorTimelock.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (interfaces/IERC1155.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (interfaces/IERC1155MetadataURI.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (interfaces/IERC1155Receiver.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (interfaces/IERC1271.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (interfaces/IERC1363.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (interfaces/IERC1363Receiver.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (interfaces/IERC1363Spender.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (interfaces/IERC165.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (interfaces/IERC1820Implementer.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (interfaces/IERC1820Registry.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (interfaces/IERC20.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (interfaces/IERC20Metadata.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (interfaces/IERC2981.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (interfaces/IERC3156.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (interfaces/IERC3156FlashBorrower.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (interfaces/IERC3156FlashLender.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (interfaces/IERC721.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (interfaces/IERC721Enumerable.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (interfaces/IERC721Metadata.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (interfaces/IERC721Receiver.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (interfaces/IERC777.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (interfaces/IERC777Recipient.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (interfaces/IERC777Sender.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (interfaces/draft-IERC2612.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (metatx/ERC2771Context.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (metatx/MinimalForwarder.sol)
pragma solidity ^0.8.0;
......
......@@ -6,6 +6,7 @@ import "../utils/cryptography/ECDSA.sol";
contract ECDSAMock {
using ECDSA for bytes32;
using ECDSA for bytes;
function recover(bytes32 hash, bytes memory signature) public pure returns (address) {
return hash.recover(signature);
......@@ -33,4 +34,8 @@ contract ECDSAMock {
function toEthSignedMessageHash(bytes32 hash) public pure returns (bytes32) {
return hash.toEthSignedMessageHash();
}
function toEthSignedMessageHash(bytes memory s) public pure returns (bytes32) {
return s.toEthSignedMessageHash();
}
}
......@@ -2,34 +2,22 @@
pragma solidity ^0.8.0;
import "../governance/Governor.sol";
import "../governance/extensions/GovernorCountingSimple.sol";
import "../governance/extensions/GovernorVotesComp.sol";
contract GovernorCompMock is Governor, GovernorVotesComp, GovernorCountingSimple {
uint256 immutable _votingDelay;
uint256 immutable _votingPeriod;
constructor(
string memory name_,
ERC20VotesComp token_,
uint256 votingDelay_,
uint256 votingPeriod_
) Governor(name_) GovernorVotesComp(token_) {
_votingDelay = votingDelay_;
_votingPeriod = votingPeriod_;
}
contract GovernorCompMock is GovernorVotesComp, GovernorCountingSimple {
constructor(string memory name_, ERC20VotesComp token_) Governor(name_) GovernorVotesComp(token_) {}
function votingDelay() public view override returns (uint256) {
return _votingDelay;
function quorum(uint256) public pure override returns (uint256) {
return 0;
}
function votingPeriod() public view override returns (uint256) {
return _votingPeriod;
function votingDelay() public pure override returns (uint256) {
return 4;
}
function quorum(uint256) public pure override returns (uint256) {
return 0;
function votingPeriod() public pure override returns (uint256) {
return 16;
}
function cancel(
......
......@@ -3,14 +3,16 @@
pragma solidity ^0.8.0;
import "../governance/compatibility/GovernorCompatibilityBravo.sol";
import "../governance/extensions/GovernorVotesComp.sol";
import "../governance/extensions/GovernorTimelockCompound.sol";
import "../governance/extensions/GovernorSettings.sol";
import "../governance/extensions/GovernorVotesComp.sol";
contract GovernorCompatibilityBravoMock is GovernorCompatibilityBravo, GovernorTimelockCompound, GovernorVotesComp {
uint256 immutable _votingDelay;
uint256 immutable _votingPeriod;
uint256 immutable _proposalThreshold;
contract GovernorCompatibilityBravoMock is
GovernorCompatibilityBravo,
GovernorSettings,
GovernorTimelockCompound,
GovernorVotesComp
{
constructor(
string memory name_,
ERC20VotesComp token_,
......@@ -18,11 +20,12 @@ contract GovernorCompatibilityBravoMock is GovernorCompatibilityBravo, GovernorT
uint256 votingPeriod_,
uint256 proposalThreshold_,
ICompoundTimelock timelock_
) Governor(name_) GovernorVotesComp(token_) GovernorTimelockCompound(timelock_) {
_votingDelay = votingDelay_;
_votingPeriod = votingPeriod_;
_proposalThreshold = proposalThreshold_;
}
)
Governor(name_)
GovernorTimelockCompound(timelock_)
GovernorSettings(votingDelay_, votingPeriod_, proposalThreshold_)
GovernorVotesComp(token_)
{}
function supportsInterface(bytes4 interfaceId)
public
......@@ -34,18 +37,6 @@ contract GovernorCompatibilityBravoMock is GovernorCompatibilityBravo, GovernorT
return super.supportsInterface(interfaceId);
}
function votingDelay() public view override returns (uint256) {
return _votingDelay;
}
function votingPeriod() public view override returns (uint256) {
return _votingPeriod;
}
function proposalThreshold() public view virtual override returns (uint256) {
return _proposalThreshold;
}
function quorum(uint256) public pure override returns (uint256) {
return 0;
}
......@@ -70,6 +61,10 @@ contract GovernorCompatibilityBravoMock is GovernorCompatibilityBravo, GovernorT
return super.proposalEta(proposalId);
}
function proposalThreshold() public view override(Governor, GovernorSettings) returns (uint256) {
return super.proposalThreshold();
}
function propose(
address[] memory targets,
uint256[] memory values,
......
......@@ -2,32 +2,29 @@
pragma solidity ^0.8.0;
import "../governance/Governor.sol";
import "../governance/extensions/GovernorProposalThreshold.sol";
import "../governance/extensions/GovernorSettings.sol";
import "../governance/extensions/GovernorCountingSimple.sol";
import "../governance/extensions/GovernorVotesQuorumFraction.sol";
contract GovernorMock is Governor, GovernorVotesQuorumFraction, GovernorCountingSimple {
uint256 immutable _votingDelay;
uint256 immutable _votingPeriod;
contract GovernorMock is
GovernorProposalThreshold,
GovernorSettings,
GovernorVotesQuorumFraction,
GovernorCountingSimple
{
constructor(
string memory name_,
ERC20Votes token_,
uint256 votingDelay_,
uint256 votingPeriod_,
uint256 quorumNumerator_
) Governor(name_) GovernorVotes(token_) GovernorVotesQuorumFraction(quorumNumerator_) {
_votingDelay = votingDelay_;
_votingPeriod = votingPeriod_;
}
function votingDelay() public view override returns (uint256) {
return _votingDelay;
}
function votingPeriod() public view override returns (uint256) {
return _votingPeriod;
}
)
Governor(name_)
GovernorSettings(votingDelay_, votingPeriod_, 0)
GovernorVotes(token_)
GovernorVotesQuorumFraction(quorumNumerator_)
{}
function cancel(
address[] memory targets,
......@@ -47,4 +44,17 @@ contract GovernorMock is Governor, GovernorVotesQuorumFraction, GovernorCounting
{
return super.getVotes(account, blockNumber);
}
function proposalThreshold() public view override(Governor, GovernorSettings) returns (uint256) {
return super.proposalThreshold();
}
function propose(
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
string memory description
) public virtual override(Governor, GovernorProposalThreshold) returns (uint256) {
return super.propose(targets, values, calldatas, description);
}
}
......@@ -3,13 +3,16 @@
pragma solidity ^0.8.0;
import "../governance/extensions/GovernorTimelockCompound.sol";
import "../governance/extensions/GovernorSettings.sol";
import "../governance/extensions/GovernorCountingSimple.sol";
import "../governance/extensions/GovernorVotesQuorumFraction.sol";
contract GovernorTimelockCompoundMock is GovernorTimelockCompound, GovernorVotesQuorumFraction, GovernorCountingSimple {
uint256 immutable _votingDelay;
uint256 immutable _votingPeriod;
contract GovernorTimelockCompoundMock is
GovernorSettings,
GovernorTimelockCompound,
GovernorVotesQuorumFraction,
GovernorCountingSimple
{
constructor(
string memory name_,
ERC20Votes token_,
......@@ -20,12 +23,10 @@ contract GovernorTimelockCompoundMock is GovernorTimelockCompound, GovernorVotes
)
Governor(name_)
GovernorTimelockCompound(timelock_)
GovernorSettings(votingDelay_, votingPeriod_, 0)
GovernorVotes(token_)
GovernorVotesQuorumFraction(quorumNumerator_)
{
_votingDelay = votingDelay_;
_votingPeriod = votingPeriod_;
}
{}
function supportsInterface(bytes4 interfaceId)
public
......@@ -37,14 +38,6 @@ contract GovernorTimelockCompoundMock is GovernorTimelockCompound, GovernorVotes
return super.supportsInterface(interfaceId);
}
function votingDelay() public view override returns (uint256) {
return _votingDelay;
}
function votingPeriod() public view override returns (uint256) {
return _votingPeriod;
}
function quorum(uint256 blockNumber)
public
view
......@@ -76,6 +69,10 @@ contract GovernorTimelockCompoundMock is GovernorTimelockCompound, GovernorVotes
return super.state(proposalId);
}
function proposalThreshold() public view override(Governor, GovernorSettings) returns (uint256) {
return super.proposalThreshold();
}
function _execute(
uint256 proposalId,
address[] memory targets,
......
......@@ -3,13 +3,16 @@
pragma solidity ^0.8.0;
import "../governance/extensions/GovernorTimelockControl.sol";
import "../governance/extensions/GovernorSettings.sol";
import "../governance/extensions/GovernorCountingSimple.sol";
import "../governance/extensions/GovernorVotesQuorumFraction.sol";
contract GovernorTimelockControlMock is GovernorTimelockControl, GovernorVotesQuorumFraction, GovernorCountingSimple {
uint256 immutable _votingDelay;
uint256 immutable _votingPeriod;
contract GovernorTimelockControlMock is
GovernorSettings,
GovernorTimelockControl,
GovernorVotesQuorumFraction,
GovernorCountingSimple
{
constructor(
string memory name_,
ERC20Votes token_,
......@@ -20,12 +23,10 @@ contract GovernorTimelockControlMock is GovernorTimelockControl, GovernorVotesQu
)
Governor(name_)
GovernorTimelockControl(timelock_)
GovernorSettings(votingDelay_, votingPeriod_, 0)
GovernorVotes(token_)
GovernorVotesQuorumFraction(quorumNumerator_)
{
_votingDelay = votingDelay_;
_votingPeriod = votingPeriod_;
}
{}
function supportsInterface(bytes4 interfaceId)
public
......@@ -37,14 +38,6 @@ contract GovernorTimelockControlMock is GovernorTimelockControl, GovernorVotesQu
return super.supportsInterface(interfaceId);
}
function votingDelay() public view override returns (uint256) {
return _votingDelay;
}
function votingPeriod() public view override returns (uint256) {
return _votingPeriod;
}
function quorum(uint256 blockNumber)
public
view
......@@ -76,6 +69,10 @@ contract GovernorTimelockControlMock is GovernorTimelockControl, GovernorVotesQu
return super.state(proposalId);
}
function proposalThreshold() public view override(Governor, GovernorSettings) returns (uint256) {
return super.proposalThreshold();
}
function _execute(
uint256 proposalId,
address[] memory targets,
......
......@@ -12,4 +12,8 @@ contract MerkleProofWrapper {
) public pure returns (bool) {
return MerkleProof.verify(proof, root, leaf);
}
function processProof(bytes32[] memory proof, bytes32 leaf) public pure returns (bytes32) {
return MerkleProof.processProof(proof, leaf);
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "../../governance/Governor.sol";
import "../../governance/extensions/GovernorCountingSimple.sol";
import "../../governance/extensions/GovernorVotes.sol";
import "../../governance/extensions/GovernorVotesQuorumFraction.sol";
import "../../governance/extensions/GovernorTimelockControl.sol";
contract MyGovernor1 is
Governor,
GovernorTimelockControl,
GovernorVotes,
GovernorVotesQuorumFraction,
GovernorCountingSimple
{
constructor(ERC20Votes _token, TimelockController _timelock)
Governor("MyGovernor")
GovernorVotes(_token)
GovernorVotesQuorumFraction(4)
GovernorTimelockControl(_timelock)
{}
function votingDelay() public pure override returns (uint256) {
return 1; // 1 block
}
function votingPeriod() public pure override returns (uint256) {
return 45818; // 1 week
}
// The following functions are overrides required by Solidity.
function quorum(uint256 blockNumber)
public
view
override(IGovernor, GovernorVotesQuorumFraction)
returns (uint256)
{
return super.quorum(blockNumber);
}
function getVotes(address account, uint256 blockNumber)
public
view
override(IGovernor, GovernorVotes)
returns (uint256)
{
return super.getVotes(account, blockNumber);
}
function state(uint256 proposalId) public view override(Governor, GovernorTimelockControl) returns (ProposalState) {
return super.state(proposalId);
}
function propose(
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
string memory description
) public override(Governor, IGovernor) returns (uint256) {
return super.propose(targets, values, calldatas, description);
}
function _execute(
uint256 proposalId,
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
bytes32 descriptionHash
) internal override(Governor, GovernorTimelockControl) {
super._execute(proposalId, targets, values, calldatas, descriptionHash);
}
function _cancel(
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
bytes32 descriptionHash
) internal override(Governor, GovernorTimelockControl) returns (uint256) {
return super._cancel(targets, values, calldatas, descriptionHash);
}
function _executor() internal view override(Governor, GovernorTimelockControl) returns (address) {
return super._executor();
}
function supportsInterface(bytes4 interfaceId)
public
view
override(Governor, GovernorTimelockControl)
returns (bool)
{
return super.supportsInterface(interfaceId);
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "../../governance/Governor.sol";
import "../../governance/extensions/GovernorProposalThreshold.sol";
import "../../governance/extensions/GovernorCountingSimple.sol";
import "../../governance/extensions/GovernorVotes.sol";
import "../../governance/extensions/GovernorVotesQuorumFraction.sol";
import "../../governance/extensions/GovernorTimelockControl.sol";
contract MyGovernor2 is
Governor,
GovernorTimelockControl,
GovernorProposalThreshold,
GovernorVotes,
GovernorVotesQuorumFraction,
GovernorCountingSimple
{
constructor(ERC20Votes _token, TimelockController _timelock)
Governor("MyGovernor")
GovernorVotes(_token)
GovernorVotesQuorumFraction(4)
GovernorTimelockControl(_timelock)
{}
function votingDelay() public pure override returns (uint256) {
return 1; // 1 block
}
function votingPeriod() public pure override returns (uint256) {
return 45818; // 1 week
}
function proposalThreshold() public pure override returns (uint256) {
return 1000e18;
}
// The following functions are overrides required by Solidity.
function quorum(uint256 blockNumber)
public
view
override(IGovernor, GovernorVotesQuorumFraction)
returns (uint256)
{
return super.quorum(blockNumber);
}
function getVotes(address account, uint256 blockNumber)
public
view
override(IGovernor, GovernorVotes)
returns (uint256)
{
return super.getVotes(account, blockNumber);
}
function state(uint256 proposalId) public view override(Governor, GovernorTimelockControl) returns (ProposalState) {
return super.state(proposalId);
}
function propose(
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
string memory description
) public override(Governor, GovernorProposalThreshold, IGovernor) returns (uint256) {
return super.propose(targets, values, calldatas, description);
}
function _execute(
uint256 proposalId,
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
bytes32 descriptionHash
) internal override(Governor, GovernorTimelockControl) {
super._execute(proposalId, targets, values, calldatas, descriptionHash);
}
function _cancel(
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
bytes32 descriptionHash
) internal override(Governor, GovernorTimelockControl) returns (uint256) {
return super._cancel(targets, values, calldatas, descriptionHash);
}
function _executor() internal view override(Governor, GovernorTimelockControl) returns (address) {
return super._executor();
}
function supportsInterface(bytes4 interfaceId)
public
view
override(Governor, GovernorTimelockControl)
returns (bool)
{
return super.supportsInterface(interfaceId);
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "../../governance/Governor.sol";
import "../../governance/compatibility/GovernorCompatibilityBravo.sol";
import "../../governance/extensions/GovernorVotes.sol";
import "../../governance/extensions/GovernorVotesQuorumFraction.sol";
import "../../governance/extensions/GovernorTimelockControl.sol";
contract MyGovernor is
Governor,
GovernorTimelockControl,
GovernorCompatibilityBravo,
GovernorVotes,
GovernorVotesQuorumFraction
{
constructor(ERC20Votes _token, TimelockController _timelock)
Governor("MyGovernor")
GovernorVotes(_token)
GovernorVotesQuorumFraction(4)
GovernorTimelockControl(_timelock)
{}
function votingDelay() public pure override returns (uint256) {
return 1; // 1 block
}
function votingPeriod() public pure override returns (uint256) {
return 45818; // 1 week
}
function proposalThreshold() public pure override returns (uint256) {
return 1000e18;
}
// The following functions are overrides required by Solidity.
function quorum(uint256 blockNumber)
public
view
override(IGovernor, GovernorVotesQuorumFraction)
returns (uint256)
{
return super.quorum(blockNumber);
}
function getVotes(address account, uint256 blockNumber)
public
view
override(IGovernor, GovernorVotes)
returns (uint256)
{
return super.getVotes(account, blockNumber);
}
function state(uint256 proposalId)
public
view
override(Governor, IGovernor, GovernorTimelockControl)
returns (ProposalState)
{
return super.state(proposalId);
}
function propose(
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
string memory description
) public override(Governor, GovernorCompatibilityBravo, IGovernor) returns (uint256) {
return super.propose(targets, values, calldatas, description);
}
function _execute(
uint256 proposalId,
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
bytes32 descriptionHash
) internal override(Governor, GovernorTimelockControl) {
super._execute(proposalId, targets, values, calldatas, descriptionHash);
}
function _cancel(
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
bytes32 descriptionHash
) internal override(Governor, GovernorTimelockControl) returns (uint256) {
return super._cancel(targets, values, calldatas, descriptionHash);
}
function _executor() internal view override(Governor, GovernorTimelockControl) returns (address) {
return super._executor();
}
function supportsInterface(bytes4 interfaceId)
public
view
override(Governor, IERC165, GovernorTimelockControl)
returns (bool)
{
return super.supportsInterface(interfaceId);
}
}
{
"name": "@openzeppelin/contracts-upgradeable",
"description": "Secure Smart Contract library for Solidity",
"version": "4.3.2",
"version": "4.4.0-rc.0",
"files": [
"**/*.sol",
"/build/contracts/*.json",
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (proxy/Clones.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (proxy/ERC1967/ERC1967Proxy.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (proxy/ERC1967/ERC1967Upgrade.sol)
pragma solidity ^0.8.2;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (proxy/Proxy.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (proxy/beacon/BeaconProxy.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (proxy/beacon/IBeacon.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (proxy/beacon/UpgradeableBeacon.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (proxy/transparent/ProxyAdmin.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (proxy/transparent/TransparentUpgradeableProxy.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (proxy/utils/Initializable.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (proxy/utils/UUPSUpgradeable.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (security/Pausable.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (security/PullPayment.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC1155/ERC1155.sol)
pragma solidity ^0.8.0;
......@@ -100,10 +101,7 @@ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
* @dev See {IERC1155-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
require(_msgSender() != operator, "ERC1155: setting approval status for self");
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
......@@ -249,32 +247,32 @@ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
}
/**
* @dev Creates `amount` tokens of token type `id`, and assigns them to `account`.
* @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - If `account` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* - `to` cannot be the zero address.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function _mint(
address account,
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
require(account != address(0), "ERC1155: mint to the zero address");
require(to != address(0), "ERC1155: mint to the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, address(0), account, _asSingletonArray(id), _asSingletonArray(amount), data);
_beforeTokenTransfer(operator, address(0), to, _asSingletonArray(id), _asSingletonArray(amount), data);
_balances[id][account] += amount;
emit TransferSingle(operator, address(0), account, id, amount);
_balances[id][to] += amount;
emit TransferSingle(operator, address(0), to, id, amount);
_doSafeTransferAcceptanceCheck(operator, address(0), account, id, amount, data);
_doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);
}
/**
......@@ -309,31 +307,31 @@ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
}
/**
* @dev Destroys `amount` tokens of token type `id` from `account`
* @dev Destroys `amount` tokens of token type `id` from `from`
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens of token type `id`.
* - `from` cannot be the zero address.
* - `from` must have at least `amount` tokens of token type `id`.
*/
function _burn(
address account,
address from,
uint256 id,
uint256 amount
) internal virtual {
require(account != address(0), "ERC1155: burn from the zero address");
require(from != address(0), "ERC1155: burn from the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, account, address(0), _asSingletonArray(id), _asSingletonArray(amount), "");
_beforeTokenTransfer(operator, from, address(0), _asSingletonArray(id), _asSingletonArray(amount), "");
uint256 accountBalance = _balances[id][account];
require(accountBalance >= amount, "ERC1155: burn amount exceeds balance");
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][account] = accountBalance - amount;
_balances[id][from] = fromBalance - amount;
}
emit TransferSingle(operator, account, address(0), id, amount);
emit TransferSingle(operator, from, address(0), id, amount);
}
/**
......@@ -344,29 +342,44 @@ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
* - `ids` and `amounts` must have the same length.
*/
function _burnBatch(
address account,
address from,
uint256[] memory ids,
uint256[] memory amounts
) internal virtual {
require(account != address(0), "ERC1155: burn from the zero address");
require(from != address(0), "ERC1155: burn from the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgSender();
_beforeTokenTransfer(operator, account, address(0), ids, amounts, "");
_beforeTokenTransfer(operator, from, address(0), ids, amounts, "");
for (uint256 i = 0; i < ids.length; i++) {
uint256 id = ids[i];
uint256 amount = amounts[i];
uint256 accountBalance = _balances[id][account];
require(accountBalance >= amount, "ERC1155: burn amount exceeds balance");
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][account] = accountBalance - amount;
_balances[id][from] = fromBalance - amount;
}
}
emit TransferBatch(operator, account, address(0), ids, amounts);
emit TransferBatch(operator, from, address(0), ids, amounts);
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits a {ApprovalForAll} event.
*/
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC1155: setting approval status for self");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC1155/IERC1155.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC1155/IERC1155Receiver.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC1155/extensions/ERC1155Burnable.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC1155/extensions/ERC1155Pausable.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC1155/extensions/ERC1155Supply.sol)
pragma solidity ^0.8.0;
......@@ -23,7 +24,7 @@ abstract contract ERC1155Supply is ERC1155 {
}
/**
* @dev Indicates weither any token exist with a given id, or not.
* @dev Indicates whether any token exist with a given id, or not.
*/
function exists(uint256 id) public view virtual returns (bool) {
return ERC1155Supply.totalSupply(id) > 0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC1155/extensions/IERC1155MetadataURI.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC1155/presets/ERC1155PresetMinterPauser.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC1155/utils/ERC1155Holder.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC1155/utils/ERC1155Receiver.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC20/ERC20.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC20/extensions/ERC20Burnable.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC20/extensions/ERC20Capped.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC20/extensions/ERC20FlashMint.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC20/extensions/ERC20Pausable.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC20/extensions/ERC20Snapshot.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC20/extensions/ERC20Votes.sol)
pragma solidity ^0.8.0;
......@@ -134,7 +135,7 @@ abstract contract ERC20Votes is ERC20Permit {
* @dev Delegate votes from the sender to `delegatee`.
*/
function delegate(address delegatee) public virtual {
return _delegate(_msgSender(), delegatee);
_delegate(_msgSender(), delegatee);
}
/**
......@@ -156,7 +157,7 @@ abstract contract ERC20Votes is ERC20Permit {
s
);
require(nonce == _useNonce(signer), "ERC20Votes: invalid nonce");
return _delegate(signer, delegatee);
_delegate(signer, delegatee);
}
/**
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC20/extensions/ERC20VotesComp.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC20/extensions/ERC20Wrapper.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC20/extensions/draft-ERC20Permit.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC20/extensions/draft-IERC20Permit.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC20/presets/ERC20PresetFixedSupply.sol)
pragma solidity ^0.8.0;
import "../extensions/ERC20Burnable.sol";
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC20/presets/ERC20PresetMinterPauser.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC20/utils/TokenTimelock.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC721/ERC721.sol)
pragma solidity ^0.8.0;
......@@ -133,10 +134,7 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
require(operator != _msgSender(), "ERC721: approve to caller");
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
......@@ -357,6 +355,21 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits a {ApprovalForAll} event.
*/
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC721: approve to caller");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC721/extensions/ERC721Burnable.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC721/extensions/ERC721Enumerable.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC721/extensions/ERC721Pausable.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC721/extensions/ERC721URIStorage.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC721/extensions/IERC721Enumerable.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC721/presets/ERC721PresetMinterPauserAutoId.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC721/utils/ERC721Holder.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC777/ERC777.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC777/IERC777.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC777/IERC777Recipient.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC777/IERC777Sender.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (token/ERC777/presets/ERC777PresetFixedSupply.sol)
pragma solidity ^0.8.0;
import "../ERC777.sol";
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (utils/Address.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (utils/Arrays.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (utils/Context.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (utils/Counters.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (utils/Create2.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (utils/Multicall.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (utils/StorageSlot.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (utils/Strings.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (utils/Timers.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (utils/cryptography/ECDSA.sol)
pragma solidity ^0.8.0;
import "../Strings.sol";
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
......@@ -205,6 +208,18 @@ library ECDSA {
}
/**
* @dev Returns an Ethereum Signed Message, created from `s`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
}
/**
* @dev Returns an Ethereum Signed Typed Data, created from a
* `domainSeparator` and a `structHash`. This produces hash corresponding
* to the one signed with the
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (utils/cryptography/MerkleProof.sol)
pragma solidity ^0.8.0;
......@@ -23,11 +24,21 @@ library MerkleProof {
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
bytes32 computedHash = leaf;
return processProof(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merklee tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leafs & pre-images are assumed to be sorted.
*
* _Available since v4.4._
*/
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
bytes32 proofElement = proof[i];
if (computedHash <= proofElement) {
// Hash(current computed hash + current element of the proof)
computedHash = keccak256(abi.encodePacked(computedHash, proofElement));
......@@ -36,8 +47,6 @@ library MerkleProof {
computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
}
}
// Check if the computed hash (root) is equal to the provided root
return computedHash == root;
return computedHash;
}
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (utils/cryptography/SignatureChecker.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (utils/cryptography/draft-EIP712.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (utils/escrow/ConditionalEscrow.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (utils/escrow/Escrow.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (utils/escrow/RefundEscrow.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (utils/introspection/ERC165Checker.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (utils/introspection/ERC165Storage.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (utils/introspection/ERC1820Implementer.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (utils/introspection/IERC1820Implementer.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (utils/introspection/IERC1820Registry.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (utils/math/Math.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (utils/math/SafeCast.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (utils/math/SignedSafeMath.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (utils/structs/BitMaps.sol)
pragma solidity ^0.8.0;
/**
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (utils/structs/EnumerableMap.sol)
pragma solidity ^0.8.0;
......
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0-rc.0 (utils/structs/EnumerableSet.sol)
pragma solidity ^0.8.0;
......
......@@ -16,7 +16,7 @@ The data signer can be recovered with xref:api:cryptography.adoc#ECDSA-recover-b
using ECDSA for bytes32;
function _verify(bytes32 data, bytes memory signature, address account) internal pure returns (bool) {
return keccak256(data)
return data
.toEthSignedMessageHash()
.recover(signature) == account;
}
......
{
"name": "openzeppelin-solidity",
"version": "4.3.2",
"version": "4.4.0-rc.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "openzeppelin-solidity",
"version": "4.3.2",
"version": "4.4.0-rc.0",
"license": "MIT",
"bin": {
"openzeppelin-contracts-migrate-imports": "scripts/migrate-imports.js"
......@@ -28,6 +28,7 @@
"eth-sig-util": "^3.0.0",
"ethereumjs-util": "^7.0.7",
"ethereumjs-wallet": "^1.0.1",
"glob": "^7.2.0",
"graphlib": "^2.1.8",
"hardhat": "^2.0.6",
"hardhat-gas-reporter": "^1.0.4",
......@@ -8660,51 +8661,51 @@
},
"node_modules/ganache-cli/node_modules/@types/bn.js": {
"version": "4.11.6",
"integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"@types/node": "*"
}
},
"node_modules/ganache-cli/node_modules/@types/node": {
"version": "14.11.2",
"integrity": "sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA==",
"dev": true,
"inBundle": true,
"license": "MIT"
"inBundle": true
},
"node_modules/ganache-cli/node_modules/@types/pbkdf2": {
"version": "3.1.0",
"integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"@types/node": "*"
}
},
"node_modules/ganache-cli/node_modules/@types/secp256k1": {
"version": "4.0.1",
"integrity": "sha512-+ZjSA8ELlOp8SlKi0YLB2tz9d5iPNEmOBd+8Rz21wTMdaXQIa9b6TEnD6l5qKOCypE7FSyPyck12qZJxSDNoog==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"@types/node": "*"
}
},
"node_modules/ganache-cli/node_modules/ansi-regex": {
"version": "4.1.0",
"integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
"dev": true,
"inBundle": true,
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/ganache-cli/node_modules/ansi-styles": {
"version": "3.2.1",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"color-convert": "^1.9.0"
},
......@@ -8714,36 +8715,36 @@
},
"node_modules/ganache-cli/node_modules/base-x": {
"version": "3.0.8",
"integrity": "sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"safe-buffer": "^5.0.1"
}
},
"node_modules/ganache-cli/node_modules/blakejs": {
"version": "1.1.0",
"integrity": "sha1-ad+S75U6qIylGjLfarHFShVfx6U=",
"dev": true,
"inBundle": true,
"license": "CC0-1.0"
"inBundle": true
},
"node_modules/ganache-cli/node_modules/bn.js": {
"version": "4.11.9",
"integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==",
"dev": true,
"inBundle": true,
"license": "MIT"
"inBundle": true
},
"node_modules/ganache-cli/node_modules/brorand": {
"version": "1.1.0",
"integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=",
"dev": true,
"inBundle": true,
"license": "MIT"
"inBundle": true
},
"node_modules/ganache-cli/node_modules/browserify-aes": {
"version": "1.2.0",
"integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"buffer-xor": "^1.0.3",
"cipher-base": "^1.0.0",
......@@ -8755,18 +8756,18 @@
},
"node_modules/ganache-cli/node_modules/bs58": {
"version": "4.0.1",
"integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"base-x": "^3.0.2"
}
},
"node_modules/ganache-cli/node_modules/bs58check": {
"version": "2.1.2",
"integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"bs58": "^4.0.0",
"create-hash": "^1.1.0",
......@@ -8775,30 +8776,30 @@
},
"node_modules/ganache-cli/node_modules/buffer-from": {
"version": "1.1.1",
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
"dev": true,
"inBundle": true,
"license": "MIT"
"inBundle": true
},
"node_modules/ganache-cli/node_modules/buffer-xor": {
"version": "1.0.3",
"integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=",
"dev": true,
"inBundle": true,
"license": "MIT"
"inBundle": true
},
"node_modules/ganache-cli/node_modules/camelcase": {
"version": "5.3.1",
"integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
"dev": true,
"inBundle": true,
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/ganache-cli/node_modules/cipher-base": {
"version": "1.0.4",
"integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"inherits": "^2.0.1",
"safe-buffer": "^5.0.1"
......@@ -8806,9 +8807,9 @@
},
"node_modules/ganache-cli/node_modules/cliui": {
"version": "5.0.0",
"integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==",
"dev": true,
"inBundle": true,
"license": "ISC",
"dependencies": {
"string-width": "^3.1.0",
"strip-ansi": "^5.2.0",
......@@ -8817,24 +8818,24 @@
},
"node_modules/ganache-cli/node_modules/color-convert": {
"version": "1.9.3",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"color-name": "1.1.3"
}
},
"node_modules/ganache-cli/node_modules/color-name": {
"version": "1.1.3",
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
"dev": true,
"inBundle": true,
"license": "MIT"
"inBundle": true
},
"node_modules/ganache-cli/node_modules/create-hash": {
"version": "1.2.0",
"integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"cipher-base": "^1.0.1",
"inherits": "^2.0.1",
......@@ -8845,9 +8846,9 @@
},
"node_modules/ganache-cli/node_modules/create-hmac": {
"version": "1.1.7",
"integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"cipher-base": "^1.0.3",
"create-hash": "^1.1.0",
......@@ -8859,9 +8860,9 @@
},
"node_modules/ganache-cli/node_modules/cross-spawn": {
"version": "6.0.5",
"integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"nice-try": "^1.0.4",
"path-key": "^2.0.1",
......@@ -8875,18 +8876,18 @@
},
"node_modules/ganache-cli/node_modules/decamelize": {
"version": "1.2.0",
"integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=",
"dev": true,
"inBundle": true,
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/ganache-cli/node_modules/elliptic": {
"version": "6.5.3",
"integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"bn.js": "^4.4.0",
"brorand": "^1.0.1",
......@@ -8899,24 +8900,24 @@
},
"node_modules/ganache-cli/node_modules/emoji-regex": {
"version": "7.0.3",
"integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==",
"dev": true,
"inBundle": true,
"license": "MIT"
"inBundle": true
},
"node_modules/ganache-cli/node_modules/end-of-stream": {
"version": "1.4.4",
"integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"once": "^1.4.0"
}
},
"node_modules/ganache-cli/node_modules/ethereum-cryptography": {
"version": "0.1.3",
"integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"@types/pbkdf2": "^3.0.0",
"@types/secp256k1": "^4.0.1",
......@@ -8937,9 +8938,9 @@
},
"node_modules/ganache-cli/node_modules/ethereumjs-util": {
"version": "6.2.1",
"integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==",
"dev": true,
"inBundle": true,
"license": "MPL-2.0",
"dependencies": {
"@types/bn.js": "^4.11.3",
"bn.js": "^4.11.0",
......@@ -8952,9 +8953,9 @@
},
"node_modules/ganache-cli/node_modules/ethjs-util": {
"version": "0.1.6",
"integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"is-hex-prefixed": "1.0.0",
"strip-hex-prefix": "1.0.0"
......@@ -8966,9 +8967,9 @@
},
"node_modules/ganache-cli/node_modules/evp_bytestokey": {
"version": "1.0.3",
"integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"md5.js": "^1.3.4",
"safe-buffer": "^5.1.1"
......@@ -8976,9 +8977,9 @@
},
"node_modules/ganache-cli/node_modules/execa": {
"version": "1.0.0",
"integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"cross-spawn": "^6.0.0",
"get-stream": "^4.0.0",
......@@ -8994,9 +8995,9 @@
},
"node_modules/ganache-cli/node_modules/find-up": {
"version": "3.0.0",
"integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"locate-path": "^3.0.0"
},
......@@ -9006,18 +9007,18 @@
},
"node_modules/ganache-cli/node_modules/get-caller-file": {
"version": "2.0.5",
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
"dev": true,
"inBundle": true,
"license": "ISC",
"engines": {
"node": "6.* || 8.* || >= 10.*"
}
},
"node_modules/ganache-cli/node_modules/get-stream": {
"version": "4.1.0",
"integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"pump": "^3.0.0"
},
......@@ -9027,9 +9028,9 @@
},
"node_modules/ganache-cli/node_modules/hash-base": {
"version": "3.1.0",
"integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"inherits": "^2.0.4",
"readable-stream": "^3.6.0",
......@@ -9041,9 +9042,9 @@
},
"node_modules/ganache-cli/node_modules/hash.js": {
"version": "1.1.7",
"integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"inherits": "^2.0.3",
"minimalistic-assert": "^1.0.1"
......@@ -9051,9 +9052,9 @@
},
"node_modules/ganache-cli/node_modules/hmac-drbg": {
"version": "1.0.1",
"integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"hash.js": "^1.0.3",
"minimalistic-assert": "^1.0.0",
......@@ -9062,33 +9063,33 @@
},
"node_modules/ganache-cli/node_modules/inherits": {
"version": "2.0.4",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
"dev": true,
"inBundle": true,
"license": "ISC"
"inBundle": true
},
"node_modules/ganache-cli/node_modules/invert-kv": {
"version": "2.0.0",
"integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==",
"dev": true,
"inBundle": true,
"license": "MIT",
"engines": {
"node": ">=4"
}
},
"node_modules/ganache-cli/node_modules/is-fullwidth-code-point": {
"version": "2.0.0",
"integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
"dev": true,
"inBundle": true,
"license": "MIT",
"engines": {
"node": ">=4"
}
},
"node_modules/ganache-cli/node_modules/is-hex-prefixed": {
"version": "1.0.0",
"integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=",
"dev": true,
"inBundle": true,
"license": "MIT",
"engines": {
"node": ">=6.5.0",
"npm": ">=3"
......@@ -9096,25 +9097,25 @@
},
"node_modules/ganache-cli/node_modules/is-stream": {
"version": "1.1.0",
"integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=",
"dev": true,
"inBundle": true,
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/ganache-cli/node_modules/isexe": {
"version": "2.0.0",
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
"dev": true,
"inBundle": true,
"license": "ISC"
"inBundle": true
},
"node_modules/ganache-cli/node_modules/keccak": {
"version": "3.0.1",
"integrity": "sha512-epq90L9jlFWCW7+pQa6JOnKn2Xgl2mtI664seYR6MHskvI9agt7AnDqmAlp9TqU4/caMYbA08Hi5DMZAl5zdkA==",
"dev": true,
"hasInstallScript": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"node-addon-api": "^2.0.0",
"node-gyp-build": "^4.2.0"
......@@ -9125,9 +9126,9 @@
},
"node_modules/ganache-cli/node_modules/lcid": {
"version": "2.0.0",
"integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"invert-kv": "^2.0.0"
},
......@@ -9137,9 +9138,9 @@
},
"node_modules/ganache-cli/node_modules/locate-path": {
"version": "3.0.0",
"integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"p-locate": "^3.0.0",
"path-exists": "^3.0.0"
......@@ -9150,9 +9151,9 @@
},
"node_modules/ganache-cli/node_modules/map-age-cleaner": {
"version": "0.1.3",
"integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"p-defer": "^1.0.0"
},
......@@ -9162,9 +9163,9 @@
},
"node_modules/ganache-cli/node_modules/md5.js": {
"version": "1.3.5",
"integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"hash-base": "^3.0.0",
"inherits": "^2.0.1",
......@@ -9173,9 +9174,9 @@
},
"node_modules/ganache-cli/node_modules/mem": {
"version": "4.3.0",
"integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"map-age-cleaner": "^0.1.1",
"mimic-fn": "^2.0.0",
......@@ -9187,42 +9188,42 @@
},
"node_modules/ganache-cli/node_modules/mimic-fn": {
"version": "2.1.0",
"integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
"dev": true,
"inBundle": true,
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/ganache-cli/node_modules/minimalistic-assert": {
"version": "1.0.1",
"integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==",
"dev": true,
"inBundle": true,
"license": "ISC"
"inBundle": true
},
"node_modules/ganache-cli/node_modules/minimalistic-crypto-utils": {
"version": "1.0.1",
"integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=",
"dev": true,
"inBundle": true,
"license": "MIT"
"inBundle": true
},
"node_modules/ganache-cli/node_modules/nice-try": {
"version": "1.0.5",
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
"dev": true,
"inBundle": true,
"license": "MIT"
"inBundle": true
},
"node_modules/ganache-cli/node_modules/node-addon-api": {
"version": "2.0.2",
"integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==",
"dev": true,
"inBundle": true,
"license": "MIT"
"inBundle": true
},
"node_modules/ganache-cli/node_modules/node-gyp-build": {
"version": "4.2.3",
"integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==",
"dev": true,
"inBundle": true,
"license": "MIT",
"bin": {
"node-gyp-build": "bin.js",
"node-gyp-build-optional": "optional.js",
......@@ -9231,9 +9232,9 @@
},
"node_modules/ganache-cli/node_modules/npm-run-path": {
"version": "2.0.2",
"integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"path-key": "^2.0.0"
},
......@@ -9243,18 +9244,18 @@
},
"node_modules/ganache-cli/node_modules/once": {
"version": "1.4.0",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"dev": true,
"inBundle": true,
"license": "ISC",
"dependencies": {
"wrappy": "1"
}
},
"node_modules/ganache-cli/node_modules/os-locale": {
"version": "3.1.0",
"integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"execa": "^1.0.0",
"lcid": "^2.0.0",
......@@ -9266,36 +9267,36 @@
},
"node_modules/ganache-cli/node_modules/p-defer": {
"version": "1.0.0",
"integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=",
"dev": true,
"inBundle": true,
"license": "MIT",
"engines": {
"node": ">=4"
}
},
"node_modules/ganache-cli/node_modules/p-finally": {
"version": "1.0.0",
"integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=",
"dev": true,
"inBundle": true,
"license": "MIT",
"engines": {
"node": ">=4"
}
},
"node_modules/ganache-cli/node_modules/p-is-promise": {
"version": "2.1.0",
"integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==",
"dev": true,
"inBundle": true,
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/ganache-cli/node_modules/p-limit": {
"version": "2.3.0",
"integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"p-try": "^2.0.0"
},
......@@ -9308,9 +9309,9 @@
},
"node_modules/ganache-cli/node_modules/p-locate": {
"version": "3.0.0",
"integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"p-limit": "^2.0.0"
},
......@@ -9320,36 +9321,36 @@
},
"node_modules/ganache-cli/node_modules/p-try": {
"version": "2.2.0",
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
"dev": true,
"inBundle": true,
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/ganache-cli/node_modules/path-exists": {
"version": "3.0.0",
"integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
"dev": true,
"inBundle": true,
"license": "MIT",
"engines": {
"node": ">=4"
}
},
"node_modules/ganache-cli/node_modules/path-key": {
"version": "2.0.1",
"integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=",
"dev": true,
"inBundle": true,
"license": "MIT",
"engines": {
"node": ">=4"
}
},
"node_modules/ganache-cli/node_modules/pbkdf2": {
"version": "3.1.1",
"integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"create-hash": "^1.1.2",
"create-hmac": "^1.1.4",
......@@ -9363,9 +9364,9 @@
},
"node_modules/ganache-cli/node_modules/pump": {
"version": "3.0.0",
"integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"end-of-stream": "^1.1.0",
"once": "^1.3.1"
......@@ -9373,18 +9374,18 @@
},
"node_modules/ganache-cli/node_modules/randombytes": {
"version": "2.1.0",
"integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"safe-buffer": "^5.1.0"
}
},
"node_modules/ganache-cli/node_modules/readable-stream": {
"version": "3.6.0",
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"inherits": "^2.0.3",
"string_decoder": "^1.1.1",
......@@ -9396,24 +9397,24 @@
},
"node_modules/ganache-cli/node_modules/require-directory": {
"version": "2.1.1",
"integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=",
"dev": true,
"inBundle": true,
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/ganache-cli/node_modules/require-main-filename": {
"version": "2.0.0",
"integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
"dev": true,
"inBundle": true,
"license": "ISC"
"inBundle": true
},
"node_modules/ganache-cli/node_modules/ripemd160": {
"version": "2.0.2",
"integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"hash-base": "^3.0.0",
"inherits": "^2.0.1"
......@@ -9421,9 +9422,9 @@
},
"node_modules/ganache-cli/node_modules/rlp": {
"version": "2.2.6",
"integrity": "sha512-HAfAmL6SDYNWPUOJNrM500x4Thn4PZsEy5pijPh40U9WfNk0z15hUYzO9xVIMAdIHdFtD8CBDHd75Td1g36Mjg==",
"dev": true,
"inBundle": true,
"license": "MPL-2.0",
"dependencies": {
"bn.js": "^4.11.1"
},
......@@ -9433,6 +9434,7 @@
},
"node_modules/ganache-cli/node_modules/safe-buffer": {
"version": "5.2.1",
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
"dev": true,
"funding": [
{
......@@ -9448,21 +9450,20 @@
"url": "https://feross.org/support"
}
],
"inBundle": true,
"license": "MIT"
"inBundle": true
},
"node_modules/ganache-cli/node_modules/scrypt-js": {
"version": "3.0.1",
"integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==",
"dev": true,
"inBundle": true,
"license": "MIT"
"inBundle": true
},
"node_modules/ganache-cli/node_modules/secp256k1": {
"version": "4.0.2",
"integrity": "sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg==",
"dev": true,
"hasInstallScript": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"elliptic": "^6.5.2",
"node-addon-api": "^2.0.0",
......@@ -9474,30 +9475,30 @@
},
"node_modules/ganache-cli/node_modules/semver": {
"version": "5.7.1",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
"dev": true,
"inBundle": true,
"license": "ISC",
"bin": {
"semver": "bin/semver"
}
},
"node_modules/ganache-cli/node_modules/set-blocking": {
"version": "2.0.0",
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
"dev": true,
"inBundle": true,
"license": "ISC"
"inBundle": true
},
"node_modules/ganache-cli/node_modules/setimmediate": {
"version": "1.0.5",
"integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=",
"dev": true,
"inBundle": true,
"license": "MIT"
"inBundle": true
},
"node_modules/ganache-cli/node_modules/sha.js": {
"version": "2.4.11",
"integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==",
"dev": true,
"inBundle": true,
"license": "(MIT AND BSD-3-Clause)",
"dependencies": {
"inherits": "^2.0.1",
"safe-buffer": "^5.0.1"
......@@ -9508,9 +9509,9 @@
},
"node_modules/ganache-cli/node_modules/shebang-command": {
"version": "1.2.0",
"integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"shebang-regex": "^1.0.0"
},
......@@ -9520,33 +9521,33 @@
},
"node_modules/ganache-cli/node_modules/shebang-regex": {
"version": "1.0.0",
"integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
"dev": true,
"inBundle": true,
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/ganache-cli/node_modules/signal-exit": {
"version": "3.0.3",
"integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==",
"dev": true,
"inBundle": true,
"license": "ISC"
"inBundle": true
},
"node_modules/ganache-cli/node_modules/source-map": {
"version": "0.6.1",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true,
"inBundle": true,
"license": "BSD-3-Clause",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/ganache-cli/node_modules/source-map-support": {
"version": "0.5.12",
"integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"buffer-from": "^1.0.0",
"source-map": "^0.6.0"
......@@ -9554,18 +9555,18 @@
},
"node_modules/ganache-cli/node_modules/string_decoder": {
"version": "1.3.0",
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"safe-buffer": "~5.2.0"
}
},
"node_modules/ganache-cli/node_modules/string-width": {
"version": "3.1.0",
"integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"emoji-regex": "^7.0.1",
"is-fullwidth-code-point": "^2.0.0",
......@@ -9577,9 +9578,9 @@
},
"node_modules/ganache-cli/node_modules/strip-ansi": {
"version": "5.2.0",
"integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"ansi-regex": "^4.1.0"
},
......@@ -9589,18 +9590,18 @@
},
"node_modules/ganache-cli/node_modules/strip-eof": {
"version": "1.0.0",
"integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=",
"dev": true,
"inBundle": true,
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/ganache-cli/node_modules/strip-hex-prefix": {
"version": "1.0.0",
"integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"is-hex-prefixed": "1.0.0"
},
......@@ -9611,15 +9612,15 @@
},
"node_modules/ganache-cli/node_modules/util-deprecate": {
"version": "1.0.2",
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
"dev": true,
"inBundle": true,
"license": "MIT"
"inBundle": true
},
"node_modules/ganache-cli/node_modules/which": {
"version": "1.3.1",
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
"dev": true,
"inBundle": true,
"license": "ISC",
"dependencies": {
"isexe": "^2.0.0"
},
......@@ -9629,15 +9630,15 @@
},
"node_modules/ganache-cli/node_modules/which-module": {
"version": "2.0.0",
"integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=",
"dev": true,
"inBundle": true,
"license": "ISC"
"inBundle": true
},
"node_modules/ganache-cli/node_modules/wrap-ansi": {
"version": "5.1.0",
"integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"ansi-styles": "^3.2.0",
"string-width": "^3.0.0",
......@@ -9649,21 +9650,21 @@
},
"node_modules/ganache-cli/node_modules/wrappy": {
"version": "1.0.2",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
"dev": true,
"inBundle": true,
"license": "ISC"
"inBundle": true
},
"node_modules/ganache-cli/node_modules/y18n": {
"version": "4.0.0",
"integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==",
"dev": true,
"inBundle": true,
"license": "ISC"
"inBundle": true
},
"node_modules/ganache-cli/node_modules/yargs": {
"version": "13.2.4",
"integrity": "sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"cliui": "^5.0.0",
"find-up": "^3.0.0",
......@@ -9680,9 +9681,9 @@
},
"node_modules/ganache-cli/node_modules/yargs-parser": {
"version": "13.1.2",
"integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==",
"dev": true,
"inBundle": true,
"license": "ISC",
"dependencies": {
"camelcase": "^5.0.0",
"decamelize": "^1.2.0"
......@@ -28074,6 +28075,7 @@
"dependencies": {
"@types/bn.js": {
"version": "4.11.6",
"integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28082,11 +28084,13 @@
},
"@types/node": {
"version": "14.11.2",
"integrity": "sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA==",
"bundled": true,
"dev": true
},
"@types/pbkdf2": {
"version": "3.1.0",
"integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28095,6 +28099,7 @@
},
"@types/secp256k1": {
"version": "4.0.1",
"integrity": "sha512-+ZjSA8ELlOp8SlKi0YLB2tz9d5iPNEmOBd+8Rz21wTMdaXQIa9b6TEnD6l5qKOCypE7FSyPyck12qZJxSDNoog==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28103,11 +28108,13 @@
},
"ansi-regex": {
"version": "4.1.0",
"integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
"bundled": true,
"dev": true
},
"ansi-styles": {
"version": "3.2.1",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28116,6 +28123,7 @@
},
"base-x": {
"version": "3.0.8",
"integrity": "sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28124,21 +28132,25 @@
},
"blakejs": {
"version": "1.1.0",
"integrity": "sha1-ad+S75U6qIylGjLfarHFShVfx6U=",
"bundled": true,
"dev": true
},
"bn.js": {
"version": "4.11.9",
"integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==",
"bundled": true,
"dev": true
},
"brorand": {
"version": "1.1.0",
"integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=",
"bundled": true,
"dev": true
},
"browserify-aes": {
"version": "1.2.0",
"integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28152,6 +28164,7 @@
},
"bs58": {
"version": "4.0.1",
"integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=",
"bundled": true,
"dev": true,
"requires": {
......@@ -28160,6 +28173,7 @@
},
"bs58check": {
"version": "2.1.2",
"integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28170,21 +28184,25 @@
},
"buffer-from": {
"version": "1.1.1",
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
"bundled": true,
"dev": true
},
"buffer-xor": {
"version": "1.0.3",
"integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=",
"bundled": true,
"dev": true
},
"camelcase": {
"version": "5.3.1",
"integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
"bundled": true,
"dev": true
},
"cipher-base": {
"version": "1.0.4",
"integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28194,6 +28212,7 @@
},
"cliui": {
"version": "5.0.0",
"integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28204,6 +28223,7 @@
},
"color-convert": {
"version": "1.9.3",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28212,11 +28232,13 @@
},
"color-name": {
"version": "1.1.3",
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
"bundled": true,
"dev": true
},
"create-hash": {
"version": "1.2.0",
"integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28229,6 +28251,7 @@
},
"create-hmac": {
"version": "1.1.7",
"integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28242,6 +28265,7 @@
},
"cross-spawn": {
"version": "6.0.5",
"integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28254,11 +28278,13 @@
},
"decamelize": {
"version": "1.2.0",
"integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=",
"bundled": true,
"dev": true
},
"elliptic": {
"version": "6.5.3",
"integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28273,11 +28299,13 @@
},
"emoji-regex": {
"version": "7.0.3",
"integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==",
"bundled": true,
"dev": true
},
"end-of-stream": {
"version": "1.4.4",
"integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28286,6 +28314,7 @@
},
"ethereum-cryptography": {
"version": "0.1.3",
"integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28308,6 +28337,7 @@
},
"ethereumjs-util": {
"version": "6.2.1",
"integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28322,6 +28352,7 @@
},
"ethjs-util": {
"version": "0.1.6",
"integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28331,6 +28362,7 @@
},
"evp_bytestokey": {
"version": "1.0.3",
"integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28340,6 +28372,7 @@
},
"execa": {
"version": "1.0.0",
"integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28354,6 +28387,7 @@
},
"find-up": {
"version": "3.0.0",
"integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28362,11 +28396,13 @@
},
"get-caller-file": {
"version": "2.0.5",
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
"bundled": true,
"dev": true
},
"get-stream": {
"version": "4.1.0",
"integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28375,6 +28411,7 @@
},
"hash-base": {
"version": "3.1.0",
"integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28385,6 +28422,7 @@
},
"hash.js": {
"version": "1.1.7",
"integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28394,6 +28432,7 @@
},
"hmac-drbg": {
"version": "1.0.1",
"integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=",
"bundled": true,
"dev": true,
"requires": {
......@@ -28404,36 +28443,43 @@
},
"inherits": {
"version": "2.0.4",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
"bundled": true,
"dev": true
},
"invert-kv": {
"version": "2.0.0",
"integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==",
"bundled": true,
"dev": true
},
"is-fullwidth-code-point": {
"version": "2.0.0",
"integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
"bundled": true,
"dev": true
},
"is-hex-prefixed": {
"version": "1.0.0",
"integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=",
"bundled": true,
"dev": true
},
"is-stream": {
"version": "1.1.0",
"integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=",
"bundled": true,
"dev": true
},
"isexe": {
"version": "2.0.0",
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
"bundled": true,
"dev": true
},
"keccak": {
"version": "3.0.1",
"integrity": "sha512-epq90L9jlFWCW7+pQa6JOnKn2Xgl2mtI664seYR6MHskvI9agt7AnDqmAlp9TqU4/caMYbA08Hi5DMZAl5zdkA==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28443,6 +28489,7 @@
},
"lcid": {
"version": "2.0.0",
"integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28451,6 +28498,7 @@
},
"locate-path": {
"version": "3.0.0",
"integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28460,6 +28508,7 @@
},
"map-age-cleaner": {
"version": "0.1.3",
"integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28468,6 +28517,7 @@
},
"md5.js": {
"version": "1.3.5",
"integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28478,6 +28528,7 @@
},
"mem": {
"version": "4.3.0",
"integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28488,36 +28539,43 @@
},
"mimic-fn": {
"version": "2.1.0",
"integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
"bundled": true,
"dev": true
},
"minimalistic-assert": {
"version": "1.0.1",
"integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==",
"bundled": true,
"dev": true
},
"minimalistic-crypto-utils": {
"version": "1.0.1",
"integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=",
"bundled": true,
"dev": true
},
"nice-try": {
"version": "1.0.5",
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
"bundled": true,
"dev": true
},
"node-addon-api": {
"version": "2.0.2",
"integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==",
"bundled": true,
"dev": true
},
"node-gyp-build": {
"version": "4.2.3",
"integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==",
"bundled": true,
"dev": true
},
"npm-run-path": {
"version": "2.0.2",
"integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=",
"bundled": true,
"dev": true,
"requires": {
......@@ -28526,6 +28584,7 @@
},
"once": {
"version": "1.4.0",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"bundled": true,
"dev": true,
"requires": {
......@@ -28534,6 +28593,7 @@
},
"os-locale": {
"version": "3.1.0",
"integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28544,21 +28604,25 @@
},
"p-defer": {
"version": "1.0.0",
"integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=",
"bundled": true,
"dev": true
},
"p-finally": {
"version": "1.0.0",
"integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=",
"bundled": true,
"dev": true
},
"p-is-promise": {
"version": "2.1.0",
"integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==",
"bundled": true,
"dev": true
},
"p-limit": {
"version": "2.3.0",
"integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28567,6 +28631,7 @@
},
"p-locate": {
"version": "3.0.0",
"integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28575,21 +28640,25 @@
},
"p-try": {
"version": "2.2.0",
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
"bundled": true,
"dev": true
},
"path-exists": {
"version": "3.0.0",
"integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
"bundled": true,
"dev": true
},
"path-key": {
"version": "2.0.1",
"integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=",
"bundled": true,
"dev": true
},
"pbkdf2": {
"version": "3.1.1",
"integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28602,6 +28671,7 @@
},
"pump": {
"version": "3.0.0",
"integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28611,6 +28681,7 @@
},
"randombytes": {
"version": "2.1.0",
"integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28619,6 +28690,7 @@
},
"readable-stream": {
"version": "3.6.0",
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28629,16 +28701,19 @@
},
"require-directory": {
"version": "2.1.1",
"integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=",
"bundled": true,
"dev": true
},
"require-main-filename": {
"version": "2.0.0",
"integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
"bundled": true,
"dev": true
},
"ripemd160": {
"version": "2.0.2",
"integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28648,6 +28723,7 @@
},
"rlp": {
"version": "2.2.6",
"integrity": "sha512-HAfAmL6SDYNWPUOJNrM500x4Thn4PZsEy5pijPh40U9WfNk0z15hUYzO9xVIMAdIHdFtD8CBDHd75Td1g36Mjg==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28656,16 +28732,19 @@
},
"safe-buffer": {
"version": "5.2.1",
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
"bundled": true,
"dev": true
},
"scrypt-js": {
"version": "3.0.1",
"integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==",
"bundled": true,
"dev": true
},
"secp256k1": {
"version": "4.0.2",
"integrity": "sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28676,21 +28755,25 @@
},
"semver": {
"version": "5.7.1",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
"bundled": true,
"dev": true
},
"set-blocking": {
"version": "2.0.0",
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
"bundled": true,
"dev": true
},
"setimmediate": {
"version": "1.0.5",
"integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=",
"bundled": true,
"dev": true
},
"sha.js": {
"version": "2.4.11",
"integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28700,6 +28783,7 @@
},
"shebang-command": {
"version": "1.2.0",
"integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
"bundled": true,
"dev": true,
"requires": {
......@@ -28708,21 +28792,25 @@
},
"shebang-regex": {
"version": "1.0.0",
"integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
"bundled": true,
"dev": true
},
"signal-exit": {
"version": "3.0.3",
"integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==",
"bundled": true,
"dev": true
},
"source-map": {
"version": "0.6.1",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"bundled": true,
"dev": true
},
"source-map-support": {
"version": "0.5.12",
"integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28732,6 +28820,7 @@
},
"string_decoder": {
"version": "1.3.0",
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28740,6 +28829,7 @@
},
"string-width": {
"version": "3.1.0",
"integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28750,6 +28840,7 @@
},
"strip-ansi": {
"version": "5.2.0",
"integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28758,11 +28849,13 @@
},
"strip-eof": {
"version": "1.0.0",
"integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=",
"bundled": true,
"dev": true
},
"strip-hex-prefix": {
"version": "1.0.0",
"integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=",
"bundled": true,
"dev": true,
"requires": {
......@@ -28771,11 +28864,13 @@
},
"util-deprecate": {
"version": "1.0.2",
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
"bundled": true,
"dev": true
},
"which": {
"version": "1.3.1",
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28784,11 +28879,13 @@
},
"which-module": {
"version": "2.0.0",
"integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=",
"bundled": true,
"dev": true
},
"wrap-ansi": {
"version": "5.1.0",
"integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28799,16 +28896,19 @@
},
"wrappy": {
"version": "1.0.2",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
"bundled": true,
"dev": true
},
"y18n": {
"version": "4.0.0",
"integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==",
"bundled": true,
"dev": true
},
"yargs": {
"version": "13.2.4",
"integrity": "sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg==",
"bundled": true,
"dev": true,
"requires": {
......@@ -28827,6 +28927,7 @@
},
"yargs-parser": {
"version": "13.1.2",
"integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==",
"bundled": true,
"dev": true,
"requires": {
......@@ -2,7 +2,7 @@
"private": true,
"name": "openzeppelin-solidity",
"description": "Secure Smart Contract library for Solidity",
"version": "4.3.2",
"version": "4.4.0-rc.0",
"files": [
"/contracts/**/*.sol",
"/build/contracts/*.json",
......@@ -67,6 +67,7 @@
"eth-sig-util": "^3.0.0",
"ethereumjs-util": "^7.0.7",
"ethereumjs-wallet": "^1.0.1",
"glob": "^7.2.0",
"graphlib": "^2.1.8",
"hardhat": "^2.0.6",
"hardhat-gas-reporter": "^1.0.4",
......
#!/usr/bin/env node
const fs = require('fs');
const glob = require('glob');
const proc = require('child_process');
const gitStatus = proc.execFileSync('git', ['status', '--porcelain', '-uno', 'contracts/**/*.sol']);
if (gitStatus.length > 0) {
console.error('Contracts directory is not clean');
process.exit(1);
}
const { version } = require('../../package.json');
const files = glob.sync('contracts/!(mocks)/**/*.sol');
for (const file of files) {
const current = fs.readFileSync(file, 'utf8');
const updated = current.replace(
/(\/\/ SPDX-License-Identifier:.*)$(\n\/\/ OpenZeppelin Contracts v.*$)?/m,
`$1\n// OpenZeppelin Contracts v${version} (${file.replace('contracts/', '')})`,
);
fs.writeFileSync(file, updated);
}
proc.execFileSync('git', ['add', '--update', 'contracts']);
......@@ -4,5 +4,6 @@ set -o errexit
scripts/release/update-changelog-release-date.js
scripts/release/synchronize-versions.js
scripts/release/update-comment.js
oz-docs update-version
......@@ -4,6 +4,7 @@ const { ZERO_ADDRESS } = constants;
const { expect } = require('chai');
const PaymentSplitter = artifacts.require('PaymentSplitter');
const Token = artifacts.require('ERC20Mock');
contract('PaymentSplitter', function (accounts) {
const [ owner, payee1, payee2, payee3, nonpayee1, payer1 ] = accounts;
......@@ -50,6 +51,7 @@ contract('PaymentSplitter', function (accounts) {
this.shares = [20, 10, 70];
this.contract = await PaymentSplitter.new(this.payees, this.shares);
this.token = await Token.new('MyToken', 'MT', owner, ether('1000'));
});
it('has total shares', async function () {
......@@ -63,12 +65,20 @@ contract('PaymentSplitter', function (accounts) {
}));
});
it('accepts payments', async function () {
describe('accepts payments', async function () {
it('Ether', async function () {
await send.ether(owner, this.contract.address, amount);
expect(await balance.current(this.contract.address)).to.be.bignumber.equal(amount);
});
it('Token', async function () {
await this.token.transfer(this.contract.address, amount, { from: owner });
expect(await this.token.balanceOf(this.contract.address)).to.be.bignumber.equal(amount);
});
});
describe('shares', async function () {
it('stores shares if address is payee', async function () {
expect(await this.contract.shares(payee1)).to.be.bignumber.not.equal('0');
......@@ -80,6 +90,7 @@ contract('PaymentSplitter', function (accounts) {
});
describe('release', async function () {
describe('Ether', async function () {
it('reverts if no funds to claim', async function () {
await expectRevert(this.contract.release(payee1),
'PaymentSplitter: account is not due payment',
......@@ -93,7 +104,23 @@ contract('PaymentSplitter', function (accounts) {
});
});
it('distributes funds to payees', async function () {
describe('Token', async function () {
it('reverts if no funds to claim', async function () {
await expectRevert(this.contract.release(this.token.address, payee1),
'PaymentSplitter: account is not due payment',
);
});
it('reverts if non-payee want to claim', async function () {
await this.token.transfer(this.contract.address, amount, { from: owner });
await expectRevert(this.contract.release(this.token.address, nonpayee1),
'PaymentSplitter: account has no shares',
);
});
});
});
describe('distributes funds to payees', async function () {
it('Ether', async function () {
await send.ether(payer1, this.contract.address, amount);
// receive funds
......@@ -126,5 +153,44 @@ contract('PaymentSplitter', function (accounts) {
// check correct funds released accounting
expect(await this.contract.totalReleased()).to.be.bignumber.equal(initBalance);
});
it('Token', async function () {
expect(await this.token.balanceOf(payee1)).to.be.bignumber.equal('0');
expect(await this.token.balanceOf(payee2)).to.be.bignumber.equal('0');
expect(await this.token.balanceOf(payee3)).to.be.bignumber.equal('0');
await this.token.transfer(this.contract.address, amount, { from: owner });
expectEvent(
await this.contract.release(this.token.address, payee1),
'ERC20PaymentReleased',
{ token: this.token.address, to: payee1, amount: ether('0.20') },
);
await this.token.transfer(this.contract.address, amount, { from: owner });
expectEvent(
await this.contract.release(this.token.address, payee1),
'ERC20PaymentReleased',
{ token: this.token.address, to: payee1, amount: ether('0.20') },
);
expectEvent(
await this.contract.release(this.token.address, payee2),
'ERC20PaymentReleased',
{ token: this.token.address, to: payee2, amount: ether('0.20') },
);
expectEvent(
await this.contract.release(this.token.address, payee3),
'ERC20PaymentReleased',
{ token: this.token.address, to: payee3, amount: ether('1.40') },
);
expect(await this.token.balanceOf(payee1)).to.be.bignumber.equal(ether('0.40'));
expect(await this.token.balanceOf(payee2)).to.be.bignumber.equal(ether('0.20'));
expect(await this.token.balanceOf(payee3)).to.be.bignumber.equal(ether('1.40'));
});
});
});
});
const { expectEvent } = require('@openzeppelin/test-helpers');
const { expect } = require('chai');
function releasedEvent (token, amount) {
return token
? [ 'ERC20Released', { token: token.address, amount } ]
: [ 'EtherReleased', { amount } ];
}
function shouldBehaveLikeVesting (beneficiary) {
it('check vesting schedule', async function () {
const [ method, ...args ] = this.token
? [ 'vestedAmount(address,uint64)', this.token.address ]
: [ 'vestedAmount(uint64)' ];
for (const timestamp of this.schedule) {
expect(await this.mock.methods[method](...args, timestamp))
.to.be.bignumber.equal(this.vestingFn(timestamp));
}
});
it('execute vesting schedule', async function () {
const [ method, ...args ] = this.token
? [ 'release(address)', this.token.address ]
: [ 'release()' ];
let released = web3.utils.toBN(0);
const before = await this.getBalance(beneficiary);
{
const receipt = await this.mock.methods[method](...args);
await expectEvent.inTransaction(
receipt.tx,
this.mock,
...releasedEvent(this.token, '0'),
);
await this.checkRelease(receipt, beneficiary, '0');
expect(await this.getBalance(beneficiary)).to.be.bignumber.equal(before);
}
for (const timestamp of this.schedule) {
const vested = this.vestingFn(timestamp);
await new Promise(resolve => web3.currentProvider.send({
method: 'evm_setNextBlockTimestamp',
params: [ timestamp.toNumber() ],
}, resolve));
const receipt = await this.mock.methods[method](...args);
await expectEvent.inTransaction(
receipt.tx,
this.mock,
...releasedEvent(this.token, vested.sub(released)),
);
await this.checkRelease(receipt, beneficiary, vested.sub(released));
expect(await this.getBalance(beneficiary))
.to.be.bignumber.equal(before.add(vested));
released = vested;
}
});
}
module.exports = {
shouldBehaveLikeVesting,
};
const { constants, expectEvent, expectRevert, time } = require('@openzeppelin/test-helpers');
const { web3 } = require('@openzeppelin/test-helpers/src/setup');
const { expect } = require('chai');
const ERC20Mock = artifacts.require('ERC20Mock');
const VestingWallet = artifacts.require('VestingWallet');
const { shouldBehaveLikeVesting } = require('./VestingWallet.behavior');
const min = (...args) => args.slice(1).reduce((x, y) => x.lt(y) ? x : y, args[0]);
contract('VestingWallet', function (accounts) {
const [ sender, beneficiary ] = accounts;
const amount = web3.utils.toBN(web3.utils.toWei('100'));
const duration = web3.utils.toBN(4 * 365 * 86400); // 4 years
beforeEach(async function () {
this.start = (await time.latest()).addn(3600); // in 1 hour
this.mock = await VestingWallet.new(beneficiary, this.start, duration);
});
it('rejects zero address for beneficiary', async function () {
await expectRevert(
VestingWallet.new(constants.ZERO_ADDRESS, this.start, duration),
'VestingWallet: beneficiary is zero address',
);
});
it('check vesting contract', async function () {
expect(await this.mock.beneficiary()).to.be.equal(beneficiary);
expect(await this.mock.start()).to.be.bignumber.equal(this.start);
expect(await this.mock.duration()).to.be.bignumber.equal(duration);
});
describe('vesting schedule', function () {
beforeEach(async function () {
this.schedule = Array(64).fill().map((_, i) => web3.utils.toBN(i).mul(duration).divn(60).add(this.start));
this.vestingFn = timestamp => min(amount, amount.mul(timestamp.sub(this.start)).div(duration));
});
describe('Eth vesting', function () {
beforeEach(async function () {
await web3.eth.sendTransaction({ from: sender, to: this.mock.address, value: amount });
this.getBalance = account => web3.eth.getBalance(account).then(web3.utils.toBN);
this.checkRelease = () => {};
});
shouldBehaveLikeVesting(beneficiary);
});
describe('ERC20 vesting', function () {
beforeEach(async function () {
this.token = await ERC20Mock.new('Name', 'Symbol', this.mock.address, amount);
this.getBalance = (account) => this.token.balanceOf(account);
this.checkRelease = (receipt, to, value) => expectEvent.inTransaction(
receipt.tx,
this.token,
'Transfer',
{ from: this.mock.address, to, value },
);
});
shouldBehaveLikeVesting(beneficiary);
});
});
});
......@@ -559,6 +559,10 @@ contract('Governor', function (accounts) {
await time.advanceBlockTo(this.snapshot);
expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Pending);
await time.advanceBlock();
expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Active);
});
runGovernorWorkflow();
......@@ -818,4 +822,125 @@ contract('Governor', function (accounts) {
);
});
});
describe('Settings update', function () {
describe('setVotingDelay', function () {
beforeEach(async function () {
this.settings = {
proposal: [
[ this.mock.address ],
[ web3.utils.toWei('0') ],
[ this.mock.contract.methods.setVotingDelay('0').encodeABI() ],
'<proposal description>',
],
tokenHolder: owner,
voters: [
{ voter: voter1, weight: web3.utils.toWei('10'), support: Enums.VoteType.For },
],
};
});
afterEach(async function () {
expect(await this.mock.votingDelay()).to.be.bignumber.equal('0');
expectEvent(
this.receipts.execute,
'VotingDelaySet',
{ oldVotingDelay: '4', newVotingDelay: '0' },
);
});
runGovernorWorkflow();
});
describe('setVotingPeriod', function () {
beforeEach(async function () {
this.settings = {
proposal: [
[ this.mock.address ],
[ web3.utils.toWei('0') ],
[ this.mock.contract.methods.setVotingPeriod('32').encodeABI() ],
'<proposal description>',
],
tokenHolder: owner,
voters: [
{ voter: voter1, weight: web3.utils.toWei('10'), support: Enums.VoteType.For },
],
};
});
afterEach(async function () {
expect(await this.mock.votingPeriod()).to.be.bignumber.equal('32');
expectEvent(
this.receipts.execute,
'VotingPeriodSet',
{ oldVotingPeriod: '16', newVotingPeriod: '32' },
);
});
runGovernorWorkflow();
});
describe('setVotingPeriod to 0', function () {
beforeEach(async function () {
this.settings = {
proposal: [
[ this.mock.address ],
[ web3.utils.toWei('0') ],
[ this.mock.contract.methods.setVotingPeriod('0').encodeABI() ],
'<proposal description>',
],
tokenHolder: owner,
voters: [
{ voter: voter1, weight: web3.utils.toWei('10'), support: Enums.VoteType.For },
],
steps: {
execute: { error: 'GovernorSettings: voting period too low' },
},
};
});
afterEach(async function () {
expect(await this.mock.votingPeriod()).to.be.bignumber.equal('16');
});
runGovernorWorkflow();
});
describe('setProposalThreshold', function () {
beforeEach(async function () {
this.settings = {
proposal: [
[ this.mock.address ],
[ web3.utils.toWei('0') ],
[ this.mock.contract.methods.setProposalThreshold('1000000000000000000').encodeABI() ],
'<proposal description>',
],
tokenHolder: owner,
voters: [
{ voter: voter1, weight: web3.utils.toWei('10'), support: Enums.VoteType.For },
],
};
});
afterEach(async function () {
expect(await this.mock.proposalThreshold()).to.be.bignumber.equal('1000000000000000000');
expectEvent(
this.receipts.execute,
'ProposalThresholdSet',
{ oldProposalThreshold: '0', newProposalThreshold: '1000000000000000000' },
);
});
runGovernorWorkflow();
});
describe('update protected', function () {
it('setVotingDelay', async function () {
await expectRevert(this.mock.setVotingDelay('0'), 'Governor: onlyGovernance');
});
it('setVotingPeriod', async function () {
await expectRevert(this.mock.setVotingPeriod('32'), 'Governor: onlyGovernance');
});
it('setProposalThreshold', async function () {
await expectRevert(this.mock.setProposalThreshold('1000000000000000000'), 'Governor: onlyGovernance');
});
});
});
});
......@@ -58,7 +58,7 @@ function runGovernorWorkflow () {
tryGet(this.settings, 'steps.propose.error') === undefined &&
tryGet(this.settings, 'steps.propose.noadvance') !== true
) {
await time.advanceBlockTo(this.snapshot);
await time.advanceBlockTo(this.snapshot.addn(1));
}
}
......@@ -92,7 +92,7 @@ function runGovernorWorkflow () {
// fast forward
if (tryGet(this.settings, 'steps.wait.enable') !== false) {
await time.advanceBlockTo(this.deadline);
await time.advanceBlockTo(this.deadline.addn(1));
}
// queue
......
......@@ -21,7 +21,7 @@ contract('GovernorComp', function (accounts) {
beforeEach(async function () {
this.owner = owner;
this.token = await Token.new(tokenName, tokenSymbol);
this.mock = await Governor.new(name, this.token.address, 4, 16);
this.mock = await Governor.new(name, this.token.address);
this.receiver = await CallReceiver.new();
await this.token.mint(owner, tokenSupply);
await this.token.delegate(voter1, { from: voter1 });
......
......@@ -51,6 +51,10 @@ contract('GovernorTimelockCompound', function (accounts) {
'GovernorTimelock',
]);
it('doesn\'t accept ether transfers', async function () {
await expectRevert.unspecified(web3.eth.sendTransaction({ from: voter, to: this.mock.address, value: 1 }));
});
it('post deployment check', async function () {
expect(await this.mock.name()).to.be.equal(name);
expect(await this.mock.token()).to.be.equal(this.token.address);
......
......@@ -45,6 +45,10 @@ contract('GovernorTimelockControl', function (accounts) {
'GovernorTimelock',
]);
it('doesn\'t accept ether transfers', async function () {
await expectRevert.unspecified(web3.eth.sendTransaction({ from: voter, to: this.mock.address, value: 1 }));
});
it('post deployment check', async function () {
expect(await this.mock.name()).to.be.equal(name);
expect(await this.mock.token()).to.be.equal(this.token.address);
......
......@@ -7,6 +7,7 @@ const ECDSAMock = artifacts.require('ECDSAMock');
const TEST_MESSAGE = web3.utils.sha3('OpenZeppelin');
const WRONG_MESSAGE = web3.utils.sha3('Nope');
const NON_HASH_MESSAGE = '0x' + Buffer.from('abcd').toString('hex');
function to2098Format (signature) {
const long = web3.utils.hexToBytes(signature);
......@@ -84,6 +85,17 @@ contract('ECDSA', function (accounts) {
)).to.equal(other);
});
it('returns signer address with correct signature for arbitrary length message', async function () {
// Create the signature
const signature = await web3.eth.sign(NON_HASH_MESSAGE, other);
// Recover the signer address from the generated message and signature.
expect(await this.ecdsa.recover(
toEthSignedMessageHash(NON_HASH_MESSAGE),
signature,
)).to.equal(other);
});
it('returns a different address', async function () {
const signature = await web3.eth.sign(TEST_MESSAGE, other);
expect(await this.ecdsa.recover(WRONG_MESSAGE, signature)).to.not.equal(other);
......@@ -196,9 +208,15 @@ contract('ECDSA', function (accounts) {
});
});
context('toEthSignedMessage', function () {
it('prefixes hashes correctly', async function () {
expect(await this.ecdsa.toEthSignedMessageHash(TEST_MESSAGE)).to.equal(toEthSignedMessageHash(TEST_MESSAGE));
context('toEthSignedMessageHash', function () {
it('prefixes bytes32 data correctly', async function () {
expect(await this.ecdsa.methods['toEthSignedMessageHash(bytes32)'](TEST_MESSAGE))
.to.equal(toEthSignedMessageHash(TEST_MESSAGE));
});
it('prefixes dynamic length data correctly', async function () {
expect(await this.ecdsa.methods['toEthSignedMessageHash(bytes)'](NON_HASH_MESSAGE))
.to.equal(toEthSignedMessageHash(NON_HASH_MESSAGE));
});
});
});
......@@ -37,7 +37,7 @@ contract('MerkleProof', function (accounts) {
const badElements = ['d', 'e', 'f'];
const badMerkleTree = new MerkleTree(badElements);
const badProof = badMerkleTree.getHexProof(badElements[0], keccak256, { hashLeaves: true, sortPairs: true });
const badProof = badMerkleTree.getHexProof(badElements[0]);
expect(await this.merkleProof.verify(badProof, correctRoot, correctLeaf)).to.equal(false);
});
......
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