Commit e93d36db by github-actions

Transpile 21f37381

parent 4f754a0e
......@@ -19,7 +19,7 @@ jobs:
ssh-key: ${{secrets.DEPLOY_KEY}}
- uses: actions/setup-node@v1
with:
node-version: 10.x
node-version: 12.x
- uses: actions/cache@v2
id: cache
with:
......
......@@ -6,6 +6,10 @@
## 4.1.0 (2021-04-29)
* `ERC20Votes`: add a new extension of the `ERC20` token with support for voting snapshots and delegation. This extension is compatible with Compound's `Comp` token interface. ([#2632](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2632))
## Unreleased
* `IERC20Metadata`: add a new extended interface that includes the optional `name()`, `symbol()` and `decimals()` functions. ([#2561](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2561))
* `ERC777`: make reception acquirement optional in `_mint`. ([#2552](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2552))
* `ERC20Permit`: add a `_useNonce` to enable further usage of ERC712 signatures. ([#2565](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2565))
......
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../token/ERC20/extensions/draft-ERC20VotesUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
contract ERC20VotesMockUpgradeable is Initializable, ERC20VotesUpgradeable {
function __ERC20VotesMock_init(
string memory name,
string memory symbol,
address initialAccount,
uint256 initialBalance
) internal initializer {
__Context_init_unchained();
__ERC20_init_unchained(name, symbol);
__EIP712_init_unchained(name, "1");
__ERC20Permit_init_unchained(name);
__ERC20Votes_init_unchained();
__ERC20VotesMock_init_unchained(name, symbol, initialAccount, initialBalance);
}
function __ERC20VotesMock_init_unchained(
string memory name,
string memory symbol,
address initialAccount,
uint256 initialBalance
) internal initializer {
_mint(initialAccount, initialBalance);
}
function getChainId() external view returns (uint256) {
return block.chainid;
}
uint256[50] private __gap;
}
......@@ -43,32 +43,53 @@ contract MathMockUpgradeableWithInit is MathMockUpgradeable {
__MathMock_init();
}
}
import "./ArraysImplUpgradeable.sol";
import "./ERC1271WalletMockUpgradeable.sol";
contract ArraysImplUpgradeableWithInit is ArraysImplUpgradeable {
constructor(uint256[] memory array) public payable {
__ArraysImpl_init(array);
contract ERC1271WalletMockUpgradeableWithInit is ERC1271WalletMockUpgradeable {
constructor(address originalOwner) public payable {
__ERC1271WalletMock_init(originalOwner);
}
}
import "../token/ERC20/presets/ERC20PresetMinterPauserUpgradeable.sol";
import "../token/ERC20/utils/TokenTimelockUpgradeable.sol";
contract ERC20PresetMinterPauserUpgradeableWithInit is ERC20PresetMinterPauserUpgradeable {
constructor(string memory name, string memory symbol) public payable {
__ERC20PresetMinterPauser_init(name, symbol);
contract TokenTimelockUpgradeableWithInit is TokenTimelockUpgradeable {
constructor(IERC20Upgradeable token_, address beneficiary_, uint256 releaseTime_) public payable {
__TokenTimelock_init(token_, beneficiary_, releaseTime_);
}
}
import "../token/ERC1155/presets/ERC1155PresetMinterPauserUpgradeable.sol";
import "./SafeERC20HelperUpgradeable.sol";
contract ERC1155PresetMinterPauserUpgradeableWithInit is ERC1155PresetMinterPauserUpgradeable {
constructor(string memory uri) public payable {
__ERC1155PresetMinterPauser_init(uri);
contract ERC20ReturnFalseMockUpgradeableWithInit is ERC20ReturnFalseMockUpgradeable {
constructor() public payable {
__ERC20ReturnFalseMock_init();
}
}
import "../token/ERC1155/ERC1155Upgradeable.sol";
import "./SafeERC20HelperUpgradeable.sol";
contract ERC1155UpgradeableWithInit is ERC1155Upgradeable {
constructor(string memory uri_) public payable {
__ERC1155_init(uri_);
contract ERC20ReturnTrueMockUpgradeableWithInit is ERC20ReturnTrueMockUpgradeable {
constructor() public payable {
__ERC20ReturnTrueMock_init();
}
}
import "./SafeERC20HelperUpgradeable.sol";
contract ERC20NoReturnMockUpgradeableWithInit is ERC20NoReturnMockUpgradeable {
constructor() public payable {
__ERC20NoReturnMock_init();
}
}
import "./SafeERC20HelperUpgradeable.sol";
contract SafeERC20WrapperUpgradeableWithInit is SafeERC20WrapperUpgradeable {
constructor(IERC20Upgradeable token) public payable {
__SafeERC20Wrapper_init(token);
}
}
import "../token/ERC20/presets/ERC20PresetMinterPauserUpgradeable.sol";
contract ERC20PresetMinterPauserUpgradeableWithInit is ERC20PresetMinterPauserUpgradeable {
constructor(string memory name, string memory symbol) public payable {
__ERC20PresetMinterPauser_init(name, symbol);
}
}
import "./PausableMockUpgradeable.sol";
......@@ -139,11 +160,18 @@ contract ERC1155ReceiverMockUpgradeableWithInit is ERC1155ReceiverMockUpgradeabl
__ERC1155ReceiverMock_init(recRetval, recReverts, batRetval, batReverts);
}
}
import "./ERC1155MockUpgradeable.sol";
import "../token/ERC1155/ERC1155Upgradeable.sol";
contract ERC1155MockUpgradeableWithInit is ERC1155MockUpgradeable {
contract ERC1155UpgradeableWithInit is ERC1155Upgradeable {
constructor(string memory uri_) public payable {
__ERC1155_init(uri_);
}
}
import "../token/ERC1155/presets/ERC1155PresetMinterPauserUpgradeable.sol";
contract ERC1155PresetMinterPauserUpgradeableWithInit is ERC1155PresetMinterPauserUpgradeable {
constructor(string memory uri) public payable {
__ERC1155Mock_init(uri);
__ERC1155PresetMinterPauser_init(uri);
}
}
import "./ERC1155PausableMockUpgradeable.sol";
......@@ -153,60 +181,86 @@ contract ERC1155PausableMockUpgradeableWithInit is ERC1155PausableMockUpgradeabl
__ERC1155PausableMock_init(uri);
}
}
import "./StorageSlotMockUpgradeable.sol";
import "./ERC1155MockUpgradeable.sol";
contract StorageSlotMockUpgradeableWithInit is StorageSlotMockUpgradeable {
constructor() public payable {
__StorageSlotMock_init();
contract ERC1155MockUpgradeableWithInit is ERC1155MockUpgradeable {
constructor(string memory uri) public payable {
__ERC1155Mock_init(uri);
}
}
import "./UUPS/TestInProdUpgradeable.sol";
import "./ERC1155BurnableMockUpgradeable.sol";
contract UUPSUpgradeableMockUpgradeableWithInit is UUPSUpgradeableMockUpgradeable {
constructor() public payable {
__UUPSUpgradeableMock_init();
contract ERC1155BurnableMockUpgradeableWithInit is ERC1155BurnableMockUpgradeable {
constructor(string memory uri) public payable {
__ERC1155BurnableMock_init(uri);
}
}
import "./UUPS/TestInProdUpgradeable.sol";
import "../token/ERC1155/utils/ERC1155HolderUpgradeable.sol";
contract UUPSUpgradeableUnsafeMockUpgradeableWithInit is UUPSUpgradeableUnsafeMockUpgradeable {
contract ERC1155HolderUpgradeableWithInit is ERC1155HolderUpgradeable {
constructor() public payable {
__UUPSUpgradeableUnsafeMock_init();
__ERC1155Holder_init();
}
}
import "./UUPS/TestInProdUpgradeable.sol";
import "./ERC721EnumerableMockUpgradeable.sol";
contract UUPSUpgradeableBrokenMockUpgradeableWithInit is UUPSUpgradeableBrokenMockUpgradeable {
constructor() public payable {
__UUPSUpgradeableBrokenMock_init();
contract ERC721EnumerableMockUpgradeableWithInit is ERC721EnumerableMockUpgradeable {
constructor(string memory name, string memory symbol) public payable {
__ERC721EnumerableMock_init(name, symbol);
}
}
import "./CountersImplUpgradeable.sol";
import "./StringsMockUpgradeable.sol";
contract CountersImplUpgradeableWithInit is CountersImplUpgradeable {
contract StringsMockUpgradeableWithInit is StringsMockUpgradeable {
constructor() public payable {
__CountersImpl_init();
__StringsMock_init();
}
}
import "./OwnableMockUpgradeable.sol";
import "../token/ERC721/utils/ERC721HolderUpgradeable.sol";
contract OwnableMockUpgradeableWithInit is OwnableMockUpgradeable {
contract ERC721HolderUpgradeableWithInit is ERC721HolderUpgradeable {
constructor() public payable {
__OwnableMock_init();
__ERC721Holder_init();
}
}
import "./ERC1271WalletMockUpgradeable.sol";
import "./ERC721ReceiverMockUpgradeable.sol";
contract ERC1271WalletMockUpgradeableWithInit is ERC1271WalletMockUpgradeable {
constructor(address originalOwner) public payable {
__ERC1271WalletMock_init(originalOwner);
contract ERC721ReceiverMockUpgradeableWithInit is ERC721ReceiverMockUpgradeable {
constructor(bytes4 retval, Error error) public payable {
__ERC721ReceiverMock_init(retval, error);
}
}
import "./SignatureCheckerMockUpgradeable.sol";
import "./ERC721BurnableMockUpgradeable.sol";
contract SignatureCheckerMockUpgradeableWithInit is SignatureCheckerMockUpgradeable {
constructor() public payable {
__SignatureCheckerMock_init();
contract ERC721BurnableMockUpgradeableWithInit is ERC721BurnableMockUpgradeable {
constructor(string memory name, string memory symbol) public payable {
__ERC721BurnableMock_init(name, symbol);
}
}
import "./ERC721PausableMockUpgradeable.sol";
contract ERC721PausableMockUpgradeableWithInit is ERC721PausableMockUpgradeable {
constructor(string memory name, string memory symbol) public payable {
__ERC721PausableMock_init(name, symbol);
}
}
import "./ERC3156FlashBorrowerMockUpgradeable.sol";
contract ERC3156FlashBorrowerMockUpgradeableWithInit is ERC3156FlashBorrowerMockUpgradeable {
constructor(bool enableReturn, bool enableApprove) public payable {
__ERC3156FlashBorrowerMock_init(enableReturn, enableApprove);
}
}
import "./ERC3156MockUpgradeable.sol";
contract ERC20FlashMintMockUpgradeableWithInit is ERC20FlashMintMockUpgradeable {
constructor(
string memory name,
string memory symbol,
address initialAccount,
uint256 initialBalance
) public payable {
__ERC20FlashMintMock_init(name, symbol, initialAccount, initialBalance);
}
}
import "./EIP712ExternalUpgradeable.sol";
......@@ -235,98 +289,94 @@ contract ERC20PermitMockUpgradeableWithInit is ERC20PermitMockUpgradeable {
__ERC20PermitMock_init(name, symbol, initialAccount, initialBalance);
}
}
import "./ECDSAMockUpgradeable.sol";
import "./ERC20MockUpgradeable.sol";
contract ECDSAMockUpgradeableWithInit is ECDSAMockUpgradeable {
constructor() public payable {
__ECDSAMock_init();
contract ERC20MockUpgradeableWithInit is ERC20MockUpgradeable {
constructor(
string memory name,
string memory symbol,
address initialAccount,
uint256 initialBalance
) public payable {
__ERC20Mock_init(name, symbol, initialAccount, initialBalance);
}
}
import "../utils/escrow/EscrowUpgradeable.sol";
import "./MulticallTokenMockUpgradeable.sol";
contract EscrowUpgradeableWithInit is EscrowUpgradeable {
constructor() public payable {
__Escrow_init();
contract MulticallTokenMockUpgradeableWithInit is MulticallTokenMockUpgradeable {
constructor(uint256 initialBalance) public payable {
__MulticallTokenMock_init(initialBalance);
}
}
import "./PullPaymentMockUpgradeable.sol";
import "./MulticallTestUpgradeable.sol";
contract PullPaymentMockUpgradeableWithInit is PullPaymentMockUpgradeable {
contract MulticallTestUpgradeableWithInit is MulticallTestUpgradeable {
constructor() public payable {
__PullPaymentMock_init();
__MulticallTest_init();
}
}
import "../utils/escrow/RefundEscrowUpgradeable.sol";
import "./ERC20DecimalsMockUpgradeable.sol";
contract RefundEscrowUpgradeableWithInit is RefundEscrowUpgradeable {
constructor(address payable beneficiary_) public payable {
__RefundEscrow_init(beneficiary_);
contract ERC20DecimalsMockUpgradeableWithInit is ERC20DecimalsMockUpgradeable {
constructor(string memory name_, string memory symbol_, uint8 decimals_) public payable {
__ERC20DecimalsMock_init(name_, symbol_, decimals_);
}
}
import "./ConditionalEscrowMockUpgradeable.sol";
import "./ERC20CappedMockUpgradeable.sol";
contract ConditionalEscrowMockUpgradeableWithInit is ConditionalEscrowMockUpgradeable {
constructor() public payable {
__ConditionalEscrowMock_init();
contract ERC20CappedMockUpgradeableWithInit is ERC20CappedMockUpgradeable {
constructor(string memory name, string memory symbol, uint256 cap) public payable {
__ERC20CappedMock_init(name, symbol, cap);
}
}
import "../token/ERC20/utils/TokenTimelockUpgradeable.sol";
import "../token/ERC20/presets/ERC20PresetFixedSupplyUpgradeable.sol";
contract TokenTimelockUpgradeableWithInit is TokenTimelockUpgradeable {
constructor(IERC20Upgradeable token_, address beneficiary_, uint256 releaseTime_) public payable {
__TokenTimelock_init(token_, beneficiary_, releaseTime_);
contract ERC20PresetFixedSupplyUpgradeableWithInit is ERC20PresetFixedSupplyUpgradeable {
constructor(
string memory name,
string memory symbol,
uint256 initialSupply,
address owner
) public payable {
__ERC20PresetFixedSupply_init(name, symbol, initialSupply, owner);
}
}
import "./SafeERC20HelperUpgradeable.sol";
import "./ERC20BurnableMockUpgradeable.sol";
contract ERC20ReturnFalseMockUpgradeableWithInit is ERC20ReturnFalseMockUpgradeable {
constructor() public payable {
__ERC20ReturnFalseMock_init();
contract ERC20BurnableMockUpgradeableWithInit is ERC20BurnableMockUpgradeable {
constructor(
string memory name,
string memory symbol,
address initialAccount,
uint256 initialBalance
) public payable {
__ERC20BurnableMock_init(name, symbol, initialAccount, initialBalance);
}
}
import "./SafeERC20HelperUpgradeable.sol";
import "./ERC20PausableMockUpgradeable.sol";
contract ERC20ReturnTrueMockUpgradeableWithInit is ERC20ReturnTrueMockUpgradeable {
constructor() public payable {
__ERC20ReturnTrueMock_init();
contract ERC20PausableMockUpgradeableWithInit is ERC20PausableMockUpgradeable {
constructor(
string memory name,
string memory symbol,
address initialAccount,
uint256 initialBalance
) public payable {
__ERC20PausableMock_init(name, symbol, initialAccount, initialBalance);
}
}
import "./SafeERC20HelperUpgradeable.sol";
import "./ReentrancyAttackUpgradeable.sol";
contract ERC20NoReturnMockUpgradeableWithInit is ERC20NoReturnMockUpgradeable {
contract ReentrancyAttackUpgradeableWithInit is ReentrancyAttackUpgradeable {
constructor() public payable {
__ERC20NoReturnMock_init();
}
}
import "./SafeERC20HelperUpgradeable.sol";
contract SafeERC20WrapperUpgradeableWithInit is SafeERC20WrapperUpgradeable {
constructor(IERC20Upgradeable token) public payable {
__SafeERC20Wrapper_init(token);
}
}
import "../token/ERC777/ERC777Upgradeable.sol";
contract ERC777UpgradeableWithInit is ERC777Upgradeable {
constructor(
string memory name_,
string memory symbol_,
address[] memory defaultOperators_
) public payable {
__ERC777_init(name_, symbol_, defaultOperators_);
__ReentrancyAttack_init();
}
}
import "../token/ERC777/presets/ERC777PresetFixedSupplyUpgradeable.sol";
import "./ReentrancyMockUpgradeable.sol";
contract ERC777PresetFixedSupplyUpgradeableWithInit is ERC777PresetFixedSupplyUpgradeable {
constructor(
string memory name,
string memory symbol,
address[] memory defaultOperators,
uint256 initialSupply,
address owner
) public payable {
__ERC777PresetFixedSupply_init(name, symbol, defaultOperators, initialSupply, owner);
contract ReentrancyMockUpgradeableWithInit is ReentrancyMockUpgradeable {
constructor() public payable {
__ReentrancyMock_init();
}
}
import "./ERC777SenderRecipientMockUpgradeable.sol";
......@@ -357,76 +407,62 @@ contract Create2ImplUpgradeableWithInit is Create2ImplUpgradeable {
__Create2Impl_init();
}
}
import "./ERC777MockUpgradeable.sol";
import "../token/ERC777/ERC777Upgradeable.sol";
contract ERC777MockUpgradeableWithInit is ERC777MockUpgradeable {
contract ERC777UpgradeableWithInit is ERC777Upgradeable {
constructor(
address initialHolder,
uint256 initialBalance,
string memory name,
string memory symbol,
address[] memory defaultOperators
string memory name_,
string memory symbol_,
address[] memory defaultOperators_
) public payable {
__ERC777Mock_init(initialHolder, initialBalance, name, symbol, defaultOperators);
}
}
import "./ERC3156FlashBorrowerMockUpgradeable.sol";
contract ERC3156FlashBorrowerMockUpgradeableWithInit is ERC3156FlashBorrowerMockUpgradeable {
constructor(bool enableReturn, bool enableApprove) public payable {
__ERC3156FlashBorrowerMock_init(enableReturn, enableApprove);
__ERC777_init(name_, symbol_, defaultOperators_);
}
}
import "./ERC3156MockUpgradeable.sol";
import "../token/ERC777/presets/ERC777PresetFixedSupplyUpgradeable.sol";
contract ERC20FlashMintMockUpgradeableWithInit is ERC20FlashMintMockUpgradeable {
contract ERC777PresetFixedSupplyUpgradeableWithInit is ERC777PresetFixedSupplyUpgradeable {
constructor(
string memory name,
string memory symbol,
address initialAccount,
uint256 initialBalance
address[] memory defaultOperators,
uint256 initialSupply,
address owner
) public payable {
__ERC20FlashMintMock_init(name, symbol, initialAccount, initialBalance);
}
}
import "./MulticallTokenMockUpgradeable.sol";
contract MulticallTokenMockUpgradeableWithInit is MulticallTokenMockUpgradeable {
constructor(uint256 initialBalance) public payable {
__MulticallTokenMock_init(initialBalance);
__ERC777PresetFixedSupply_init(name, symbol, defaultOperators, initialSupply, owner);
}
}
import "./ERC20MockUpgradeable.sol";
import "./ERC777MockUpgradeable.sol";
contract ERC20MockUpgradeableWithInit is ERC20MockUpgradeable {
contract ERC777MockUpgradeableWithInit is ERC777MockUpgradeable {
constructor(
address initialHolder,
uint256 initialBalance,
string memory name,
string memory symbol,
address initialAccount,
uint256 initialBalance
address[] memory defaultOperators
) public payable {
__ERC20Mock_init(name, symbol, initialAccount, initialBalance);
__ERC777Mock_init(initialHolder, initialBalance, name, symbol, defaultOperators);
}
}
import "./MulticallTestUpgradeable.sol";
import "./ContextMockUpgradeable.sol";
contract MulticallTestUpgradeableWithInit is MulticallTestUpgradeable {
contract ContextMockUpgradeableWithInit is ContextMockUpgradeable {
constructor() public payable {
__MulticallTest_init();
__ContextMock_init();
}
}
import "./ClonesMockUpgradeable.sol";
import "./ContextMockUpgradeable.sol";
contract ClonesMockUpgradeableWithInit is ClonesMockUpgradeable {
contract ContextMockCallerUpgradeableWithInit is ContextMockCallerUpgradeable {
constructor() public payable {
__ClonesMock_init();
__ContextMockCaller_init();
}
}
import "./AddressImplUpgradeable.sol";
import "./ERC2771ContextMockUpgradeable.sol";
contract AddressImplUpgradeableWithInit is AddressImplUpgradeable {
constructor() public payable {
__AddressImpl_init();
contract ERC2771ContextMockUpgradeableWithInit is ERC2771ContextMockUpgradeable {
constructor(address trustedForwarder) public payable {
__ERC2771ContextMock_init(trustedForwarder);
}
}
import "../finance/PaymentSplitterUpgradeable.sol";
......@@ -443,145 +479,128 @@ contract SafeMathMockUpgradeableWithInit is SafeMathMockUpgradeable {
__SafeMathMock_init();
}
}
import "./ERC1155BurnableMockUpgradeable.sol";
import "../utils/escrow/EscrowUpgradeable.sol";
contract ERC1155BurnableMockUpgradeableWithInit is ERC1155BurnableMockUpgradeable {
constructor(string memory uri) public payable {
__ERC1155BurnableMock_init(uri);
contract EscrowUpgradeableWithInit is EscrowUpgradeable {
constructor() public payable {
__Escrow_init();
}
}
import "../token/ERC1155/utils/ERC1155HolderUpgradeable.sol";
import "./PullPaymentMockUpgradeable.sol";
contract ERC1155HolderUpgradeableWithInit is ERC1155HolderUpgradeable {
contract PullPaymentMockUpgradeableWithInit is PullPaymentMockUpgradeable {
constructor() public payable {
__ERC1155Holder_init();
__PullPaymentMock_init();
}
}
import "./ERC721EnumerableMockUpgradeable.sol";
import "../utils/escrow/RefundEscrowUpgradeable.sol";
contract ERC721EnumerableMockUpgradeableWithInit is ERC721EnumerableMockUpgradeable {
constructor(string memory name, string memory symbol) public payable {
__ERC721EnumerableMock_init(name, symbol);
contract RefundEscrowUpgradeableWithInit is RefundEscrowUpgradeable {
constructor(address payable beneficiary_) public payable {
__RefundEscrow_init(beneficiary_);
}
}
import "./StringsMockUpgradeable.sol";
import "./ConditionalEscrowMockUpgradeable.sol";
contract StringsMockUpgradeableWithInit is StringsMockUpgradeable {
contract ConditionalEscrowMockUpgradeableWithInit is ConditionalEscrowMockUpgradeable {
constructor() public payable {
__StringsMock_init();
__ConditionalEscrowMock_init();
}
}
import "../token/ERC721/utils/ERC721HolderUpgradeable.sol";
import "./ClonesMockUpgradeable.sol";
contract ERC721HolderUpgradeableWithInit is ERC721HolderUpgradeable {
contract ClonesMockUpgradeableWithInit is ClonesMockUpgradeable {
constructor() public payable {
__ERC721Holder_init();
}
}
import "./ERC721ReceiverMockUpgradeable.sol";
contract ERC721ReceiverMockUpgradeableWithInit is ERC721ReceiverMockUpgradeable {
constructor(bytes4 retval, Error error) public payable {
__ERC721ReceiverMock_init(retval, error);
__ClonesMock_init();
}
}
import "./ERC721BurnableMockUpgradeable.sol";
import "./AddressImplUpgradeable.sol";
contract ERC721BurnableMockUpgradeableWithInit is ERC721BurnableMockUpgradeable {
constructor(string memory name, string memory symbol) public payable {
__ERC721BurnableMock_init(name, symbol);
contract AddressImplUpgradeableWithInit is AddressImplUpgradeable {
constructor() public payable {
__AddressImpl_init();
}
}
import "./ERC721PausableMockUpgradeable.sol";
import "./StorageSlotMockUpgradeable.sol";
contract ERC721PausableMockUpgradeableWithInit is ERC721PausableMockUpgradeable {
constructor(string memory name, string memory symbol) public payable {
__ERC721PausableMock_init(name, symbol);
contract StorageSlotMockUpgradeableWithInit is StorageSlotMockUpgradeable {
constructor() public payable {
__StorageSlotMock_init();
}
}
import "./ERC20PausableMockUpgradeable.sol";
import "./UUPS/TestInProdUpgradeable.sol";
contract ERC20PausableMockUpgradeableWithInit is ERC20PausableMockUpgradeable {
constructor(
string memory name,
string memory symbol,
address initialAccount,
uint256 initialBalance
) public payable {
__ERC20PausableMock_init(name, symbol, initialAccount, initialBalance);
contract UUPSUpgradeableMockUpgradeableWithInit is UUPSUpgradeableMockUpgradeable {
constructor() public payable {
__UUPSUpgradeableMock_init();
}
}
import "./ReentrancyAttackUpgradeable.sol";
import "./UUPS/TestInProdUpgradeable.sol";
contract ReentrancyAttackUpgradeableWithInit is ReentrancyAttackUpgradeable {
contract UUPSUpgradeableUnsafeMockUpgradeableWithInit is UUPSUpgradeableUnsafeMockUpgradeable {
constructor() public payable {
__ReentrancyAttack_init();
__UUPSUpgradeableUnsafeMock_init();
}
}
import "./ReentrancyMockUpgradeable.sol";
import "./UUPS/TestInProdUpgradeable.sol";
contract ReentrancyMockUpgradeableWithInit is ReentrancyMockUpgradeable {
contract UUPSUpgradeableBrokenMockUpgradeableWithInit is UUPSUpgradeableBrokenMockUpgradeable {
constructor() public payable {
__ReentrancyMock_init();
__UUPSUpgradeableBrokenMock_init();
}
}
import "../token/ERC20/presets/ERC20PresetFixedSupplyUpgradeable.sol";
import "./CountersImplUpgradeable.sol";
contract ERC20PresetFixedSupplyUpgradeableWithInit is ERC20PresetFixedSupplyUpgradeable {
constructor(
string memory name,
string memory symbol,
uint256 initialSupply,
address owner
) public payable {
__ERC20PresetFixedSupply_init(name, symbol, initialSupply, owner);
contract CountersImplUpgradeableWithInit is CountersImplUpgradeable {
constructor() public payable {
__CountersImpl_init();
}
}
import "./ERC20BurnableMockUpgradeable.sol";
import "./OwnableMockUpgradeable.sol";
contract ERC20BurnableMockUpgradeableWithInit is ERC20BurnableMockUpgradeable {
constructor(
string memory name,
string memory symbol,
address initialAccount,
uint256 initialBalance
) public payable {
__ERC20BurnableMock_init(name, symbol, initialAccount, initialBalance);
contract OwnableMockUpgradeableWithInit is OwnableMockUpgradeable {
constructor() public payable {
__OwnableMock_init();
}
}
import "./ContextMockUpgradeable.sol";
import "./SignatureCheckerMockUpgradeable.sol";
contract ContextMockUpgradeableWithInit is ContextMockUpgradeable {
contract SignatureCheckerMockUpgradeableWithInit is SignatureCheckerMockUpgradeable {
constructor() public payable {
__ContextMock_init();
__SignatureCheckerMock_init();
}
}
import "./ContextMockUpgradeable.sol";
import "./ECDSAMockUpgradeable.sol";
contract ContextMockCallerUpgradeableWithInit is ContextMockCallerUpgradeable {
contract ECDSAMockUpgradeableWithInit is ECDSAMockUpgradeable {
constructor() public payable {
__ContextMockCaller_init();
__ECDSAMock_init();
}
}
import "./ERC2771ContextMockUpgradeable.sol";
import "./SafeCastMockUpgradeable.sol";
contract ERC2771ContextMockUpgradeableWithInit is ERC2771ContextMockUpgradeable {
constructor(address trustedForwarder) public payable {
__ERC2771ContextMock_init(trustedForwarder);
contract SafeCastMockUpgradeableWithInit is SafeCastMockUpgradeable {
constructor() public payable {
__SafeCastMock_init();
}
}
import "./ERC20DecimalsMockUpgradeable.sol";
import "./ERC20VotesMockUpgradeable.sol";
contract ERC20DecimalsMockUpgradeableWithInit is ERC20DecimalsMockUpgradeable {
constructor(string memory name_, string memory symbol_, uint8 decimals_) public payable {
__ERC20DecimalsMock_init(name_, symbol_, decimals_);
contract ERC20VotesMockUpgradeableWithInit is ERC20VotesMockUpgradeable {
constructor(
string memory name,
string memory symbol,
address initialAccount,
uint256 initialBalance
) public payable {
__ERC20VotesMock_init(name, symbol, initialAccount, initialBalance);
}
}
import "./ERC20CappedMockUpgradeable.sol";
import "./ArraysImplUpgradeable.sol";
contract ERC20CappedMockUpgradeableWithInit is ERC20CappedMockUpgradeable {
constructor(string memory name, string memory symbol, uint256 cap) public payable {
__ERC20CappedMock_init(name, symbol, cap);
contract ArraysImplUpgradeableWithInit is ArraysImplUpgradeable {
constructor(uint256[] memory array) public payable {
__ArraysImpl_init(array);
}
}
import "./ERC20SnapshotMockUpgradeable.sol";
......@@ -701,13 +720,6 @@ contract MerkleProofWrapperUpgradeableWithInit is MerkleProofWrapperUpgradeable
__MerkleProofWrapper_init();
}
}
import "./SafeCastMockUpgradeable.sol";
contract SafeCastMockUpgradeableWithInit is SafeCastMockUpgradeable {
constructor() public payable {
__SafeCastMock_init();
}
}
import "./SignedSafeMathMockUpgradeable.sol";
contract SignedSafeMathMockUpgradeableWithInit is SignedSafeMathMockUpgradeable {
......
......@@ -21,6 +21,7 @@ Additionally there are multiple custom extensions, including:
* {ERC20Snapshot}: efficient storage of past token balances to be later queried at any point in time.
* {ERC20Permit}: gasless approval of tokens (standardized as ERC2612).
* {ERC20FlashMint}: token level support for flash loans through the minting and burning of ephemeral tokens (standardized as ERC3156).
* {ERC20Votes}: support for voting and vote delegation (compatible with Compound's token).
Finally, there are some utilities to interact with ERC20 contracts in various ways.
......@@ -31,6 +32,7 @@ The following related EIPs are in draft status.
- {ERC20Permit}
- {ERC20FlashMint}
- {ERC20Votes}
NOTE: This core set of contracts is designed to be unopinionated, allowing developers to access the internal functions in ERC20 (such as <<ERC20-_mint-address-uint256-,`_mint`>>) and expose them as external functions in the way they prefer. On the other hand, xref:ROOT:erc20.adoc#Presets[ERC20 Presets] (such as {ERC20PresetMinterPauser}) are designed using opinionated patterns to provide developers with ready to use, deployable contracts.
......@@ -60,6 +62,8 @@ The following EIPs are still in Draft status. Due to their nature as drafts, the
{{ERC20FlashMint}}
{{ERC20Votes}}
== Presets
These contracts are preconfigured combinations of the above features. They can be used through inheritance or as models to copy and paste their source code.
......
......@@ -21,6 +21,13 @@ import "../../../proxy/utils/Initializable.sol";
* id. To get the balance of an account at the time of a snapshot, call the {balanceOfAt} function with the snapshot id
* and the account address.
*
* NOTE: Snapshot policy can be customized by overriding the {_getCurrentSnapshotId} method. For example, having it
* return `block.number` will trigger the creation of snapshot at the begining of each new block. When overridding this
* function, be careful about the monotonicity of its result. Non-monotonic snapshot ids will break the contract.
*
* Implementing snapshots for every block using this method will incur significant gas costs. For a gas-efficient
* alternative consider {ERC20Votes}.
*
* ==== Gas Costs
*
* Snapshots are efficient. Snapshot creation is _O(1)_. Retrieval of balances or total supply from a snapshot is _O(log
......@@ -31,6 +38,7 @@ import "../../../proxy/utils/Initializable.sol";
* only significant for the first transfer that immediately follows a snapshot for a particular account. Subsequent
* transfers will have normal cost until the next snapshot, and so on.
*/
abstract contract ERC20SnapshotUpgradeable is Initializable, ERC20Upgradeable {
function __ERC20Snapshot_init() internal initializer {
__Context_init_unchained();
......@@ -87,12 +95,19 @@ abstract contract ERC20SnapshotUpgradeable is Initializable, ERC20Upgradeable {
function _snapshot() internal virtual returns (uint256) {
_currentSnapshotId.increment();
uint256 currentId = _currentSnapshotId.current();
uint256 currentId = _getCurrentSnapshotId();
emit Snapshot(currentId);
return currentId;
}
/**
* @dev Get the current snapshotId
*/
function _getCurrentSnapshotId() internal view virtual returns (uint256) {
return _currentSnapshotId.current();
}
/**
* @dev Retrieves the balance of `account` at the time `snapshotId` was created.
*/
function balanceOfAt(address account, uint256 snapshotId) public view virtual returns (uint256) {
......@@ -110,7 +125,6 @@ abstract contract ERC20SnapshotUpgradeable is Initializable, ERC20Upgradeable {
return snapshotted ? value : totalSupply();
}
// Update balance and/or total supply snapshots before the values are modified. This is implemented
// in the _beforeTokenTransfer hook, which is executed for _mint, _burn, and _transfer operations.
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override {
......@@ -135,8 +149,7 @@ abstract contract ERC20SnapshotUpgradeable is Initializable, ERC20Upgradeable {
private view returns (bool, uint256)
{
require(snapshotId > 0, "ERC20Snapshot: id is 0");
// solhint-disable-next-line max-line-length
require(snapshotId <= _currentSnapshotId.current(), "ERC20Snapshot: nonexistent id");
require(snapshotId <= _getCurrentSnapshotId(), "ERC20Snapshot: nonexistent id");
// When a valid snapshot is queried, there are three possibilities:
// a) The queried value was not modified after the snapshot was taken. Therefore, a snapshot entry was never
......@@ -170,7 +183,7 @@ abstract contract ERC20SnapshotUpgradeable is Initializable, ERC20Upgradeable {
}
function _updateSnapshot(Snapshots storage snapshots, uint256 currentValue) private {
uint256 currentId = _currentSnapshotId.current();
uint256 currentId = _getCurrentSnapshotId();
if (_lastSnapshotId(snapshots.ids) < currentId) {
snapshots.ids.push(currentId);
snapshots.values.push(currentValue);
......
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./draft-ERC20PermitUpgradeable.sol";
import "./draft-IERC20VotesUpgradeable.sol";
import "../../../utils/math/MathUpgradeable.sol";
import "../../../utils/math/SafeCastUpgradeable.sol";
import "../../../utils/cryptography/ECDSAUpgradeable.sol";
import "../../../proxy/utils/Initializable.sol";
/**
* @dev Extension of the ERC20 token contract to support Compound's voting and delegation.
*
* This extensions keeps a history (checkpoints) of each account's vote power. Vote power can be delegated either
* by calling the {delegate} function directly, or by providing a signature to be used with {delegateBySig}. Voting
* power can be queried through the public accessors {getCurrentVotes} and {getPriorVotes}.
*
* By default, token balance does not account for voting power. This makes transfers cheaper. The downside is that it
* requires users to delegate to themselves in order to activate checkpoints and have their voting power tracked.
* Enabling self-delegation can easily be done by overriding the {delegates} function. Keep in mind however that this
* will significantly increase the base gas cost of transfers.
*
* _Available since v4.2._
*/
abstract contract ERC20VotesUpgradeable is Initializable, IERC20VotesUpgradeable, ERC20PermitUpgradeable {
function __ERC20Votes_init() internal initializer {
__Context_init_unchained();
__EIP712_init_unchained(name, "1");
__ERC20Votes_init_unchained();
}
function __ERC20Votes_init_unchained() internal initializer {
}
bytes32 private constant _DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");
mapping (address => address) private _delegates;
mapping (address => Checkpoint[]) private _checkpoints;
/**
* @dev Get the `pos`-th checkpoint for `account`.
*/
function checkpoints(address account, uint32 pos) external view virtual override returns (Checkpoint memory) {
return _checkpoints[account][pos];
}
/**
* @dev Get number of checkpoints for `account`.
*/
function numCheckpoints(address account) external view virtual override returns (uint32) {
return SafeCastUpgradeable.toUint32(_checkpoints[account].length);
}
/**
* @dev Get the address `account` is currently delegating to.
*/
function delegates(address account) public view virtual override returns (address) {
return _delegates[account];
}
/**
* @dev Gets the current votes balance for `account`
*/
function getCurrentVotes(address account) external view override returns (uint256) {
uint256 pos = _checkpoints[account].length;
return pos == 0 ? 0 : _checkpoints[account][pos - 1].votes;
}
/**
* @dev Determine the number of votes for `account` at the begining of `blockNumber`.
*/
function getPriorVotes(address account, uint256 blockNumber) external view override returns (uint256) {
require(blockNumber < block.number, "ERC20Votes::getPriorVotes: not yet determined");
Checkpoint[] storage ckpts = _checkpoints[account];
// We run a binary search to look for the earliest checkpoint taken after `blockNumber`.
//
// During the loop, the index of the wanted checkpoint remains in the range [low, high).
// With each iteration, either `low` or `high` is moved towards the middle of the range to maintain the invariant.
// - If the middle checkpoint is after `blockNumber`, we look in [low, mid)
// - If the middle checkpoint is before `blockNumber`, we look in [mid+1, high)
// Once we reach a single value (when low == high), we've found the right checkpoint at the index high-1, if not
// out of bounds (in which case we're looking too far in the past and the result is 0).
// Note that if the latest checkpoint available is exactly for `blockNumber`, we end up with an index that is
// past the end of the array, so we technically don't find a checkpoint after `blockNumber`, but it works out
// the same.
uint256 high = ckpts.length;
uint256 low = 0;
while (low < high) {
uint256 mid = MathUpgradeable.average(low, high);
if (ckpts[mid].fromBlock > blockNumber) {
high = mid;
} else {
low = mid + 1;
}
}
return high == 0 ? 0 : ckpts[high - 1].votes;
}
/**
* @dev Delegate votes from the sender to `delegatee`.
*/
function delegate(address delegatee) public virtual override {
return _delegate(_msgSender(), delegatee);
}
/**
* @dev Delegates votes from signer to `delegatee`
*/
function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s)
public virtual override
{
require(block.timestamp <= expiry, "ERC20Votes::delegateBySig: signature expired");
address signer = ECDSAUpgradeable.recover(
_hashTypedDataV4(keccak256(abi.encode(
_DELEGATION_TYPEHASH,
delegatee,
nonce,
expiry
))),
v, r, s
);
require(nonce == _useNonce(signer), "ERC20Votes::delegateBySig: invalid nonce");
return _delegate(signer, delegatee);
}
/**
* @dev Change delegation for `delegator` to `delegatee`.
*/
function _delegate(address delegator, address delegatee) internal virtual {
address currentDelegate = delegates(delegator);
uint256 delegatorBalance = balanceOf(delegator);
_delegates[delegator] = delegatee;
emit DelegateChanged(delegator, currentDelegate, delegatee);
_moveVotingPower(currentDelegate, delegatee, delegatorBalance);
}
function _moveVotingPower(address src, address dst, uint256 amount) private {
if (src != dst && amount > 0) {
if (src != address(0)) {
uint256 srcCkptLen = _checkpoints[src].length;
uint256 srcCkptOld = srcCkptLen == 0 ? 0 : _checkpoints[src][srcCkptLen - 1].votes;
uint256 srcCkptNew = srcCkptOld - amount;
_writeCheckpoint(src, srcCkptLen, srcCkptOld, srcCkptNew);
}
if (dst != address(0)) {
uint256 dstCkptLen = _checkpoints[dst].length;
uint256 dstCkptOld = dstCkptLen == 0 ? 0 : _checkpoints[dst][dstCkptLen - 1].votes;
uint256 dstCkptNew = dstCkptOld + amount;
_writeCheckpoint(dst, dstCkptLen, dstCkptOld, dstCkptNew);
}
}
}
function _writeCheckpoint(address delegatee, uint256 pos, uint256 oldWeight, uint256 newWeight) private {
if (pos > 0 && _checkpoints[delegatee][pos - 1].fromBlock == block.number) {
_checkpoints[delegatee][pos - 1].votes = SafeCastUpgradeable.toUint224(newWeight);
} else {
_checkpoints[delegatee].push(Checkpoint({
fromBlock: SafeCastUpgradeable.toUint32(block.number),
votes: SafeCastUpgradeable.toUint224(newWeight)
}));
}
emit DelegateVotesChanged(delegatee, oldWeight, newWeight);
}
function _mint(address account, uint256 amount) internal virtual override {
super._mint(account, amount);
require(totalSupply() <= type(uint224).max, "ERC20Votes: total supply exceeds 2**224");
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override {
_moveVotingPower(delegates(from), delegates(to), amount);
}
uint256[48] private __gap;
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../IERC20Upgradeable.sol";
interface IERC20VotesUpgradeable is IERC20Upgradeable {
struct Checkpoint {
uint32 fromBlock;
uint224 votes;
}
event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);
event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance);
function delegates(address owner) external view returns (address);
function checkpoints(address account, uint32 pos) external view returns (Checkpoint memory);
function numCheckpoints(address account) external view returns (uint32);
function getCurrentVotes(address account) external view returns (uint256);
function getPriorVotes(address account, uint256 blockNumber) external view returns (uint256);
function delegate(address delegatee) external;
function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) external;
}
......@@ -19,6 +19,21 @@ pragma solidity ^0.8.0;
*/
library SafeCastUpgradeable {
/**
* @dev Returns the downcasted uint224 from uint256, reverting on
* overflow (when the input is greater than largest uint224).
*
* Counterpart to Solidity's `uint224` operator.
*
* Requirements:
*
* - input must fit into 224 bits
*/
function toUint224(uint256 value) internal pure returns (uint224) {
require(value < 2**224, "SafeCast: value doesn\'t fit in 224 bits");
return uint224(value);
}
/**
* @dev Returns the downcasted uint128 from uint256, reverting on
* overflow (when the input is greater than largest uint128).
*
......
......@@ -1332,12 +1332,6 @@
"node": ">=8"
}
},
"node_modules/@oclif/config/node_modules/tslib": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz",
"integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==",
"dev": true
},
"node_modules/@oclif/errors": {
"version": "1.3.4",
"resolved": "https://registry.npmjs.org/@oclif/errors/-/errors-1.3.4.tgz",
......@@ -1472,6 +1466,12 @@
"node": ">=4"
}
},
"node_modules/@oclif/parser/node_modules/tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
},
"node_modules/@oclif/plugin-help": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/@oclif/plugin-help/-/plugin-help-3.2.2.tgz",
......@@ -1715,6 +1715,12 @@
"node": ">=6"
}
},
"node_modules/@sentry/core/node_modules/tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
},
"node_modules/@sentry/hub": {
"version": "5.30.0",
"resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-5.30.0.tgz",
......@@ -1729,6 +1735,12 @@
"node": ">=6"
}
},
"node_modules/@sentry/hub/node_modules/tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
},
"node_modules/@sentry/minimal": {
"version": "5.30.0",
"resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-5.30.0.tgz",
......@@ -1743,6 +1755,12 @@
"node": ">=6"
}
},
"node_modules/@sentry/minimal/node_modules/tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
},
"node_modules/@sentry/node": {
"version": "5.30.0",
"resolved": "https://registry.npmjs.org/@sentry/node/-/node-5.30.0.tgz",
......@@ -1763,6 +1781,12 @@
"node": ">=6"
}
},
"node_modules/@sentry/node/node_modules/tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
},
"node_modules/@sentry/tracing": {
"version": "5.30.0",
"resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-5.30.0.tgz",
......@@ -1779,6 +1803,12 @@
"node": ">=6"
}
},
"node_modules/@sentry/tracing/node_modules/tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
},
"node_modules/@sentry/types": {
"version": "5.30.0",
"resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.30.0.tgz",
......@@ -1801,6 +1831,12 @@
"node": ">=6"
}
},
"node_modules/@sentry/utils/node_modules/tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
},
"node_modules/@sindresorhus/is": {
"version": "0.14.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz",
......@@ -1909,16 +1945,16 @@
}
},
"node_modules/@truffle/contract": {
"version": "4.3.15",
"resolved": "https://registry.npmjs.org/@truffle/contract/-/contract-4.3.15.tgz",
"integrity": "sha512-PHM6tCF/GB3r/t5YbeXagtg9XPtjFgbc5YnRcXs8m2Cp2hXFeU91n1dxmIkBVJklia+tWGqLuVxvMqI88tcWbw==",
"version": "4.3.16",
"resolved": "https://registry.npmjs.org/@truffle/contract/-/contract-4.3.16.tgz",
"integrity": "sha512-/GhDFu8pu1TMVev5WTxQj87Vo8Di5Uo0LXvdV7ESdUbEIzMlm9pjfkf2uWg8Jx2aSBGgfCeLXw8GVScBk9OjlA==",
"dev": true,
"dependencies": {
"@truffle/blockchain-utils": "^0.0.29",
"@truffle/contract-schema": "^3.4.0",
"@truffle/debug-utils": "^5.0.15",
"@truffle/error": "^0.0.13",
"@truffle/interface-adapter": "^0.4.22",
"@truffle/blockchain-utils": "^0.0.30",
"@truffle/contract-schema": "^3.4.1",
"@truffle/debug-utils": "^5.0.16",
"@truffle/error": "^0.0.14",
"@truffle/interface-adapter": "^0.4.23",
"bignumber.js": "^7.2.1",
"ethereum-ens": "^0.8.0",
"ethers": "^4.0.32",
......@@ -1930,9 +1966,9 @@
}
},
"node_modules/@truffle/contract-schema": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/@truffle/contract-schema/-/contract-schema-3.4.0.tgz",
"integrity": "sha512-Kk2t7r98tiL3nxj0/4ukZ7Asvi5K/5JlHuI3jM7dXAMhrWYrt+nf5LZVwJPd1nlzuZy8WK4AgSj2B1vCTz/AlQ==",
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/@truffle/contract-schema/-/contract-schema-3.4.1.tgz",
"integrity": "sha512-2gvu6gxJtbbI67H2Bwh2rBuej+1uCV3z4zKFzQZP00hjNoL+QfybrmBcOVB88PflBeEB+oUXuwQfDoKX3TXlnQ==",
"dev": true,
"dependencies": {
"ajv": "^6.10.0",
......@@ -1941,15 +1977,15 @@
}
},
"node_modules/@truffle/contract/node_modules/@truffle/blockchain-utils": {
"version": "0.0.29",
"resolved": "https://registry.npmjs.org/@truffle/blockchain-utils/-/blockchain-utils-0.0.29.tgz",
"integrity": "sha512-bPUN0GBc9kEAD0Hg7BJXQ0F1BwPI/4wwc1B580QwyOQp0Fp8uK9kOOxNagh4wB+s8vPFlmC62OqoYyG4CeYyHQ==",
"version": "0.0.30",
"resolved": "https://registry.npmjs.org/@truffle/blockchain-utils/-/blockchain-utils-0.0.30.tgz",
"integrity": "sha512-3hkHSHxVavoALcxpBqD4YwHuCmkBrvjq6PAGw93i6WCB+pnejBD5sFjVCiZZKCogh4kGObxxcwu53+3dyT/6IQ==",
"dev": true
},
"node_modules/@truffle/contract/node_modules/@truffle/codec": {
"version": "0.10.5",
"resolved": "https://registry.npmjs.org/@truffle/codec/-/codec-0.10.5.tgz",
"integrity": "sha512-M8YR8hKxXTypgg8g8iD/rUkkWgS89/NqkLAR+ZpZIzO3PZ5pkiIysO2VkWeqJid8hVDM4O4Eswgt2ISrQzsVRg==",
"version": "0.10.6",
"resolved": "https://registry.npmjs.org/@truffle/codec/-/codec-0.10.6.tgz",
"integrity": "sha512-laKk5iL2Y9W0ndNnFAy2f3tuhwYV4PlQf1aZO3mlxk0QgCVkhS1G+p/b2xsJp75CI1PVVvEfGwjshQk8qL04wA==",
"dev": true,
"dependencies": {
"big.js": "^5.2.2",
......@@ -1966,12 +2002,12 @@
}
},
"node_modules/@truffle/contract/node_modules/@truffle/debug-utils": {
"version": "5.0.15",
"resolved": "https://registry.npmjs.org/@truffle/debug-utils/-/debug-utils-5.0.15.tgz",
"integrity": "sha512-G5y+0Xx+IM6C9b8Vjm6bl73wIjB1/2qtVKnBlhbKfgxNpRgxFvXE/jeSkCPYpcnF3CsGign0dsIyZj59tMqE5A==",
"version": "5.0.16",
"resolved": "https://registry.npmjs.org/@truffle/debug-utils/-/debug-utils-5.0.16.tgz",
"integrity": "sha512-1I6DYs/eGeeTPXi+S3720HCzb9bsG5X6Oxjh2K/tlV0GeDnsmr+PN+ODFpbpa/ZtY0W07+5vBUUo+wzNlbOZrA==",
"dev": true,
"dependencies": {
"@truffle/codec": "^0.10.5",
"@truffle/codec": "^0.10.6",
"@trufflesuite/chromafi": "^2.2.2",
"bn.js": "^5.1.3",
"chalk": "^2.4.2",
......@@ -1981,9 +2017,9 @@
}
},
"node_modules/@truffle/contract/node_modules/@truffle/error": {
"version": "0.0.13",
"resolved": "https://registry.npmjs.org/@truffle/error/-/error-0.0.13.tgz",
"integrity": "sha512-tzB2Kt9QSMK0He86ZFYhNyew9V6vZ7FboqmCFL5YyQd/P2mY14PJIw92NdkcTGxn1GNe+oYoHBS0Eu1c7DhC5Q==",
"version": "0.0.14",
"resolved": "https://registry.npmjs.org/@truffle/error/-/error-0.0.14.tgz",
"integrity": "sha512-utJx+SZYoMqk8wldQG4gCVKhV8GwMJbWY7sLXFT/D8wWZTnE2peX7URFJh/cxkjTRCO328z1s2qewkhyVsu2HA==",
"dev": true
},
"node_modules/@truffle/contract/node_modules/ansi-styles": {
......@@ -2179,9 +2215,9 @@
"dev": true
},
"node_modules/@truffle/interface-adapter": {
"version": "0.4.22",
"resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.4.22.tgz",
"integrity": "sha512-G5uLkXUv/1Cp4090hEGX9Y96FwUuLvsZloZu/cF3ltK/oj0ltNPMxt009v5ptFu3jH1c2IwLvxtvvL0Y+pI8GQ==",
"version": "0.4.23",
"resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.4.23.tgz",
"integrity": "sha512-mfpwY25Apx36WHHNJMNHWyDQVFZoZYNQ43rOwr/n+5gAMxke7+D7+IR9UW4kuO/Jp0+2848UxMdRV+oqm017kQ==",
"dev": true,
"dependencies": {
"bn.js": "^5.1.3",
......@@ -2196,20 +2232,20 @@
"dev": true
},
"node_modules/@truffle/provider": {
"version": "0.2.29",
"resolved": "https://registry.npmjs.org/@truffle/provider/-/provider-0.2.29.tgz",
"integrity": "sha512-hZs9pWjPHsQ1HPROYf5N9pnLMPsDeLYUaDCO/D8sO4mjE+u3ZfUf2scIfNh7/BP76WQDXO7GzzV8CDLS8Zln3Q==",
"version": "0.2.30",
"resolved": "https://registry.npmjs.org/@truffle/provider/-/provider-0.2.30.tgz",
"integrity": "sha512-5ScTbWsrm7zmQjw020T41U30/kYA1LppXAtaeucUGN2jvPrSwlh0aTL18makbqftTx1NRuYKw7C8wO4jCKQSUQ==",
"dev": true,
"dependencies": {
"@truffle/error": "^0.0.13",
"@truffle/interface-adapter": "^0.4.22",
"@truffle/error": "^0.0.14",
"@truffle/interface-adapter": "^0.4.23",
"web3": "1.3.5"
}
},
"node_modules/@truffle/provider/node_modules/@truffle/error": {
"version": "0.0.13",
"resolved": "https://registry.npmjs.org/@truffle/error/-/error-0.0.13.tgz",
"integrity": "sha512-tzB2Kt9QSMK0He86ZFYhNyew9V6vZ7FboqmCFL5YyQd/P2mY14PJIw92NdkcTGxn1GNe+oYoHBS0Eu1c7DhC5Q==",
"version": "0.0.14",
"resolved": "https://registry.npmjs.org/@truffle/error/-/error-0.0.14.tgz",
"integrity": "sha512-utJx+SZYoMqk8wldQG4gCVKhV8GwMJbWY7sLXFT/D8wWZTnE2peX7URFJh/cxkjTRCO328z1s2qewkhyVsu2HA==",
"dev": true
},
"node_modules/@trufflesuite/chromafi": {
......@@ -2331,9 +2367,9 @@
}
},
"node_modules/@types/chai": {
"version": "4.2.17",
"resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.17.tgz",
"integrity": "sha512-LaiwWNnYuL8xJlQcE91QB2JoswWZckq9A4b+nMPq8dt8AP96727Nb3X4e74u+E3tm4NLTILNI9MYFsyVc30wSA==",
"version": "4.2.18",
"resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.18.tgz",
"integrity": "sha512-rS27+EkB/RE1Iz3u0XtVL5q36MGDWbgYe7zWiodyKNUnthxY0rukK5V36eiUCtCisB7NN8zKYH6DO2M37qxFEQ==",
"dev": true
},
"node_modules/@types/concat-stream": {
......@@ -2393,9 +2429,9 @@
"dev": true
},
"node_modules/@types/node": {
"version": "15.0.1",
"resolved": "https://registry.npmjs.org/@types/node/-/node-15.0.1.tgz",
"integrity": "sha512-TMkXt0Ck1y0KKsGr9gJtWGjttxlZnnvDtphxUOSd0bfaR6Q1jle+sPvrzNR1urqYTWMinoKvjKfXUGsumaO1PA==",
"version": "15.0.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-15.0.2.tgz",
"integrity": "sha512-p68+a+KoxpoB47015IeYZYRrdqMUcpbK8re/zpFB8Ld46LHC1lPEbp3EXgkEhAYEcPvjJF6ZO+869SQ0aH1dcA==",
"dev": true
},
"node_modules/@types/pbkdf2": {
......@@ -3770,20 +3806,24 @@
}
},
"node_modules/cheerio": {
"version": "1.0.0-rc.6",
"resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.6.tgz",
"integrity": "sha512-hjx1XE1M/D5pAtMgvWwE21QClmAEeGHOIDfycgmndisdNgI6PE1cGRQkMGBcsbUbmEQyWu5PJLUcAOjtQS8DWw==",
"version": "1.0.0-rc.9",
"resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.9.tgz",
"integrity": "sha512-QF6XVdrLONO6DXRF5iaolY+odmhj2CLj+xzNod7INPWMi/x9X4SOylH0S/vaPpX+AUU6t04s34SQNh7DbkuCng==",
"dev": true,
"dependencies": {
"cheerio-select": "^1.3.0",
"cheerio-select": "^1.4.0",
"dom-serializer": "^1.3.1",
"domhandler": "^4.1.0",
"domhandler": "^4.2.0",
"htmlparser2": "^6.1.0",
"parse5": "^6.0.1",
"parse5-htmlparser2-tree-adapter": "^6.0.1"
"parse5-htmlparser2-tree-adapter": "^6.0.1",
"tslib": "^2.2.0"
},
"engines": {
"node": ">= 0.12"
"node": ">= 6"
},
"funding": {
"url": "https://github.com/cheeriojs/cheerio?sponsor=1"
}
},
"node_modules/cheerio-select": {
......@@ -4273,9 +4313,9 @@
}
},
"node_modules/core-js-pure": {
"version": "3.11.1",
"resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.11.1.tgz",
"integrity": "sha512-2JukQi8HgAOCD5CSimxWWXVrUBoA9Br796uIA5Z06bIjt7PBBI19ircFaAxplgE1mJf3x2BY6MkT/HWA/UryPg==",
"version": "3.12.1",
"resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.12.1.tgz",
"integrity": "sha512-1cch+qads4JnDSWsvc7d6nzlKAippwjUlf6vykkTLW53VSV+NkE6muGBToAjEA8pG90cSfcud3JgVmW2ds5TaQ==",
"dev": true,
"hasInstallScript": true,
"funding": {
......@@ -7050,9 +7090,9 @@
"dev": true
},
"node_modules/follow-redirects": {
"version": "1.14.0",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.0.tgz",
"integrity": "sha512-0vRwd7RKQBTt+mgu87mtYeofLFZpTas2S9zY+jIeuLJMNvudIgF52nr19q40HOwH5RrhWIPuj9puybzSJiRrVg==",
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.1.tgz",
"integrity": "sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg==",
"dev": true,
"funding": [
{
......@@ -8415,9 +8455,9 @@
}
},
"node_modules/glob": {
"version": "7.1.6",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
"integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
"version": "7.1.7",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz",
"integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==",
"dev": true,
"dependencies": {
"fs.realpath": "^1.0.0",
......@@ -9951,9 +9991,9 @@
"dev": true
},
"node_modules/is-bigint": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.1.tgz",
"integrity": "sha512-J0ELF4yHFxHy0cmSxZuheDOz2luOdVvqjwmEcj8H/L1JHeuEDSDbeRP+Dk9kFVk5RTFzbucJ2Kb9F7ixY2QaCg==",
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.2.tgz",
"integrity": "sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA==",
"dev": true,
"funding": {
"url": "https://github.com/sponsors/ljharb"
......@@ -9972,12 +10012,12 @@
}
},
"node_modules/is-boolean-object": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.0.tgz",
"integrity": "sha512-a7Uprx8UtD+HWdyYwnD1+ExtTgqQtD2k/1yJgtXP6wnMm8byhkoTZRl+95LLThpzNZJ5aEvi46cdH+ayMFRwmA==",
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.1.tgz",
"integrity": "sha512-bXdQWkECBUIAcCkeH1unwJLIpZYaa5VvuygSyS/c2lf719mTKZDU5UdDRlpd01UjADgmW8RfqaP+mRaVPdr/Ng==",
"dev": true,
"dependencies": {
"call-bind": "^1.0.0"
"call-bind": "^1.0.2"
},
"engines": {
"node": ">= 0.4"
......@@ -10022,9 +10062,9 @@
}
},
"node_modules/is-core-module": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.3.0.tgz",
"integrity": "sha512-xSphU2KG9867tsYdLD4RWQ1VqdFl4HTO9Thf3I/3dLEfr0dbPTWKsuCKrgqMljg4nPE+Gq0VCnzT3gr0CyBmsw==",
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.4.0.tgz",
"integrity": "sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A==",
"dev": true,
"dependencies": {
"has": "^1.0.3"
......@@ -10064,9 +10104,9 @@
}
},
"node_modules/is-date-object": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz",
"integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==",
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.4.tgz",
"integrity": "sha512-/b4ZVsG7Z5XVtIxs/h9W8nvfLgSAyKYdtGWQLbqy6jA1icmgjf8WCoTKgeS4wy5tYaPePouzFMANbnj94c2Z+A==",
"dev": true,
"engines": {
"node": ">= 0.4"
......@@ -10156,9 +10196,9 @@
"dev": true
},
"node_modules/is-generator-function": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.8.tgz",
"integrity": "sha512-2Omr/twNtufVZFr1GhxjOMFPAj2sjc/dKaIqBhvo4qciXfJmITGH6ZGd8eZYNHza8t1y0e01AuqRhJwfWp26WQ==",
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.9.tgz",
"integrity": "sha512-ZJ34p1uvIfptHCN7sFTjGibB9/oBg17sHqzDLfuwhvmN/qLVvIQXRQ8licZQ35WJ8KuEQt/etnnzQFI9C9Ue/A==",
"dev": true,
"engines": {
"node": ">= 0.4"
......@@ -10211,9 +10251,9 @@
}
},
"node_modules/is-number-object": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.4.tgz",
"integrity": "sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw==",
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.5.tgz",
"integrity": "sha512-RU0lI/n95pMoUKu9v1BZP5MBcZuNSVJkMkAG2dJqC4z2GlkGUNeH68SuHuBKBD/XFe+LHZ+f9BKkLET60Niedw==",
"dev": true,
"engines": {
"node": ">= 0.4"
......@@ -10262,13 +10302,13 @@
}
},
"node_modules/is-regex": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.2.tgz",
"integrity": "sha512-axvdhb5pdhEVThqJzYXwMlVuZwC+FF2DpcOhTS+y/8jVq4trxyPgfcwIxIKiyeuLlSQYKkmUaPQJ8ZE4yNKXDg==",
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.3.tgz",
"integrity": "sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ==",
"dev": true,
"dependencies": {
"call-bind": "^1.0.2",
"has-symbols": "^1.0.1"
"has-symbols": "^1.0.2"
},
"engines": {
"node": ">= 0.4"
......@@ -10296,9 +10336,9 @@
}
},
"node_modules/is-string": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz",
"integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==",
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.6.tgz",
"integrity": "sha512-2gdzbKUuqtQ3lYNrUTQYoClPhm7oQu4UdpSZMp1/DGgkHBT8E2Z1l0yMdb6D4zNAxwDiMv8MdulKROJGNl0Q0w==",
"dev": true,
"engines": {
"node": ">= 0.4"
......@@ -10308,12 +10348,12 @@
}
},
"node_modules/is-symbol": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz",
"integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==",
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz",
"integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==",
"dev": true,
"dependencies": {
"has-symbols": "^1.0.1"
"has-symbols": "^1.0.2"
},
"engines": {
"node": ">= 0.4"
......@@ -11394,9 +11434,9 @@
}
},
"node_modules/mcl-wasm": {
"version": "0.7.6",
"resolved": "https://registry.npmjs.org/mcl-wasm/-/mcl-wasm-0.7.6.tgz",
"integrity": "sha512-cbRl3sUOkBeRY2hsM4t1EIln2TIdQBkSiTOqNTv/4Hu5KOECnMWCgjIf+a9Ebunyn22VKqkMF3zj6ejRzz7YBw==",
"version": "0.7.7",
"resolved": "https://registry.npmjs.org/mcl-wasm/-/mcl-wasm-0.7.7.tgz",
"integrity": "sha512-jDGiCQA++5hX37gdH6RDZ3ZsA0raet7xyY/R5itj5cbcdf4Gvw+YyxWX/ZZ0Z2UPxJiw1ktRsCJZzpnqlQILdw==",
"dev": true,
"engines": {
"node": ">=8.9.0"
......@@ -11738,9 +11778,9 @@
}
},
"node_modules/mocha": {
"version": "8.3.2",
"resolved": "https://registry.npmjs.org/mocha/-/mocha-8.3.2.tgz",
"integrity": "sha512-UdmISwr/5w+uXLPKspgoV7/RXZwKRTiTjJ2/AC5ZiEztIoOYdfKb19+9jNmEInzx5pBsCyJQzarAxqIGBNYJhg==",
"version": "8.4.0",
"resolved": "https://registry.npmjs.org/mocha/-/mocha-8.4.0.tgz",
"integrity": "sha512-hJaO0mwDXmZS4ghXsvPVriOhsxQ7ofcpQdm8dE+jISUOKopitvnXFQmpRR7jd2K6VBG6E26gU3IAbXXGIbu4sQ==",
"dev": true,
"dependencies": {
"@ungap/promise-all-settled": "1.1.2",
......@@ -11833,6 +11873,26 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/mocha/node_modules/glob": {
"version": "7.1.6",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
"integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
"dev": true,
"dependencies": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.4",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
},
"engines": {
"node": "*"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/mocha/node_modules/is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
......@@ -12416,9 +12476,9 @@
}
},
"node_modules/object-inspect": {
"version": "1.10.2",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.2.tgz",
"integrity": "sha512-gz58rdPpadwztRrPjZE9DZLOABUpTGdcANUgOwBFO1C+HZZhePoP83M65WGDmbpwFYJSWqavbl4SgDn4k8RYTA==",
"version": "1.10.3",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.3.tgz",
"integrity": "sha512-e5mCJlSH7poANfC8z8S9s9S2IN5/4Zb3aZ33f5s8YqoazCFzNLloLU8r5VCG+G7WoqLvAAZoVMcy3tp/3X0Plw==",
"dev": true,
"funding": {
"url": "https://github.com/sponsors/ljharb"
......@@ -13752,6 +13812,12 @@
"npm": ">=2.0.0"
}
},
"node_modules/rxjs/node_modules/tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
},
"node_modules/safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
......@@ -16081,9 +16147,9 @@
}
},
"node_modules/tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz",
"integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==",
"dev": true
},
"node_modules/tsort": {
......@@ -16195,9 +16261,9 @@
}
},
"node_modules/uglify-js": {
"version": "3.13.5",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.5.tgz",
"integrity": "sha512-xtB8yEqIkn7zmOyS2zUNBsYCBRhDkvlNxMMY2smuJ/qA8NCHeQvKCF3i9Z4k8FJH4+PJvZRtMrPynfZ75+CSZw==",
"version": "3.13.6",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.6.tgz",
"integrity": "sha512-rRprLwl8RVaS+Qvx3Wh5hPfPBn9++G6xkGlUupya0s5aDmNjI7z3lnRLB3u7sN4OmbB0pWgzhM9BEJyiWAwtAA==",
"dev": true,
"optional": true,
"bin": {
......@@ -16391,9 +16457,9 @@
}
},
"node_modules/utf-8-validate": {
"version": "5.0.4",
"resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.4.tgz",
"integrity": "sha512-MEF05cPSq3AwJ2C7B7sHAA6i53vONoZbMGX8My5auEVm6W+dJ2Jd/TZPyGJ5CH42V2XtbI5FD28HeHeqlPzZ3Q==",
"version": "5.0.5",
"resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.5.tgz",
"integrity": "sha512-+pnxRYsS/axEpkrrEpzYfNZGXp0IjC/9RIxwM5gntY4Koi8SHmUGSfxfWqxZdRxrtaoVstuOzUp/rbs3JSPELQ==",
"dev": true,
"hasInstallScript": true,
"dependencies": {
......@@ -16541,9 +16607,9 @@
}
},
"node_modules/web3-bzz/node_modules/@types/node": {
"version": "12.20.11",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.11.tgz",
"integrity": "sha512-gema+apZ6qLQK7k7F0dGkGCWQYsL0qqKORWOQO6tq46q+x+1C0vbOiOqOwRVlh4RAdbQwV/j/ryr3u5NOG1fPQ==",
"version": "12.20.12",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.12.tgz",
"integrity": "sha512-KQZ1al2hKOONAs2MFv+yTQP1LkDWMrRJ9YCVRalXltOfXsBmH5IownLxQaiq0lnAHwAViLnh2aTYqrPcRGEbgg==",
"dev": true
},
"node_modules/web3-bzz/node_modules/underscore": {
......@@ -16678,9 +16744,9 @@
}
},
"node_modules/web3-core/node_modules/@types/node": {
"version": "12.20.11",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.11.tgz",
"integrity": "sha512-gema+apZ6qLQK7k7F0dGkGCWQYsL0qqKORWOQO6tq46q+x+1C0vbOiOqOwRVlh4RAdbQwV/j/ryr3u5NOG1fPQ==",
"version": "12.20.12",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.12.tgz",
"integrity": "sha512-KQZ1al2hKOONAs2MFv+yTQP1LkDWMrRJ9YCVRalXltOfXsBmH5IownLxQaiq0lnAHwAViLnh2aTYqrPcRGEbgg==",
"dev": true
},
"node_modules/web3-core/node_modules/bignumber.js": {
......@@ -16893,9 +16959,9 @@
}
},
"node_modules/web3-eth-personal/node_modules/@types/node": {
"version": "12.20.11",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.11.tgz",
"integrity": "sha512-gema+apZ6qLQK7k7F0dGkGCWQYsL0qqKORWOQO6tq46q+x+1C0vbOiOqOwRVlh4RAdbQwV/j/ryr3u5NOG1fPQ==",
"version": "12.20.12",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.12.tgz",
"integrity": "sha512-KQZ1al2hKOONAs2MFv+yTQP1LkDWMrRJ9YCVRalXltOfXsBmH5IownLxQaiq0lnAHwAViLnh2aTYqrPcRGEbgg==",
"dev": true
},
"node_modules/web3-eth/node_modules/underscore": {
......@@ -17408,9 +17474,9 @@
"dev": true
},
"node_modules/yargs": {
"version": "17.0.0",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-17.0.0.tgz",
"integrity": "sha512-gbtedDPfBgG40iLbaRXhqYJycUYqFVZQLIxl1cG5Ez/xZL/47TetSYzPSIixkWa36GKHr9D/o/oSG1vHXF4zTw==",
"version": "17.0.1",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-17.0.1.tgz",
"integrity": "sha512-xBBulfCc8Y6gLFcrPvtqKz9hz8SO0l1Ni8GgDekvBX2ro0HRQImDGnikfc33cgzcYUSncapnNcZDjVFIH3f6KQ==",
"dev": true,
"dependencies": {
"cliui": "^7.0.2",
......@@ -18423,6 +18489,7 @@
"integrity": "sha512-5vwpq6kbvwkQwKqAoOU3L72GZ3Ta8RRrewKj9OJRolx28KLJJ8Dg9Rf7obRwt5jQA9bkYd8gqzMTrI7H3xLfaw==",
"dev": true,
"requires": {
"@oclif/config": "^1.15.1",
"@oclif/errors": "^1.3.3",
"@oclif/parser": "^3.8.3",
"@oclif/plugin-help": "^3",
......@@ -18498,12 +18565,6 @@
"requires": {
"is-docker": "^2.0.0"
}
},
"tslib": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz",
"integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==",
"dev": true
}
}
},
......@@ -18615,6 +18676,12 @@
"requires": {
"has-flag": "^3.0.0"
}
},
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
}
}
},
......@@ -18817,6 +18884,14 @@
"@sentry/types": "5.30.0",
"@sentry/utils": "5.30.0",
"tslib": "^1.9.3"
},
"dependencies": {
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
}
}
},
"@sentry/hub": {
......@@ -18828,6 +18903,14 @@
"@sentry/types": "5.30.0",
"@sentry/utils": "5.30.0",
"tslib": "^1.9.3"
},
"dependencies": {
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
}
}
},
"@sentry/minimal": {
......@@ -18839,6 +18922,14 @@
"@sentry/hub": "5.30.0",
"@sentry/types": "5.30.0",
"tslib": "^1.9.3"
},
"dependencies": {
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
}
}
},
"@sentry/node": {
......@@ -18856,6 +18947,14 @@
"https-proxy-agent": "^5.0.0",
"lru_map": "^0.3.3",
"tslib": "^1.9.3"
},
"dependencies": {
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
}
}
},
"@sentry/tracing": {
......@@ -18869,6 +18968,14 @@
"@sentry/types": "5.30.0",
"@sentry/utils": "5.30.0",
"tslib": "^1.9.3"
},
"dependencies": {
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
}
}
},
"@sentry/types": {
......@@ -18885,6 +18992,14 @@
"requires": {
"@sentry/types": "5.30.0",
"tslib": "^1.9.3"
},
"dependencies": {
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
}
}
},
"@sindresorhus/is": {
......@@ -18985,16 +19100,16 @@
}
},
"@truffle/contract": {
"version": "4.3.15",
"resolved": "https://registry.npmjs.org/@truffle/contract/-/contract-4.3.15.tgz",
"integrity": "sha512-PHM6tCF/GB3r/t5YbeXagtg9XPtjFgbc5YnRcXs8m2Cp2hXFeU91n1dxmIkBVJklia+tWGqLuVxvMqI88tcWbw==",
"version": "4.3.16",
"resolved": "https://registry.npmjs.org/@truffle/contract/-/contract-4.3.16.tgz",
"integrity": "sha512-/GhDFu8pu1TMVev5WTxQj87Vo8Di5Uo0LXvdV7ESdUbEIzMlm9pjfkf2uWg8Jx2aSBGgfCeLXw8GVScBk9OjlA==",
"dev": true,
"requires": {
"@truffle/blockchain-utils": "^0.0.29",
"@truffle/contract-schema": "^3.4.0",
"@truffle/debug-utils": "^5.0.15",
"@truffle/error": "^0.0.13",
"@truffle/interface-adapter": "^0.4.22",
"@truffle/blockchain-utils": "^0.0.30",
"@truffle/contract-schema": "^3.4.1",
"@truffle/debug-utils": "^5.0.16",
"@truffle/error": "^0.0.14",
"@truffle/interface-adapter": "^0.4.23",
"bignumber.js": "^7.2.1",
"ethereum-ens": "^0.8.0",
"ethers": "^4.0.32",
......@@ -19006,15 +19121,15 @@
},
"dependencies": {
"@truffle/blockchain-utils": {
"version": "0.0.29",
"resolved": "https://registry.npmjs.org/@truffle/blockchain-utils/-/blockchain-utils-0.0.29.tgz",
"integrity": "sha512-bPUN0GBc9kEAD0Hg7BJXQ0F1BwPI/4wwc1B580QwyOQp0Fp8uK9kOOxNagh4wB+s8vPFlmC62OqoYyG4CeYyHQ==",
"version": "0.0.30",
"resolved": "https://registry.npmjs.org/@truffle/blockchain-utils/-/blockchain-utils-0.0.30.tgz",
"integrity": "sha512-3hkHSHxVavoALcxpBqD4YwHuCmkBrvjq6PAGw93i6WCB+pnejBD5sFjVCiZZKCogh4kGObxxcwu53+3dyT/6IQ==",
"dev": true
},
"@truffle/codec": {
"version": "0.10.5",
"resolved": "https://registry.npmjs.org/@truffle/codec/-/codec-0.10.5.tgz",
"integrity": "sha512-M8YR8hKxXTypgg8g8iD/rUkkWgS89/NqkLAR+ZpZIzO3PZ5pkiIysO2VkWeqJid8hVDM4O4Eswgt2ISrQzsVRg==",
"version": "0.10.6",
"resolved": "https://registry.npmjs.org/@truffle/codec/-/codec-0.10.6.tgz",
"integrity": "sha512-laKk5iL2Y9W0ndNnFAy2f3tuhwYV4PlQf1aZO3mlxk0QgCVkhS1G+p/b2xsJp75CI1PVVvEfGwjshQk8qL04wA==",
"dev": true,
"requires": {
"big.js": "^5.2.2",
......@@ -19031,12 +19146,12 @@
}
},
"@truffle/debug-utils": {
"version": "5.0.15",
"resolved": "https://registry.npmjs.org/@truffle/debug-utils/-/debug-utils-5.0.15.tgz",
"integrity": "sha512-G5y+0Xx+IM6C9b8Vjm6bl73wIjB1/2qtVKnBlhbKfgxNpRgxFvXE/jeSkCPYpcnF3CsGign0dsIyZj59tMqE5A==",
"version": "5.0.16",
"resolved": "https://registry.npmjs.org/@truffle/debug-utils/-/debug-utils-5.0.16.tgz",
"integrity": "sha512-1I6DYs/eGeeTPXi+S3720HCzb9bsG5X6Oxjh2K/tlV0GeDnsmr+PN+ODFpbpa/ZtY0W07+5vBUUo+wzNlbOZrA==",
"dev": true,
"requires": {
"@truffle/codec": "^0.10.5",
"@truffle/codec": "^0.10.6",
"@trufflesuite/chromafi": "^2.2.2",
"bn.js": "^5.1.3",
"chalk": "^2.4.2",
......@@ -19046,9 +19161,9 @@
}
},
"@truffle/error": {
"version": "0.0.13",
"resolved": "https://registry.npmjs.org/@truffle/error/-/error-0.0.13.tgz",
"integrity": "sha512-tzB2Kt9QSMK0He86ZFYhNyew9V6vZ7FboqmCFL5YyQd/P2mY14PJIw92NdkcTGxn1GNe+oYoHBS0Eu1c7DhC5Q==",
"version": "0.0.14",
"resolved": "https://registry.npmjs.org/@truffle/error/-/error-0.0.14.tgz",
"integrity": "sha512-utJx+SZYoMqk8wldQG4gCVKhV8GwMJbWY7sLXFT/D8wWZTnE2peX7URFJh/cxkjTRCO328z1s2qewkhyVsu2HA==",
"dev": true
},
"ansi-styles": {
......@@ -19140,9 +19255,9 @@
}
},
"@truffle/contract-schema": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/@truffle/contract-schema/-/contract-schema-3.4.0.tgz",
"integrity": "sha512-Kk2t7r98tiL3nxj0/4ukZ7Asvi5K/5JlHuI3jM7dXAMhrWYrt+nf5LZVwJPd1nlzuZy8WK4AgSj2B1vCTz/AlQ==",
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/@truffle/contract-schema/-/contract-schema-3.4.1.tgz",
"integrity": "sha512-2gvu6gxJtbbI67H2Bwh2rBuej+1uCV3z4zKFzQZP00hjNoL+QfybrmBcOVB88PflBeEB+oUXuwQfDoKX3TXlnQ==",
"dev": true,
"requires": {
"ajv": "^6.10.0",
......@@ -19223,9 +19338,9 @@
"dev": true
},
"@truffle/interface-adapter": {
"version": "0.4.22",
"resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.4.22.tgz",
"integrity": "sha512-G5uLkXUv/1Cp4090hEGX9Y96FwUuLvsZloZu/cF3ltK/oj0ltNPMxt009v5ptFu3jH1c2IwLvxtvvL0Y+pI8GQ==",
"version": "0.4.23",
"resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.4.23.tgz",
"integrity": "sha512-mfpwY25Apx36WHHNJMNHWyDQVFZoZYNQ43rOwr/n+5gAMxke7+D7+IR9UW4kuO/Jp0+2848UxMdRV+oqm017kQ==",
"dev": true,
"requires": {
"bn.js": "^5.1.3",
......@@ -19242,20 +19357,20 @@
}
},
"@truffle/provider": {
"version": "0.2.29",
"resolved": "https://registry.npmjs.org/@truffle/provider/-/provider-0.2.29.tgz",
"integrity": "sha512-hZs9pWjPHsQ1HPROYf5N9pnLMPsDeLYUaDCO/D8sO4mjE+u3ZfUf2scIfNh7/BP76WQDXO7GzzV8CDLS8Zln3Q==",
"version": "0.2.30",
"resolved": "https://registry.npmjs.org/@truffle/provider/-/provider-0.2.30.tgz",
"integrity": "sha512-5ScTbWsrm7zmQjw020T41U30/kYA1LppXAtaeucUGN2jvPrSwlh0aTL18makbqftTx1NRuYKw7C8wO4jCKQSUQ==",
"dev": true,
"requires": {
"@truffle/error": "^0.0.13",
"@truffle/interface-adapter": "^0.4.22",
"@truffle/error": "^0.0.14",
"@truffle/interface-adapter": "^0.4.23",
"web3": "1.3.5"
},
"dependencies": {
"@truffle/error": {
"version": "0.0.13",
"resolved": "https://registry.npmjs.org/@truffle/error/-/error-0.0.13.tgz",
"integrity": "sha512-tzB2Kt9QSMK0He86ZFYhNyew9V6vZ7FboqmCFL5YyQd/P2mY14PJIw92NdkcTGxn1GNe+oYoHBS0Eu1c7DhC5Q==",
"version": "0.0.14",
"resolved": "https://registry.npmjs.org/@truffle/error/-/error-0.0.14.tgz",
"integrity": "sha512-utJx+SZYoMqk8wldQG4gCVKhV8GwMJbWY7sLXFT/D8wWZTnE2peX7URFJh/cxkjTRCO328z1s2qewkhyVsu2HA==",
"dev": true
}
}
......@@ -19365,9 +19480,9 @@
}
},
"@types/chai": {
"version": "4.2.17",
"resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.17.tgz",
"integrity": "sha512-LaiwWNnYuL8xJlQcE91QB2JoswWZckq9A4b+nMPq8dt8AP96727Nb3X4e74u+E3tm4NLTILNI9MYFsyVc30wSA==",
"version": "4.2.18",
"resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.18.tgz",
"integrity": "sha512-rS27+EkB/RE1Iz3u0XtVL5q36MGDWbgYe7zWiodyKNUnthxY0rukK5V36eiUCtCisB7NN8zKYH6DO2M37qxFEQ==",
"dev": true
},
"@types/concat-stream": {
......@@ -19427,9 +19542,9 @@
"dev": true
},
"@types/node": {
"version": "15.0.1",
"resolved": "https://registry.npmjs.org/@types/node/-/node-15.0.1.tgz",
"integrity": "sha512-TMkXt0Ck1y0KKsGr9gJtWGjttxlZnnvDtphxUOSd0bfaR6Q1jle+sPvrzNR1urqYTWMinoKvjKfXUGsumaO1PA==",
"version": "15.0.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-15.0.2.tgz",
"integrity": "sha512-p68+a+KoxpoB47015IeYZYRrdqMUcpbK8re/zpFB8Ld46LHC1lPEbp3EXgkEhAYEcPvjJF6ZO+869SQ0aH1dcA==",
"dev": true
},
"@types/pbkdf2": {
......@@ -20553,17 +20668,18 @@
"dev": true
},
"cheerio": {
"version": "1.0.0-rc.6",
"resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.6.tgz",
"integrity": "sha512-hjx1XE1M/D5pAtMgvWwE21QClmAEeGHOIDfycgmndisdNgI6PE1cGRQkMGBcsbUbmEQyWu5PJLUcAOjtQS8DWw==",
"version": "1.0.0-rc.9",
"resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.9.tgz",
"integrity": "sha512-QF6XVdrLONO6DXRF5iaolY+odmhj2CLj+xzNod7INPWMi/x9X4SOylH0S/vaPpX+AUU6t04s34SQNh7DbkuCng==",
"dev": true,
"requires": {
"cheerio-select": "^1.3.0",
"cheerio-select": "^1.4.0",
"dom-serializer": "^1.3.1",
"domhandler": "^4.1.0",
"domhandler": "^4.2.0",
"htmlparser2": "^6.1.0",
"parse5": "^6.0.1",
"parse5-htmlparser2-tree-adapter": "^6.0.1"
"parse5-htmlparser2-tree-adapter": "^6.0.1",
"tslib": "^2.2.0"
}
},
"cheerio-select": {
......@@ -20978,9 +21094,9 @@
"dev": true
},
"core-js-pure": {
"version": "3.11.1",
"resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.11.1.tgz",
"integrity": "sha512-2JukQi8HgAOCD5CSimxWWXVrUBoA9Br796uIA5Z06bIjt7PBBI19ircFaAxplgE1mJf3x2BY6MkT/HWA/UryPg==",
"version": "3.12.1",
"resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.12.1.tgz",
"integrity": "sha512-1cch+qads4JnDSWsvc7d6nzlKAippwjUlf6vykkTLW53VSV+NkE6muGBToAjEA8pG90cSfcud3JgVmW2ds5TaQ==",
"dev": true
},
"core-util-is": {
......@@ -23285,9 +23401,9 @@
"dev": true
},
"follow-redirects": {
"version": "1.14.0",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.0.tgz",
"integrity": "sha512-0vRwd7RKQBTt+mgu87mtYeofLFZpTas2S9zY+jIeuLJMNvudIgF52nr19q40HOwH5RrhWIPuj9puybzSJiRrVg==",
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.1.tgz",
"integrity": "sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg==",
"dev": true
},
"for-each": {
......@@ -24303,9 +24419,9 @@
}
},
"glob": {
"version": "7.1.6",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
"integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
"version": "7.1.7",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz",
"integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==",
"dev": true,
"requires": {
"fs.realpath": "^1.0.0",
......@@ -25508,9 +25624,9 @@
"dev": true
},
"is-bigint": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.1.tgz",
"integrity": "sha512-J0ELF4yHFxHy0cmSxZuheDOz2luOdVvqjwmEcj8H/L1JHeuEDSDbeRP+Dk9kFVk5RTFzbucJ2Kb9F7ixY2QaCg==",
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.2.tgz",
"integrity": "sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA==",
"dev": true
},
"is-binary-path": {
......@@ -25523,12 +25639,12 @@
}
},
"is-boolean-object": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.0.tgz",
"integrity": "sha512-a7Uprx8UtD+HWdyYwnD1+ExtTgqQtD2k/1yJgtXP6wnMm8byhkoTZRl+95LLThpzNZJ5aEvi46cdH+ayMFRwmA==",
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.1.tgz",
"integrity": "sha512-bXdQWkECBUIAcCkeH1unwJLIpZYaa5VvuygSyS/c2lf719mTKZDU5UdDRlpd01UjADgmW8RfqaP+mRaVPdr/Ng==",
"dev": true,
"requires": {
"call-bind": "^1.0.0"
"call-bind": "^1.0.2"
}
},
"is-buffer": {
......@@ -25544,9 +25660,9 @@
"dev": true
},
"is-core-module": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.3.0.tgz",
"integrity": "sha512-xSphU2KG9867tsYdLD4RWQ1VqdFl4HTO9Thf3I/3dLEfr0dbPTWKsuCKrgqMljg4nPE+Gq0VCnzT3gr0CyBmsw==",
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.4.0.tgz",
"integrity": "sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A==",
"dev": true,
"requires": {
"has": "^1.0.3"
......@@ -25579,9 +25695,9 @@
}
},
"is-date-object": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz",
"integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==",
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.4.tgz",
"integrity": "sha512-/b4ZVsG7Z5XVtIxs/h9W8nvfLgSAyKYdtGWQLbqy6jA1icmgjf8WCoTKgeS4wy5tYaPePouzFMANbnj94c2Z+A==",
"dev": true
},
"is-descriptor": {
......@@ -25640,9 +25756,9 @@
"dev": true
},
"is-generator-function": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.8.tgz",
"integrity": "sha512-2Omr/twNtufVZFr1GhxjOMFPAj2sjc/dKaIqBhvo4qciXfJmITGH6ZGd8eZYNHza8t1y0e01AuqRhJwfWp26WQ==",
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.9.tgz",
"integrity": "sha512-ZJ34p1uvIfptHCN7sFTjGibB9/oBg17sHqzDLfuwhvmN/qLVvIQXRQ8licZQ35WJ8KuEQt/etnnzQFI9C9Ue/A==",
"dev": true
},
"is-glob": {
......@@ -25673,9 +25789,9 @@
"dev": true
},
"is-number-object": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.4.tgz",
"integrity": "sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw==",
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.5.tgz",
"integrity": "sha512-RU0lI/n95pMoUKu9v1BZP5MBcZuNSVJkMkAG2dJqC4z2GlkGUNeH68SuHuBKBD/XFe+LHZ+f9BKkLET60Niedw==",
"dev": true
},
"is-object": {
......@@ -25706,13 +25822,13 @@
"dev": true
},
"is-regex": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.2.tgz",
"integrity": "sha512-axvdhb5pdhEVThqJzYXwMlVuZwC+FF2DpcOhTS+y/8jVq4trxyPgfcwIxIKiyeuLlSQYKkmUaPQJ8ZE4yNKXDg==",
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.3.tgz",
"integrity": "sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ==",
"dev": true,
"requires": {
"call-bind": "^1.0.2",
"has-symbols": "^1.0.1"
"has-symbols": "^1.0.2"
}
},
"is-retry-allowed": {
......@@ -25728,18 +25844,18 @@
"dev": true
},
"is-string": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz",
"integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==",
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.6.tgz",
"integrity": "sha512-2gdzbKUuqtQ3lYNrUTQYoClPhm7oQu4UdpSZMp1/DGgkHBT8E2Z1l0yMdb6D4zNAxwDiMv8MdulKROJGNl0Q0w==",
"dev": true
},
"is-symbol": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz",
"integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==",
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz",
"integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==",
"dev": true,
"requires": {
"has-symbols": "^1.0.1"
"has-symbols": "^1.0.2"
}
},
"is-typed-array": {
......@@ -26639,9 +26755,9 @@
}
},
"mcl-wasm": {
"version": "0.7.6",
"resolved": "https://registry.npmjs.org/mcl-wasm/-/mcl-wasm-0.7.6.tgz",
"integrity": "sha512-cbRl3sUOkBeRY2hsM4t1EIln2TIdQBkSiTOqNTv/4Hu5KOECnMWCgjIf+a9Ebunyn22VKqkMF3zj6ejRzz7YBw==",
"version": "0.7.7",
"resolved": "https://registry.npmjs.org/mcl-wasm/-/mcl-wasm-0.7.7.tgz",
"integrity": "sha512-jDGiCQA++5hX37gdH6RDZ3ZsA0raet7xyY/R5itj5cbcdf4Gvw+YyxWX/ZZ0Z2UPxJiw1ktRsCJZzpnqlQILdw==",
"dev": true
},
"md5.js": {
......@@ -26919,9 +27035,9 @@
}
},
"mocha": {
"version": "8.3.2",
"resolved": "https://registry.npmjs.org/mocha/-/mocha-8.3.2.tgz",
"integrity": "sha512-UdmISwr/5w+uXLPKspgoV7/RXZwKRTiTjJ2/AC5ZiEztIoOYdfKb19+9jNmEInzx5pBsCyJQzarAxqIGBNYJhg==",
"version": "8.4.0",
"resolved": "https://registry.npmjs.org/mocha/-/mocha-8.4.0.tgz",
"integrity": "sha512-hJaO0mwDXmZS4ghXsvPVriOhsxQ7ofcpQdm8dE+jISUOKopitvnXFQmpRR7jd2K6VBG6E26gU3IAbXXGIbu4sQ==",
"dev": true,
"requires": {
"@ungap/promise-all-settled": "1.1.2",
......@@ -26985,6 +27101,20 @@
"path-exists": "^4.0.0"
}
},
"glob": {
"version": "7.1.6",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
"integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
"dev": true,
"requires": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.4",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
}
},
"is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
......@@ -27459,9 +27589,9 @@
}
},
"object-inspect": {
"version": "1.10.2",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.2.tgz",
"integrity": "sha512-gz58rdPpadwztRrPjZE9DZLOABUpTGdcANUgOwBFO1C+HZZhePoP83M65WGDmbpwFYJSWqavbl4SgDn4k8RYTA==",
"version": "1.10.3",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.3.tgz",
"integrity": "sha512-e5mCJlSH7poANfC8z8S9s9S2IN5/4Zb3aZ33f5s8YqoazCFzNLloLU8r5VCG+G7WoqLvAAZoVMcy3tp/3X0Plw==",
"dev": true
},
"object-keys": {
......@@ -28460,6 +28590,14 @@
"dev": true,
"requires": {
"tslib": "^1.9.0"
},
"dependencies": {
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
}
}
},
"safe-buffer": {
......@@ -30367,9 +30505,9 @@
}
},
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz",
"integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==",
"dev": true
},
"tsort": {
......@@ -30459,9 +30597,9 @@
"peer": true
},
"uglify-js": {
"version": "3.13.5",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.5.tgz",
"integrity": "sha512-xtB8yEqIkn7zmOyS2zUNBsYCBRhDkvlNxMMY2smuJ/qA8NCHeQvKCF3i9Z4k8FJH4+PJvZRtMrPynfZ75+CSZw==",
"version": "3.13.6",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.6.tgz",
"integrity": "sha512-rRprLwl8RVaS+Qvx3Wh5hPfPBn9++G6xkGlUupya0s5aDmNjI7z3lnRLB3u7sN4OmbB0pWgzhM9BEJyiWAwtAA==",
"dev": true,
"optional": true
},
......@@ -30615,9 +30753,9 @@
"dev": true
},
"utf-8-validate": {
"version": "5.0.4",
"resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.4.tgz",
"integrity": "sha512-MEF05cPSq3AwJ2C7B7sHAA6i53vONoZbMGX8My5auEVm6W+dJ2Jd/TZPyGJ5CH42V2XtbI5FD28HeHeqlPzZ3Q==",
"version": "5.0.5",
"resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.5.tgz",
"integrity": "sha512-+pnxRYsS/axEpkrrEpzYfNZGXp0IjC/9RIxwM5gntY4Koi8SHmUGSfxfWqxZdRxrtaoVstuOzUp/rbs3JSPELQ==",
"dev": true,
"requires": {
"node-gyp-build": "^4.2.0"
......@@ -30741,9 +30879,9 @@
},
"dependencies": {
"@types/node": {
"version": "12.20.11",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.11.tgz",
"integrity": "sha512-gema+apZ6qLQK7k7F0dGkGCWQYsL0qqKORWOQO6tq46q+x+1C0vbOiOqOwRVlh4RAdbQwV/j/ryr3u5NOG1fPQ==",
"version": "12.20.12",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.12.tgz",
"integrity": "sha512-KQZ1al2hKOONAs2MFv+yTQP1LkDWMrRJ9YCVRalXltOfXsBmH5IownLxQaiq0lnAHwAViLnh2aTYqrPcRGEbgg==",
"dev": true
},
"underscore": {
......@@ -30779,9 +30917,9 @@
}
},
"@types/node": {
"version": "12.20.11",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.11.tgz",
"integrity": "sha512-gema+apZ6qLQK7k7F0dGkGCWQYsL0qqKORWOQO6tq46q+x+1C0vbOiOqOwRVlh4RAdbQwV/j/ryr3u5NOG1fPQ==",
"version": "12.20.12",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.12.tgz",
"integrity": "sha512-KQZ1al2hKOONAs2MFv+yTQP1LkDWMrRJ9YCVRalXltOfXsBmH5IownLxQaiq0lnAHwAViLnh2aTYqrPcRGEbgg==",
"dev": true
},
"bignumber.js": {
......@@ -31076,9 +31214,9 @@
},
"dependencies": {
"@types/node": {
"version": "12.20.11",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.11.tgz",
"integrity": "sha512-gema+apZ6qLQK7k7F0dGkGCWQYsL0qqKORWOQO6tq46q+x+1C0vbOiOqOwRVlh4RAdbQwV/j/ryr3u5NOG1fPQ==",
"version": "12.20.12",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.12.tgz",
"integrity": "sha512-KQZ1al2hKOONAs2MFv+yTQP1LkDWMrRJ9YCVRalXltOfXsBmH5IownLxQaiq0lnAHwAViLnh2aTYqrPcRGEbgg==",
"dev": true
}
}
......@@ -31494,9 +31632,9 @@
"dev": true
},
"yargs": {
"version": "17.0.0",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-17.0.0.tgz",
"integrity": "sha512-gbtedDPfBgG40iLbaRXhqYJycUYqFVZQLIxl1cG5Ez/xZL/47TetSYzPSIixkWa36GKHr9D/o/oSG1vHXF4zTw==",
"version": "17.0.1",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-17.0.1.tgz",
"integrity": "sha512-xBBulfCc8Y6gLFcrPvtqKz9hz8SO0l1Ni8GgDekvBX2ro0HRQImDGnikfc33cgzcYUSncapnNcZDjVFIH3f6KQ==",
"dev": true,
"requires": {
"cliui": "^7.0.2",
/* eslint-disable */
const { BN, constants, expectEvent, expectRevert, time } = require('@openzeppelin/test-helpers');
const { expect } = require('chai');
const { MAX_UINT256, ZERO_ADDRESS, ZERO_BYTES32 } = constants;
const { fromRpcSig } = require('ethereumjs-util');
const ethSigUtil = require('eth-sig-util');
const Wallet = require('ethereumjs-wallet').default;
const { promisify } = require('util');
const queue = promisify(setImmediate);
const ERC20VotesMock = artifacts.require('ERC20VotesMock');
const { EIP712Domain, domainSeparator } = require('../../../helpers/eip712');
const Delegation = [
{ name: 'delegatee', type: 'address' },
{ name: 'nonce', type: 'uint256' },
{ name: 'expiry', type: 'uint256' },
];
async function countPendingTransactions() {
return parseInt(
await network.provider.send('eth_getBlockTransactionCountByNumber', ['pending'])
);
}
async function batchInBlock (txs) {
try {
// disable auto-mining
await network.provider.send('evm_setAutomine', [false]);
// send all transactions
const promises = txs.map(fn => fn());
// wait for node to have all pending transactions
while (txs.length > await countPendingTransactions()) {
await queue();
}
// mine one block
await network.provider.send('evm_mine');
// fetch receipts
const receipts = await Promise.all(promises);
// Sanity check, all tx should be in the same block
const minedBlocks = new Set(receipts.map(({ receipt }) => receipt.blockNumber));
expect(minedBlocks.size).to.equal(1);
return receipts;
} finally {
// enable auto-mining
await network.provider.send('evm_setAutomine', [true]);
}
}
contract('ERC20Votes', function (accounts) {
const [ holder, recipient, holderDelegatee, recipientDelegatee, other1, other2 ] = accounts;
const name = 'My Token';
const symbol = 'MTKN';
const version = '1';
const supply = new BN('10000000000000000000000000');
beforeEach(async function () {
this.token = await ERC20VotesMock.new(name, symbol, holder, supply);
// We get the chain id from the contract because Ganache (used for coverage) does not return the same chain id
// from within the EVM as from the JSON RPC interface.
// See https://github.com/trufflesuite/ganache-core/issues/515
this.chainId = await this.token.getChainId();
});
it('initial nonce is 0', async function () {
expect(await this.token.nonces(holder)).to.be.bignumber.equal('0');
});
it('domain separator', async function () {
expect(
await this.token.DOMAIN_SEPARATOR(),
).to.equal(
await domainSeparator(name, version, this.chainId, this.token.address),
);
});
it('minting restriction', async function () {
const amount = new BN('2').pow(new BN('224'));
await expectRevert(
ERC20VotesMock.new(name, symbol, holder, amount),
'ERC20Votes: total supply exceeds 2**224',
);
});
describe('set delegation', function () {
describe('call', function () {
it('delegation with balance', async function () {
expect(await this.token.delegates(holder)).to.be.equal(ZERO_ADDRESS);
const { receipt } = await this.token.delegate(holder, { from: holder });
expectEvent(receipt, 'DelegateChanged', {
delegator: holder,
fromDelegate: ZERO_ADDRESS,
toDelegate: holder,
});
expectEvent(receipt, 'DelegateVotesChanged', {
delegate: holder,
previousBalance: '0',
newBalance: supply,
});
expect(await this.token.delegates(holder)).to.be.equal(holder);
expect(await this.token.getCurrentVotes(holder)).to.be.bignumber.equal(supply);
expect(await this.token.getPriorVotes(holder, receipt.blockNumber - 1)).to.be.bignumber.equal('0');
await time.advanceBlock();
expect(await this.token.getPriorVotes(holder, receipt.blockNumber)).to.be.bignumber.equal(supply);
});
it('delegation without balance', async function () {
expect(await this.token.delegates(recipient)).to.be.equal(ZERO_ADDRESS);
const { receipt } = await this.token.delegate(recipient, { from: recipient });
expectEvent(receipt, 'DelegateChanged', {
delegator: recipient,
fromDelegate: ZERO_ADDRESS,
toDelegate: recipient,
});
expectEvent.notEmitted(receipt, 'DelegateVotesChanged');
expect(await this.token.delegates(recipient)).to.be.equal(recipient);
});
});
describe('with signature', function () {
const delegator = Wallet.generate();
const delegatorAddress = web3.utils.toChecksumAddress(delegator.getAddressString());
const nonce = 0;
const buildData = (chainId, verifyingContract, message) => ({ data: {
primaryType: 'Delegation',
types: { EIP712Domain, Delegation },
domain: { name, version, chainId, verifyingContract },
message,
}});
beforeEach(async function () {
await this.token.transfer(delegatorAddress, supply, { from: holder });
});
it('accept signed delegation', async function () {
const { v, r, s } = fromRpcSig(ethSigUtil.signTypedMessage(
delegator.getPrivateKey(),
buildData(this.chainId, this.token.address, {
delegatee: delegatorAddress,
nonce,
expiry: MAX_UINT256,
}),
));
expect(await this.token.delegates(delegatorAddress)).to.be.equal(ZERO_ADDRESS);
const { receipt } = await this.token.delegateBySig(delegatorAddress, nonce, MAX_UINT256, v, r, s);
expectEvent(receipt, 'DelegateChanged', {
delegator: delegatorAddress,
fromDelegate: ZERO_ADDRESS,
toDelegate: delegatorAddress,
});
expectEvent(receipt, 'DelegateVotesChanged', {
delegate: delegatorAddress,
previousBalance: '0',
newBalance: supply,
});
expect(await this.token.delegates(delegatorAddress)).to.be.equal(delegatorAddress);
expect(await this.token.getCurrentVotes(delegatorAddress)).to.be.bignumber.equal(supply);
expect(await this.token.getPriorVotes(delegatorAddress, receipt.blockNumber - 1)).to.be.bignumber.equal('0');
await time.advanceBlock();
expect(await this.token.getPriorVotes(delegatorAddress, receipt.blockNumber)).to.be.bignumber.equal(supply);
});
it('rejects reused signature', async function () {
const { v, r, s } = fromRpcSig(ethSigUtil.signTypedMessage(
delegator.getPrivateKey(),
buildData(this.chainId, this.token.address, {
delegatee: delegatorAddress,
nonce,
expiry: MAX_UINT256,
}),
));
await this.token.delegateBySig(delegatorAddress, nonce, MAX_UINT256, v, r, s);
await expectRevert(
this.token.delegateBySig(delegatorAddress, nonce, MAX_UINT256, v, r, s),
'ERC20Votes::delegateBySig: invalid nonce',
);
});
it('rejects bad delegatee', async function () {
const { v, r, s } = fromRpcSig(ethSigUtil.signTypedMessage(
delegator.getPrivateKey(),
buildData(this.chainId, this.token.address, {
delegatee: delegatorAddress,
nonce,
expiry: MAX_UINT256,
}),
));
const { logs } = await this.token.delegateBySig(holderDelegatee, nonce, MAX_UINT256, v, r, s);
const { args } = logs.find(({ event }) => event == 'DelegateChanged');
expect(args.delegator).to.not.be.equal(delegatorAddress);
expect(args.fromDelegate).to.be.equal(ZERO_ADDRESS);
expect(args.toDelegate).to.be.equal(holderDelegatee);
});
it('rejects bad nonce', async function () {
const { v, r, s } = fromRpcSig(ethSigUtil.signTypedMessage(
delegator.getPrivateKey(),
buildData(this.chainId, this.token.address, {
delegatee: delegatorAddress,
nonce,
expiry: MAX_UINT256,
}),
));
await expectRevert(
this.token.delegateBySig(delegatorAddress, nonce + 1, MAX_UINT256, v, r, s),
'ERC20Votes::delegateBySig: invalid nonce',
);
});
it('rejects expired permit', async function () {
const expiry = (await time.latest()) - time.duration.weeks(1);
const { v, r, s } = fromRpcSig(ethSigUtil.signTypedMessage(
delegator.getPrivateKey(),
buildData(this.chainId, this.token.address, {
delegatee: delegatorAddress,
nonce,
expiry,
}),
));
await expectRevert(
this.token.delegateBySig(delegatorAddress, nonce, expiry, v, r, s),
'ERC20Votes::delegateBySig: signature expired',
);
});
});
});
describe('change delegation', function () {
beforeEach(async function () {
await this.token.delegate(holder, { from: holder });
});
it('call', async function () {
expect(await this.token.delegates(holder)).to.be.equal(holder);
const { receipt } = await this.token.delegate(holderDelegatee, { from: holder });
expectEvent(receipt, 'DelegateChanged', {
delegator: holder,
fromDelegate: holder,
toDelegate: holderDelegatee,
});
expectEvent(receipt, 'DelegateVotesChanged', {
delegate: holder,
previousBalance: supply,
newBalance: '0',
});
expectEvent(receipt, 'DelegateVotesChanged', {
delegate: holderDelegatee,
previousBalance: '0',
newBalance: supply,
});
expect(await this.token.delegates(holder)).to.be.equal(holderDelegatee);
expect(await this.token.getCurrentVotes(holder)).to.be.bignumber.equal('0');
expect(await this.token.getCurrentVotes(holderDelegatee)).to.be.bignumber.equal(supply);
expect(await this.token.getPriorVotes(holder, receipt.blockNumber - 1)).to.be.bignumber.equal(supply);
expect(await this.token.getPriorVotes(holderDelegatee, receipt.blockNumber - 1)).to.be.bignumber.equal('0');
await time.advanceBlock();
expect(await this.token.getPriorVotes(holder, receipt.blockNumber)).to.be.bignumber.equal('0');
expect(await this.token.getPriorVotes(holderDelegatee, receipt.blockNumber)).to.be.bignumber.equal(supply);
});
});
describe('transfers', function () {
it('no delegation', async function () {
const { receipt } = await this.token.transfer(recipient, 1, { from: holder });
expectEvent(receipt, 'Transfer', { from: holder, to: recipient, value: '1' });
expectEvent.notEmitted(receipt, 'DelegateVotesChanged');
this.holderVotes = '0';
this.recipientVotes = '0';
});
it('sender delegation', async function () {
await this.token.delegate(holder, { from: holder });
const { receipt } = await this.token.transfer(recipient, 1, { from: holder });
expectEvent(receipt, 'Transfer', { from: holder, to: recipient, value: '1' });
expectEvent(receipt, 'DelegateVotesChanged', { delegate: holder, previousBalance: supply, newBalance: supply.subn(1) });
this.holderVotes = supply.subn(1);
this.recipientVotes = '0';
});
it('receiver delegation', async function () {
await this.token.delegate(recipient, { from: recipient });
const { receipt } = await this.token.transfer(recipient, 1, { from: holder });
expectEvent(receipt, 'Transfer', { from: holder, to: recipient, value: '1' });
expectEvent(receipt, 'DelegateVotesChanged', { delegate: recipient, previousBalance: '0', newBalance: '1' });
this.holderVotes = '0';
this.recipientVotes = '1';
});
it('full delegation', async function () {
await this.token.delegate(holder, { from: holder });
await this.token.delegate(recipient, { from: recipient });
const { receipt } = await this.token.transfer(recipient, 1, { from: holder });
expectEvent(receipt, 'Transfer', { from: holder, to: recipient, value: '1' });
expectEvent(receipt, 'DelegateVotesChanged', { delegate: holder, previousBalance: supply, newBalance: supply.subn(1) });
expectEvent(receipt, 'DelegateVotesChanged', { delegate: recipient, previousBalance: '0', newBalance: '1' });
this.holderVotes = supply.subn(1);
this.recipientVotes = '1';
});
afterEach(async function () {
expect(await this.token.getCurrentVotes(holder)).to.be.bignumber.equal(this.holderVotes);
expect(await this.token.getCurrentVotes(recipient)).to.be.bignumber.equal(this.recipientVotes);
// need to advance 2 blocks to see the effect of a transfer on "getPriorVotes"
const blockNumber = await time.latestBlock();
await time.advanceBlock();
expect(await this.token.getPriorVotes(holder, blockNumber)).to.be.bignumber.equal(this.holderVotes);
expect(await this.token.getPriorVotes(recipient, blockNumber)).to.be.bignumber.equal(this.recipientVotes);
});
});
// The following tests are a adaptation of https://github.com/compound-finance/compound-protocol/blob/master/tests/Governance/CompTest.js.
describe('Compound test suite', function () {
describe('balanceOf', function () {
it('grants to initial account', async function () {
expect(await this.token.balanceOf(holder)).to.be.bignumber.equal('10000000000000000000000000');
});
});
describe('numCheckpoints', function () {
it('returns the number of checkpoints for a delegate', async function () {
await this.token.transfer(recipient, '100', { from: holder }); //give an account a few tokens for readability
expect(await this.token.numCheckpoints(other1)).to.be.bignumber.equal('0');
const t1 = await this.token.delegate(other1, { from: recipient });
expect(await this.token.numCheckpoints(other1)).to.be.bignumber.equal('1');
const t2 = await this.token.transfer(other2, 10, { from: recipient });
expect(await this.token.numCheckpoints(other1)).to.be.bignumber.equal('2');
const t3 = await this.token.transfer(other2, 10, { from: recipient });
expect(await this.token.numCheckpoints(other1)).to.be.bignumber.equal('3');
const t4 = await this.token.transfer(recipient, 20, { from: holder });
expect(await this.token.numCheckpoints(other1)).to.be.bignumber.equal('4');
expect(await this.token.checkpoints(other1, 0)).to.be.deep.equal([ t1.receipt.blockNumber.toString(), '100' ]);
expect(await this.token.checkpoints(other1, 1)).to.be.deep.equal([ t2.receipt.blockNumber.toString(), '90' ]);
expect(await this.token.checkpoints(other1, 2)).to.be.deep.equal([ t3.receipt.blockNumber.toString(), '80' ]);
expect(await this.token.checkpoints(other1, 3)).to.be.deep.equal([ t4.receipt.blockNumber.toString(), '100' ]);
await time.advanceBlock();
expect(await this.token.getPriorVotes(other1, t1.receipt.blockNumber)).to.be.bignumber.equal('100');
expect(await this.token.getPriorVotes(other1, t2.receipt.blockNumber)).to.be.bignumber.equal('90');
expect(await this.token.getPriorVotes(other1, t3.receipt.blockNumber)).to.be.bignumber.equal('80');
expect(await this.token.getPriorVotes(other1, t4.receipt.blockNumber)).to.be.bignumber.equal('100');
});
it('does not add more than one checkpoint in a block', async function () {
await this.token.transfer(recipient, '100', { from: holder });
expect(await this.token.numCheckpoints(other1)).to.be.bignumber.equal('0');
const [ t1, t2, t3 ] = await batchInBlock([
() => this.token.delegate(other1, { from: recipient, gas: 100000 }),
() => this.token.transfer(other2, 10, { from: recipient, gas: 100000 }),
() => this.token.transfer(other2, 10, { from: recipient, gas: 100000 }),
]);
expect(await this.token.numCheckpoints(other1)).to.be.bignumber.equal('1');
expect(await this.token.checkpoints(other1, 0)).to.be.deep.equal([ t1.receipt.blockNumber.toString(), '80' ]);
// expectReve(await this.token.checkpoints(other1, 1)).to.be.deep.equal([ '0', '0' ]); // Reverts due to array overflow check
// expect(await this.token.checkpoints(other1, 2)).to.be.deep.equal([ '0', '0' ]); // Reverts due to array overflow check
const t4 = await this.token.transfer(recipient, 20, { from: holder });
expect(await this.token.numCheckpoints(other1)).to.be.bignumber.equal('2');
expect(await this.token.checkpoints(other1, 1)).to.be.deep.equal([ t4.receipt.blockNumber.toString(), '100' ]);
});
});
describe('getPriorVotes', function () {
it('reverts if block number >= current block', async function () {
await expectRevert(
this.token.getPriorVotes(other1, 5e10),
'ERC20Votes::getPriorVotes: not yet determined',
);
});
it('returns 0 if there are no checkpoints', async function () {
expect(await this.token.getPriorVotes(other1, 0)).to.be.bignumber.equal('0');
});
it('returns the latest block if >= last checkpoint block', async function () {
const t1 = await this.token.delegate(other1, { from: holder });
await time.advanceBlock();
await time.advanceBlock();
expect(await this.token.getPriorVotes(other1, t1.receipt.blockNumber)).to.be.bignumber.equal('10000000000000000000000000');
expect(await this.token.getPriorVotes(other1, t1.receipt.blockNumber + 1)).to.be.bignumber.equal('10000000000000000000000000');
});
it('returns zero if < first checkpoint block', async function () {
await time.advanceBlock();
const t1 = await this.token.delegate(other1, { from: holder });
await time.advanceBlock();
await time.advanceBlock();
expect(await this.token.getPriorVotes(other1, t1.receipt.blockNumber - 1)).to.be.bignumber.equal('0');
expect(await this.token.getPriorVotes(other1, t1.receipt.blockNumber + 1)).to.be.bignumber.equal('10000000000000000000000000');
});
it('generally returns the voting balance at the appropriate checkpoint', async function () {
const t1 = await this.token.delegate(other1, { from: holder });
await time.advanceBlock();
await time.advanceBlock();
const t2 = await this.token.transfer(other2, 10, { from: holder });
await time.advanceBlock();
await time.advanceBlock();
const t3 = await this.token.transfer(other2, 10, { from: holder });
await time.advanceBlock();
await time.advanceBlock();
const t4 = await this.token.transfer(holder, 20, { from: other2 });
await time.advanceBlock();
await time.advanceBlock();
expect(await this.token.getPriorVotes(other1, t1.receipt.blockNumber - 1)).to.be.bignumber.equal('0');
expect(await this.token.getPriorVotes(other1, t1.receipt.blockNumber)).to.be.bignumber.equal('10000000000000000000000000');
expect(await this.token.getPriorVotes(other1, t1.receipt.blockNumber + 1)).to.be.bignumber.equal('10000000000000000000000000');
expect(await this.token.getPriorVotes(other1, t2.receipt.blockNumber)).to.be.bignumber.equal('9999999999999999999999990');
expect(await this.token.getPriorVotes(other1, t2.receipt.blockNumber + 1)).to.be.bignumber.equal('9999999999999999999999990');
expect(await this.token.getPriorVotes(other1, t3.receipt.blockNumber)).to.be.bignumber.equal('9999999999999999999999980');
expect(await this.token.getPriorVotes(other1, t3.receipt.blockNumber + 1)).to.be.bignumber.equal('9999999999999999999999980');
expect(await this.token.getPriorVotes(other1, t4.receipt.blockNumber)).to.be.bignumber.equal('10000000000000000000000000');
expect(await this.token.getPriorVotes(other1, t4.receipt.blockNumber + 1)).to.be.bignumber.equal('10000000000000000000000000');
});
});
});
});
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