diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 00000000..5a8d2038 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,38 @@ +name: "Bug Report" +description: File a bug report +title: "[Bug]: " +labels: + - bug +body: + - attributes: + value: | + Please check the [issues tab](https://github.com/ERC725Alliance/ERC725/issues) to avoid duplicates. + Remember, this is not a place to ask for help debugging code. For that, we welcome you in the [LUKSO's discord server](https://discord.com/channels/359064931246538762/585786253992132609)! + Thanks for taking the time to fill out this bug report! + type: markdown + - attributes: + label: "Describe the issue:" + id: what-happen + type: textarea + validations: + required: true + - attributes: + label: "Expected behavior:" + id: expected-behavior + type: textarea + validations: + required: true + - attributes: + label: "Environment" + description: "Compiler version, Compiler options, Node/NPM version, Framework/IDE (e.g. Truffle/Hardhat/Remix), Operating System" + id: environment + type: textarea + validations: + required: true + - attributes: + label: "Code example to reproduce the issue:" + description: "It can be a GitHub repository/gist or a simple code snippet." + id: reproduce + type: textarea + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..bc1ae39a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,4 @@ +contact_links: + - name: Questions & Support Requests + url: https://discord.com/channels/359064931246538762/585786253992132609 + about: Ask in the dev-chat channel in LUKSO's discord server diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 00000000..33b823d0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,30 @@ +name: Feature | Changes Request +description: Suggest an idea to improve the repository. +title: "[Feature-Request]: " +labels: + - feature +body: + - attributes: + value: | + Please check the [issues tab](https://github.com/ERC725Alliance/ERC725/issues) to avoid duplicates. + Thanks for taking the time to provide feedback! + type: markdown + - attributes: + label: "Rationale/Motivation:" + description: "Explain why the feature is important and how it benefits the project." + id: rationale + type: textarea + validations: + required: true + - attributes: + label: "Describe the desired feature:" + description: Explain what the feature enables/improves. + id: feature-request + type: textarea + validations: + required: true + - attributes: + label: "Code example that enables the feature:" + description: "Can be a link to a GitHub repository, gist or a simple code snippet." + id: reproduce + type: textarea diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..544807eb --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,68 @@ + + + + + + +# What does this PR introduce? + + + + + + + + + + + + + + + + + + + + + + + + +Fixes #???? + + + + + +### PR Checklist + + + + + +- [ ] Wrote Tests +- [ ] Wrote Documentation +- [ ] Ran `npm run lint` +- [ ] Ran `npm run build` +- [ ] Ran `npm run test` diff --git a/docs/ERC-725.md b/docs/ERC-725.md index a0ab3b5b..45788246 100644 --- a/docs/ERC-725.md +++ b/docs/ERC-725.md @@ -41,7 +41,7 @@ And the event: ### ERC725X -**ERC725X** interface id according to [ERC165]: `0x570ef073`. +**ERC725X** interface id according to [ERC165]: `0x7545acac`. Smart contracts implementing the ERC725X standard MUST implement the [ERC165] `supportsInterface(..)` function and MUST support the ERC165 and ERC725X interface ids. @@ -103,13 +103,13 @@ data = + + See [EIP-1014: Skinny CREATE2](https://eips.ethereum.org/EIPS/eip-1014) for more information. -#### execute (Array) +#### executeBatch ```solidity -function execute(uint256[] memory operationsType, address[] memory targets, uint256[] memory values, bytes[] memory datas) external payable returns(bytes[] memory) +function executeBatch(uint256[] memory operationsType, address[] memory targets, uint256[] memory values, bytes[] memory datas) external payable returns(bytes[] memory) ``` -Function Selector: `0x13ced88d` +Function Selector: `0x31858452` Executes a batch of calls on any other smart contracts, transfers the blockchain native token, or deploys a new smart contract. MUST only be called by the current owner of the contract. @@ -134,26 +134,6 @@ _Returns:_ `bytes[]` , array list of returned data of the called function, or th **Triggers Event:** [ContractCreated](#contractcreated), [Executed](#executed) on each call iteration -**Note:** The `execute()` functions use function overloading, therefore it is better to reference them by the given function signature as follows: - -```js -// web3.js example - -// execute -myContract.methods['execute(uint256,address,uint256,bytes)'](OPERATION_CALL, target.address, 2WEI, "0x").send(); - -// execute Array -myContract.methods['execute(uint256[],address[],uint256[],bytes[])']([OPERATION_CALL, OPERATION_CREATE], [target.address, ZERO_ADDRESS], [2WEI, 0WEI], ["0x", CONTRACT_BYTECODE]).send() - -// OR - -// execute -myContract.methods['0x44c028fe'](OPERATION_CALL, target.address, 2WEI, "0x").send(); - -// execute Array -myContract.methods['0x13ced88d']([OPERATION_CALL, OPERATION_CREATE], [target.address, ZERO_ADDRESS], [2WEI, 0WEI], ["0x", CONTRACT_BYTECODE]).send() -``` - ### Events #### Executed @@ -176,7 +156,7 @@ MUST be triggered when `execute` creates a new contract using the `operationType ### ERC725Y -**ERC725Y** interface id according to [ERC165]: `0x714df77c`. +**ERC725Y** interface id according to [ERC165]: `0x629aa694`. Smart contracts implementing the ERC725Y standard MUST implement the [ERC165] `supportsInterface(..)` function and MUST support the ERC165 and ERC725Y interface ids. @@ -200,13 +180,13 @@ _Parameters:_ _Returns:_ `bytes` , The data for the requested data key. -#### getData (Array) +#### getDataBatch ```solidity function getData(bytes32[] memory dataKeys) external view returns(bytes[] memory) ``` -Function Selector: `0x4e3e6e9c` +Function Selector: `0xdedff9c6` Gets array of data at multiple given data keys. @@ -237,13 +217,13 @@ _Requirements:_ **Triggers Event:** [DataChanged](#datachanged) -#### setData (Array) +#### setDataBatch ```solidity function setData(bytes32[] memory dataKeys, bytes[] memory dataValues) external payable ``` -Function Selector: `0x14a6e293` +Function Selector: `0x97902421` Sets array of data at multiple data keys. MUST only be called by the current owner of the contract. @@ -259,26 +239,6 @@ _Requirements:_ **Triggers Event:** [DataChanged](#datachanged) -**Note:** `setData()` and `getData()` uses function overloading, therefore it is better to reference them by the given function signature as follows: - -```js -// web3.js example - -// setData -myContract.methods['setData(bytes32,bytes)'](dataKey, dataValue).send() - -// setData Array -myContract.methods['setData(bytes32[],bytes[])']([dataKeys, ...], [dataValues, ...]).send() - -// OR - -// setData -myContract.methods['0x7f23690c'](dataKey, dataValue).send() - -// setData Array -myContract.methods['0x14a6e293']([dataKeys, ...], [dataValues, ...]).send() -``` - ### Events #### DataChanged @@ -304,7 +264,7 @@ The data stored in an ERC725Y smart contract is not only readable/writable by of ## Backwards Compatibility -All contracts since ERC725v2 from 2018/19 should be compatible to the current version of the standard. Mainly interface ID and Event parameters have changed, while `getData(bytes32[])` and `setData(bytes32[], bytes[])` was added as an efficient way to set/get multiple keys at once. The same applies for execution, as `execute(..[])` was added as an efficient way to batch calls. +All contracts since ERC725v2 from 2018/19 should be compatible to the current version of the standard. Mainly interface ID and Event parameters have changed, while `getDataBatch(bytes32[])` and `setDataBatch(bytes32[], bytes[])` was added as an efficient way to set/get multiple keys at once. The same applies for execution, as `executeBatch(..[])` was added as an efficient way to batch calls. ## Reference Implementation @@ -322,25 +282,24 @@ When using the operation type `4` for `delegatecall`, it is important to conside // SPDX-License-Identifier: CC0-1.0 pragma solidity >=0.5.0 <0.7.0; -// ERC165 identifier: `0x570ef073` interface IERC725X /* is ERC165, ERC173 */ { event ContractCreated(uint256 indexed operationType, address indexed contractAddress, uint256 indexed value, bytes32 salt); event Executed(uint256 indexed operationType, address indexed target, uint256 indexed value, bytes4 data); function execute(uint256 operationType, address target, uint256 value, bytes memory data) external payable returns(bytes memory); - function execute(uint256[] memory operationsType, address[] memory targets, uint256[] memory values, bytes memory datas) external payable returns(bytes[] memory); + function executeBatch(uint256[] memory operationsType, address[] memory targets, uint256[] memory values, bytes memory datas) external payable returns(bytes[] memory); } -// ERC165 identifier: `0x714df77c` + interface IERC725Y /* is ERC165, ERC173 */ { event DataChanged(bytes32 indexed dataKey, bytes dataValue); function getData(bytes32 dataKey) external view returns(bytes memory); - function getData(bytes32[] memory dataKeys) external view returns(bytes[] memory); + function getDataBatch(bytes32[] memory dataKeys) external view returns(bytes[] memory); function setData(bytes32 dataKey, bytes memory dataValue) external; - function setData(bytes32[] memory dataKeys, bytes[] memory dataValues) external; + function setDataBatch(bytes32[] memory dataKeys, bytes[] memory dataValues) external; } interface IERC725 /* is IERC725X, IERC725Y */ { diff --git a/implementations/.editorconfig b/implementations/.editorconfig new file mode 100644 index 00000000..469ff31b --- /dev/null +++ b/implementations/.editorconfig @@ -0,0 +1,10 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true + +[*.{js,json,yml}] +charset = utf-8 +indent_style = space +indent_size = 2 \ No newline at end of file diff --git a/implementations/.prettierrc b/implementations/.prettierrc index c63dee4f..17a6ef71 100644 --- a/implementations/.prettierrc +++ b/implementations/.prettierrc @@ -1,10 +1,9 @@ { "overrides": [ { - "files": ["*.js", "*.,ts"], + "files": ["*.js", "*.ts"], "options": { - "tabWidth": 4, - "useTabs": true, + "tabWidth": 2, "printWidth": 100, "trailingComma": "all", "singleQuote": true diff --git a/implementations/CHANGELOG.md b/implementations/CHANGELOG.md index d724adce..9dde2ead 100644 --- a/implementations/CHANGELOG.md +++ b/implementations/CHANGELOG.md @@ -2,6 +2,23 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [5.0.0](https://github.com/ERC725Alliance/ERC725/compare/v4.2.0...v5.0.0) (2023-04-26) + +### โš  BREAKING CHANGES + +- Remove function overloading and rename overloaded functions to add "Batch" keyword: ([#209](https://github.com/ERC725Alliance/ERC725/pull/209)) + - `setData(bytes32[],bytes[])` --> `setDataBatch(bytes32[],bytes[])` + - `getData(bytes32[])` --> `getDataBatch(bytes32[])` + - `execute(uint256[],address[],uint256[],bytes[])` --> `executeBatch(uint256[],address[],uint256[],bytes[])` + +- Change interfaceId of ERC725X and ERC725Y: ([#209](https://github.com/ERC725Alliance/ERC725/pull/209)) + - ERC725X from `0x570ef073` to `0x7545acac` + - ERC725Y from `0x714df77c` to `0x629aa694` + +### Refactor + +- Remove parameters from error in ERC725Y (`ERC725Y_DataKeysValuesLengthMismatch`) ([#208](https://github.com/ERC725Alliance/ERC725/pull/208)) + ## [4.2.0](https://github.com/ERC725Alliance/ERC725/compare/v4.1.1...v4.2.0) (2023-03-13) ### โš  BREAKING CHANGES diff --git a/implementations/constants.js b/implementations/constants.js index ebe3b7b3..901bbb0b 100644 --- a/implementations/constants.js +++ b/implementations/constants.js @@ -1,110 +1,121 @@ const INTERFACE_ID = { - ERC165: '0x01ffc9a7', - ERC725X: '0x570ef073', - ERC725Y: '0x714df77c', + ERC165: '0x01ffc9a7', + ERC725X: '0x7545acac', + ERC725Y: '0x629aa694', }; const OPERATION_TYPE = { - CALL: 0, - CREATE: 1, - CREATE2: 2, - STATICCALL: 3, - DELEGATECALL: 4, + CALL: 0, + CREATE: 1, + CREATE2: 2, + STATICCALL: 3, + DELEGATECALL: 4, }; const FUNCTIONS_SELECTOR = { - EXECUTE: '0x44c028fe', - EXECUTE_ARRAY: '0x13ced88d', - SETDATA: '0x7f23690c', - SETDATA_ARRAY: '0x14a6e293', + EXECUTE: '0x44c028fe', + EXECUTE_BATCH: '0x31858452', + SETDATA: '0x7f23690c', + SETDATA_BATCH: '0x97902421', }; const Errors = { - ERC725X: { - '0x0df9a8f8': { - error: 'ERC725X_InsufficientBalance(uint256,uint256)', - message: 'ERC725X: Sending more balance than available in the contract', - }, - '0x7583b3bc': { - error: 'ERC725X_UnknownOperationType(uint256)', - message: 'ERC725X: Operation type provided is none of the default operation types available', - }, - '0x72f2bc6a': { - error: 'ERC725X_MsgValueDisallowedInStaticCall()', - message: 'ERC725X: Sending value is not allowed when making a staticcall', - }, - '0x5ac83135': { - error: 'ERC725X_MsgValueDisallowedInDelegateCall()', - message: 'ERC725X: Sending value is not allowed when making a delegatecall', - }, - '0x3041824a': { - error: 'ERC725X_CreateOperationsRequireEmptyRecipientAddress()()', - message: 'ERC725X: The `to` address needs to be address(0) when deploying contracts', - }, - '0x0b07489b': { - error: 'ERC725X_ContractDeploymentFailed()', - message: 'ERC725X: Contract deployment failed', - }, - '0xb81cd8d9': { - error: 'ERC725X_NoContractBytecodeProvided()', - message: 'ERC725X: Contract deployment requires bytecode to be provided as data', - }, - '0x3ff55f4d': { - error: 'ERC725X_ExecuteParametersLengthMismatch()', - message: 'ERC725X: Parameters length mismatch in execute batch', - }, - }, - ERC725Y: { - '0x43a3c266': { - error: 'ERC725Y_DataKeysValuesLengthMismatch(uint256,uint256)', - message: 'ERC725Y: Parameters length mismatch in setData batch', - }, - }, -} + ERC725X: { + '0x0df9a8f8': { + error: 'ERC725X_InsufficientBalance(uint256,uint256)', + message: 'ERC725X: Sending more balance than available in the contract', + }, + '0x7583b3bc': { + error: 'ERC725X_UnknownOperationType(uint256)', + message: 'ERC725X: Operation type provided is none of the default operation types available', + }, + '0x72f2bc6a': { + error: 'ERC725X_MsgValueDisallowedInStaticCall()', + message: 'ERC725X: Sending value is not allowed when making a staticcall', + }, + '0x5ac83135': { + error: 'ERC725X_MsgValueDisallowedInDelegateCall()', + message: 'ERC725X: Sending value is not allowed when making a delegatecall', + }, + '0x3041824a': { + error: 'ERC725X_CreateOperationsRequireEmptyRecipientAddress()()', + message: 'ERC725X: The `to` address needs to be address(0) when deploying contracts', + }, + '0x0b07489b': { + error: 'ERC725X_ContractDeploymentFailed()', + message: 'ERC725X: Contract deployment failed', + }, + '0xb81cd8d9': { + error: 'ERC725X_NoContractBytecodeProvided()', + message: 'ERC725X: Contract deployment requires bytecode to be provided as data', + }, + '0x3ff55f4d': { + error: 'ERC725X_ExecuteParametersLengthMismatch()', + message: 'ERC725X: Parameters length mismatch in execute batch', + }, + '0xe9ad2b5f': { + error: 'ERC725X_ExecuteParametersEmptyArray()', + message: 'ERC725X: Parameters cannot be an empty array' + } + }, + ERC725Y: { + '0x3bcc8979': { + error: 'ERC725Y_DataKeysValuesLengthMismatch()', + message: 'ERC725Y: Parameters length mismatch in setData batch', + }, + '0x97da5f95': { + error: 'ERC725Y_DataKeysValuesEmptyArray()', + message: 'ERC725Y: Parameters cannot be an empty array' + }, + '0xf36ba737': { + error: 'ERC725Y_MsgValueDisallowed()', + message: 'ERC725Y: Sending value to setData functions is not allowed' + } + }, +}; const EventSignatures = { - ERC725X: { - /** - * event ContractCreated( - * uint256 indexed _operation, - * address indexed _contractAddress, - * uint256 indexed _value - * bytes32 _salt - * ); - * - * signature = keccak256('ContractCreated(uint256,address,uint256,bytes32)') - */ - ContractCreated: '0xa1fb700aaee2ae4a2ff6f91ce7eba292f89c2f5488b8ec4c5c5c8150692595c3', - /** - * event Executed( - * uint256 indexed _operation, - * address indexed _to, - * uint256 indexed _value, - * bytes4 _data - * ); - * - * signature = keccak256('Executed(uint256,address,uint256,bytes4)') - */ - Executed: '0x4810874456b8e6487bd861375cf6abd8e1c8bb5858c8ce36a86a04dabfac199e', - }, - ERC725Y: { - /** - * event DataChanged( - * bytes32 indexed dataKey, - * bytes dataValue - * ); - * - * signature = keccak256('DataChanged(bytes32,bytes)') - */ - DataChanged: '0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2', - }, -} - + ERC725X: { + /** + * event ContractCreated( + * uint256 indexed _operation, + * address indexed _contractAddress, + * uint256 indexed _value + * bytes32 _salt + * ); + * + * signature = keccak256('ContractCreated(uint256,address,uint256,bytes32)') + */ + ContractCreated: '0xa1fb700aaee2ae4a2ff6f91ce7eba292f89c2f5488b8ec4c5c5c8150692595c3', + /** + * event Executed( + * uint256 indexed _operation, + * address indexed _to, + * uint256 indexed _value, + * bytes4 _data + * ); + * + * signature = keccak256('Executed(uint256,address,uint256,bytes4)') + */ + Executed: '0x4810874456b8e6487bd861375cf6abd8e1c8bb5858c8ce36a86a04dabfac199e', + }, + ERC725Y: { + /** + * event DataChanged( + * bytes32 indexed dataKey, + * bytes dataValue + * ); + * + * signature = keccak256('DataChanged(bytes32,bytes)') + */ + DataChanged: '0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2', + }, +}; module.exports = { - INTERFACE_ID, - OPERATION_TYPE, - Errors, - EventSignatures, - FUNCTIONS_SELECTOR, + INTERFACE_ID, + OPERATION_TYPE, + Errors, + EventSignatures, + FUNCTIONS_SELECTOR, }; diff --git a/implementations/contracts/ERC725XCore.sol b/implementations/contracts/ERC725XCore.sol index 954b17c8..fda00a40 100644 --- a/implementations/contracts/ERC725XCore.sol +++ b/implementations/contracts/ERC725XCore.sol @@ -49,13 +49,13 @@ abstract contract ERC725XCore is OwnableUnset, ERC165, IERC725X { /** * @inheritdoc IERC725X */ - function execute( + function executeBatch( uint256[] memory operationsType, address[] memory targets, uint256[] memory values, bytes[] memory datas ) public payable virtual override onlyOwner returns (bytes[] memory) { - return _execute(operationsType, targets, values, datas); + return _executeBatch(operationsType, targets, values, datas); } /** @@ -83,19 +83,19 @@ abstract contract ERC725XCore is OwnableUnset, ERC165, IERC725X { } // Deploy with CREATE - if (operationType == uint256(OPERATION_1_CREATE)) { + if (operationType == OPERATION_1_CREATE) { if (target != address(0)) revert ERC725X_CreateOperationsRequireEmptyRecipientAddress(); return _deployCreate(value, data); } // Deploy with CREATE2 - if (operationType == uint256(OPERATION_2_CREATE2)) { + if (operationType == OPERATION_2_CREATE2) { if (target != address(0)) revert ERC725X_CreateOperationsRequireEmptyRecipientAddress(); return _deployCreate2(value, data); } // STATICCALL - if (operationType == uint256(OPERATION_3_STATICCALL)) { + if (operationType == OPERATION_3_STATICCALL) { if (value != 0) revert ERC725X_MsgValueDisallowedInStaticCall(); return _executeStaticCall(target, data); } @@ -112,7 +112,7 @@ abstract contract ERC725XCore is OwnableUnset, ERC165, IERC725X { // - update the contract owner // - run selfdestruct in the context of this contract // - if (operationType == uint256(OPERATION_4_DELEGATECALL)) { + if (operationType == OPERATION_4_DELEGATECALL) { if (value != 0) revert ERC725X_MsgValueDisallowedInDelegateCall(); return _executeDelegateCall(target, data); } @@ -124,7 +124,7 @@ abstract contract ERC725XCore is OwnableUnset, ERC165, IERC725X { * @dev same as `_execute` but for batch execution * see `IERC725X,execute(uint256[],address[],uint256[],bytes[])` */ - function _execute( + function _executeBatch( uint256[] memory operationsType, address[] memory targets, uint256[] memory values, @@ -133,12 +133,23 @@ abstract contract ERC725XCore is OwnableUnset, ERC165, IERC725X { if ( operationsType.length != targets.length || (targets.length != values.length || values.length != datas.length) - ) revert ERC725X_ExecuteParametersLengthMismatch(); + ) { + revert ERC725X_ExecuteParametersLengthMismatch(); + } + + if (operationsType.length == 0) { + revert ERC725X_ExecuteParametersEmptyArray(); + } bytes[] memory result = new bytes[](operationsType.length); - for (uint256 i = 0; i < operationsType.length; i = _uncheckedIncrementERC725X(i)) { + for (uint256 i = 0; i < operationsType.length; ) { result[i] = _execute(operationsType[i], targets[i], values[i], datas[i]); + + // Increment the iterator in unchecked block to save gas + unchecked { + ++i; + } } return result; @@ -254,14 +265,4 @@ abstract contract ERC725XCore is OwnableUnset, ERC165, IERC725X { newContract = abi.encodePacked(contractAddress); emit ContractCreated(OPERATION_2_CREATE2, contractAddress, value, salt); } - - /** - * @dev Will return unchecked incremented uint256 - * can be used to save gas when iterating over loops - */ - function _uncheckedIncrementERC725X(uint256 i) internal pure returns (uint256) { - unchecked { - return i + 1; - } - } } diff --git a/implementations/contracts/ERC725YCore.sol b/implementations/contracts/ERC725YCore.sol index b6c0a128..6dc03d54 100644 --- a/implementations/contracts/ERC725YCore.sol +++ b/implementations/contracts/ERC725YCore.sol @@ -39,13 +39,18 @@ abstract contract ERC725YCore is OwnableUnset, ERC165, IERC725Y { /** * @inheritdoc IERC725Y */ - function getData( + function getDataBatch( bytes32[] memory dataKeys ) public view virtual override returns (bytes[] memory dataValues) { dataValues = new bytes[](dataKeys.length); - for (uint256 i = 0; i < dataKeys.length; i = _uncheckedIncrementERC725Y(i)) { + for (uint256 i = 0; i < dataKeys.length; ) { dataValues[i] = _getData(dataKeys[i]); + + // Increment the iterator in unchecked block to save gas + unchecked { + ++i; + } } return dataValues; @@ -65,7 +70,7 @@ abstract contract ERC725YCore is OwnableUnset, ERC165, IERC725Y { /** * @inheritdoc IERC725Y */ - function setData( + function setDataBatch( bytes32[] memory dataKeys, bytes[] memory dataValues ) public payable virtual override onlyOwner { @@ -73,11 +78,20 @@ abstract contract ERC725YCore is OwnableUnset, ERC165, IERC725Y { if (msg.value != 0) revert ERC725Y_MsgValueDisallowed(); if (dataKeys.length != dataValues.length) { - revert ERC725Y_DataKeysValuesLengthMismatch(dataKeys.length, dataValues.length); + revert ERC725Y_DataKeysValuesLengthMismatch(); } - for (uint256 i = 0; i < dataKeys.length; i = _uncheckedIncrementERC725Y(i)) { + if (dataKeys.length == 0) { + revert ERC725Y_DataKeysValuesEmptyArray(); + } + + for (uint256 i = 0; i < dataKeys.length; ) { _setData(dataKeys[i], dataValues[i]); + + // Increment the iterator in unchecked block to save gas + unchecked { + ++i; + } } } @@ -90,16 +104,6 @@ abstract contract ERC725YCore is OwnableUnset, ERC165, IERC725Y { emit DataChanged(dataKey, dataValue); } - /** - * @dev Will return unchecked incremented uint256 - * can be used to save gas when iterating over loops - */ - function _uncheckedIncrementERC725Y(uint256 i) internal pure returns (uint256) { - unchecked { - return i + 1; - } - } - /** * @inheritdoc ERC165 */ diff --git a/implementations/contracts/constants.sol b/implementations/contracts/constants.sol index abb919e4..3eef99f8 100644 --- a/implementations/contracts/constants.sol +++ b/implementations/contracts/constants.sol @@ -2,12 +2,12 @@ pragma solidity ^0.8.0; // ERC165 INTERFACE IDs -bytes4 constant _INTERFACEID_ERC725X = 0x570ef073; -bytes4 constant _INTERFACEID_ERC725Y = 0x714df77c; +bytes4 constant _INTERFACEID_ERC725X = 0x7545acac; +bytes4 constant _INTERFACEID_ERC725Y = 0x629aa694; -// ERC725X overloaded function selectors +// ERC725X function selectors bytes4 constant EXECUTE_SELECTOR = 0x44c028fe; -bytes4 constant EXECUTE_ARRAY_SELECTOR = 0x13ced88d; +bytes4 constant EXECUTE_BATCH_SELECTOR = 0x31858452; // ERC725X OPERATION TYPES uint256 constant OPERATION_0_CALL = 0; @@ -16,6 +16,6 @@ uint256 constant OPERATION_2_CREATE2 = 2; uint256 constant OPERATION_3_STATICCALL = 3; uint256 constant OPERATION_4_DELEGATECALL = 4; -// ERC725Y overloaded function selectors +// ERC725Y function selectors bytes4 constant SETDATA_SELECTOR = 0x7f23690c; -bytes4 constant SETDATA_ARRAY_SELECTOR = 0x14a6e293; +bytes4 constant SETDATA_BATCH_SELECTOR = 0x97902421; diff --git a/implementations/contracts/errors.sol b/implementations/contracts/errors.sol index 48016cc4..977d2471 100644 --- a/implementations/contracts/errors.sol +++ b/implementations/contracts/errors.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.0; /** * @dev reverts when trying to send more native tokens `value` than available in current `balance`. * @param balance the balance of the ERC725X contract. - * @param value the amount of native tokens sent via `ERC725X.execute(...)`. + * @param value the amount of native tokens sent via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)`. */ error ERC725X_InsufficientBalance(uint256 balance, uint256 value); @@ -16,31 +16,31 @@ error ERC725X_UnknownOperationType(uint256 operationTypeProvided); /** * @dev the `value` parameter (= sending native tokens) is not allowed when making a staticcall - * via `ERC725X.execute(...)` because sending native tokens is a state changing operation. + * via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)` because sending native tokens is a state changing operation. */ error ERC725X_MsgValueDisallowedInStaticCall(); /** * @dev the `value` parameter (= sending native tokens) is not allowed when making a delegatecall - * via `ERC725X.execute(...)` because msg.value is persisting. + * via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)` because msg.value is persisting. */ error ERC725X_MsgValueDisallowedInDelegateCall(); /** - * @dev reverts when passing a `to` address while deploying a contract va `ERC725X.execute(...)` + * @dev reverts when passing a `to` address while deploying a contract va `ERC725X.execute(...)`/`ERC725X.executeBatch(...)` * whether using operation type 1 (CREATE) or 2 (CREATE2). */ error ERC725X_CreateOperationsRequireEmptyRecipientAddress(); /** - * @dev reverts when contract deployment via `ERC725X.execute(...)` failed. + * @dev reverts when contract deployment via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)` failed. * whether using operation type 1 (CREATE) or 2 (CREATE2). */ error ERC725X_ContractDeploymentFailed(); /** * @dev reverts when no contract bytecode was provided as parameter when trying to deploy a contract - * via `ERC725X.execute(...)`, whether using operation type 1 (CREATE) or 2 (CREATE2). + * via `ERC725X.execute(...)`/`ERC725X.executeBatch(...)`, whether using operation type 1 (CREATE) or 2 (CREATE2). */ error ERC725X_NoContractBytecodeProvided(); @@ -49,13 +49,23 @@ error ERC725X_NoContractBytecodeProvided(); */ error ERC725X_ExecuteParametersLengthMismatch(); +/** + * @dev reverts when one of the array parameter provided to + * `executeBatch(uint256[],address[],uint256[],bytes[]) is an empty array + */ +error ERC725X_ExecuteParametersEmptyArray(); + /** * @dev reverts when there is not the same number of elements in the lists of data keys and data values - * when calling setData(bytes32[],bytes[]). - * @param dataKeysLength the number of data keys in the bytes32[] dataKeys - * @param dataValuesLength the number of data value in the bytes[] dataValue + * when calling setDataBatch. + */ +error ERC725Y_DataKeysValuesLengthMismatch(); + +/** + * @dev reverts when one of the array parameter provided to + * `setDataBatch` is an empty array */ -error ERC725Y_DataKeysValuesLengthMismatch(uint256 dataKeysLength, uint256 dataValuesLength); +error ERC725Y_DataKeysValuesEmptyArray(); /** * @dev reverts when sending value to the `setData(..)` functions diff --git a/implementations/contracts/helpers/ConstantsChecker.sol b/implementations/contracts/helpers/ConstantsChecker.sol index 4d093008..67125558 100644 --- a/implementations/contracts/helpers/ConstantsChecker.sol +++ b/implementations/contracts/helpers/ConstantsChecker.sol @@ -30,34 +30,33 @@ contract ConstantsChecker { function getExecuteSelector() public pure returns (bytes4) { require( - EXECUTE_SELECTOR == bytes4(keccak256("execute(uint256,address,uint256,bytes)")), + EXECUTE_SELECTOR == IERC725X.execute.selector, "hardcoded EXECUTE_SELECTOR in `constants.sol` does not match `IERC725X.execute.selector`" ); - return bytes4(keccak256("execute(uint256,address,uint256,bytes)")); + return IERC725X.execute.selector; } function getExecuteArraySelector() public pure returns (bytes4) { require( - EXECUTE_ARRAY_SELECTOR == - bytes4(keccak256("execute(uint256[],address[],uint256[],bytes[])")), - "hardcoded EXECUTE_ARRAY_SELECTOR in `constants.sol` does not match `IERC725X.execute.selector`" + EXECUTE_BATCH_SELECTOR == IERC725X.executeBatch.selector, + "hardcoded EXECUTE_BATCH_SELECTOR in `constants.sol` does not match `IERC725X.execute.selector`" ); - return bytes4(keccak256("execute(uint256[],address[],uint256[],bytes[])")); + return IERC725X.executeBatch.selector; } function getSetDataSelector() public pure returns (bytes4) { require( - SETDATA_SELECTOR == bytes4(keccak256("setData(bytes32,bytes)")), + SETDATA_SELECTOR == IERC725Y.setData.selector, "hardcoded SETDATA_SELECTOR in `constants.sol` does not match `IERC725Y.setData.selector`" ); - return bytes4(keccak256("setData(bytes32,bytes)")); + return IERC725Y.setData.selector; } function getSetDataArraySelector() public pure returns (bytes4) { require( - SETDATA_ARRAY_SELECTOR == bytes4(keccak256("setData(bytes32[],bytes[])")), - "hardcoded SETDATA_ARRAY_SELECTOR in `constants.sol` does not match `IERC725Y.setData.selector`" + SETDATA_BATCH_SELECTOR == IERC725Y.setDataBatch.selector, + "hardcoded SETDATA_BATCH_SELECTOR in `constants.sol` does not match `IERC725Y.setData.selector`" ); - return bytes4(keccak256("setData(bytes32[],bytes[])")); + return IERC725Y.setDataBatch.selector; } } diff --git a/implementations/contracts/helpers/ERC725YReader.sol b/implementations/contracts/helpers/ERC725YReader.sol index 41013eb7..39230be6 100644 --- a/implementations/contracts/helpers/ERC725YReader.sol +++ b/implementations/contracts/helpers/ERC725YReader.sol @@ -8,15 +8,14 @@ import {IERC725Y} from "../interfaces/IERC725Y.sol"; * @dev Contract used for testing */ contract ERC725YReader { - function callGetDataArray(address to, bytes32[] calldata _keys) - public - view - returns (bytes[] memory) - { - return IERC725Y(to).getData(_keys); + function callGetDataBatch( + address to, + bytes32[] calldata _keys + ) public view returns (bytes[] memory) { + return IERC725Y(to).getDataBatch(_keys); } - function callGetDataSingle(address to, bytes32 _key) public view returns (bytes memory) { + function callGetData(address to, bytes32 _key) public view returns (bytes memory) { return IERC725Y(to).getData(_key); } } diff --git a/implementations/contracts/helpers/ERC725YWriter.sol b/implementations/contracts/helpers/ERC725YWriter.sol index 01932ea6..048dbc76 100644 --- a/implementations/contracts/helpers/ERC725YWriter.sol +++ b/implementations/contracts/helpers/ERC725YWriter.sol @@ -8,19 +8,15 @@ import {IERC725Y} from "../interfaces/IERC725Y.sol"; * @dev Contract used for testing */ contract ERC725YWriter { - function callSetDataArray( + function callSetDataBatch( address to, bytes32[] calldata _keys, bytes[] calldata _values ) public { - IERC725Y(to).setData(_keys, _values); + IERC725Y(to).setDataBatch(_keys, _values); } - function callSetDataSingle( - address to, - bytes32 _key, - bytes calldata _value - ) public { + function callSetData(address to, bytes32 _key, bytes calldata _value) public { IERC725Y(to).setData(_key, _value); } } diff --git a/implementations/contracts/helpers/Reader.sol b/implementations/contracts/helpers/Reader.sol index aa939bd3..8d218498 100644 --- a/implementations/contracts/helpers/Reader.sol +++ b/implementations/contracts/helpers/Reader.sol @@ -11,14 +11,14 @@ contract Reader { } /** - * @dev do not put the `view` modifier, so to display the gas usage of `getData(...)` + * @dev do not put the `view` modifier, so to display the gas usage of `getDataBatch(...)` * in the gas reporter of the test suite */ function read(bytes32 _key) public view returns (bytes memory) { bytes32[] memory keys = new bytes32[](1); keys[0] = _key; - bytes[] memory result = erc725y.getData(keys); + bytes[] memory result = erc725y.getDataBatch(keys); return result[0]; } } diff --git a/implementations/contracts/interfaces/IERC725X.sol b/implementations/contracts/interfaces/IERC725X.sol index 3f13ae45..b78e5cdd 100644 --- a/implementations/contracts/interfaces/IERC725X.sol +++ b/implementations/contracts/interfaces/IERC725X.sol @@ -90,7 +90,7 @@ interface IERC725X is IERC165 { * Emits an {Executed} event, when a call is made with `operationType` 0 (CALL), 3 (STATICCALL) or 4 (DELEGATECALL) * Emits a {ContractCreated} event, when deploying a contract with `operationType` 1 (CREATE) or 2 (CREATE2) */ - function execute( + function executeBatch( uint256[] memory operationsType, address[] memory targets, uint256[] memory values, diff --git a/implementations/contracts/interfaces/IERC725Y.sol b/implementations/contracts/interfaces/IERC725Y.sol index 342d3009..c0aec74f 100644 --- a/implementations/contracts/interfaces/IERC725Y.sol +++ b/implementations/contracts/interfaces/IERC725Y.sol @@ -30,7 +30,9 @@ interface IERC725Y is IERC165 { * @param dataKeys The array of keys which values to retrieve * @return dataValues The array of data stored at multiple keys */ - function getData(bytes32[] memory dataKeys) external view returns (bytes[] memory dataValues); + function getDataBatch( + bytes32[] memory dataKeys + ) external view returns (bytes[] memory dataValues); /** * @notice Sets singular data for a given `dataKey` @@ -60,5 +62,5 @@ interface IERC725Y is IERC165 { * * Emits a {DataChanged} event. */ - function setData(bytes32[] memory dataKeys, bytes[] memory dataValues) external payable; + function setDataBatch(bytes32[] memory dataKeys, bytes[] memory dataValues) external payable; } diff --git a/implementations/package-lock.json b/implementations/package-lock.json index c832d671..5d04005e 100644 --- a/implementations/package-lock.json +++ b/implementations/package-lock.json @@ -1,25 +1,25 @@ { "name": "@erc725/smart-contracts", - "version": "4.1.1", + "version": "4.2.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@erc725/smart-contracts", - "version": "4.1.1", + "version": "4.2.0", "license": "Apache-2.0", "dependencies": { - "@openzeppelin/contracts": "^4.7.3", - "@openzeppelin/contracts-upgradeable": "^4.7.3", + "@openzeppelin/contracts": "^4.8.3", + "@openzeppelin/contracts-upgradeable": "^4.8.3", "solidity-bytes-utils": "0.8.0" }, "devDependencies": { - "@nomicfoundation/hardhat-toolbox": "^2.0.0", + "@nomicfoundation/hardhat-toolbox": "^2.0.2", "@types/chai": "^4.3.1", "chai": "^4.2.0", "coveralls": "^3.1.1", "eth-create2-calculator": "^1.1.5", - "hardhat": "^2.10.1", + "hardhat": "^2.13.1", "hardhat-packager": "^1.4.2", "npm-run-all": "^4.1.5", "prettier": "^2.4.1", @@ -389,6 +389,32 @@ "node": ">=6.9.0" } }, + "node_modules/@chainsafe/as-sha256": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@chainsafe/as-sha256/-/as-sha256-0.3.1.tgz", + "integrity": "sha512-hldFFYuf49ed7DAakWVXSJODuq3pzJEguD8tQ7h+sGkM18vja+OFoJI9krnGmgzyuZC2ETX0NOIcCTy31v2Mtg==", + "dev": true + }, + "node_modules/@chainsafe/persistent-merkle-tree": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.4.2.tgz", + "integrity": "sha512-lLO3ihKPngXLTus/L7WHKaw9PnNJWizlOF1H9NNzHP6Xvh82vzg9F2bzkXhYIFshMZ2gTCEz8tq6STe7r5NDfQ==", + "dev": true, + "dependencies": { + "@chainsafe/as-sha256": "^0.3.1" + } + }, + "node_modules/@chainsafe/ssz": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/@chainsafe/ssz/-/ssz-0.9.4.tgz", + "integrity": "sha512-77Qtg2N1ayqs4Bg/wvnWfg5Bta7iy7IRh8XqXh7oNMeP2HBbBwx8m6yTpA8p0EHItWPEBkgZd5S5/LSlp3GXuQ==", + "dev": true, + "dependencies": { + "@chainsafe/as-sha256": "^0.3.1", + "@chainsafe/persistent-merkle-tree": "^0.4.2", + "case": "^1.6.3" + } + }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", @@ -420,9 +446,9 @@ } }, "node_modules/@ethersproject/abi": { - "version": "5.6.4", - "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.6.4.tgz", - "integrity": "sha512-TTeZUlCeIHG6527/2goZA6gW5F8Emoc7MrZDC7hhP84aRGvW3TEdTnZR08Ls88YXM1m2SuK42Osw/jSi3uO8gg==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.7.0.tgz", + "integrity": "sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA==", "dev": true, "funding": [ { @@ -435,21 +461,21 @@ } ], "dependencies": { - "@ethersproject/address": "^5.6.1", - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/constants": "^5.6.1", - "@ethersproject/hash": "^5.6.1", - "@ethersproject/keccak256": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/strings": "^5.6.1" + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" } }, "node_modules/@ethersproject/abstract-provider": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.6.1.tgz", - "integrity": "sha512-BxlIgogYJtp1FS8Muvj8YfdClk3unZH0vRMVX791Z9INBNT/kuACZ9GzaY1Y4yFq+YSy6/w4gzj3HCRKrK9hsQ==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz", + "integrity": "sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw==", "dev": true, "funding": [ { @@ -462,19 +488,19 @@ } ], "dependencies": { - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/networks": "^5.6.3", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/transactions": "^5.6.2", - "@ethersproject/web": "^5.6.1" + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/networks": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/web": "^5.7.0" } }, "node_modules/@ethersproject/abstract-signer": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.6.2.tgz", - "integrity": "sha512-n1r6lttFBG0t2vNiI3HoWaS/KdOt8xyDjzlP2cuevlWLG6EX0OwcKLyG/Kp/cuwNxdy/ous+R/DEMdTUwWQIjQ==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz", + "integrity": "sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ==", "dev": true, "funding": [ { @@ -487,17 +513,17 @@ } ], "dependencies": { - "@ethersproject/abstract-provider": "^5.6.1", - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0" + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0" } }, "node_modules/@ethersproject/address": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.6.1.tgz", - "integrity": "sha512-uOgF0kS5MJv9ZvCz7x6T2EXJSzotiybApn4XlOgoTX0xdtyVIJ7pF+6cGPxiEq/dpBiTfMiw7Yc81JcwhSYA0Q==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.7.0.tgz", + "integrity": "sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA==", "dev": true, "funding": [ { @@ -510,17 +536,17 @@ } ], "dependencies": { - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/keccak256": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/rlp": "^5.6.1" + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/rlp": "^5.7.0" } }, "node_modules/@ethersproject/base64": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.6.1.tgz", - "integrity": "sha512-qB76rjop6a0RIYYMiB4Eh/8n+Hxu2NIZm8S/Q7kNo5pmZfXhHGHmS4MinUainiBC54SCyRnwzL+KZjj8zbsSsw==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.7.0.tgz", + "integrity": "sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ==", "dev": true, "funding": [ { @@ -533,13 +559,13 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.6.1" + "@ethersproject/bytes": "^5.7.0" } }, "node_modules/@ethersproject/basex": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.6.1.tgz", - "integrity": "sha512-a52MkVz4vuBXR06nvflPMotld1FJWSj2QT0985v7P/emPZO00PucFAkbcmq2vpVU7Ts7umKiSI6SppiLykVWsA==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.7.0.tgz", + "integrity": "sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw==", "dev": true, "funding": [ { @@ -552,14 +578,14 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/properties": "^5.6.0" + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/properties": "^5.7.0" } }, "node_modules/@ethersproject/bignumber": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.6.2.tgz", - "integrity": "sha512-v7+EEUbhGqT3XJ9LMPsKvXYHFc8eHxTowFCG/HgJErmq4XHJ2WR7aeyICg3uTOAQ7Icn0GFHAohXEhxQHq4Ubw==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.7.0.tgz", + "integrity": "sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==", "dev": true, "funding": [ { @@ -572,15 +598,15 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", "bn.js": "^5.2.1" } }, "node_modules/@ethersproject/bytes": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.6.1.tgz", - "integrity": "sha512-NwQt7cKn5+ZE4uDn+X5RAXLp46E1chXoaMmrxAyA0rblpxz8t58lVkrHXoRIn0lz1joQElQ8410GqhTqMOwc6g==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.7.0.tgz", + "integrity": "sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==", "dev": true, "funding": [ { @@ -593,13 +619,13 @@ } ], "dependencies": { - "@ethersproject/logger": "^5.6.0" + "@ethersproject/logger": "^5.7.0" } }, "node_modules/@ethersproject/constants": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.6.1.tgz", - "integrity": "sha512-QSq9WVnZbxXYFftrjSjZDUshp6/eKp6qrtdBtUCm0QxCV5z1fG/w3kdlcsjMCQuQHUnAclKoK7XpXMezhRDOLg==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.7.0.tgz", + "integrity": "sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==", "dev": true, "funding": [ { @@ -612,13 +638,13 @@ } ], "dependencies": { - "@ethersproject/bignumber": "^5.6.2" + "@ethersproject/bignumber": "^5.7.0" } }, "node_modules/@ethersproject/contracts": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.6.2.tgz", - "integrity": "sha512-hguUA57BIKi6WY0kHvZp6PwPlWF87MCeB4B7Z7AbUpTxfFXFdn/3b0GmjZPagIHS+3yhcBJDnuEfU4Xz+Ks/8g==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.7.0.tgz", + "integrity": "sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg==", "dev": true, "funding": [ { @@ -631,22 +657,22 @@ } ], "dependencies": { - "@ethersproject/abi": "^5.6.3", - "@ethersproject/abstract-provider": "^5.6.1", - "@ethersproject/abstract-signer": "^5.6.2", - "@ethersproject/address": "^5.6.1", - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/constants": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/transactions": "^5.6.2" + "@ethersproject/abi": "^5.7.0", + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/transactions": "^5.7.0" } }, "node_modules/@ethersproject/hash": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.6.1.tgz", - "integrity": "sha512-L1xAHurbaxG8VVul4ankNX5HgQ8PNCTrnVXEiFnE9xoRnaUcgfD12tZINtDinSllxPLCtGwguQxJ5E6keE84pA==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.7.0.tgz", + "integrity": "sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==", "dev": true, "funding": [ { @@ -659,20 +685,21 @@ } ], "dependencies": { - "@ethersproject/abstract-signer": "^5.6.2", - "@ethersproject/address": "^5.6.1", - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/keccak256": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/strings": "^5.6.1" + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" } }, "node_modules/@ethersproject/hdnode": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.6.2.tgz", - "integrity": "sha512-tERxW8Ccf9CxW2db3WsN01Qao3wFeRsfYY9TCuhmG0xNpl2IO8wgXU3HtWIZ49gUWPggRy4Yg5axU0ACaEKf1Q==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.7.0.tgz", + "integrity": "sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg==", "dev": true, "funding": [ { @@ -685,24 +712,24 @@ } ], "dependencies": { - "@ethersproject/abstract-signer": "^5.6.2", - "@ethersproject/basex": "^5.6.1", - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/pbkdf2": "^5.6.1", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/sha2": "^5.6.1", - "@ethersproject/signing-key": "^5.6.2", - "@ethersproject/strings": "^5.6.1", - "@ethersproject/transactions": "^5.6.2", - "@ethersproject/wordlists": "^5.6.1" + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/basex": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/pbkdf2": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/wordlists": "^5.7.0" } }, "node_modules/@ethersproject/json-wallets": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.6.1.tgz", - "integrity": "sha512-KfyJ6Zwz3kGeX25nLihPwZYlDqamO6pfGKNnVMWWfEVVp42lTfCZVXXy5Ie8IZTN0HKwAngpIPi7gk4IJzgmqQ==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz", + "integrity": "sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g==", "dev": true, "funding": [ { @@ -715,25 +742,25 @@ } ], "dependencies": { - "@ethersproject/abstract-signer": "^5.6.2", - "@ethersproject/address": "^5.6.1", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/hdnode": "^5.6.2", - "@ethersproject/keccak256": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/pbkdf2": "^5.6.1", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/random": "^5.6.1", - "@ethersproject/strings": "^5.6.1", - "@ethersproject/transactions": "^5.6.2", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hdnode": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/pbkdf2": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", "aes-js": "3.0.0", "scrypt-js": "3.0.1" } }, "node_modules/@ethersproject/keccak256": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.6.1.tgz", - "integrity": "sha512-bB7DQHCTRDooZZdL3lk9wpL0+XuG3XLGHLh3cePnybsO3V0rdCAOQGpn/0R3aODmnTOOkCATJiD2hnL+5bwthA==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.7.0.tgz", + "integrity": "sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==", "dev": true, "funding": [ { @@ -746,14 +773,14 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.6.1", + "@ethersproject/bytes": "^5.7.0", "js-sha3": "0.8.0" } }, "node_modules/@ethersproject/logger": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.6.0.tgz", - "integrity": "sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.7.0.tgz", + "integrity": "sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==", "dev": true, "funding": [ { @@ -767,9 +794,9 @@ ] }, "node_modules/@ethersproject/networks": { - "version": "5.6.4", - "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.6.4.tgz", - "integrity": "sha512-KShHeHPahHI2UlWdtDMn2lJETcbtaJge4k7XSjDR9h79QTd6yQJmv6Cp2ZA4JdqWnhszAOLSuJEd9C0PRw7hSQ==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.7.1.tgz", + "integrity": "sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ==", "dev": true, "funding": [ { @@ -782,13 +809,13 @@ } ], "dependencies": { - "@ethersproject/logger": "^5.6.0" + "@ethersproject/logger": "^5.7.0" } }, "node_modules/@ethersproject/pbkdf2": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.6.1.tgz", - "integrity": "sha512-k4gRQ+D93zDRPNUfmduNKq065uadC2YjMP/CqwwX5qG6R05f47boq6pLZtV/RnC4NZAYOPH1Cyo54q0c9sshRQ==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.7.0.tgz", + "integrity": "sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw==", "dev": true, "funding": [ { @@ -801,14 +828,14 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/sha2": "^5.6.1" + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/sha2": "^5.7.0" } }, "node_modules/@ethersproject/properties": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.6.0.tgz", - "integrity": "sha512-szoOkHskajKePTJSZ46uHUWWkbv7TzP2ypdEK6jGMqJaEt2sb0jCgfBo0gH0m2HBpRixMuJ6TBRaQCF7a9DoCg==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.7.0.tgz", + "integrity": "sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw==", "dev": true, "funding": [ { @@ -821,13 +848,13 @@ } ], "dependencies": { - "@ethersproject/logger": "^5.6.0" + "@ethersproject/logger": "^5.7.0" } }, "node_modules/@ethersproject/providers": { - "version": "5.6.8", - "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.6.8.tgz", - "integrity": "sha512-Wf+CseT/iOJjrGtAOf3ck9zS7AgPmr2fZ3N97r4+YXN3mBePTG2/bJ8DApl9mVwYL+RpYbNxMEkEp4mPGdwG/w==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.7.2.tgz", + "integrity": "sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg==", "dev": true, "funding": [ { @@ -840,32 +867,32 @@ } ], "dependencies": { - "@ethersproject/abstract-provider": "^5.6.1", - "@ethersproject/abstract-signer": "^5.6.2", - "@ethersproject/address": "^5.6.1", - "@ethersproject/base64": "^5.6.1", - "@ethersproject/basex": "^5.6.1", - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/constants": "^5.6.1", - "@ethersproject/hash": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/networks": "^5.6.3", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/random": "^5.6.1", - "@ethersproject/rlp": "^5.6.1", - "@ethersproject/sha2": "^5.6.1", - "@ethersproject/strings": "^5.6.1", - "@ethersproject/transactions": "^5.6.2", - "@ethersproject/web": "^5.6.1", + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/basex": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/networks": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/web": "^5.7.0", "bech32": "1.1.4", "ws": "7.4.6" } }, "node_modules/@ethersproject/random": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.6.1.tgz", - "integrity": "sha512-/wtPNHwbmng+5yi3fkipA8YBT59DdkGRoC2vWk09Dci/q5DlgnMkhIycjHlavrvrjJBkFjO/ueLyT+aUDfc4lA==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.7.0.tgz", + "integrity": "sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ==", "dev": true, "funding": [ { @@ -878,14 +905,14 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0" + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0" } }, "node_modules/@ethersproject/rlp": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.6.1.tgz", - "integrity": "sha512-uYjmcZx+DKlFUk7a5/W9aQVaoEC7+1MOBgNtvNg13+RnuUwT4F0zTovC0tmay5SmRslb29V1B7Y5KCri46WhuQ==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.7.0.tgz", + "integrity": "sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==", "dev": true, "funding": [ { @@ -898,14 +925,14 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0" + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0" } }, "node_modules/@ethersproject/sha2": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.6.1.tgz", - "integrity": "sha512-5K2GyqcW7G4Yo3uenHegbXRPDgARpWUiXc6RiF7b6i/HXUoWlb7uCARh7BAHg7/qT/Q5ydofNwiZcim9qpjB6g==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.7.0.tgz", + "integrity": "sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw==", "dev": true, "funding": [ { @@ -918,15 +945,15 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", "hash.js": "1.1.7" } }, "node_modules/@ethersproject/signing-key": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.6.2.tgz", - "integrity": "sha512-jVbu0RuP7EFpw82vHcL+GP35+KaNruVAZM90GxgQnGqB6crhBqW/ozBfFvdeImtmb4qPko0uxXjn8l9jpn0cwQ==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.7.0.tgz", + "integrity": "sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q==", "dev": true, "funding": [ { @@ -939,18 +966,18 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", "bn.js": "^5.2.1", "elliptic": "6.5.4", "hash.js": "1.1.7" } }, "node_modules/@ethersproject/solidity": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.6.1.tgz", - "integrity": "sha512-KWqVLkUUoLBfL1iwdzUVlkNqAUIFMpbbeH0rgCfKmJp0vFtY4AsaN91gHKo9ZZLkC4UOm3cI3BmMV4N53BOq4g==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.7.0.tgz", + "integrity": "sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA==", "dev": true, "funding": [ { @@ -963,18 +990,18 @@ } ], "dependencies": { - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/keccak256": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/sha2": "^5.6.1", - "@ethersproject/strings": "^5.6.1" + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/strings": "^5.7.0" } }, "node_modules/@ethersproject/strings": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.6.1.tgz", - "integrity": "sha512-2X1Lgk6Jyfg26MUnsHiT456U9ijxKUybz8IM1Vih+NJxYtXhmvKBcHOmvGqpFSVJ0nQ4ZCoIViR8XlRw1v/+Cw==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.7.0.tgz", + "integrity": "sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==", "dev": true, "funding": [ { @@ -987,15 +1014,15 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/constants": "^5.6.1", - "@ethersproject/logger": "^5.6.0" + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0" } }, "node_modules/@ethersproject/transactions": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.6.2.tgz", - "integrity": "sha512-BuV63IRPHmJvthNkkt9G70Ullx6AcM+SDc+a8Aw/8Yew6YwT51TcBKEp1P4oOQ/bP25I18JJr7rcFRgFtU9B2Q==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.7.0.tgz", + "integrity": "sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ==", "dev": true, "funding": [ { @@ -1008,21 +1035,21 @@ } ], "dependencies": { - "@ethersproject/address": "^5.6.1", - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/constants": "^5.6.1", - "@ethersproject/keccak256": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/rlp": "^5.6.1", - "@ethersproject/signing-key": "^5.6.2" + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0" } }, "node_modules/@ethersproject/units": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.6.1.tgz", - "integrity": "sha512-rEfSEvMQ7obcx3KWD5EWWx77gqv54K6BKiZzKxkQJqtpriVsICrktIQmKl8ReNToPeIYPnFHpXvKpi068YFZXw==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.7.0.tgz", + "integrity": "sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg==", "dev": true, "funding": [ { @@ -1035,15 +1062,15 @@ } ], "dependencies": { - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/constants": "^5.6.1", - "@ethersproject/logger": "^5.6.0" + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0" } }, "node_modules/@ethersproject/wallet": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.6.2.tgz", - "integrity": "sha512-lrgh0FDQPuOnHcF80Q3gHYsSUODp6aJLAdDmDV0xKCN/T7D99ta1jGVhulg3PY8wiXEngD0DfM0I2XKXlrqJfg==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.7.0.tgz", + "integrity": "sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA==", "dev": true, "funding": [ { @@ -1056,27 +1083,27 @@ } ], "dependencies": { - "@ethersproject/abstract-provider": "^5.6.1", - "@ethersproject/abstract-signer": "^5.6.2", - "@ethersproject/address": "^5.6.1", - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/hash": "^5.6.1", - "@ethersproject/hdnode": "^5.6.2", - "@ethersproject/json-wallets": "^5.6.1", - "@ethersproject/keccak256": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/random": "^5.6.1", - "@ethersproject/signing-key": "^5.6.2", - "@ethersproject/transactions": "^5.6.2", - "@ethersproject/wordlists": "^5.6.1" + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/hdnode": "^5.7.0", + "@ethersproject/json-wallets": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/wordlists": "^5.7.0" } }, "node_modules/@ethersproject/web": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.6.1.tgz", - "integrity": "sha512-/vSyzaQlNXkO1WV+RneYKqCJwualcUdx/Z3gseVovZP0wIlOFcCE1hkRhKBH8ImKbGQbMl9EAAyJFrJu7V0aqA==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.7.1.tgz", + "integrity": "sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w==", "dev": true, "funding": [ { @@ -1089,17 +1116,17 @@ } ], "dependencies": { - "@ethersproject/base64": "^5.6.1", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/strings": "^5.6.1" + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" } }, "node_modules/@ethersproject/wordlists": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.6.1.tgz", - "integrity": "sha512-wiPRgBpNbNwCQFoCr8bcWO8o5I810cqO6mkdtKfLKFlLxeCWcnzDi4Alu8iyNzlhYuS9npCwivMbRWF19dyblw==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.7.0.tgz", + "integrity": "sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA==", "dev": true, "funding": [ { @@ -1112,11 +1139,11 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/hash": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/strings": "^5.6.1" + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" } }, "node_modules/@hutson/parse-repository-url": { @@ -1299,17 +1326,18 @@ } }, "node_modules/@nomicfoundation/ethereumjs-block": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-4.0.0.tgz", - "integrity": "sha512-bk8uP8VuexLgyIZAHExH1QEovqx0Lzhc9Ntm63nCRKLHXIZkobaFaeCVwTESV7YkPKUk7NiK11s8ryed4CS9yA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-5.0.0.tgz", + "integrity": "sha512-DfhVbqM5DjriguuSv6r3TgOpyXC76oX8D/VEODsSwJQ1bZGqu4xLLfYPPTacpCAYOnewzJsZli+Ao9TBTAo2uw==", "dev": true, "dependencies": { - "@nomicfoundation/ethereumjs-common": "^3.0.0", - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-trie": "^5.0.0", - "@nomicfoundation/ethereumjs-tx": "^4.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", - "ethereum-cryptography": "0.1.3" + "@nomicfoundation/ethereumjs-common": "4.0.0", + "@nomicfoundation/ethereumjs-rlp": "5.0.0", + "@nomicfoundation/ethereumjs-trie": "6.0.0", + "@nomicfoundation/ethereumjs-tx": "5.0.0", + "@nomicfoundation/ethereumjs-util": "9.0.0", + "ethereum-cryptography": "0.1.3", + "ethers": "^5.7.1" }, "engines": { "node": ">=14" @@ -1339,17 +1367,18 @@ } }, "node_modules/@nomicfoundation/ethereumjs-blockchain": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-6.0.0.tgz", - "integrity": "sha512-pLFEoea6MWd81QQYSReLlLfH7N9v7lH66JC/NMPN848ySPPQA5renWnE7wPByfQFzNrPBuDDRFFULMDmj1C0xw==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-7.0.0.tgz", + "integrity": "sha512-cVRCrXZminZr0Mbx2hm0/109GZLn1v5bf0/k+SIbGn50yZm6YCdQt9CgGT0Gk56N2vy8NhXD4apo167m4LWk6Q==", "dev": true, "dependencies": { - "@nomicfoundation/ethereumjs-block": "^4.0.0", - "@nomicfoundation/ethereumjs-common": "^3.0.0", - "@nomicfoundation/ethereumjs-ethash": "^2.0.0", - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-trie": "^5.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", + "@nomicfoundation/ethereumjs-block": "5.0.0", + "@nomicfoundation/ethereumjs-common": "4.0.0", + "@nomicfoundation/ethereumjs-ethash": "3.0.0", + "@nomicfoundation/ethereumjs-rlp": "5.0.0", + "@nomicfoundation/ethereumjs-trie": "6.0.0", + "@nomicfoundation/ethereumjs-tx": "5.0.0", + "@nomicfoundation/ethereumjs-util": "9.0.0", "abstract-level": "^1.0.3", "debug": "^4.3.3", "ethereum-cryptography": "0.1.3", @@ -1385,24 +1414,24 @@ } }, "node_modules/@nomicfoundation/ethereumjs-common": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-3.0.0.tgz", - "integrity": "sha512-WS7qSshQfxoZOpHG/XqlHEGRG1zmyjYrvmATvc4c62+gZXgre1ymYP8ZNgx/3FyZY0TWe9OjFlKOfLqmgOeYwA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.0.tgz", + "integrity": "sha512-UPpm5FAGAf2B6hQ8aVgO44Rdo0k73oMMCViqNJcKMlk1s9l3rxwuPTp1l20NiGvNO2Pzqk3chFL+BzmLL2g4wQ==", "dev": true, "dependencies": { - "@nomicfoundation/ethereumjs-util": "^8.0.0", + "@nomicfoundation/ethereumjs-util": "9.0.0", "crc-32": "^1.2.0" } }, "node_modules/@nomicfoundation/ethereumjs-ethash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-2.0.0.tgz", - "integrity": "sha512-WpDvnRncfDUuXdsAXlI4lXbqUDOA+adYRQaEezIkxqDkc+LDyYDbd/xairmY98GnQzo1zIqsIL6GB5MoMSJDew==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-3.0.0.tgz", + "integrity": "sha512-6zNv5Y3vNIsxjrsbKjMInVpo8cmR0c7yjZbBpy7NYuIMtm0JKhQoXsiFN56t/1sfn9V3v0wgrkAixo5v6bahpA==", "dev": true, "dependencies": { - "@nomicfoundation/ethereumjs-block": "^4.0.0", - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", + "@nomicfoundation/ethereumjs-block": "5.0.0", + "@nomicfoundation/ethereumjs-rlp": "5.0.0", + "@nomicfoundation/ethereumjs-util": "9.0.0", "abstract-level": "^1.0.3", "bigint-crypto-utils": "^3.0.23", "ethereum-cryptography": "0.1.3" @@ -1435,15 +1464,15 @@ } }, "node_modules/@nomicfoundation/ethereumjs-evm": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-1.0.0.tgz", - "integrity": "sha512-hVS6qRo3V1PLKCO210UfcEQHvlG7GqR8iFzp0yyjTg2TmJQizcChKgWo8KFsdMw6AyoLgLhHGHw4HdlP8a4i+Q==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-2.0.0.tgz", + "integrity": "sha512-D+tr3M9sictopr3E20OVgme7YF/d0fU566WKh+ofXwmxapz/Dd8RSLSaVeKgfCI2BkzVA+XqXY08NNCV8w8fWA==", "dev": true, "dependencies": { - "@nomicfoundation/ethereumjs-common": "^3.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", - "@types/async-eventemitter": "^0.2.1", - "async-eventemitter": "^0.2.4", + "@ethersproject/providers": "^5.7.1", + "@nomicfoundation/ethereumjs-common": "4.0.0", + "@nomicfoundation/ethereumjs-tx": "5.0.0", + "@nomicfoundation/ethereumjs-util": "9.0.0", "debug": "^4.3.3", "ethereum-cryptography": "0.1.3", "mcl-wasm": "^0.7.1", @@ -1477,9 +1506,9 @@ } }, "node_modules/@nomicfoundation/ethereumjs-rlp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-4.0.0.tgz", - "integrity": "sha512-GaSOGk5QbUk4eBP5qFbpXoZoZUj/NrW7MRa0tKY4Ew4c2HAS0GXArEMAamtFrkazp0BO4K5p2ZCG3b2FmbShmw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.0.tgz", + "integrity": "sha512-U1A0y330PtGb8Wft4yPVv0myWYJTesi89ItGoB0ICdqz7793KmUhpfQb2vJUXBi98wSdnxkIABO/GmsQvGKVDw==", "dev": true, "bin": { "rlp": "bin/rlp" @@ -1489,18 +1518,17 @@ } }, "node_modules/@nomicfoundation/ethereumjs-statemanager": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-1.0.0.tgz", - "integrity": "sha512-jCtqFjcd2QejtuAMjQzbil/4NHf5aAWxUc+CvS0JclQpl+7M0bxMofR2AJdtz+P3u0ke2euhYREDiE7iSO31vQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-2.0.0.tgz", + "integrity": "sha512-tgXtsx8yIDlxWMN+ThqPtGK0ITAuITrDy+GYIgGrnT6ZtelvXWM7SUYR0Mcv578lmGCoIwyHFtSBqOkOBYHLjw==", "dev": true, "dependencies": { - "@nomicfoundation/ethereumjs-common": "^3.0.0", - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-trie": "^5.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", + "@nomicfoundation/ethereumjs-common": "4.0.0", + "@nomicfoundation/ethereumjs-rlp": "5.0.0", "debug": "^4.3.3", "ethereum-cryptography": "0.1.3", - "functional-red-black-tree": "^1.0.1" + "ethers": "^5.7.1", + "js-sdsl": "^4.1.4" } }, "node_modules/@nomicfoundation/ethereumjs-statemanager/node_modules/ethereum-cryptography": { @@ -1527,13 +1555,14 @@ } }, "node_modules/@nomicfoundation/ethereumjs-trie": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-5.0.0.tgz", - "integrity": "sha512-LIj5XdE+s+t6WSuq/ttegJzZ1vliwg6wlb+Y9f4RlBpuK35B9K02bO7xU+E6Rgg9RGptkWd6TVLdedTI4eNc2A==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-6.0.0.tgz", + "integrity": "sha512-YqPWiNxrZvL+Ef7KHqgru1IlaIGXhu78wd2fxNFOvi/NAQBF845dVfTKKXs1L9x0QBRRQRephgxHCKMuISGppw==", "dev": true, "dependencies": { - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", + "@nomicfoundation/ethereumjs-rlp": "5.0.0", + "@nomicfoundation/ethereumjs-util": "9.0.0", + "@types/readable-stream": "^2.3.13", "ethereum-cryptography": "0.1.3", "readable-stream": "^3.6.0" }, @@ -1565,14 +1594,16 @@ } }, "node_modules/@nomicfoundation/ethereumjs-tx": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-4.0.0.tgz", - "integrity": "sha512-Gg3Lir2lNUck43Kp/3x6TfBNwcWC9Z1wYue9Nz3v4xjdcv6oDW9QSMJxqsKw9QEGoBBZ+gqwpW7+F05/rs/g1w==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.0.tgz", + "integrity": "sha512-LTyxI+zBJ+HuEBblUGbxvfKl1hg1uJlz2XhnszNagiBWQSgLb1vQCa1QaXV5Q8cUDYkr/Xe4NXWiUGEvH4e6lA==", "dev": true, "dependencies": { - "@nomicfoundation/ethereumjs-common": "^3.0.0", - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", + "@chainsafe/ssz": "^0.9.2", + "@ethersproject/providers": "^5.7.2", + "@nomicfoundation/ethereumjs-common": "4.0.0", + "@nomicfoundation/ethereumjs-rlp": "5.0.0", + "@nomicfoundation/ethereumjs-util": "9.0.0", "ethereum-cryptography": "0.1.3" }, "engines": { @@ -1603,18 +1634,38 @@ } }, "node_modules/@nomicfoundation/ethereumjs-util": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-8.0.0.tgz", - "integrity": "sha512-2emi0NJ/HmTG+CGY58fa+DQuAoroFeSH9gKu9O6JnwTtlzJtgfTixuoOqLEgyyzZVvwfIpRueuePb8TonL1y+A==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.0.tgz", + "integrity": "sha512-9EG98CsEC9BnI7AY27F4QXZ8Vf0re8R9XoxQ0//KWF+B7quu6GQvgTq1RlNUjGh/XNCCJNf8E3LOY9ULR85wFQ==", "dev": true, "dependencies": { - "@nomicfoundation/ethereumjs-rlp": "^4.0.0-beta.2", + "@chainsafe/ssz": "^0.10.0", + "@nomicfoundation/ethereumjs-rlp": "5.0.0", "ethereum-cryptography": "0.1.3" }, "engines": { "node": ">=14" } }, + "node_modules/@nomicfoundation/ethereumjs-util/node_modules/@chainsafe/persistent-merkle-tree": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.5.0.tgz", + "integrity": "sha512-l0V1b5clxA3iwQLXP40zYjyZYospQLZXzBVIhhr9kDg/1qHZfzzHw0jj4VPBijfYCArZDlPkRi1wZaV2POKeuw==", + "dev": true, + "dependencies": { + "@chainsafe/as-sha256": "^0.3.1" + } + }, + "node_modules/@nomicfoundation/ethereumjs-util/node_modules/@chainsafe/ssz": { + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/@chainsafe/ssz/-/ssz-0.10.2.tgz", + "integrity": "sha512-/NL3Lh8K+0q7A3LsiFq09YXS9fPE+ead2rr7vM2QK8PLzrNsw3uqrif9bpRX5UxgeRjM+vYi+boCM3+GM4ovXg==", + "dev": true, + "dependencies": { + "@chainsafe/as-sha256": "^0.3.1", + "@chainsafe/persistent-merkle-tree": "^0.5.0" + } + }, "node_modules/@nomicfoundation/ethereumjs-util/node_modules/ethereum-cryptography": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", @@ -1639,25 +1690,22 @@ } }, "node_modules/@nomicfoundation/ethereumjs-vm": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-6.0.0.tgz", - "integrity": "sha512-JMPxvPQ3fzD063Sg3Tp+UdwUkVxMoo1uML6KSzFhMH3hoQi/LMuXBoEHAoW83/vyNS9BxEe6jm6LmT5xdeEJ6w==", - "dev": true, - "dependencies": { - "@nomicfoundation/ethereumjs-block": "^4.0.0", - "@nomicfoundation/ethereumjs-blockchain": "^6.0.0", - "@nomicfoundation/ethereumjs-common": "^3.0.0", - "@nomicfoundation/ethereumjs-evm": "^1.0.0", - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-statemanager": "^1.0.0", - "@nomicfoundation/ethereumjs-trie": "^5.0.0", - "@nomicfoundation/ethereumjs-tx": "^4.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", - "@types/async-eventemitter": "^0.2.1", - "async-eventemitter": "^0.2.4", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-7.0.0.tgz", + "integrity": "sha512-eHkEoe/4r4+g+fZyIIlQjBHEjCPFs8CHiIEEMvMfvFrV4hyHnuTg4LH7l92ok7TGZqpWxgMG2JOEUFkNsXrKuQ==", + "dev": true, + "dependencies": { + "@nomicfoundation/ethereumjs-block": "5.0.0", + "@nomicfoundation/ethereumjs-blockchain": "7.0.0", + "@nomicfoundation/ethereumjs-common": "4.0.0", + "@nomicfoundation/ethereumjs-evm": "2.0.0", + "@nomicfoundation/ethereumjs-rlp": "5.0.0", + "@nomicfoundation/ethereumjs-statemanager": "2.0.0", + "@nomicfoundation/ethereumjs-trie": "6.0.0", + "@nomicfoundation/ethereumjs-tx": "5.0.0", + "@nomicfoundation/ethereumjs-util": "9.0.0", "debug": "^4.3.3", "ethereum-cryptography": "0.1.3", - "functional-red-black-tree": "^1.0.1", "mcl-wasm": "^0.7.1", "rustbn.js": "~0.2.0" }, @@ -1723,9 +1771,9 @@ } }, "node_modules/@nomicfoundation/hardhat-toolbox": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-toolbox/-/hardhat-toolbox-2.0.0.tgz", - "integrity": "sha512-BoOPbzLQ1GArnBZd4Jz4IU8FY3RY4nUwpXlfymXwxlXNimngkPRJj7ivVNurD7igohEjf90v/Axn2M5WwAdCJQ==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-toolbox/-/hardhat-toolbox-2.0.2.tgz", + "integrity": "sha512-vnN1AzxbvpSx9pfdRHbUzTRIXpMLPXnUlkW855VaDk6N1pwRaQ2gNzEmFAABk4lWf11E00PKwFd/q27HuwYrYg==", "dev": true, "peerDependencies": { "@ethersproject/abi": "^5.4.7", @@ -1737,7 +1785,7 @@ "@typechain/ethers-v5": "^10.1.0", "@typechain/hardhat": "^6.1.2", "@types/chai": "^4.2.0", - "@types/mocha": "^9.1.0", + "@types/mocha": ">=9.1.0", "@types/node": ">=12.0.0", "chai": "^4.2.0", "ethers": "^5.4.7", @@ -1964,14 +2012,14 @@ } }, "node_modules/@openzeppelin/contracts": { - "version": "4.7.3", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.7.3.tgz", - "integrity": "sha512-dGRS0agJzu8ybo44pCIf3xBaPQN/65AIXNgK8+4gzKd5kbvlqyxryUYVLJv7fK98Seyd2hDZzVEHSWAh0Bt1Yw==" + "version": "4.8.3", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.8.3.tgz", + "integrity": "sha512-bQHV8R9Me8IaJoJ2vPG4rXcL7seB7YVuskr4f+f5RyOStSZetwzkWtoqDMl5erkBJy0lDRUnIR2WIkPiC0GJlg==" }, "node_modules/@openzeppelin/contracts-upgradeable": { - "version": "4.7.3", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.7.3.tgz", - "integrity": "sha512-+wuegAMaLcZnLCJIvrVUDzA9z/Wp93f0Dla/4jJvIhijRrPabjQbZe6fWiECLaJyfn5ci9fqf9vTw3xpQOad2A==" + "version": "4.8.3", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.8.3.tgz", + "integrity": "sha512-SXDRl7HKpl2WDoJpn7CK/M9U4Z8gNXDHHChAKh0Iz+Wew3wu6CmFYBeie3je8V0GSXZAIYYwUktSrnW/kwVPtg==" }, "node_modules/@scure/base": { "version": "1.1.1", @@ -2238,12 +2286,6 @@ "node": ">= 10.0.0" } }, - "node_modules/@types/async-eventemitter": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@types/async-eventemitter/-/async-eventemitter-0.2.1.tgz", - "integrity": "sha512-M2P4Ng26QbAeITiH7w1d7OxtldgfAe0wobpyJzVK/XOb0cUGKU2R4pfAhqcJBXAe2ife5ZOhSv4wk7p+ffURtg==", - "dev": true - }, "node_modules/@types/bn.js": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.0.tgz", @@ -2357,6 +2399,22 @@ "dev": true, "peer": true }, + "node_modules/@types/readable-stream": { + "version": "2.3.15", + "resolved": "https://registry.npmjs.org/@types/readable-stream/-/readable-stream-2.3.15.tgz", + "integrity": "sha512-oM5JSKQCcICF1wvGgmecmHldZ48OZamtMxcGGVICOJA8o8cahXC1zEVAif8iwoc5j8etxFaRFnf095+CDsuoFQ==", + "dev": true, + "dependencies": { + "@types/node": "*", + "safe-buffer": "~5.1.1" + } + }, + "node_modules/@types/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, "node_modules/@types/secp256k1": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.3.tgz", @@ -2877,24 +2935,12 @@ "dev": true }, "node_modules/bigint-crypto-utils": { - "version": "3.1.8", - "resolved": "https://registry.npmjs.org/bigint-crypto-utils/-/bigint-crypto-utils-3.1.8.tgz", - "integrity": "sha512-+VMV9Laq8pXLBKKKK49nOoq9bfR3j7NNQAtbA617a4nw9bVLo8rsqkKMBgM2AJWlNX9fEIyYaYX+d0laqYV4tw==", - "dev": true, - "dependencies": { - "bigint-mod-arith": "^3.1.0" - }, - "engines": { - "node": ">=10.4.0" - } - }, - "node_modules/bigint-mod-arith": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bigint-mod-arith/-/bigint-mod-arith-3.1.2.tgz", - "integrity": "sha512-nx8J8bBeiRR+NlsROFH9jHswW5HO8mgfOSqW0AmjicMMvaONDa8AO+5ViKDUUNytBPWiwfvZP4/Bj4Y3lUfvgQ==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/bigint-crypto-utils/-/bigint-crypto-utils-3.2.2.tgz", + "integrity": "sha512-U1RbE3aX9ayCUVcIPHuPDPKcK3SFOXf93J1UK/iHlJuQB7bhagPIX06/CLpLEsDThJ7KA4Dhrnzynl+d2weTiw==", "dev": true, "engines": { - "node": ">=10.4.0" + "node": ">=14.0.0" } }, "node_modules/bignumber.js": { @@ -3090,6 +3136,18 @@ "node": ">=6.14.2" } }, + "node_modules/busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dev": true, + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -3186,6 +3244,15 @@ } ] }, + "node_modules/case": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/case/-/case-1.6.3.tgz", + "integrity": "sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", @@ -3346,16 +3413,16 @@ } }, "node_modules/classic-level": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/classic-level/-/classic-level-1.2.0.tgz", - "integrity": "sha512-qw5B31ANxSluWz9xBzklRWTUAJ1SXIdaVKTVS7HcTGKOAmExx65Wo5BUICW+YGORe2FOUaDghoI9ZDxj82QcFg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/classic-level/-/classic-level-1.3.0.tgz", + "integrity": "sha512-iwFAJQYtqRTRM0F6L8h4JCt00ZSGdOyqh7yVrhhjrOpFhmBjNlRUey64MCiyo6UmQHMJ+No3c81nujPv+n9yrg==", "dev": true, "hasInstallScript": true, "dependencies": { "abstract-level": "^1.0.2", "catering": "^2.1.0", "module-error": "^1.0.1", - "napi-macros": "~2.0.0", + "napi-macros": "^2.2.2", "node-gyp-build": "^4.3.0" }, "engines": { @@ -6078,9 +6145,9 @@ } }, "node_modules/ethers": { - "version": "5.6.9", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.6.9.tgz", - "integrity": "sha512-lMGC2zv9HC5EC+8r429WaWu3uWJUCgUCt8xxKCFqkrFuBDZXDYIdzDUECxzjf2BMF8IVBByY1EBoGSL3RTm8RA==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz", + "integrity": "sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==", "dev": true, "funding": [ { @@ -6093,36 +6160,36 @@ } ], "dependencies": { - "@ethersproject/abi": "5.6.4", - "@ethersproject/abstract-provider": "5.6.1", - "@ethersproject/abstract-signer": "5.6.2", - "@ethersproject/address": "5.6.1", - "@ethersproject/base64": "5.6.1", - "@ethersproject/basex": "5.6.1", - "@ethersproject/bignumber": "5.6.2", - "@ethersproject/bytes": "5.6.1", - "@ethersproject/constants": "5.6.1", - "@ethersproject/contracts": "5.6.2", - "@ethersproject/hash": "5.6.1", - "@ethersproject/hdnode": "5.6.2", - "@ethersproject/json-wallets": "5.6.1", - "@ethersproject/keccak256": "5.6.1", - "@ethersproject/logger": "5.6.0", - "@ethersproject/networks": "5.6.4", - "@ethersproject/pbkdf2": "5.6.1", - "@ethersproject/properties": "5.6.0", - "@ethersproject/providers": "5.6.8", - "@ethersproject/random": "5.6.1", - "@ethersproject/rlp": "5.6.1", - "@ethersproject/sha2": "5.6.1", - "@ethersproject/signing-key": "5.6.2", - "@ethersproject/solidity": "5.6.1", - "@ethersproject/strings": "5.6.1", - "@ethersproject/transactions": "5.6.2", - "@ethersproject/units": "5.6.1", - "@ethersproject/wallet": "5.6.2", - "@ethersproject/web": "5.6.1", - "@ethersproject/wordlists": "5.6.1" + "@ethersproject/abi": "5.7.0", + "@ethersproject/abstract-provider": "5.7.0", + "@ethersproject/abstract-signer": "5.7.0", + "@ethersproject/address": "5.7.0", + "@ethersproject/base64": "5.7.0", + "@ethersproject/basex": "5.7.0", + "@ethersproject/bignumber": "5.7.0", + "@ethersproject/bytes": "5.7.0", + "@ethersproject/constants": "5.7.0", + "@ethersproject/contracts": "5.7.0", + "@ethersproject/hash": "5.7.0", + "@ethersproject/hdnode": "5.7.0", + "@ethersproject/json-wallets": "5.7.0", + "@ethersproject/keccak256": "5.7.0", + "@ethersproject/logger": "5.7.0", + "@ethersproject/networks": "5.7.1", + "@ethersproject/pbkdf2": "5.7.0", + "@ethersproject/properties": "5.7.0", + "@ethersproject/providers": "5.7.2", + "@ethersproject/random": "5.7.0", + "@ethersproject/rlp": "5.7.0", + "@ethersproject/sha2": "5.7.0", + "@ethersproject/signing-key": "5.7.0", + "@ethersproject/solidity": "5.7.0", + "@ethersproject/strings": "5.7.0", + "@ethersproject/transactions": "5.7.0", + "@ethersproject/units": "5.7.0", + "@ethersproject/wallet": "5.7.0", + "@ethersproject/web": "5.7.1", + "@ethersproject/wordlists": "5.7.0" } }, "node_modules/ethjs-unit": { @@ -7036,23 +7103,23 @@ } }, "node_modules/hardhat": { - "version": "2.12.5", - "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.12.5.tgz", - "integrity": "sha512-f/t7+hLlhsnQZ6LDXyV+8rHGRZFZY1sgFvgrwr9fBjMdGp1Bu6hHq1KXS4/VFZfZcVdL1DAWWEkryinZhqce+A==", + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.13.1.tgz", + "integrity": "sha512-ZZL7LQxHmbw4JQJsiEv2qE35nbR+isr2sIdtgZVPp0+zWqRkpr1OT7gmvhCNYfjpEPyfjZIxWriQWlphJhVPLQ==", "dev": true, "dependencies": { "@ethersproject/abi": "^5.1.2", "@metamask/eth-sig-util": "^4.0.0", - "@nomicfoundation/ethereumjs-block": "^4.0.0", - "@nomicfoundation/ethereumjs-blockchain": "^6.0.0", - "@nomicfoundation/ethereumjs-common": "^3.0.0", - "@nomicfoundation/ethereumjs-evm": "^1.0.0", - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-statemanager": "^1.0.0", - "@nomicfoundation/ethereumjs-trie": "^5.0.0", - "@nomicfoundation/ethereumjs-tx": "^4.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", - "@nomicfoundation/ethereumjs-vm": "^6.0.0", + "@nomicfoundation/ethereumjs-block": "5.0.0", + "@nomicfoundation/ethereumjs-blockchain": "7.0.0", + "@nomicfoundation/ethereumjs-common": "4.0.0", + "@nomicfoundation/ethereumjs-evm": "2.0.0", + "@nomicfoundation/ethereumjs-rlp": "5.0.0", + "@nomicfoundation/ethereumjs-statemanager": "2.0.0", + "@nomicfoundation/ethereumjs-trie": "6.0.0", + "@nomicfoundation/ethereumjs-tx": "5.0.0", + "@nomicfoundation/ethereumjs-util": "9.0.0", + "@nomicfoundation/ethereumjs-vm": "7.0.0", "@nomicfoundation/solidity-analyzer": "^0.1.0", "@sentry/node": "^5.18.1", "@types/bn.js": "^5.1.0", @@ -7088,15 +7155,15 @@ "source-map-support": "^0.5.13", "stacktrace-parser": "^0.1.10", "tsort": "0.0.1", - "undici": "^5.4.0", + "undici": "^5.14.0", "uuid": "^8.3.2", "ws": "^7.4.6" }, "bin": { - "hardhat": "internal/cli/cli.js" + "hardhat": "internal/cli/bootstrap.js" }, "engines": { - "node": "^14.0.0 || ^16.0.0 || ^18.0.0" + "node": ">=14.0.0" }, "peerDependencies": { "ts-node": "*", @@ -8537,6 +8604,16 @@ "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==" }, + "node_modules/js-sdsl": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.0.tgz", + "integrity": "sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, "node_modules/js-sha3": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", @@ -9635,9 +9712,9 @@ } }, "node_modules/napi-macros": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.0.0.tgz", - "integrity": "sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.2.2.tgz", + "integrity": "sha512-hmEVtAGYzVQpCKdbQea4skABsdXW4RUh5t5mJ2zzqowJS2OyXZTU1KhDVFhx+NlWZ4ap9mqR9TcDO3LTTttd+g==", "dev": true }, "node_modules/natural-compare": { @@ -12135,6 +12212,15 @@ "node": ">=0.10.0" } }, + "node_modules/streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "dev": true, + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -13008,10 +13094,13 @@ } }, "node_modules/undici": { - "version": "5.10.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.10.0.tgz", - "integrity": "sha512-c8HsD3IbwmjjbLvoZuRI26TZic+TSEe8FPMLLOkN1AfYRhdjnKBU6yL+IwcSCbdZiX4e5t0lfMDLDCqj4Sq70g==", + "version": "5.21.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.21.0.tgz", + "integrity": "sha512-HOjK8l6a57b2ZGXOcUsI5NLfoTrfmbOl90ixJDl0AEFG4wgHNDQxtZy15/ZQp7HhjkpaGlp/eneMgtsu1dIlUA==", "dev": true, + "dependencies": { + "busboy": "^1.6.0" + }, "engines": { "node": ">=12.18" } @@ -13963,6 +14052,32 @@ "to-fast-properties": "^2.0.0" } }, + "@chainsafe/as-sha256": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@chainsafe/as-sha256/-/as-sha256-0.3.1.tgz", + "integrity": "sha512-hldFFYuf49ed7DAakWVXSJODuq3pzJEguD8tQ7h+sGkM18vja+OFoJI9krnGmgzyuZC2ETX0NOIcCTy31v2Mtg==", + "dev": true + }, + "@chainsafe/persistent-merkle-tree": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.4.2.tgz", + "integrity": "sha512-lLO3ihKPngXLTus/L7WHKaw9PnNJWizlOF1H9NNzHP6Xvh82vzg9F2bzkXhYIFshMZ2gTCEz8tq6STe7r5NDfQ==", + "dev": true, + "requires": { + "@chainsafe/as-sha256": "^0.3.1" + } + }, + "@chainsafe/ssz": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/@chainsafe/ssz/-/ssz-0.9.4.tgz", + "integrity": "sha512-77Qtg2N1ayqs4Bg/wvnWfg5Bta7iy7IRh8XqXh7oNMeP2HBbBwx8m6yTpA8p0EHItWPEBkgZd5S5/LSlp3GXuQ==", + "dev": true, + "requires": { + "@chainsafe/as-sha256": "^0.3.1", + "@chainsafe/persistent-merkle-tree": "^0.4.2", + "case": "^1.6.3" + } + }, "@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", @@ -13991,403 +14106,404 @@ } }, "@ethersproject/abi": { - "version": "5.6.4", - "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.6.4.tgz", - "integrity": "sha512-TTeZUlCeIHG6527/2goZA6gW5F8Emoc7MrZDC7hhP84aRGvW3TEdTnZR08Ls88YXM1m2SuK42Osw/jSi3uO8gg==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.7.0.tgz", + "integrity": "sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA==", "dev": true, "requires": { - "@ethersproject/address": "^5.6.1", - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/constants": "^5.6.1", - "@ethersproject/hash": "^5.6.1", - "@ethersproject/keccak256": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/strings": "^5.6.1" + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" } }, "@ethersproject/abstract-provider": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.6.1.tgz", - "integrity": "sha512-BxlIgogYJtp1FS8Muvj8YfdClk3unZH0vRMVX791Z9INBNT/kuACZ9GzaY1Y4yFq+YSy6/w4gzj3HCRKrK9hsQ==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz", + "integrity": "sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw==", "dev": true, "requires": { - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/networks": "^5.6.3", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/transactions": "^5.6.2", - "@ethersproject/web": "^5.6.1" + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/networks": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/web": "^5.7.0" } }, "@ethersproject/abstract-signer": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.6.2.tgz", - "integrity": "sha512-n1r6lttFBG0t2vNiI3HoWaS/KdOt8xyDjzlP2cuevlWLG6EX0OwcKLyG/Kp/cuwNxdy/ous+R/DEMdTUwWQIjQ==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz", + "integrity": "sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ==", "dev": true, "requires": { - "@ethersproject/abstract-provider": "^5.6.1", - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0" + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0" } }, "@ethersproject/address": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.6.1.tgz", - "integrity": "sha512-uOgF0kS5MJv9ZvCz7x6T2EXJSzotiybApn4XlOgoTX0xdtyVIJ7pF+6cGPxiEq/dpBiTfMiw7Yc81JcwhSYA0Q==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.7.0.tgz", + "integrity": "sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA==", "dev": true, "requires": { - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/keccak256": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/rlp": "^5.6.1" + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/rlp": "^5.7.0" } }, "@ethersproject/base64": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.6.1.tgz", - "integrity": "sha512-qB76rjop6a0RIYYMiB4Eh/8n+Hxu2NIZm8S/Q7kNo5pmZfXhHGHmS4MinUainiBC54SCyRnwzL+KZjj8zbsSsw==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.7.0.tgz", + "integrity": "sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.6.1" + "@ethersproject/bytes": "^5.7.0" } }, "@ethersproject/basex": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.6.1.tgz", - "integrity": "sha512-a52MkVz4vuBXR06nvflPMotld1FJWSj2QT0985v7P/emPZO00PucFAkbcmq2vpVU7Ts7umKiSI6SppiLykVWsA==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.7.0.tgz", + "integrity": "sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/properties": "^5.6.0" + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/properties": "^5.7.0" } }, "@ethersproject/bignumber": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.6.2.tgz", - "integrity": "sha512-v7+EEUbhGqT3XJ9LMPsKvXYHFc8eHxTowFCG/HgJErmq4XHJ2WR7aeyICg3uTOAQ7Icn0GFHAohXEhxQHq4Ubw==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.7.0.tgz", + "integrity": "sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", "bn.js": "^5.2.1" } }, "@ethersproject/bytes": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.6.1.tgz", - "integrity": "sha512-NwQt7cKn5+ZE4uDn+X5RAXLp46E1chXoaMmrxAyA0rblpxz8t58lVkrHXoRIn0lz1joQElQ8410GqhTqMOwc6g==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.7.0.tgz", + "integrity": "sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==", "dev": true, "requires": { - "@ethersproject/logger": "^5.6.0" + "@ethersproject/logger": "^5.7.0" } }, "@ethersproject/constants": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.6.1.tgz", - "integrity": "sha512-QSq9WVnZbxXYFftrjSjZDUshp6/eKp6qrtdBtUCm0QxCV5z1fG/w3kdlcsjMCQuQHUnAclKoK7XpXMezhRDOLg==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.7.0.tgz", + "integrity": "sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==", "dev": true, "requires": { - "@ethersproject/bignumber": "^5.6.2" + "@ethersproject/bignumber": "^5.7.0" } }, "@ethersproject/contracts": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.6.2.tgz", - "integrity": "sha512-hguUA57BIKi6WY0kHvZp6PwPlWF87MCeB4B7Z7AbUpTxfFXFdn/3b0GmjZPagIHS+3yhcBJDnuEfU4Xz+Ks/8g==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.7.0.tgz", + "integrity": "sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg==", "dev": true, "requires": { - "@ethersproject/abi": "^5.6.3", - "@ethersproject/abstract-provider": "^5.6.1", - "@ethersproject/abstract-signer": "^5.6.2", - "@ethersproject/address": "^5.6.1", - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/constants": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/transactions": "^5.6.2" + "@ethersproject/abi": "^5.7.0", + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/transactions": "^5.7.0" } }, "@ethersproject/hash": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.6.1.tgz", - "integrity": "sha512-L1xAHurbaxG8VVul4ankNX5HgQ8PNCTrnVXEiFnE9xoRnaUcgfD12tZINtDinSllxPLCtGwguQxJ5E6keE84pA==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.7.0.tgz", + "integrity": "sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==", "dev": true, "requires": { - "@ethersproject/abstract-signer": "^5.6.2", - "@ethersproject/address": "^5.6.1", - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/keccak256": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/strings": "^5.6.1" + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" } }, "@ethersproject/hdnode": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.6.2.tgz", - "integrity": "sha512-tERxW8Ccf9CxW2db3WsN01Qao3wFeRsfYY9TCuhmG0xNpl2IO8wgXU3HtWIZ49gUWPggRy4Yg5axU0ACaEKf1Q==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.7.0.tgz", + "integrity": "sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg==", "dev": true, "requires": { - "@ethersproject/abstract-signer": "^5.6.2", - "@ethersproject/basex": "^5.6.1", - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/pbkdf2": "^5.6.1", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/sha2": "^5.6.1", - "@ethersproject/signing-key": "^5.6.2", - "@ethersproject/strings": "^5.6.1", - "@ethersproject/transactions": "^5.6.2", - "@ethersproject/wordlists": "^5.6.1" + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/basex": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/pbkdf2": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/wordlists": "^5.7.0" } }, "@ethersproject/json-wallets": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.6.1.tgz", - "integrity": "sha512-KfyJ6Zwz3kGeX25nLihPwZYlDqamO6pfGKNnVMWWfEVVp42lTfCZVXXy5Ie8IZTN0HKwAngpIPi7gk4IJzgmqQ==", - "dev": true, - "requires": { - "@ethersproject/abstract-signer": "^5.6.2", - "@ethersproject/address": "^5.6.1", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/hdnode": "^5.6.2", - "@ethersproject/keccak256": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/pbkdf2": "^5.6.1", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/random": "^5.6.1", - "@ethersproject/strings": "^5.6.1", - "@ethersproject/transactions": "^5.6.2", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz", + "integrity": "sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g==", + "dev": true, + "requires": { + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hdnode": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/pbkdf2": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", "aes-js": "3.0.0", "scrypt-js": "3.0.1" } }, "@ethersproject/keccak256": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.6.1.tgz", - "integrity": "sha512-bB7DQHCTRDooZZdL3lk9wpL0+XuG3XLGHLh3cePnybsO3V0rdCAOQGpn/0R3aODmnTOOkCATJiD2hnL+5bwthA==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.7.0.tgz", + "integrity": "sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.6.1", + "@ethersproject/bytes": "^5.7.0", "js-sha3": "0.8.0" } }, "@ethersproject/logger": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.6.0.tgz", - "integrity": "sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.7.0.tgz", + "integrity": "sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==", "dev": true }, "@ethersproject/networks": { - "version": "5.6.4", - "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.6.4.tgz", - "integrity": "sha512-KShHeHPahHI2UlWdtDMn2lJETcbtaJge4k7XSjDR9h79QTd6yQJmv6Cp2ZA4JdqWnhszAOLSuJEd9C0PRw7hSQ==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.7.1.tgz", + "integrity": "sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ==", "dev": true, "requires": { - "@ethersproject/logger": "^5.6.0" + "@ethersproject/logger": "^5.7.0" } }, "@ethersproject/pbkdf2": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.6.1.tgz", - "integrity": "sha512-k4gRQ+D93zDRPNUfmduNKq065uadC2YjMP/CqwwX5qG6R05f47boq6pLZtV/RnC4NZAYOPH1Cyo54q0c9sshRQ==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.7.0.tgz", + "integrity": "sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/sha2": "^5.6.1" + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/sha2": "^5.7.0" } }, "@ethersproject/properties": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.6.0.tgz", - "integrity": "sha512-szoOkHskajKePTJSZ46uHUWWkbv7TzP2ypdEK6jGMqJaEt2sb0jCgfBo0gH0m2HBpRixMuJ6TBRaQCF7a9DoCg==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.7.0.tgz", + "integrity": "sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw==", "dev": true, "requires": { - "@ethersproject/logger": "^5.6.0" + "@ethersproject/logger": "^5.7.0" } }, "@ethersproject/providers": { - "version": "5.6.8", - "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.6.8.tgz", - "integrity": "sha512-Wf+CseT/iOJjrGtAOf3ck9zS7AgPmr2fZ3N97r4+YXN3mBePTG2/bJ8DApl9mVwYL+RpYbNxMEkEp4mPGdwG/w==", - "dev": true, - "requires": { - "@ethersproject/abstract-provider": "^5.6.1", - "@ethersproject/abstract-signer": "^5.6.2", - "@ethersproject/address": "^5.6.1", - "@ethersproject/base64": "^5.6.1", - "@ethersproject/basex": "^5.6.1", - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/constants": "^5.6.1", - "@ethersproject/hash": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/networks": "^5.6.3", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/random": "^5.6.1", - "@ethersproject/rlp": "^5.6.1", - "@ethersproject/sha2": "^5.6.1", - "@ethersproject/strings": "^5.6.1", - "@ethersproject/transactions": "^5.6.2", - "@ethersproject/web": "^5.6.1", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.7.2.tgz", + "integrity": "sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg==", + "dev": true, + "requires": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/basex": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/networks": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/web": "^5.7.0", "bech32": "1.1.4", "ws": "7.4.6" } }, "@ethersproject/random": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.6.1.tgz", - "integrity": "sha512-/wtPNHwbmng+5yi3fkipA8YBT59DdkGRoC2vWk09Dci/q5DlgnMkhIycjHlavrvrjJBkFjO/ueLyT+aUDfc4lA==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.7.0.tgz", + "integrity": "sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0" + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0" } }, "@ethersproject/rlp": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.6.1.tgz", - "integrity": "sha512-uYjmcZx+DKlFUk7a5/W9aQVaoEC7+1MOBgNtvNg13+RnuUwT4F0zTovC0tmay5SmRslb29V1B7Y5KCri46WhuQ==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.7.0.tgz", + "integrity": "sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0" + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0" } }, "@ethersproject/sha2": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.6.1.tgz", - "integrity": "sha512-5K2GyqcW7G4Yo3uenHegbXRPDgARpWUiXc6RiF7b6i/HXUoWlb7uCARh7BAHg7/qT/Q5ydofNwiZcim9qpjB6g==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.7.0.tgz", + "integrity": "sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", "hash.js": "1.1.7" } }, "@ethersproject/signing-key": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.6.2.tgz", - "integrity": "sha512-jVbu0RuP7EFpw82vHcL+GP35+KaNruVAZM90GxgQnGqB6crhBqW/ozBfFvdeImtmb4qPko0uxXjn8l9jpn0cwQ==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.7.0.tgz", + "integrity": "sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", "bn.js": "^5.2.1", "elliptic": "6.5.4", "hash.js": "1.1.7" } }, "@ethersproject/solidity": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.6.1.tgz", - "integrity": "sha512-KWqVLkUUoLBfL1iwdzUVlkNqAUIFMpbbeH0rgCfKmJp0vFtY4AsaN91gHKo9ZZLkC4UOm3cI3BmMV4N53BOq4g==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.7.0.tgz", + "integrity": "sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA==", "dev": true, "requires": { - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/keccak256": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/sha2": "^5.6.1", - "@ethersproject/strings": "^5.6.1" + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/strings": "^5.7.0" } }, "@ethersproject/strings": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.6.1.tgz", - "integrity": "sha512-2X1Lgk6Jyfg26MUnsHiT456U9ijxKUybz8IM1Vih+NJxYtXhmvKBcHOmvGqpFSVJ0nQ4ZCoIViR8XlRw1v/+Cw==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.7.0.tgz", + "integrity": "sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/constants": "^5.6.1", - "@ethersproject/logger": "^5.6.0" + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0" } }, "@ethersproject/transactions": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.6.2.tgz", - "integrity": "sha512-BuV63IRPHmJvthNkkt9G70Ullx6AcM+SDc+a8Aw/8Yew6YwT51TcBKEp1P4oOQ/bP25I18JJr7rcFRgFtU9B2Q==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.7.0.tgz", + "integrity": "sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ==", "dev": true, "requires": { - "@ethersproject/address": "^5.6.1", - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/constants": "^5.6.1", - "@ethersproject/keccak256": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/rlp": "^5.6.1", - "@ethersproject/signing-key": "^5.6.2" + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0" } }, "@ethersproject/units": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.6.1.tgz", - "integrity": "sha512-rEfSEvMQ7obcx3KWD5EWWx77gqv54K6BKiZzKxkQJqtpriVsICrktIQmKl8ReNToPeIYPnFHpXvKpi068YFZXw==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.7.0.tgz", + "integrity": "sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg==", "dev": true, "requires": { - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/constants": "^5.6.1", - "@ethersproject/logger": "^5.6.0" + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0" } }, "@ethersproject/wallet": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.6.2.tgz", - "integrity": "sha512-lrgh0FDQPuOnHcF80Q3gHYsSUODp6aJLAdDmDV0xKCN/T7D99ta1jGVhulg3PY8wiXEngD0DfM0I2XKXlrqJfg==", - "dev": true, - "requires": { - "@ethersproject/abstract-provider": "^5.6.1", - "@ethersproject/abstract-signer": "^5.6.2", - "@ethersproject/address": "^5.6.1", - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/hash": "^5.6.1", - "@ethersproject/hdnode": "^5.6.2", - "@ethersproject/json-wallets": "^5.6.1", - "@ethersproject/keccak256": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/random": "^5.6.1", - "@ethersproject/signing-key": "^5.6.2", - "@ethersproject/transactions": "^5.6.2", - "@ethersproject/wordlists": "^5.6.1" + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.7.0.tgz", + "integrity": "sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA==", + "dev": true, + "requires": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/hdnode": "^5.7.0", + "@ethersproject/json-wallets": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/wordlists": "^5.7.0" } }, "@ethersproject/web": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.6.1.tgz", - "integrity": "sha512-/vSyzaQlNXkO1WV+RneYKqCJwualcUdx/Z3gseVovZP0wIlOFcCE1hkRhKBH8ImKbGQbMl9EAAyJFrJu7V0aqA==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.7.1.tgz", + "integrity": "sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w==", "dev": true, "requires": { - "@ethersproject/base64": "^5.6.1", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/strings": "^5.6.1" + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" } }, "@ethersproject/wordlists": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.6.1.tgz", - "integrity": "sha512-wiPRgBpNbNwCQFoCr8bcWO8o5I810cqO6mkdtKfLKFlLxeCWcnzDi4Alu8iyNzlhYuS9npCwivMbRWF19dyblw==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.7.0.tgz", + "integrity": "sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/hash": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/strings": "^5.6.1" + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" } }, "@hutson/parse-repository-url": { @@ -14536,17 +14652,18 @@ } }, "@nomicfoundation/ethereumjs-block": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-4.0.0.tgz", - "integrity": "sha512-bk8uP8VuexLgyIZAHExH1QEovqx0Lzhc9Ntm63nCRKLHXIZkobaFaeCVwTESV7YkPKUk7NiK11s8ryed4CS9yA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-5.0.0.tgz", + "integrity": "sha512-DfhVbqM5DjriguuSv6r3TgOpyXC76oX8D/VEODsSwJQ1bZGqu4xLLfYPPTacpCAYOnewzJsZli+Ao9TBTAo2uw==", "dev": true, "requires": { - "@nomicfoundation/ethereumjs-common": "^3.0.0", - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-trie": "^5.0.0", - "@nomicfoundation/ethereumjs-tx": "^4.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", - "ethereum-cryptography": "0.1.3" + "@nomicfoundation/ethereumjs-common": "4.0.0", + "@nomicfoundation/ethereumjs-rlp": "5.0.0", + "@nomicfoundation/ethereumjs-trie": "6.0.0", + "@nomicfoundation/ethereumjs-tx": "5.0.0", + "@nomicfoundation/ethereumjs-util": "9.0.0", + "ethereum-cryptography": "0.1.3", + "ethers": "^5.7.1" }, "dependencies": { "ethereum-cryptography": { @@ -14575,17 +14692,18 @@ } }, "@nomicfoundation/ethereumjs-blockchain": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-6.0.0.tgz", - "integrity": "sha512-pLFEoea6MWd81QQYSReLlLfH7N9v7lH66JC/NMPN848ySPPQA5renWnE7wPByfQFzNrPBuDDRFFULMDmj1C0xw==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-7.0.0.tgz", + "integrity": "sha512-cVRCrXZminZr0Mbx2hm0/109GZLn1v5bf0/k+SIbGn50yZm6YCdQt9CgGT0Gk56N2vy8NhXD4apo167m4LWk6Q==", "dev": true, "requires": { - "@nomicfoundation/ethereumjs-block": "^4.0.0", - "@nomicfoundation/ethereumjs-common": "^3.0.0", - "@nomicfoundation/ethereumjs-ethash": "^2.0.0", - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-trie": "^5.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", + "@nomicfoundation/ethereumjs-block": "5.0.0", + "@nomicfoundation/ethereumjs-common": "4.0.0", + "@nomicfoundation/ethereumjs-ethash": "3.0.0", + "@nomicfoundation/ethereumjs-rlp": "5.0.0", + "@nomicfoundation/ethereumjs-trie": "6.0.0", + "@nomicfoundation/ethereumjs-tx": "5.0.0", + "@nomicfoundation/ethereumjs-util": "9.0.0", "abstract-level": "^1.0.3", "debug": "^4.3.3", "ethereum-cryptography": "0.1.3", @@ -14620,24 +14738,24 @@ } }, "@nomicfoundation/ethereumjs-common": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-3.0.0.tgz", - "integrity": "sha512-WS7qSshQfxoZOpHG/XqlHEGRG1zmyjYrvmATvc4c62+gZXgre1ymYP8ZNgx/3FyZY0TWe9OjFlKOfLqmgOeYwA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.0.tgz", + "integrity": "sha512-UPpm5FAGAf2B6hQ8aVgO44Rdo0k73oMMCViqNJcKMlk1s9l3rxwuPTp1l20NiGvNO2Pzqk3chFL+BzmLL2g4wQ==", "dev": true, "requires": { - "@nomicfoundation/ethereumjs-util": "^8.0.0", + "@nomicfoundation/ethereumjs-util": "9.0.0", "crc-32": "^1.2.0" } }, "@nomicfoundation/ethereumjs-ethash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-2.0.0.tgz", - "integrity": "sha512-WpDvnRncfDUuXdsAXlI4lXbqUDOA+adYRQaEezIkxqDkc+LDyYDbd/xairmY98GnQzo1zIqsIL6GB5MoMSJDew==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-3.0.0.tgz", + "integrity": "sha512-6zNv5Y3vNIsxjrsbKjMInVpo8cmR0c7yjZbBpy7NYuIMtm0JKhQoXsiFN56t/1sfn9V3v0wgrkAixo5v6bahpA==", "dev": true, "requires": { - "@nomicfoundation/ethereumjs-block": "^4.0.0", - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", + "@nomicfoundation/ethereumjs-block": "5.0.0", + "@nomicfoundation/ethereumjs-rlp": "5.0.0", + "@nomicfoundation/ethereumjs-util": "9.0.0", "abstract-level": "^1.0.3", "bigint-crypto-utils": "^3.0.23", "ethereum-cryptography": "0.1.3" @@ -14669,15 +14787,15 @@ } }, "@nomicfoundation/ethereumjs-evm": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-1.0.0.tgz", - "integrity": "sha512-hVS6qRo3V1PLKCO210UfcEQHvlG7GqR8iFzp0yyjTg2TmJQizcChKgWo8KFsdMw6AyoLgLhHGHw4HdlP8a4i+Q==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-2.0.0.tgz", + "integrity": "sha512-D+tr3M9sictopr3E20OVgme7YF/d0fU566WKh+ofXwmxapz/Dd8RSLSaVeKgfCI2BkzVA+XqXY08NNCV8w8fWA==", "dev": true, "requires": { - "@nomicfoundation/ethereumjs-common": "^3.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", - "@types/async-eventemitter": "^0.2.1", - "async-eventemitter": "^0.2.4", + "@ethersproject/providers": "^5.7.1", + "@nomicfoundation/ethereumjs-common": "4.0.0", + "@nomicfoundation/ethereumjs-tx": "5.0.0", + "@nomicfoundation/ethereumjs-util": "9.0.0", "debug": "^4.3.3", "ethereum-cryptography": "0.1.3", "mcl-wasm": "^0.7.1", @@ -14710,24 +14828,23 @@ } }, "@nomicfoundation/ethereumjs-rlp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-4.0.0.tgz", - "integrity": "sha512-GaSOGk5QbUk4eBP5qFbpXoZoZUj/NrW7MRa0tKY4Ew4c2HAS0GXArEMAamtFrkazp0BO4K5p2ZCG3b2FmbShmw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.0.tgz", + "integrity": "sha512-U1A0y330PtGb8Wft4yPVv0myWYJTesi89ItGoB0ICdqz7793KmUhpfQb2vJUXBi98wSdnxkIABO/GmsQvGKVDw==", "dev": true }, "@nomicfoundation/ethereumjs-statemanager": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-1.0.0.tgz", - "integrity": "sha512-jCtqFjcd2QejtuAMjQzbil/4NHf5aAWxUc+CvS0JclQpl+7M0bxMofR2AJdtz+P3u0ke2euhYREDiE7iSO31vQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-2.0.0.tgz", + "integrity": "sha512-tgXtsx8yIDlxWMN+ThqPtGK0ITAuITrDy+GYIgGrnT6ZtelvXWM7SUYR0Mcv578lmGCoIwyHFtSBqOkOBYHLjw==", "dev": true, "requires": { - "@nomicfoundation/ethereumjs-common": "^3.0.0", - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-trie": "^5.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", + "@nomicfoundation/ethereumjs-common": "4.0.0", + "@nomicfoundation/ethereumjs-rlp": "5.0.0", "debug": "^4.3.3", "ethereum-cryptography": "0.1.3", - "functional-red-black-tree": "^1.0.1" + "ethers": "^5.7.1", + "js-sdsl": "^4.1.4" }, "dependencies": { "ethereum-cryptography": { @@ -14756,13 +14873,14 @@ } }, "@nomicfoundation/ethereumjs-trie": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-5.0.0.tgz", - "integrity": "sha512-LIj5XdE+s+t6WSuq/ttegJzZ1vliwg6wlb+Y9f4RlBpuK35B9K02bO7xU+E6Rgg9RGptkWd6TVLdedTI4eNc2A==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-6.0.0.tgz", + "integrity": "sha512-YqPWiNxrZvL+Ef7KHqgru1IlaIGXhu78wd2fxNFOvi/NAQBF845dVfTKKXs1L9x0QBRRQRephgxHCKMuISGppw==", "dev": true, "requires": { - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", + "@nomicfoundation/ethereumjs-rlp": "5.0.0", + "@nomicfoundation/ethereumjs-util": "9.0.0", + "@types/readable-stream": "^2.3.13", "ethereum-cryptography": "0.1.3", "readable-stream": "^3.6.0" }, @@ -14793,14 +14911,16 @@ } }, "@nomicfoundation/ethereumjs-tx": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-4.0.0.tgz", - "integrity": "sha512-Gg3Lir2lNUck43Kp/3x6TfBNwcWC9Z1wYue9Nz3v4xjdcv6oDW9QSMJxqsKw9QEGoBBZ+gqwpW7+F05/rs/g1w==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.0.tgz", + "integrity": "sha512-LTyxI+zBJ+HuEBblUGbxvfKl1hg1uJlz2XhnszNagiBWQSgLb1vQCa1QaXV5Q8cUDYkr/Xe4NXWiUGEvH4e6lA==", "dev": true, "requires": { - "@nomicfoundation/ethereumjs-common": "^3.0.0", - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", + "@chainsafe/ssz": "^0.9.2", + "@ethersproject/providers": "^5.7.2", + "@nomicfoundation/ethereumjs-common": "4.0.0", + "@nomicfoundation/ethereumjs-rlp": "5.0.0", + "@nomicfoundation/ethereumjs-util": "9.0.0", "ethereum-cryptography": "0.1.3" }, "dependencies": { @@ -14830,15 +14950,35 @@ } }, "@nomicfoundation/ethereumjs-util": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-8.0.0.tgz", - "integrity": "sha512-2emi0NJ/HmTG+CGY58fa+DQuAoroFeSH9gKu9O6JnwTtlzJtgfTixuoOqLEgyyzZVvwfIpRueuePb8TonL1y+A==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.0.tgz", + "integrity": "sha512-9EG98CsEC9BnI7AY27F4QXZ8Vf0re8R9XoxQ0//KWF+B7quu6GQvgTq1RlNUjGh/XNCCJNf8E3LOY9ULR85wFQ==", "dev": true, "requires": { - "@nomicfoundation/ethereumjs-rlp": "^4.0.0-beta.2", + "@chainsafe/ssz": "^0.10.0", + "@nomicfoundation/ethereumjs-rlp": "5.0.0", "ethereum-cryptography": "0.1.3" }, "dependencies": { + "@chainsafe/persistent-merkle-tree": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.5.0.tgz", + "integrity": "sha512-l0V1b5clxA3iwQLXP40zYjyZYospQLZXzBVIhhr9kDg/1qHZfzzHw0jj4VPBijfYCArZDlPkRi1wZaV2POKeuw==", + "dev": true, + "requires": { + "@chainsafe/as-sha256": "^0.3.1" + } + }, + "@chainsafe/ssz": { + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/@chainsafe/ssz/-/ssz-0.10.2.tgz", + "integrity": "sha512-/NL3Lh8K+0q7A3LsiFq09YXS9fPE+ead2rr7vM2QK8PLzrNsw3uqrif9bpRX5UxgeRjM+vYi+boCM3+GM4ovXg==", + "dev": true, + "requires": { + "@chainsafe/as-sha256": "^0.3.1", + "@chainsafe/persistent-merkle-tree": "^0.5.0" + } + }, "ethereum-cryptography": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", @@ -14865,25 +15005,22 @@ } }, "@nomicfoundation/ethereumjs-vm": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-6.0.0.tgz", - "integrity": "sha512-JMPxvPQ3fzD063Sg3Tp+UdwUkVxMoo1uML6KSzFhMH3hoQi/LMuXBoEHAoW83/vyNS9BxEe6jm6LmT5xdeEJ6w==", - "dev": true, - "requires": { - "@nomicfoundation/ethereumjs-block": "^4.0.0", - "@nomicfoundation/ethereumjs-blockchain": "^6.0.0", - "@nomicfoundation/ethereumjs-common": "^3.0.0", - "@nomicfoundation/ethereumjs-evm": "^1.0.0", - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-statemanager": "^1.0.0", - "@nomicfoundation/ethereumjs-trie": "^5.0.0", - "@nomicfoundation/ethereumjs-tx": "^4.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", - "@types/async-eventemitter": "^0.2.1", - "async-eventemitter": "^0.2.4", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-7.0.0.tgz", + "integrity": "sha512-eHkEoe/4r4+g+fZyIIlQjBHEjCPFs8CHiIEEMvMfvFrV4hyHnuTg4LH7l92ok7TGZqpWxgMG2JOEUFkNsXrKuQ==", + "dev": true, + "requires": { + "@nomicfoundation/ethereumjs-block": "5.0.0", + "@nomicfoundation/ethereumjs-blockchain": "7.0.0", + "@nomicfoundation/ethereumjs-common": "4.0.0", + "@nomicfoundation/ethereumjs-evm": "2.0.0", + "@nomicfoundation/ethereumjs-rlp": "5.0.0", + "@nomicfoundation/ethereumjs-statemanager": "2.0.0", + "@nomicfoundation/ethereumjs-trie": "6.0.0", + "@nomicfoundation/ethereumjs-tx": "5.0.0", + "@nomicfoundation/ethereumjs-util": "9.0.0", "debug": "^4.3.3", "ethereum-cryptography": "0.1.3", - "functional-red-black-tree": "^1.0.1", "mcl-wasm": "^0.7.1", "rustbn.js": "~0.2.0" }, @@ -14939,9 +15076,9 @@ } }, "@nomicfoundation/hardhat-toolbox": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-toolbox/-/hardhat-toolbox-2.0.0.tgz", - "integrity": "sha512-BoOPbzLQ1GArnBZd4Jz4IU8FY3RY4nUwpXlfymXwxlXNimngkPRJj7ivVNurD7igohEjf90v/Axn2M5WwAdCJQ==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-toolbox/-/hardhat-toolbox-2.0.2.tgz", + "integrity": "sha512-vnN1AzxbvpSx9pfdRHbUzTRIXpMLPXnUlkW855VaDk6N1pwRaQ2gNzEmFAABk4lWf11E00PKwFd/q27HuwYrYg==", "dev": true, "requires": {} }, @@ -15061,14 +15198,14 @@ } }, "@openzeppelin/contracts": { - "version": "4.7.3", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.7.3.tgz", - "integrity": "sha512-dGRS0agJzu8ybo44pCIf3xBaPQN/65AIXNgK8+4gzKd5kbvlqyxryUYVLJv7fK98Seyd2hDZzVEHSWAh0Bt1Yw==" + "version": "4.8.3", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.8.3.tgz", + "integrity": "sha512-bQHV8R9Me8IaJoJ2vPG4rXcL7seB7YVuskr4f+f5RyOStSZetwzkWtoqDMl5erkBJy0lDRUnIR2WIkPiC0GJlg==" }, "@openzeppelin/contracts-upgradeable": { - "version": "4.7.3", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.7.3.tgz", - "integrity": "sha512-+wuegAMaLcZnLCJIvrVUDzA9z/Wp93f0Dla/4jJvIhijRrPabjQbZe6fWiECLaJyfn5ci9fqf9vTw3xpQOad2A==" + "version": "4.8.3", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.8.3.tgz", + "integrity": "sha512-SXDRl7HKpl2WDoJpn7CK/M9U4Z8gNXDHHChAKh0Iz+Wew3wu6CmFYBeie3je8V0GSXZAIYYwUktSrnW/kwVPtg==" }, "@scure/base": { "version": "1.1.1", @@ -15274,12 +15411,6 @@ } } }, - "@types/async-eventemitter": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@types/async-eventemitter/-/async-eventemitter-0.2.1.tgz", - "integrity": "sha512-M2P4Ng26QbAeITiH7w1d7OxtldgfAe0wobpyJzVK/XOb0cUGKU2R4pfAhqcJBXAe2ife5ZOhSv4wk7p+ffURtg==", - "dev": true - }, "@types/bn.js": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.0.tgz", @@ -15393,6 +15524,24 @@ "dev": true, "peer": true }, + "@types/readable-stream": { + "version": "2.3.15", + "resolved": "https://registry.npmjs.org/@types/readable-stream/-/readable-stream-2.3.15.tgz", + "integrity": "sha512-oM5JSKQCcICF1wvGgmecmHldZ48OZamtMxcGGVICOJA8o8cahXC1zEVAif8iwoc5j8etxFaRFnf095+CDsuoFQ==", + "dev": true, + "requires": { + "@types/node": "*", + "safe-buffer": "~5.1.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, "@types/secp256k1": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.3.tgz", @@ -15804,18 +15953,9 @@ "dev": true }, "bigint-crypto-utils": { - "version": "3.1.8", - "resolved": "https://registry.npmjs.org/bigint-crypto-utils/-/bigint-crypto-utils-3.1.8.tgz", - "integrity": "sha512-+VMV9Laq8pXLBKKKK49nOoq9bfR3j7NNQAtbA617a4nw9bVLo8rsqkKMBgM2AJWlNX9fEIyYaYX+d0laqYV4tw==", - "dev": true, - "requires": { - "bigint-mod-arith": "^3.1.0" - } - }, - "bigint-mod-arith": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bigint-mod-arith/-/bigint-mod-arith-3.1.2.tgz", - "integrity": "sha512-nx8J8bBeiRR+NlsROFH9jHswW5HO8mgfOSqW0AmjicMMvaONDa8AO+5ViKDUUNytBPWiwfvZP4/Bj4Y3lUfvgQ==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/bigint-crypto-utils/-/bigint-crypto-utils-3.2.2.tgz", + "integrity": "sha512-U1RbE3aX9ayCUVcIPHuPDPKcK3SFOXf93J1UK/iHlJuQB7bhagPIX06/CLpLEsDThJ7KA4Dhrnzynl+d2weTiw==", "dev": true }, "bignumber.js": { @@ -15964,6 +16104,15 @@ "node-gyp-build": "^4.3.0" } }, + "busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dev": true, + "requires": { + "streamsearch": "^1.1.0" + } + }, "bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -16026,6 +16175,12 @@ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001374.tgz", "integrity": "sha512-mWvzatRx3w+j5wx/mpFN5v5twlPrabG8NqX2c6e45LCpymdoGqNvRkRutFUqpRTXKFQFNQJasvK0YT7suW6/Hw==" }, + "case": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/case/-/case-1.6.3.tgz", + "integrity": "sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ==", + "dev": true + }, "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", @@ -16153,15 +16308,15 @@ } }, "classic-level": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/classic-level/-/classic-level-1.2.0.tgz", - "integrity": "sha512-qw5B31ANxSluWz9xBzklRWTUAJ1SXIdaVKTVS7HcTGKOAmExx65Wo5BUICW+YGORe2FOUaDghoI9ZDxj82QcFg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/classic-level/-/classic-level-1.3.0.tgz", + "integrity": "sha512-iwFAJQYtqRTRM0F6L8h4JCt00ZSGdOyqh7yVrhhjrOpFhmBjNlRUey64MCiyo6UmQHMJ+No3c81nujPv+n9yrg==", "dev": true, "requires": { "abstract-level": "^1.0.2", "catering": "^2.1.0", "module-error": "^1.0.1", - "napi-macros": "~2.0.0", + "napi-macros": "^2.2.2", "node-gyp-build": "^4.3.0" } }, @@ -18537,41 +18692,41 @@ } }, "ethers": { - "version": "5.6.9", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.6.9.tgz", - "integrity": "sha512-lMGC2zv9HC5EC+8r429WaWu3uWJUCgUCt8xxKCFqkrFuBDZXDYIdzDUECxzjf2BMF8IVBByY1EBoGSL3RTm8RA==", - "dev": true, - "requires": { - "@ethersproject/abi": "5.6.4", - "@ethersproject/abstract-provider": "5.6.1", - "@ethersproject/abstract-signer": "5.6.2", - "@ethersproject/address": "5.6.1", - "@ethersproject/base64": "5.6.1", - "@ethersproject/basex": "5.6.1", - "@ethersproject/bignumber": "5.6.2", - "@ethersproject/bytes": "5.6.1", - "@ethersproject/constants": "5.6.1", - "@ethersproject/contracts": "5.6.2", - "@ethersproject/hash": "5.6.1", - "@ethersproject/hdnode": "5.6.2", - "@ethersproject/json-wallets": "5.6.1", - "@ethersproject/keccak256": "5.6.1", - "@ethersproject/logger": "5.6.0", - "@ethersproject/networks": "5.6.4", - "@ethersproject/pbkdf2": "5.6.1", - "@ethersproject/properties": "5.6.0", - "@ethersproject/providers": "5.6.8", - "@ethersproject/random": "5.6.1", - "@ethersproject/rlp": "5.6.1", - "@ethersproject/sha2": "5.6.1", - "@ethersproject/signing-key": "5.6.2", - "@ethersproject/solidity": "5.6.1", - "@ethersproject/strings": "5.6.1", - "@ethersproject/transactions": "5.6.2", - "@ethersproject/units": "5.6.1", - "@ethersproject/wallet": "5.6.2", - "@ethersproject/web": "5.6.1", - "@ethersproject/wordlists": "5.6.1" + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz", + "integrity": "sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==", + "dev": true, + "requires": { + "@ethersproject/abi": "5.7.0", + "@ethersproject/abstract-provider": "5.7.0", + "@ethersproject/abstract-signer": "5.7.0", + "@ethersproject/address": "5.7.0", + "@ethersproject/base64": "5.7.0", + "@ethersproject/basex": "5.7.0", + "@ethersproject/bignumber": "5.7.0", + "@ethersproject/bytes": "5.7.0", + "@ethersproject/constants": "5.7.0", + "@ethersproject/contracts": "5.7.0", + "@ethersproject/hash": "5.7.0", + "@ethersproject/hdnode": "5.7.0", + "@ethersproject/json-wallets": "5.7.0", + "@ethersproject/keccak256": "5.7.0", + "@ethersproject/logger": "5.7.0", + "@ethersproject/networks": "5.7.1", + "@ethersproject/pbkdf2": "5.7.0", + "@ethersproject/properties": "5.7.0", + "@ethersproject/providers": "5.7.2", + "@ethersproject/random": "5.7.0", + "@ethersproject/rlp": "5.7.0", + "@ethersproject/sha2": "5.7.0", + "@ethersproject/signing-key": "5.7.0", + "@ethersproject/solidity": "5.7.0", + "@ethersproject/strings": "5.7.0", + "@ethersproject/transactions": "5.7.0", + "@ethersproject/units": "5.7.0", + "@ethersproject/wallet": "5.7.0", + "@ethersproject/web": "5.7.1", + "@ethersproject/wordlists": "5.7.0" } }, "ethjs-unit": { @@ -19280,23 +19435,23 @@ "dev": true }, "hardhat": { - "version": "2.12.5", - "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.12.5.tgz", - "integrity": "sha512-f/t7+hLlhsnQZ6LDXyV+8rHGRZFZY1sgFvgrwr9fBjMdGp1Bu6hHq1KXS4/VFZfZcVdL1DAWWEkryinZhqce+A==", + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.13.1.tgz", + "integrity": "sha512-ZZL7LQxHmbw4JQJsiEv2qE35nbR+isr2sIdtgZVPp0+zWqRkpr1OT7gmvhCNYfjpEPyfjZIxWriQWlphJhVPLQ==", "dev": true, "requires": { "@ethersproject/abi": "^5.1.2", "@metamask/eth-sig-util": "^4.0.0", - "@nomicfoundation/ethereumjs-block": "^4.0.0", - "@nomicfoundation/ethereumjs-blockchain": "^6.0.0", - "@nomicfoundation/ethereumjs-common": "^3.0.0", - "@nomicfoundation/ethereumjs-evm": "^1.0.0", - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-statemanager": "^1.0.0", - "@nomicfoundation/ethereumjs-trie": "^5.0.0", - "@nomicfoundation/ethereumjs-tx": "^4.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", - "@nomicfoundation/ethereumjs-vm": "^6.0.0", + "@nomicfoundation/ethereumjs-block": "5.0.0", + "@nomicfoundation/ethereumjs-blockchain": "7.0.0", + "@nomicfoundation/ethereumjs-common": "4.0.0", + "@nomicfoundation/ethereumjs-evm": "2.0.0", + "@nomicfoundation/ethereumjs-rlp": "5.0.0", + "@nomicfoundation/ethereumjs-statemanager": "2.0.0", + "@nomicfoundation/ethereumjs-trie": "6.0.0", + "@nomicfoundation/ethereumjs-tx": "5.0.0", + "@nomicfoundation/ethereumjs-util": "9.0.0", + "@nomicfoundation/ethereumjs-vm": "7.0.0", "@nomicfoundation/solidity-analyzer": "^0.1.0", "@sentry/node": "^5.18.1", "@types/bn.js": "^5.1.0", @@ -19332,7 +19487,7 @@ "source-map-support": "^0.5.13", "stacktrace-parser": "^0.1.10", "tsort": "0.0.1", - "undici": "^5.4.0", + "undici": "^5.14.0", "uuid": "^8.3.2", "ws": "^7.4.6" }, @@ -20387,6 +20542,12 @@ "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==" }, + "js-sdsl": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.0.tgz", + "integrity": "sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg==", + "dev": true + }, "js-sha3": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", @@ -21245,9 +21406,9 @@ "dev": true }, "napi-macros": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.0.0.tgz", - "integrity": "sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.2.2.tgz", + "integrity": "sha512-hmEVtAGYzVQpCKdbQea4skABsdXW4RUh5t5mJ2zzqowJS2OyXZTU1KhDVFhx+NlWZ4ap9mqR9TcDO3LTTttd+g==", "dev": true }, "natural-compare": { @@ -23128,6 +23289,12 @@ "dev": true, "peer": true }, + "streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "dev": true + }, "string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -23790,10 +23957,13 @@ } }, "undici": { - "version": "5.10.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.10.0.tgz", - "integrity": "sha512-c8HsD3IbwmjjbLvoZuRI26TZic+TSEe8FPMLLOkN1AfYRhdjnKBU6yL+IwcSCbdZiX4e5t0lfMDLDCqj4Sq70g==", - "dev": true + "version": "5.21.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.21.0.tgz", + "integrity": "sha512-HOjK8l6a57b2ZGXOcUsI5NLfoTrfmbOl90ixJDl0AEFG4wgHNDQxtZy15/ZQp7HhjkpaGlp/eneMgtsu1dIlUA==", + "dev": true, + "requires": { + "busboy": "^1.6.0" + } }, "unique-string": { "version": "2.0.0", diff --git a/implementations/package.json b/implementations/package.json index b4a116e9..828240d3 100644 --- a/implementations/package.json +++ b/implementations/package.json @@ -1,6 +1,6 @@ { "name": "@erc725/smart-contracts", - "version": "4.2.0", + "version": "5.0.0", "description": "ERC725 contract implementations", "homepage": "https://erc725alliance.org", "repository": { @@ -32,17 +32,17 @@ "author": "Fabian Vogelsteller ", "license": "Apache-2.0", "dependencies": { - "@openzeppelin/contracts": "^4.7.3", - "@openzeppelin/contracts-upgradeable": "^4.7.3", + "@openzeppelin/contracts": "^4.8.3", + "@openzeppelin/contracts-upgradeable": "^4.8.3", "solidity-bytes-utils": "0.8.0" }, "devDependencies": { - "@nomicfoundation/hardhat-toolbox": "^2.0.0", + "@nomicfoundation/hardhat-toolbox": "^2.0.2", "@types/chai": "^4.3.1", "chai": "^4.2.0", "coveralls": "^3.1.1", "eth-create2-calculator": "^1.1.5", - "hardhat": "^2.10.1", + "hardhat": "^2.13.1", "hardhat-packager": "^1.4.2", "npm-run-all": "^4.1.5", "prettier": "^2.4.1", diff --git a/implementations/test/ConstantsChecker.test.ts b/implementations/test/ConstantsChecker.test.ts index 6204b825..52f99125 100644 --- a/implementations/test/ConstantsChecker.test.ts +++ b/implementations/test/ConstantsChecker.test.ts @@ -1,13 +1,13 @@ -import type { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; -import { expect } from "chai"; -import { ethers } from "hardhat"; +import type { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; +import { expect } from 'chai'; +import { ethers } from 'hardhat'; -import { ConstantsChecker, ConstantsChecker__factory } from "../types"; +import { ConstantsChecker, ConstantsChecker__factory } from '../types'; // utils -import { INTERFACE_ID, FUNCTIONS_SELECTOR } from "../constants"; +import { INTERFACE_ID, FUNCTIONS_SELECTOR } from '../constants'; -describe("Constants Checker", () => { +describe('Constants Checker', () => { let accounts: SignerWithAddress[]; let contract: ConstantsChecker; @@ -16,40 +16,40 @@ describe("Constants Checker", () => { contract = await new ConstantsChecker__factory(accounts[0]).deploy(); }); - describe("Calculating ERC165InterfaceIds", () => { - it("ERC725X", async () => { + describe('Calculating ERC165InterfaceIds', () => { + it('ERC725X', async () => { const result = await contract.getERC725XInterfaceID(); expect(result).to.equal(INTERFACE_ID.ERC725X); }); - it("ERC725Y", async () => { + it('ERC725Y', async () => { const result = await contract.getERC725YInterfaceID(); expect(result).to.equal(INTERFACE_ID.ERC725Y); }); }); - describe("Calculating Functions selectors", () => { - describe("ERC725X", () => { - it("execute selector", async () => { + describe('Calculating Functions selectors', () => { + describe('ERC725X', () => { + it('execute selector', async () => { const result = await contract.getExecuteSelector(); expect(result).to.equal(FUNCTIONS_SELECTOR.EXECUTE); }); - it("execute array selector", async () => { + it('execute array selector', async () => { const result = await contract.getExecuteArraySelector(); - expect(result).to.equal(FUNCTIONS_SELECTOR.EXECUTE_ARRAY); + expect(result).to.equal(FUNCTIONS_SELECTOR.EXECUTE_BATCH); }); }); - describe("ERC725Y", () => { - it("setData selector", async () => { + describe('ERC725Y', () => { + it('setData selector', async () => { const result = await contract.getSetDataSelector(); expect(result).to.equal(FUNCTIONS_SELECTOR.SETDATA); }); - it("setData array selector", async () => { + it('setData array selector', async () => { const result = await contract.getSetDataArraySelector(); - expect(result).to.equal(FUNCTIONS_SELECTOR.SETDATA_ARRAY); + expect(result).to.equal(FUNCTIONS_SELECTOR.SETDATA_BATCH); }); }); }); diff --git a/implementations/test/ERC725.test.ts b/implementations/test/ERC725.test.ts index 9e6f66d7..753403a9 100644 --- a/implementations/test/ERC725.test.ts +++ b/implementations/test/ERC725.test.ts @@ -1,12 +1,12 @@ -import { ethers } from "hardhat"; -import { expect } from "chai"; +import { ethers } from 'hardhat'; +import { expect } from 'chai'; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; // types -import { ERC725, ERC725__factory, ERC725Init__factory } from "../types"; +import { ERC725, ERC725__factory, ERC725Init__factory } from '../types'; -import { deployProxy } from "./fixtures"; +import { deployProxy } from './fixtures'; type ERC725DeployParams = { newOwner: string; @@ -18,28 +18,26 @@ type ERC725TestContext = { deployParams: ERC725DeployParams; }; -describe("ERC725", () => { - describe("when using ERC725 with constructor", () => { - describe("when deploying the contract", () => { - it("should revert when giving address(0) as owner", async () => { +describe('ERC725', () => { + describe('when using ERC725 with constructor', () => { + describe('when deploying the contract', () => { + it('should revert when giving address(0) as owner', async () => { const accounts = await ethers.getSigners(); const deployParams = { newOwner: ethers.constants.AddressZero, }; - const contract = await new ERC725__factory(accounts[0]).deploy(accounts[0].address) + const contract = await new ERC725__factory(accounts[0]).deploy(accounts[0].address); await expect( - new ERC725__factory(accounts[0]).deploy(deployParams.newOwner) - ).to.be.revertedWith( - "Ownable: new owner is the zero address" - ); + new ERC725__factory(accounts[0]).deploy(deployParams.newOwner), + ).to.be.revertedWith('Ownable: new owner is the zero address'); }); }); }); - describe("when using ERC725 with proxy", () => { + describe('when using ERC725 with proxy', () => { const buildTestContext = async (): Promise => { const accounts = await ethers.getSigners(); @@ -55,33 +53,31 @@ describe("ERC725", () => { return { accounts, erc725, deployParams }; }; - describe("when deploying the base implementation contract", () => { - it("prevent any address from calling the initialize(...) function on the implementation", async () => { + describe('when deploying the base implementation contract', () => { + it('prevent any address from calling the initialize(...) function on the implementation', async () => { const accounts = await ethers.getSigners(); const erc725Base = await new ERC725Init__factory(accounts[0]).deploy(); const randomCaller = accounts[1]; - await expect( - erc725Base["initialize(address)"](randomCaller.address) - ).to.be.revertedWith("Initializable: contract is already initialized"); + await expect(erc725Base['initialize(address)'](randomCaller.address)).to.be.revertedWith( + 'Initializable: contract is already initialized', + ); }); }); - describe("when deploying the contract as proxy", () => { + describe('when deploying the contract as proxy', () => { let context: ERC725TestContext; beforeEach(async () => { context = await buildTestContext(); }); - it("should revert when initializing with address(0) as owner", async () => { + it('should revert when initializing with address(0) as owner', async () => { await expect( - context.erc725["initialize(address)"](ethers.constants.AddressZero) - ).to.be.revertedWith( - "Ownable: new owner is the zero address" - ); + context.erc725['initialize(address)'](ethers.constants.AddressZero), + ).to.be.revertedWith('Ownable: new owner is the zero address'); }); }); }); diff --git a/implementations/test/ERC725X.behaviour.ts b/implementations/test/ERC725X.behaviour.ts index f30ebb21..2d650e3d 100644 --- a/implementations/test/ERC725X.behaviour.ts +++ b/implementations/test/ERC725X.behaviour.ts @@ -1,9 +1,9 @@ -import { ethers } from "hardhat"; -import { expect } from "chai"; +import { ethers } from 'hardhat'; +import { expect } from 'chai'; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; -import { AddressZero } from "@ethersproject/constants"; -import type { TransactionResponse } from "@ethersproject/abstract-provider"; +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; +import { AddressZero } from '@ethersproject/constants'; +import type { TransactionResponse } from '@ethersproject/abstract-provider'; // types import { @@ -19,40 +19,40 @@ import { SelfDestruct, ReturnTest__factory, SelfDestruct__factory, -} from "../types"; +} from '../types'; // bytecode for CREATE Operations import { bytecode as WithConstructorWithArgsContractBytecode, deployedBytecode as WithConstructorWithArgsContractDeployedBytecode, -} from "../artifacts/contracts/helpers/WithConstructorWithArgs.sol/WithConstructorWithArgs.json"; +} from '../artifacts/contracts/helpers/WithConstructorWithArgs.sol/WithConstructorWithArgs.json'; import { bytecode as WithConstructorWithoutArgsContractBytecode, deployedBytecode as WithConstructorWithoutArgsContractDeployedBytecode, -} from "../artifacts/contracts/helpers/WithConstructorWithoutArgs.sol/WithConstructorWithoutArgs.json"; +} from '../artifacts/contracts/helpers/WithConstructorWithoutArgs.sol/WithConstructorWithoutArgs.json'; import { bytecode as WithConstructorPayableContractBytecode, deployedBytecode as WithConstructorPayableContractDeployedBytecode, -} from "../artifacts/contracts/helpers/WithConstructorPayable.sol/WithConstructorPayable.json"; +} from '../artifacts/contracts/helpers/WithConstructorPayable.sol/WithConstructorPayable.json'; import { bytecode as WithoutConstructorContractBytecode, deployedBytecode as WithoutConstructorContractDeployedBytecode, -} from "../artifacts/contracts/helpers/WithoutConstructor.sol/WithoutConstructor.json"; +} from '../artifacts/contracts/helpers/WithoutConstructor.sol/WithoutConstructor.json'; import { bytecode as DestructableContractBytecode, deployedBytecode as DestructableContractDeployedBytecode, -} from "../artifacts/contracts/helpers/selfdestruct.sol/SelfDestruct.json"; +} from '../artifacts/contracts/helpers/selfdestruct.sol/SelfDestruct.json'; // abi -import { abi as DestructableContractABI } from "../artifacts/contracts/helpers/selfdestruct.sol/SelfDestruct.json"; +import { abi as DestructableContractABI } from '../artifacts/contracts/helpers/selfdestruct.sol/SelfDestruct.json'; // constants -import { INTERFACE_ID, OPERATION_TYPE } from "../constants"; +import { INTERFACE_ID, OPERATION_TYPE } from '../constants'; export type ERC725XTestAccounts = { owner: SignerWithAddress; @@ -81,9 +81,7 @@ export type ERC725XTestContext = { deployParams: ERC725XDeployParams; }; -export const shouldBehaveLikeERC725X = ( - buildContext: () => Promise -) => { +export const shouldBehaveLikeERC725X = (buildContext: () => Promise) => { let context: ERC725XTestContext; let provider; let valueToSend; @@ -95,33 +93,24 @@ export const shouldBehaveLikeERC725X = ( abiCoder = new ethers.utils.AbiCoder(); // fund erc725X contract - valueToSend = ethers.utils.parseEther("50"); + valueToSend = ethers.utils.parseEther('50'); await context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( - OPERATION_TYPE.CALL, - AddressZero, - 0, - "0x", - { - value: valueToSend, - } - ); + .execute(OPERATION_TYPE.CALL, AddressZero, 0, '0x', { + value: valueToSend, + }); }); - describe("When testing ownership", () => { - describe("When owner is transferring ownership", () => { - it("should pass and emit OwnershipTransferred event ", async () => { + describe('When testing ownership', () => { + describe('When owner is transferring ownership', () => { + it('should pass and emit OwnershipTransferred event ', async () => { await expect( context.erc725X .connect(context.accounts.owner) - .transferOwnership(context.accounts.anyone.address) + .transferOwnership(context.accounts.anyone.address), ) - .to.emit(context.erc725X, "OwnershipTransferred") - .withArgs( - context.accounts.owner.address, - context.accounts.anyone.address - ); + .to.emit(context.erc725X, 'OwnershipTransferred') + .withArgs(context.accounts.owner.address, context.accounts.anyone.address); const accountOwner = await context.erc725X.callStatic.owner(); @@ -129,22 +118,20 @@ export const shouldBehaveLikeERC725X = ( }); }); - describe("When non-owner is transferring ownership", () => { - it("should revert", async () => { + describe('When non-owner is transferring ownership', () => { + it('should revert', async () => { await expect( context.erc725X .connect(context.accounts.anyone) - .transferOwnership(context.accounts.anyone.address) - ).to.be.revertedWith("Ownable: caller is not the owner"); + .transferOwnership(context.accounts.anyone.address), + ).to.be.revertedWith('Ownable: caller is not the owner'); }); }); - describe("When owner is renouncing ownership", () => { - it("should pass and emit OwnershipTransferred event", async () => { - await expect( - context.erc725X.connect(context.accounts.owner).renounceOwnership() - ) - .to.emit(context.erc725X, "OwnershipTransferred") + describe('When owner is renouncing ownership', () => { + it('should pass and emit OwnershipTransferred event', async () => { + await expect(context.erc725X.connect(context.accounts.owner).renounceOwnership()) + .to.emit(context.erc725X, 'OwnershipTransferred') .withArgs(context.accounts.owner.address, AddressZero); const accountOwner = await context.erc725X.callStatic.owner(); @@ -153,25 +140,25 @@ export const shouldBehaveLikeERC725X = ( }); }); - describe("When non-owner is renouncing ownership", () => { - it("should revert", async () => { + describe('When non-owner is renouncing ownership', () => { + it('should revert', async () => { await expect( - context.erc725X.connect(context.accounts.anyone).renounceOwnership() - ).to.be.revertedWith("Ownable: caller is not the owner"); + context.erc725X.connect(context.accounts.anyone).renounceOwnership(), + ).to.be.revertedWith('Ownable: caller is not the owner'); }); }); }); - describe("When testing execution", () => { - describe("When testing the execute function", () => { - describe("When testing execution ownership", () => { - describe("When owner is executing", () => { - it("should pass and emit Executed event", async () => { + describe('When testing execution', () => { + describe('When testing the execute function', () => { + describe('When testing execution ownership', () => { + describe('When owner is executing', () => { + it('should pass and emit Executed event', async () => { const txParams = { Operation: OPERATION_TYPE.CALL, to: context.accounts.anyone.address, - value: ethers.utils.parseEther("1"), - data: "0x", + value: ethers.utils.parseEther('1'), + data: '0x', }; const balanceBefore = await context.accounts.anyone.getBalance(); @@ -179,19 +166,19 @@ export const shouldBehaveLikeERC725X = ( await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) + txParams.data, + ), ) - .to.emit(context.erc725X, "Executed") + .to.emit(context.erc725X, 'Executed') .withArgs( txParams.Operation, txParams.to, txParams.value, - "0x00000000" // no function selector + '0x00000000', // no function selector ); const balanceAfter = await context.accounts.anyone.getBalance(); @@ -199,212 +186,193 @@ export const shouldBehaveLikeERC725X = ( expect(balanceBefore.add(txParams.value)).to.equal(balanceAfter); }); }); - describe("When non-owner is executing", () => { - it("should revert", async () => { + describe('When non-owner is executing', () => { + it('should revert', async () => { const txParams = { Operation: OPERATION_TYPE.CALL, to: context.accounts.anyone.address, - value: ethers.utils.parseEther("1"), - data: "0x", + value: ethers.utils.parseEther('1'), + data: '0x', }; await expect( context.erc725X .connect(context.accounts.anyone) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) - ).to.be.revertedWith("Ownable: caller is not the owner"); + txParams.data, + ), + ).to.be.revertedWith('Ownable: caller is not the owner'); }); }); }); - describe("When testing Operation CALL", () => { - describe("When sending native token", () => { - describe("to a smart contract implementing receive()", () => { + describe('When testing Operation CALL', () => { + describe('When sending native token', () => { + describe('to a smart contract implementing receive()', () => { let receiveTester; before(async () => { // Helper contract implementing receive() function - receiveTester = await new ReceiveTester__factory( - context.accounts.anyone - ).deploy(); + receiveTester = await new ReceiveTester__factory(context.accounts.anyone).deploy(); }); - it("should pass", async () => { - const balanceBefore = await provider.getBalance( - receiveTester.address - ); + it('should pass', async () => { + const balanceBefore = await provider.getBalance(receiveTester.address); const txParams = { Operation: OPERATION_TYPE.CALL, to: receiveTester.address, - value: ethers.utils.parseEther("1"), - data: "0x", + value: ethers.utils.parseEther('1'), + data: '0x', }; await context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data + txParams.data, ); - const balanceAfter = await provider.getBalance( - receiveTester.address - ); + const balanceAfter = await provider.getBalance(receiveTester.address); expect(balanceBefore.add(txParams.value)).to.equal(balanceAfter); }); }); - describe("to a smart contract implementing payable fallback()", () => { + describe('to a smart contract implementing payable fallback()', () => { let payableFallbackContract; before(async () => { // Helper contract implementing payable fallback() function - payableFallbackContract = - await new PayableFallbackContract__factory( - context.accounts.anyone - ).deploy(); + payableFallbackContract = await new PayableFallbackContract__factory( + context.accounts.anyone, + ).deploy(); }); - it("should pass", async () => { - const balanceBefore = await provider.getBalance( - payableFallbackContract.address - ); + it('should pass', async () => { + const balanceBefore = await provider.getBalance(payableFallbackContract.address); const txParams = { Operation: OPERATION_TYPE.CALL, to: payableFallbackContract.address, - value: ethers.utils.parseEther("1"), - data: "0x", + value: ethers.utils.parseEther('1'), + data: '0x', }; await context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data + txParams.data, ); - const balanceAfter = await provider.getBalance( - payableFallbackContract.address - ); + const balanceAfter = await provider.getBalance(payableFallbackContract.address); expect(balanceBefore.add(txParams.value)).to.equal(balanceAfter); }); }); - describe("to a smart contract implementing non-payable fallback()", () => { + describe('to a smart contract implementing non-payable fallback()', () => { let nonPayableFallbackContract; before(async () => { // Helper contract implementing non-payable fallback() function - nonPayableFallbackContract = - await new NonPayableFallbackContract__factory( - context.accounts.anyone - ).deploy(); + nonPayableFallbackContract = await new NonPayableFallbackContract__factory( + context.accounts.anyone, + ).deploy(); }); - it("should revert", async () => { + it('should revert', async () => { const txParams = { Operation: OPERATION_TYPE.CALL, to: nonPayableFallbackContract.address, - value: ethers.utils.parseEther("1"), - data: "0x", + value: ethers.utils.parseEther('1'), + data: '0x', }; await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) - ).to.be.revertedWith("ERC725X: Unknown Error"); + txParams.data, + ), + ).to.be.revertedWith('ERC725X: Unknown Error'); }); }); - describe("to a smart contract not implementing receive()", () => { + describe('to a smart contract not implementing receive()', () => { let noReceive; before(async () => { // Helper contract not implementing receive() function - noReceive = await new NoReceive__factory( - context.accounts.anyone - ).deploy(); + noReceive = await new NoReceive__factory(context.accounts.anyone).deploy(); }); - it("should revert", async () => { + it('should revert', async () => { const txParams = { Operation: OPERATION_TYPE.CALL, to: noReceive.address, - value: ethers.utils.parseEther("1"), - data: "0x", + value: ethers.utils.parseEther('1'), + data: '0x', }; await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) - ).to.be.revertedWith("ERC725X: Unknown Error"); + txParams.data, + ), + ).to.be.revertedWith('ERC725X: Unknown Error'); }); }); - describe("to a smart contract implementing receive() that reverts with custom error", () => { + describe('to a smart contract implementing receive() that reverts with custom error', () => { let revertTester; before(async () => { // Helper contract implementing receive() function that revert with custom error - revertTester = await new RevertTester__factory( - context.accounts.anyone - ).deploy(); + revertTester = await new RevertTester__factory(context.accounts.anyone).deploy(); }); - it("should revert with custom errors", async () => { + it('should revert with custom errors', async () => { const txParams = { Operation: OPERATION_TYPE.CALL, to: revertTester.address, - value: ethers.utils.parseEther("1"), - data: "0x", + value: ethers.utils.parseEther('1'), + data: '0x', }; await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) + txParams.data, + ), ) - .to.be.revertedWithCustomError(revertTester, "MyCustomError") - .withArgs( - context.erc725X.address, - context.accounts.owner.address - ); + .to.be.revertedWithCustomError(revertTester, 'MyCustomError') + .withArgs(context.erc725X.address, context.accounts.owner.address); }); }); - describe("to an EOA without sending some bytes", () => { - it("should pass and emit an event with bytes4(0) as data", async () => { + describe('to an EOA without sending some bytes', () => { + it('should pass and emit an event with bytes4(0) as data', async () => { const txParams = { Operation: OPERATION_TYPE.CALL, to: context.accounts.anyone.address, - value: ethers.utils.parseEther("1"), - data: "0x", + value: ethers.utils.parseEther('1'), + data: '0x', }; const balanceBefore = await context.accounts.anyone.getBalance(); @@ -412,20 +380,15 @@ export const shouldBehaveLikeERC725X = ( await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) + txParams.data, + ), ) - .to.emit(context.erc725X, "Executed") - .withArgs( - txParams.Operation, - txParams.to, - txParams.value, - "0x00000000" - ); + .to.emit(context.erc725X, 'Executed') + .withArgs(txParams.Operation, txParams.to, txParams.value, '0x00000000'); const balanceAfter = await context.accounts.anyone.getBalance(); @@ -433,13 +396,13 @@ export const shouldBehaveLikeERC725X = ( }); }); - describe("to an EOA with sending some bytes (more than 4 bytes)", () => { - it("should pass and emit an event with first 4 bytes sent", async () => { + describe('to an EOA with sending some bytes (more than 4 bytes)', () => { + it('should pass and emit an event with first 4 bytes sent', async () => { const txParams = { Operation: OPERATION_TYPE.CALL, to: context.accounts.anyone.address, - value: ethers.utils.parseEther("1"), - data: "0xaabbccddaabbccdd", + value: ethers.utils.parseEther('1'), + data: '0xaabbccddaabbccdd', }; const balanceBefore = await context.accounts.anyone.getBalance(); @@ -447,19 +410,19 @@ export const shouldBehaveLikeERC725X = ( await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) + txParams.data, + ), ) - .to.emit(context.erc725X, "Executed") + .to.emit(context.erc725X, 'Executed') .withArgs( txParams.Operation, txParams.to, txParams.value, - txParams.data.substring(0, 10) + txParams.data.substring(0, 10), ); const balanceAfter = await context.accounts.anyone.getBalance(); @@ -468,13 +431,13 @@ export const shouldBehaveLikeERC725X = ( }); }); - describe("to an EOA with sending some bytes (less than 4 bytes)", () => { - it("should emit an event with bytes padded with 0", async () => { + describe('to an EOA with sending some bytes (less than 4 bytes)', () => { + it('should emit an event with bytes padded with 0', async () => { const txParams = { Operation: OPERATION_TYPE.CALL, to: context.accounts.anyone.address, - value: ethers.utils.parseEther("1"), - data: "0xaabb", + value: ethers.utils.parseEther('1'), + data: '0xaabb', }; const balanceBefore = await context.accounts.anyone.getBalance(); @@ -482,74 +445,60 @@ export const shouldBehaveLikeERC725X = ( await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) + txParams.data, + ), ) - .to.emit(context.erc725X, "Executed") - .withArgs( - txParams.Operation, - txParams.to, - txParams.value, - txParams.data + "0000" - ); + .to.emit(context.erc725X, 'Executed') + .withArgs(txParams.Operation, txParams.to, txParams.value, txParams.data + '0000'); const balanceAfter = await context.accounts.anyone.getBalance(); expect(balanceBefore.add(txParams.value)).to.equal(balanceAfter); }); }); - describe("without having enough balance", () => { - it("should revert", async () => { + describe('without having enough balance', () => { + it('should revert', async () => { const txParams = { Operation: OPERATION_TYPE.CALL, to: AddressZero, - value: ethers.utils.parseEther("75"), - data: "0x", + value: ethers.utils.parseEther('75'), + data: '0x', }; - const contractBalance = await provider.getBalance( - context.erc725X.address - ); + const contractBalance = await provider.getBalance(context.erc725X.address); await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) + txParams.data, + ), ) - .to.be.revertedWithCustomError( - context.erc725X, - "ERC725X_InsufficientBalance" - ) - .withArgs(contractBalance, ethers.utils.parseEther("75")); + .to.be.revertedWithCustomError(context.erc725X, 'ERC725X_InsufficientBalance') + .withArgs(contractBalance, ethers.utils.parseEther('75')); }); }); }); - describe("When interacting with functions", () => { - describe("that change the state", () => { + describe('When interacting with functions', () => { + describe('that change the state', () => { let counterContract; before(async () => { // Helper contract implementing state - counterContract = await new Counter__factory( - context.accounts.anyone - ).deploy(); + counterContract = await new Counter__factory(context.accounts.anyone).deploy(); }); - it("should pass and emit event with function selector", async () => { - const counterBeforeIncrementing = - await counterContract.callStatic.count(); + it('should pass and emit event with function selector', async () => { + const counterBeforeIncrementing = await counterContract.callStatic.count(); - const incrementCounterABI = - counterContract.interface.encodeFunctionData("increment"); + const incrementCounterABI = counterContract.interface.encodeFunctionData('increment'); const txParams = { Operation: OPERATION_TYPE.CALL, @@ -561,95 +510,81 @@ export const shouldBehaveLikeERC725X = ( await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) + txParams.data, + ), ) - .to.emit(context.erc725X, "Executed") + .to.emit(context.erc725X, 'Executed') .withArgs( txParams.Operation, txParams.to, txParams.value, - txParams.data.substring(0, 10) + txParams.data.substring(0, 10), ); - const counterAfterIncrementing = - await counterContract.callStatic.count(); + const counterAfterIncrementing = await counterContract.callStatic.count(); - expect(counterBeforeIncrementing.add(1)).to.equal( - counterAfterIncrementing - ); + expect(counterBeforeIncrementing.add(1)).to.equal(counterAfterIncrementing); }); }); - describe("that is marked payable", () => { + describe('that is marked payable', () => { let counterContract; before(async () => { // Helper contract implementing payable function - counterContract = await new Counter__factory( - context.accounts.anyone - ).deploy(); + counterContract = await new Counter__factory(context.accounts.anyone).deploy(); }); - it("should pass and emit event with function selector", async () => { - const counterBeforeIncrementing = - await counterContract.callStatic.count(); + it('should pass and emit event with function selector', async () => { + const counterBeforeIncrementing = await counterContract.callStatic.count(); const incrementWithValueCounterABI = - counterContract.interface.encodeFunctionData( - "incrementWithValue" - ); + counterContract.interface.encodeFunctionData('incrementWithValue'); const txParams = { Operation: OPERATION_TYPE.CALL, to: counterContract.address, - value: ethers.utils.parseEther("1"), + value: ethers.utils.parseEther('1'), data: incrementWithValueCounterABI, }; await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) + txParams.data, + ), ) - .to.emit(context.erc725X, "Executed") + .to.emit(context.erc725X, 'Executed') .withArgs( txParams.Operation, txParams.to, txParams.value, - txParams.data.substring(0, 10) + txParams.data.substring(0, 10), ); - const counterAfterIncrementing = - await counterContract.callStatic.count(); + const counterAfterIncrementing = await counterContract.callStatic.count(); - expect(counterBeforeIncrementing.add(1)).to.equal( - counterAfterIncrementing - ); + expect(counterBeforeIncrementing.add(1)).to.equal(counterAfterIncrementing); }); }); - describe("that is marked view", () => { + describe('that is marked view', () => { let counterContract; before(async () => { // Helper contract implementing view function - counterContract = await new Counter__factory( - context.accounts.anyone - ).deploy(); + counterContract = await new Counter__factory(context.accounts.anyone).deploy(); }); - it("should pass", async () => { + it('should pass', async () => { const counter = await counterContract.callStatic.count(); - const countCounterABI = - counterContract.interface.encodeFunctionData("count"); + const countCounterABI = counterContract.interface.encodeFunctionData('count'); const txParams = { Operation: OPERATION_TYPE.CALL, @@ -659,29 +594,26 @@ export const shouldBehaveLikeERC725X = ( }; const returnValue = await context.erc725X.callStatic[ - "execute(uint256,address,uint256,bytes)" + 'execute(uint256,address,uint256,bytes)' ](txParams.Operation, txParams.to, txParams.value, txParams.data); - const [countDecoded] = abiCoder.decode(["uint256"], returnValue); + const [countDecoded] = abiCoder.decode(['uint256'], returnValue); expect(countDecoded).to.equal(counter); }); }); - describe("that reverts with custom errors", () => { + describe('that reverts with custom errors', () => { let returnTest; before(async () => { // Helper contract implementing function that reverts with custom errors - returnTest = await new ReturnTest__factory( - context.accounts.anyone - ).deploy(); + returnTest = await new ReturnTest__factory(context.accounts.anyone).deploy(); }); - it("should revert and bubble the error", async () => { - const customErrorFunctionABI = - returnTest.interface.encodeFunctionData( - "functionThatRevertsWithCustomError" - ); + it('should revert and bubble the error', async () => { + const customErrorFunctionABI = returnTest.interface.encodeFunctionData( + 'functionThatRevertsWithCustomError', + ); const txParams = { Operation: OPERATION_TYPE.CALL, @@ -693,33 +625,30 @@ export const shouldBehaveLikeERC725X = ( await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) - ).to.be.revertedWithCustomError(returnTest, "Bang"); + txParams.data, + ), + ).to.be.revertedWithCustomError(returnTest, 'Bang'); }); }); - describe("that reverts with string errors", () => { + describe('that reverts with string errors', () => { let returnTest; before(async () => { // Helper contract implementing function that reverts with string errors - returnTest = await new ReturnTest__factory( - context.accounts.anyone - ).deploy(); + returnTest = await new ReturnTest__factory(context.accounts.anyone).deploy(); }); - it("should revert with string and bubble the error", async () => { - let errorString = "Oh! I revert"; + it('should revert with string and bubble the error', async () => { + let errorString = 'Oh! I revert'; - const stringErrorFunctionABI = - returnTest.interface.encodeFunctionData( - "functionThatRevertsWithErrorString", - [errorString] - ); + const stringErrorFunctionABI = returnTest.interface.encodeFunctionData( + 'functionThatRevertsWithErrorString', + [errorString], + ); const txParams = { Operation: OPERATION_TYPE.CALL, @@ -731,35 +660,32 @@ export const shouldBehaveLikeERC725X = ( await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) + txParams.data, + ), ).to.be.revertedWith(errorString); }); }); - describe("that returns", () => { - describe("arrays of strings", () => { + describe('that returns', () => { + describe('arrays of strings', () => { let returnTest; before(async () => { // Helper contract implementing function that return - returnTest = await new ReturnTest__factory( - context.accounts.anyone - ).deploy(); + returnTest = await new ReturnTest__factory(context.accounts.anyone).deploy(); }); - it("should pass and return bytes and decode their values", async () => { - const namesArrays = ["Alice", "Bob"]; - const randomStringsArrays = ["LUKSO", "CreativeEconomy"]; + it('should pass and return bytes and decode their values', async () => { + const namesArrays = ['Alice', 'Bob']; + const randomStringsArrays = ['LUKSO', 'CreativeEconomy']; - const returnSomeStringsABI = - returnTest.interface.encodeFunctionData("returnSomeStrings", [ - namesArrays, - randomStringsArrays, - ]); + const returnSomeStringsABI = returnTest.interface.encodeFunctionData( + 'returnSomeStrings', + [namesArrays, randomStringsArrays], + ); const txParams = { Operation: OPERATION_TYPE.CALL, @@ -769,18 +695,10 @@ export const shouldBehaveLikeERC725X = ( }; const returnValue = await context.erc725X.callStatic[ - "execute(uint256,address,uint256,bytes)" - ]( - txParams.Operation, - txParams.to, - txParams.value, - txParams.data - ); + 'execute(uint256,address,uint256,bytes)' + ](txParams.Operation, txParams.to, txParams.value, txParams.data); - const arrays = abiCoder.decode( - ["string[]", "string[]"], - returnValue - ); + const arrays = abiCoder.decode(['string[]', 'string[]'], returnValue); expect(arrays[0]).to.deep.equal(namesArrays); expect(arrays[1]).to.deep.equal(randomStringsArrays); @@ -792,35 +710,35 @@ export const shouldBehaveLikeERC725X = ( }); }); - describe("When testing Operation CREATE", () => { - describe("When creating a contract", () => { - describe("without passing the contract deployment code", () => { - it("should revert", async () => { + describe('When testing Operation CREATE', () => { + describe('When creating a contract', () => { + describe('without passing the contract deployment code', () => { + it('should revert', async () => { const txParams = { Operation: OPERATION_TYPE.CREATE, to: AddressZero, value: 0, - data: "0x", + data: '0x', }; await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) + txParams.data, + ), ).to.be.revertedWithCustomError( context.erc725X, - "ERC725X_NoContractBytecodeProvided" + 'ERC725X_NoContractBytecodeProvided', ); }); }); - describe("without constructor", () => { - it("should create the contract and emit ContractCreated event", async () => { + describe('without constructor', () => { + it('should create the contract and emit ContractCreated event', async () => { const txParams = { Operation: OPERATION_TYPE.CREATE, to: AddressZero, @@ -830,55 +748,46 @@ export const shouldBehaveLikeERC725X = ( const addressContractCreated = await context.erc725X .connect(context.accounts.owner) - .callStatic["execute(uint256,address,uint256,bytes)"]( + .callStatic.execute( txParams.Operation, txParams.to, txParams.value, - txParams.data + txParams.data, ); - const addressContractCreatedChecksumed = ethers.utils.getAddress( - addressContractCreated - ); + const addressContractCreatedChecksumed = + ethers.utils.getAddress(addressContractCreated); await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) + txParams.data, + ), ) - .to.emit(context.erc725X, "ContractCreated") + .to.emit(context.erc725X, 'ContractCreated') .withArgs( txParams.Operation, addressContractCreatedChecksumed, txParams.value, - ethers.utils.hexZeroPad("0x00", 32) + ethers.utils.hexZeroPad('0x00', 32), ); - const codeRetreived = await provider.getCode( - addressContractCreated - ); + const codeRetreived = await provider.getCode(addressContractCreated); - expect(codeRetreived).to.equal( - WithoutConstructorContractDeployedBytecode - ); + expect(codeRetreived).to.equal(WithoutConstructorContractDeployedBytecode); }); }); - describe("with constructor with arguments", () => { - it("should create the contract and emit ContractCreated event", async () => { - const argument = abiCoder.encode( - ["address"], - [context.accounts.anyone.address] - ); + describe('with constructor with arguments', () => { + it('should create the contract and emit ContractCreated event', async () => { + const argument = abiCoder.encode(['address'], [context.accounts.anyone.address]); // Bytecode + arguments - const initCode = - WithConstructorWithArgsContractBytecode + argument.substring(2); + const initCode = WithConstructorWithArgsContractBytecode + argument.substring(2); const txParams = { Operation: OPERATION_TYPE.CREATE, @@ -889,47 +798,42 @@ export const shouldBehaveLikeERC725X = ( const addressContractCreated = await context.erc725X .connect(context.accounts.owner) - .callStatic["execute(uint256,address,uint256,bytes)"]( + .callStatic.execute( txParams.Operation, txParams.to, txParams.value, - txParams.data + txParams.data, ); - const addressContractCreatedChecksumed = ethers.utils.getAddress( - addressContractCreated - ); + const addressContractCreatedChecksumed = + ethers.utils.getAddress(addressContractCreated); await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) + txParams.data, + ), ) - .to.emit(context.erc725X, "ContractCreated") + .to.emit(context.erc725X, 'ContractCreated') .withArgs( txParams.Operation, addressContractCreatedChecksumed, txParams.value, - ethers.utils.hexZeroPad("0x00", 32) + ethers.utils.hexZeroPad('0x00', 32), ); - const codeRetreived = await provider.getCode( - addressContractCreated - ); + const codeRetreived = await provider.getCode(addressContractCreated); - expect(codeRetreived).to.equal( - WithConstructorWithArgsContractDeployedBytecode - ); + expect(codeRetreived).to.equal(WithConstructorWithArgsContractDeployedBytecode); }); }); - describe("with constructor without arguments", () => { - it("should create the contract and emit ContractCreated event", async () => { + describe('with constructor without arguments', () => { + it('should create the contract and emit ContractCreated event', async () => { const txParams = { Operation: OPERATION_TYPE.CREATE, to: AddressZero, @@ -939,47 +843,42 @@ export const shouldBehaveLikeERC725X = ( const addressContractCreated = await context.erc725X .connect(context.accounts.owner) - .callStatic["execute(uint256,address,uint256,bytes)"]( + .callStatic.execute( txParams.Operation, txParams.to, txParams.value, - txParams.data + txParams.data, ); - const addressContractCreatedChecksumed = ethers.utils.getAddress( - addressContractCreated - ); + const addressContractCreatedChecksumed = + ethers.utils.getAddress(addressContractCreated); await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) + txParams.data, + ), ) - .to.emit(context.erc725X, "ContractCreated") + .to.emit(context.erc725X, 'ContractCreated') .withArgs( txParams.Operation, addressContractCreatedChecksumed, txParams.value, - ethers.utils.hexZeroPad("0x00", 32) + ethers.utils.hexZeroPad('0x00', 32), ); - const codeRetreived = await provider.getCode( - addressContractCreated - ); + const codeRetreived = await provider.getCode(addressContractCreated); - expect(codeRetreived).to.equal( - WithConstructorWithoutArgsContractDeployedBytecode - ); + expect(codeRetreived).to.equal(WithConstructorWithoutArgsContractDeployedBytecode); }); }); - describe("with constructor with arguments but without passing them", () => { - it("should revert and not create the contract", async () => { + describe('with constructor with arguments but without passing them', () => { + it('should revert and not create the contract', async () => { // Bytecode + the needed argument const initCode = WithConstructorWithArgsContractBytecode; // without the needed argument @@ -993,21 +892,18 @@ export const shouldBehaveLikeERC725X = ( await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) - ).to.be.revertedWithCustomError( - context.erc725X, - "ERC725X_ContractDeploymentFailed" - ); + txParams.data, + ), + ).to.be.revertedWithCustomError(context.erc725X, 'ERC725X_ContractDeploymentFailed'); }); }); - describe("without specifying to as address(0)", () => { - it("should revert and not create the contract", async () => { + describe('without specifying to as address(0)', () => { + it('should revert and not create the contract', async () => { const txParams = { Operation: OPERATION_TYPE.CREATE, to: context.accounts.anyone.address, // should be the AddressZero when creating contract @@ -1018,136 +914,121 @@ export const shouldBehaveLikeERC725X = ( await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) + txParams.data, + ), ).to.be.revertedWithCustomError( context.erc725X, - "ERC725X_CreateOperationsRequireEmptyRecipientAddress" + 'ERC725X_CreateOperationsRequireEmptyRecipientAddress', ); }); }); - describe("that have a payable constructor with sending value ", () => { - it("should create the contract and emit ContractCreated event", async () => { + describe('that have a payable constructor with sending value ', () => { + it('should create the contract and emit ContractCreated event', async () => { const txParams = { Operation: OPERATION_TYPE.CREATE, to: AddressZero, - value: ethers.utils.parseEther("10"), + value: ethers.utils.parseEther('10'), data: WithConstructorPayableContractBytecode, }; const addressContractCreated = await context.erc725X .connect(context.accounts.owner) - .callStatic["execute(uint256,address,uint256,bytes)"]( + .callStatic.execute( txParams.Operation, txParams.to, txParams.value, - txParams.data + txParams.data, ); - const addressContractCreatedChecksumed = ethers.utils.getAddress( - addressContractCreated - ); + const addressContractCreatedChecksumed = + ethers.utils.getAddress(addressContractCreated); await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) + txParams.data, + ), ) - .to.emit(context.erc725X, "ContractCreated") + .to.emit(context.erc725X, 'ContractCreated') .withArgs( txParams.Operation, addressContractCreatedChecksumed, txParams.value, - ethers.utils.hexZeroPad("0x00", 32) + ethers.utils.hexZeroPad('0x00', 32), ); - const codeRetreived = await provider.getCode( - addressContractCreated - ); + const codeRetreived = await provider.getCode(addressContractCreated); - expect( - await provider.getBalance(addressContractCreated) - ).to.equal(txParams.value); + expect(await provider.getBalance(addressContractCreated)).to.equal(txParams.value); - expect(codeRetreived).to.equal( - WithConstructorPayableContractDeployedBytecode - ); + expect(codeRetreived).to.equal(WithConstructorPayableContractDeployedBytecode); }); }); - describe("that have a payable constructor with sending value more than balance ", () => { - it("should revert and not create the contract", async () => { + describe('that have a payable constructor with sending value more than balance ', () => { + it('should revert and not create the contract', async () => { const txParams = { Operation: OPERATION_TYPE.CREATE, to: AddressZero, - value: ethers.utils.parseEther("90"), + value: ethers.utils.parseEther('90'), data: WithConstructorPayableContractBytecode, }; - const contractBalance = await provider.getBalance( - context.erc725X.address - ); + const contractBalance = await provider.getBalance(context.erc725X.address); await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) + txParams.data, + ), ) - .to.be.revertedWithCustomError( - context.erc725X, - "ERC725X_InsufficientBalance" - ) - .withArgs(contractBalance, ethers.utils.parseEther("90")); + .to.be.revertedWithCustomError(context.erc725X, 'ERC725X_InsufficientBalance') + .withArgs(contractBalance, ethers.utils.parseEther('90')); }); }); describe("that doesn't have a payable constructor with sending value ", () => { - it("should revert and not create the contract", async () => { + it('should revert and not create the contract', async () => { const txParams = { Operation: OPERATION_TYPE.CREATE, to: AddressZero, - value: ethers.utils.parseEther("10"), + value: ethers.utils.parseEther('10'), data: WithConstructorWithoutArgsContractBytecode, }; await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) - ).to.be.revertedWithCustomError( - context.erc725X, - "ERC725X_ContractDeploymentFailed" - ); + txParams.data, + ), + ).to.be.revertedWithCustomError(context.erc725X, 'ERC725X_ContractDeploymentFailed'); }); }); }); }); - describe("When testing Operation CREATE2", () => { - describe("When creating a contract", () => { - describe("without constructor", () => { - it("should create the contract and emit ContractCreated event", async () => { - const salt = ethers.utils.formatBytes32String("LUKSO"); + describe('When testing Operation CREATE2', () => { + describe('When creating a contract', () => { + describe('without constructor', () => { + it('should create the contract and emit ContractCreated event', async () => { + const salt = ethers.utils.formatBytes32String('LUKSO'); const txParams = { Operation: OPERATION_TYPE.CREATE2, @@ -1158,59 +1039,49 @@ export const shouldBehaveLikeERC725X = ( const addressContractCreated = await context.erc725X .connect(context.accounts.owner) - .callStatic["execute(uint256,address,uint256,bytes)"]( + .callStatic.execute( txParams.Operation, txParams.to, txParams.value, - txParams.data + txParams.data, ); - const addressContractCreatedChecksumed = ethers.utils.getAddress( - addressContractCreated - ); + const addressContractCreatedChecksumed = + ethers.utils.getAddress(addressContractCreated); await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) + txParams.data, + ), ) - .to.emit(context.erc725X, "ContractCreated") + .to.emit(context.erc725X, 'ContractCreated') .withArgs( txParams.Operation, addressContractCreatedChecksumed, txParams.value, - salt + salt, ); - const codeRetreived = await provider.getCode( - addressContractCreated - ); + const codeRetreived = await provider.getCode(addressContractCreated); - expect(codeRetreived).to.equal( - WithoutConstructorContractDeployedBytecode - ); + expect(codeRetreived).to.equal(WithoutConstructorContractDeployedBytecode); }); }); - describe("with constructor with arguments", () => { - it("should create the contract and emit ContractCreated event", async () => { - const salt = ethers.utils.formatBytes32String("LUKSO"); + describe('with constructor with arguments', () => { + it('should create the contract and emit ContractCreated event', async () => { + const salt = ethers.utils.formatBytes32String('LUKSO'); - const argument = abiCoder.encode( - ["address"], - [context.accounts.anyone.address] - ); + const argument = abiCoder.encode(['address'], [context.accounts.anyone.address]); // Bytecode + arguments const initCode = - WithConstructorWithArgsContractBytecode + - argument.substring(2) + - salt.substring(2); + WithConstructorWithArgsContractBytecode + argument.substring(2) + salt.substring(2); const txParams = { Operation: OPERATION_TYPE.CREATE2, @@ -1221,105 +1092,92 @@ export const shouldBehaveLikeERC725X = ( const addressContractCreated = await context.erc725X .connect(context.accounts.owner) - .callStatic["execute(uint256,address,uint256,bytes)"]( + .callStatic.execute( txParams.Operation, txParams.to, txParams.value, - txParams.data + txParams.data, ); - const addressContractCreatedChecksumed = ethers.utils.getAddress( - addressContractCreated - ); + const addressContractCreatedChecksumed = + ethers.utils.getAddress(addressContractCreated); await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) + txParams.data, + ), ) - .to.emit(context.erc725X, "ContractCreated") + .to.emit(context.erc725X, 'ContractCreated') .withArgs( txParams.Operation, addressContractCreatedChecksumed, txParams.value, - salt + salt, ); - const codeRetreived = await provider.getCode( - addressContractCreated - ); + const codeRetreived = await provider.getCode(addressContractCreated); - expect(codeRetreived).to.equal( - WithConstructorWithArgsContractDeployedBytecode - ); + expect(codeRetreived).to.equal(WithConstructorWithArgsContractDeployedBytecode); }); }); - describe("with constructor without arguments", () => { - it("should create the contract and emit ContractCreated event", async () => { - const salt = ethers.utils.formatBytes32String("LUKSO"); + describe('with constructor without arguments', () => { + it('should create the contract and emit ContractCreated event', async () => { + const salt = ethers.utils.formatBytes32String('LUKSO'); const txParams = { Operation: OPERATION_TYPE.CREATE2, to: AddressZero, value: 0, - data: - WithConstructorWithoutArgsContractBytecode + - salt.substring(2), + data: WithConstructorWithoutArgsContractBytecode + salt.substring(2), }; const addressContractCreated = await context.erc725X .connect(context.accounts.owner) - .callStatic["execute(uint256,address,uint256,bytes)"]( + .callStatic.execute( txParams.Operation, txParams.to, txParams.value, - txParams.data + txParams.data, ); - const addressContractCreatedChecksumed = ethers.utils.getAddress( - addressContractCreated - ); + const addressContractCreatedChecksumed = + ethers.utils.getAddress(addressContractCreated); await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) + txParams.data, + ), ) - .to.emit(context.erc725X, "ContractCreated") + .to.emit(context.erc725X, 'ContractCreated') .withArgs( txParams.Operation, addressContractCreatedChecksumed, txParams.value, - salt + salt, ); - const codeRetreived = await provider.getCode( - addressContractCreated - ); + const codeRetreived = await provider.getCode(addressContractCreated); - expect(codeRetreived).to.equal( - WithConstructorWithoutArgsContractDeployedBytecode - ); + expect(codeRetreived).to.equal(WithConstructorWithoutArgsContractDeployedBytecode); }); }); - describe("with constructor with arguments but without passing them", () => { - it("should revert and not create the contract", async () => { - const salt = ethers.utils.formatBytes32String("LUKSO"); + describe('with constructor with arguments but without passing them', () => { + it('should revert and not create the contract', async () => { + const salt = ethers.utils.formatBytes32String('LUKSO'); // Bytecode + the needed argument - const initCode = - WithConstructorWithArgsContractBytecode + salt.substring(2); // without the needed argument + const initCode = WithConstructorWithArgsContractBytecode + salt.substring(2); // without the needed argument const txParams = { Operation: OPERATION_TYPE.CREATE2, @@ -1331,26 +1189,22 @@ export const shouldBehaveLikeERC725X = ( await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) - ).to.be.revertedWith("Create2: Failed on deploy"); + txParams.data, + ), + ).to.be.revertedWith('Create2: Failed on deploy'); }); }); - describe("with constructor with arguments but without passing the salt", () => { - it("should revert and not create the contract", async () => { - const argument = abiCoder.encode( - ["address"], - [context.accounts.anyone.address] - ); + describe('with constructor with arguments but without passing the salt', () => { + it('should revert and not create the contract', async () => { + const argument = abiCoder.encode(['address'], [context.accounts.anyone.address]); // Bytecode + arguments - const initCode = - WithConstructorWithArgsContractBytecode + argument.substring(2); + const initCode = WithConstructorWithArgsContractBytecode + argument.substring(2); const txParams = { Operation: OPERATION_TYPE.CREATE2, @@ -1362,19 +1216,19 @@ export const shouldBehaveLikeERC725X = ( await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) - ).to.be.revertedWith("Create2: Failed on deploy"); + txParams.data, + ), + ).to.be.revertedWith('Create2: Failed on deploy'); }); }); - describe("without specifying to as address(0)", () => { - it("should revert and not create the contract", async () => { - const salt = ethers.utils.formatBytes32String("LUKSO"); + describe('without specifying to as address(0)', () => { + it('should revert and not create the contract', async () => { + const salt = ethers.utils.formatBytes32String('LUKSO'); const txParams = { Operation: OPERATION_TYPE.CREATE2, @@ -1386,198 +1240,178 @@ export const shouldBehaveLikeERC725X = ( await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) + txParams.data, + ), ).to.be.revertedWithCustomError( context.erc725X, - "ERC725X_CreateOperationsRequireEmptyRecipientAddress" + 'ERC725X_CreateOperationsRequireEmptyRecipientAddress', ); }); }); - describe("that have a payable constructor with sending value ", () => { - it("should create the contract and emit ContractCreated event", async () => { - const salt = ethers.utils.formatBytes32String("LUKSO"); + describe('that have a payable constructor with sending value ', () => { + it('should create the contract and emit ContractCreated event', async () => { + const salt = ethers.utils.formatBytes32String('LUKSO'); const txParams = { Operation: OPERATION_TYPE.CREATE2, to: AddressZero, - value: ethers.utils.parseEther("10"), - data: - WithConstructorPayableContractBytecode + salt.substring(2), + value: ethers.utils.parseEther('10'), + data: WithConstructorPayableContractBytecode + salt.substring(2), }; const addressContractCreated = await context.erc725X .connect(context.accounts.owner) - .callStatic["execute(uint256,address,uint256,bytes)"]( + .callStatic.execute( txParams.Operation, txParams.to, txParams.value, - txParams.data + txParams.data, ); - const addressContractCreatedChecksumed = ethers.utils.getAddress( - addressContractCreated - ); + const addressContractCreatedChecksumed = + ethers.utils.getAddress(addressContractCreated); await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) + txParams.data, + ), ) - .to.emit(context.erc725X, "ContractCreated") + .to.emit(context.erc725X, 'ContractCreated') .withArgs( txParams.Operation, addressContractCreatedChecksumed, txParams.value, - salt + salt, ); - const codeRetreived = await provider.getCode( - addressContractCreated - ); + const codeRetreived = await provider.getCode(addressContractCreated); - expect( - await provider.getBalance(addressContractCreated) - ).to.equal(txParams.value); + expect(await provider.getBalance(addressContractCreated)).to.equal(txParams.value); - expect(codeRetreived).to.equal( - WithConstructorPayableContractDeployedBytecode - ); + expect(codeRetreived).to.equal(WithConstructorPayableContractDeployedBytecode); }); }); - describe("that have a payable constructor with sending value more than balance ", () => { - it("should revert and not create the contract", async () => { - const salt = ethers.utils.formatBytes32String("LUKSO"); + describe('that have a payable constructor with sending value more than balance ', () => { + it('should revert and not create the contract', async () => { + const salt = ethers.utils.formatBytes32String('LUKSO'); const txParams = { Operation: OPERATION_TYPE.CREATE2, to: AddressZero, - value: ethers.utils.parseEther("90"), - data: - WithConstructorPayableContractBytecode + salt.substring(2), + value: ethers.utils.parseEther('90'), + data: WithConstructorPayableContractBytecode + salt.substring(2), }; await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) - ).to.be.revertedWith( - "Create2: insufficient balance" - ); + txParams.data, + ), + ).to.be.revertedWith('Create2: insufficient balance'); }); }); describe("that doesn't have a payable constructor with sending value ", () => { - it("should revert and not create the contract", async () => { - const salt = ethers.utils.formatBytes32String("LUKSO"); + it('should revert and not create the contract', async () => { + const salt = ethers.utils.formatBytes32String('LUKSO'); const txParams = { Operation: OPERATION_TYPE.CREATE2, to: AddressZero, - value: ethers.utils.parseEther("10"), - data: - WithConstructorWithoutArgsContractBytecode + - salt.substring(2), + value: ethers.utils.parseEther('10'), + data: WithConstructorWithoutArgsContractBytecode + salt.substring(2), }; await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) - ).to.be.revertedWith("Create2: Failed on deploy"); + txParams.data, + ), + ).to.be.revertedWith('Create2: Failed on deploy'); }); }); - describe("with the same bytecode and salt ", () => { - it("should create the contract first time and revert on the second try", async () => { - const salt = ethers.utils.formatBytes32String("LUKSO"); + describe('with the same bytecode and salt ', () => { + it('should create the contract first time and revert on the second try', async () => { + const salt = ethers.utils.formatBytes32String('LUKSO'); const txParams = { Operation: OPERATION_TYPE.CREATE2, to: AddressZero, value: 0, - data: - WithConstructorWithoutArgsContractBytecode + - salt.substring(2), + data: WithConstructorWithoutArgsContractBytecode + salt.substring(2), }; const addressContractCreated = await context.erc725X .connect(context.accounts.owner) - .callStatic["execute(uint256,address,uint256,bytes)"]( + .callStatic.execute( txParams.Operation, txParams.to, txParams.value, - txParams.data + txParams.data, ); - const addressContractCreatedChecksumed = ethers.utils.getAddress( - addressContractCreated - ); + const addressContractCreatedChecksumed = + ethers.utils.getAddress(addressContractCreated); await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) + txParams.data, + ), ) - .to.emit(context.erc725X, "ContractCreated") + .to.emit(context.erc725X, 'ContractCreated') .withArgs( txParams.Operation, addressContractCreatedChecksumed, txParams.value, - salt + salt, ); - const codeRetreived = await provider.getCode( - addressContractCreated - ); + const codeRetreived = await provider.getCode(addressContractCreated); - expect(codeRetreived).to.equal( - WithConstructorWithoutArgsContractDeployedBytecode - ); + expect(codeRetreived).to.equal(WithConstructorWithoutArgsContractDeployedBytecode); // Second try with same parameters await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) - ).to.be.revertedWith("Create2: Failed on deploy"); + txParams.data, + ), + ).to.be.revertedWith('Create2: Failed on deploy'); }); }); - describe("and destructing it and re-create it at the same address", () => { - it("should pass", async () => { - const salt = ethers.utils.formatBytes32String("LUKSO"); + describe('and destructing it and re-create it at the same address', () => { + it('should pass', async () => { + const salt = ethers.utils.formatBytes32String('LUKSO'); const txParams = { Operation: OPERATION_TYPE.CREATE2, to: AddressZero, @@ -1586,128 +1420,111 @@ export const shouldBehaveLikeERC725X = ( }; const addressContractCreated = await context.erc725X .connect(context.accounts.owner) - .callStatic["execute(uint256,address,uint256,bytes)"]( + .callStatic.execute( txParams.Operation, txParams.to, txParams.value, - txParams.data + txParams.data, ); await context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data + txParams.data, ); const destructableContract = await new ethers.Contract( addressContractCreated, - DestructableContractABI - ); - const codeRetreivedBeforeDestructing = await provider.getCode( - addressContractCreated - ); - expect(codeRetreivedBeforeDestructing).to.equal( - DestructableContractDeployedBytecode - ); - await destructableContract - .connect(context.accounts.anyone) - .destroyMe(); - const codeRetreivedAfterDestructing = await provider.getCode( - addressContractCreated + DestructableContractABI, ); - expect(codeRetreivedAfterDestructing).to.equal("0x"); + const codeRetreivedBeforeDestructing = await provider.getCode(addressContractCreated); + expect(codeRetreivedBeforeDestructing).to.equal(DestructableContractDeployedBytecode); + await destructableContract.connect(context.accounts.anyone).destroyMe(); + const codeRetreivedAfterDestructing = await provider.getCode(addressContractCreated); + expect(codeRetreivedAfterDestructing).to.equal('0x'); // re-creating await context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data + txParams.data, ); - const codeRetreivedAfterReCreating = await provider.getCode( - addressContractCreated - ); - expect(codeRetreivedAfterReCreating).to.equal( - codeRetreivedBeforeDestructing - ); - expect(codeRetreivedAfterReCreating).to.equal( - DestructableContractDeployedBytecode - ); + const codeRetreivedAfterReCreating = await provider.getCode(addressContractCreated); + expect(codeRetreivedAfterReCreating).to.equal(codeRetreivedBeforeDestructing); + expect(codeRetreivedAfterReCreating).to.equal(DestructableContractDeployedBytecode); }); }); }); }); - describe("When testing Operation STATICCALL", () => { - describe("When interacting with a EOA", () => { - describe("When sendng some bytes", () => { - it("should pass and emit an event with data sent", async () => { + describe('When testing Operation STATICCALL', () => { + describe('When interacting with a EOA', () => { + describe('When sendng some bytes', () => { + it('should pass and emit an event with data sent', async () => { const txParams = { Operation: OPERATION_TYPE.STATICCALL, to: context.accounts.anyone.address, value: 0, - data: "0xaabbccdd", + data: '0xaabbccdd', }; await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) + txParams.data, + ), ) - .to.emit(context.erc725X, "Executed") + .to.emit(context.erc725X, 'Executed') .withArgs( txParams.Operation, txParams.to, txParams.value, - txParams.data.substring(0, 10) + txParams.data.substring(0, 10), ); }); }); - describe("When sendng value", () => { - it("should revert ", async () => { + describe('When sendng value', () => { + it('should revert ', async () => { const txParams = { Operation: OPERATION_TYPE.STATICCALL, to: context.accounts.anyone.address, - value: ethers.utils.parseEther("10"), - data: "0xaabbccdd", + value: ethers.utils.parseEther('10'), + data: '0xaabbccdd', }; await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) + txParams.data, + ), ).to.be.revertedWithCustomError( context.erc725X, - "ERC725X_MsgValueDisallowedInStaticCall" + 'ERC725X_MsgValueDisallowedInStaticCall', ); }); }); }); - describe("When interacting with a function", () => { - describe("that change state", () => { + describe('When interacting with a function', () => { + describe('that change state', () => { let counterContract; before(async () => { // Helper contract implementing state - counterContract = await new Counter__factory( - context.accounts.anyone - ).deploy(); + counterContract = await new Counter__factory(context.accounts.anyone).deploy(); }); - it("should revert", async () => { - const incrementCounterABI = - counterContract.interface.encodeFunctionData("increment"); + it('should revert', async () => { + const incrementCounterABI = counterContract.interface.encodeFunctionData('increment'); const txParams = { Operation: OPERATION_TYPE.STATICCALL, @@ -1719,32 +1536,29 @@ export const shouldBehaveLikeERC725X = ( await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) - ).to.be.revertedWith("ERC725X: Unknown Error"); + txParams.data, + ), + ).to.be.revertedWith('ERC725X: Unknown Error'); }); }); - describe("marked as view", () => { + describe('marked as view', () => { let counterContract; before(async () => { // Helper contract implementing view function - counterContract = await new Counter__factory( - context.accounts.anyone - ).deploy(); + counterContract = await new Counter__factory(context.accounts.anyone).deploy(); }); - it("should pass", async () => { + it('should pass', async () => { const getValue = await counterContract .connect(context.accounts.anyone) .callStatic.get(); - const getABI = - counterContract.interface.encodeFunctionData("get"); + const getABI = counterContract.interface.encodeFunctionData('get'); const txParams = { Operation: OPERATION_TYPE.STATICCALL, @@ -1755,30 +1569,27 @@ export const shouldBehaveLikeERC725X = ( const result = await context.erc725X .connect(context.accounts.owner) - .callStatic["execute(uint256,address,uint256,bytes)"]( + .callStatic.execute( txParams.Operation, txParams.to, txParams.value, - txParams.data + txParams.data, ); expect(result).to.equal(getValue); }); }); - describe("that reverts with a custom error", () => { + describe('that reverts with a custom error', () => { let revertTester; before(async () => { // Helper contract implementing function that reverts with custom errors - revertTester = await new RevertTester__factory( - context.accounts.anyone - ).deploy(); + revertTester = await new RevertTester__factory(context.accounts.anyone).deploy(); }); - it("should revert", async () => { - const revertMeWithCustomErrorViewABI = - revertTester.interface.encodeFunctionData( - "revertMeWithCustomErrorView" - ); + it('should revert', async () => { + const revertMeWithCustomErrorViewABI = revertTester.interface.encodeFunctionData( + 'revertMeWithCustomErrorView', + ); const txParams = { Operation: OPERATION_TYPE.STATICCALL, @@ -1790,34 +1601,27 @@ export const shouldBehaveLikeERC725X = ( await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) + txParams.data, + ), ) - .to.be.revertedWithCustomError(revertTester, "MyCustomError") - .withArgs( - context.erc725X.address, - context.accounts.owner.address - ); + .to.be.revertedWithCustomError(revertTester, 'MyCustomError') + .withArgs(context.erc725X.address, context.accounts.owner.address); }); }); - describe("that reverts with a string error", () => { + describe('that reverts with a string error', () => { let revertTester; before(async () => { // Helper contract implementing function that reverts with string errors - revertTester = await new RevertTester__factory( - context.accounts.anyone - ).deploy(); + revertTester = await new RevertTester__factory(context.accounts.anyone).deploy(); }); - it("should revert", async () => { + it('should revert', async () => { const revertMeWithStringViewABI = - revertTester.interface.encodeFunctionData( - "revertMeWithStringView" - ); + revertTester.interface.encodeFunctionData('revertMeWithStringView'); const txParams = { Operation: OPERATION_TYPE.STATICCALL, @@ -1829,59 +1633,56 @@ export const shouldBehaveLikeERC725X = ( await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) - ).to.be.revertedWith("I reverted"); + txParams.data, + ), + ).to.be.revertedWith('I reverted'); }); }); }); }); - describe("When testing Operation DELEGATECALL", () => { - describe("When interacting with a EOA", () => { - describe("When sendng value", () => { - it("should revert ", async () => { + describe('When testing Operation DELEGATECALL', () => { + describe('When interacting with a EOA', () => { + describe('When sendng value', () => { + it('should revert ', async () => { const txParams = { Operation: OPERATION_TYPE.DELEGATECALL, to: context.accounts.anyone.address, - value: ethers.utils.parseEther("10"), - data: "0xaabbccdd", + value: ethers.utils.parseEther('10'), + data: '0xaabbccdd', }; await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) + txParams.data, + ), ).to.be.revertedWithCustomError( context.erc725X, - "ERC725X_MsgValueDisallowedInDelegateCall" + 'ERC725X_MsgValueDisallowedInDelegateCall', ); }); }); }); - describe("When interacting with a function", () => { - describe("that reverts with a custom error", () => { + describe('When interacting with a function', () => { + describe('that reverts with a custom error', () => { let revertTester; before(async () => { // Helper contract implementing function that reverts with custom errors - revertTester = await new RevertTester__factory( - context.accounts.anyone - ).deploy(); + revertTester = await new RevertTester__factory(context.accounts.anyone).deploy(); }); - it("should revert", async () => { - const revertMeWithCustomErrorNotViewABI = - revertTester.interface.encodeFunctionData( - "revertMeWithCustomErrorNotView" - ); + it('should revert', async () => { + const revertMeWithCustomErrorNotViewABI = revertTester.interface.encodeFunctionData( + 'revertMeWithCustomErrorNotView', + ); const txParams = { Operation: OPERATION_TYPE.STATICCALL, @@ -1893,34 +1694,28 @@ export const shouldBehaveLikeERC725X = ( await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) + txParams.data, + ), ) - .to.be.revertedWithCustomError(revertTester, "MyCustomError") - .withArgs( - context.erc725X.address, - context.accounts.owner.address - ); + .to.be.revertedWithCustomError(revertTester, 'MyCustomError') + .withArgs(context.erc725X.address, context.accounts.owner.address); }); }); - describe("that reverts with a string error", () => { + describe('that reverts with a string error', () => { let revertTester; before(async () => { // Helper contract implementing function that reverts with string errors - revertTester = await new RevertTester__factory( - context.accounts.anyone - ).deploy(); + revertTester = await new RevertTester__factory(context.accounts.anyone).deploy(); }); - it("should revert", async () => { - const revertMeWithStringErrorNotViewABI = - revertTester.interface.encodeFunctionData( - "revertMeWithStringErrorNotView" - ); + it('should revert', async () => { + const revertMeWithStringErrorNotViewABI = revertTester.interface.encodeFunctionData( + 'revertMeWithStringErrorNotView', + ); const txParams = { Operation: OPERATION_TYPE.STATICCALL, @@ -1932,26 +1727,26 @@ export const shouldBehaveLikeERC725X = ( await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) - ).to.be.revertedWith("I reverted"); + txParams.data, + ), + ).to.be.revertedWith('I reverted'); }); }); - describe("that include selfdestruct", () => { + describe('that include selfdestruct', () => { let destructableContract; before(async () => { destructableContract = await new SelfDestruct__factory( - context.accounts.anyone + context.accounts.anyone, ).deploy(); }); - it("should destroy the erc725X contract", async () => { + it('should destroy the erc725X contract', async () => { const destroyFunctionABI = - destructableContract.interface.encodeFunctionData("destroyMe"); + destructableContract.interface.encodeFunctionData('destroyMe'); const txParams = { Operation: OPERATION_TYPE.DELEGATECALL, @@ -1962,64 +1757,136 @@ export const shouldBehaveLikeERC725X = ( await context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data + txParams.data, ); - const codeRetreived = await provider.getCode( - context.erc725X.address - ); + const codeRetreived = await provider.getCode(context.erc725X.address); - expect(codeRetreived).to.equal("0x"); + expect(codeRetreived).to.equal('0x'); }); }); }); }); - describe("When providing wrong operation type", () => { - it("should revert", async () => { + describe('When providing wrong operation type', () => { + it('should revert', async () => { const txParams = { Operation: 5, to: context.accounts.anyone.address, value: 0, - data: "0x", + data: '0x', }; await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256,address,uint256,bytes)"]( + .execute( txParams.Operation, txParams.to, txParams.value, - txParams.data - ) + txParams.data, + ), + ).to.be.revertedWithCustomError(context.erc725X, 'ERC725X_UnknownOperationType'); + }); + }); + }); + + describe('When testing the execute array function', () => { + it('should revert with error `ERC725X_ExecuteParametersEmptyArray` if all the array parameters are empty arrays [] [] [] []', async () => { + const txParams = { + operations: [], + targets: [], + values: [], + datas: [], + }; + + await expect( + context.erc725X + .connect(context.accounts.owner) + .executeBatch( + txParams.operations, + txParams.targets, + txParams.values, + txParams.datas, + ), + ).to.be.revertedWithCustomError(context.erc725X, 'ERC725X_ExecuteParametersEmptyArray'); + }); + + it('should revert with error `ERC725X_ExecuteParametersLengthMismatch` if at least one of the array parameter is an empty array []', async () => { + const txParams = { + operations: [OPERATION_TYPE.CALL, OPERATION_TYPE.CALL], + targets: [context.accounts.anyone.address, context.accounts.anyone.address], + values: [], + datas: ['0xcafecafe', '0xf00df00d'], + }; + + await expect( + context.erc725X + .connect(context.accounts.owner) + .executeBatch( + txParams.operations, + txParams.targets, + txParams.values, + txParams.datas, + ), + ).to.be.revertedWithCustomError(context.erc725X, 'ERC725X_ExecuteParametersLengthMismatch'); + }); + + describe('When testing execution ownership', () => { + it('should revert if all the array parameters are empty arrays [] [] [] []', async () => { + const txParams = { + operations: [], + targets: [], + values: [], + datas: [], + }; + + await expect( + context.erc725X + .connect(context.accounts.owner) + .executeBatch( + txParams.operations, + txParams.targets, + txParams.values, + txParams.datas, + ), + ).to.be.revertedWithCustomError(context.erc725X, 'ERC725X_ExecuteParametersEmptyArray'); + }); + + it('should revert with error `ERC725X_ExecuteParametersLengthMismatch` if at least one of the array parameter is an empty array []', async () => { + const txParams = { + operations: [OPERATION_TYPE.CALL, OPERATION_TYPE.CALL], + targets: [context.accounts.anyone.address, context.accounts.anyone.address], + values: [], + datas: ['0xcafecafe', '0xf00df00d'], + }; + + await expect( + context.erc725X + .connect(context.accounts.owner) + .executeBatch( + txParams.operations, + txParams.targets, + txParams.values, + txParams.datas, + ), ).to.be.revertedWithCustomError( context.erc725X, - "ERC725X_UnknownOperationType" + 'ERC725X_ExecuteParametersLengthMismatch', ); }); - }); - }); - describe("When testing the execute array function", () => { - describe("When testing execution ownership", () => { - describe("When owner is executing", () => { - it("should pass and emit Executed event", async () => { + describe('When owner is executing', () => { + it('should pass and emit Executed event', async () => { const txParams = { Operations: [OPERATION_TYPE.CALL, OPERATION_TYPE.CALL], - to: [ - context.accounts.anyone.address, - context.accounts.anyone.address, - ], - values: [ - ethers.utils.parseEther("1"), - ethers.utils.parseEther("1"), - ], - data: ["0x", "0x"], + to: [context.accounts.anyone.address, context.accounts.anyone.address], + values: [ethers.utils.parseEther('1'), ethers.utils.parseEther('1')], + data: ['0x', '0x'], }; const balanceBefore = await context.accounts.anyone.getBalance(); @@ -2027,65 +1894,60 @@ export const shouldBehaveLikeERC725X = ( await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256[],address[],uint256[],bytes[])"]( + .executeBatch( txParams.Operations, txParams.to, txParams.values, - txParams.data - ) + txParams.data, + ), ) - .to.emit(context.erc725X, "Executed") + .to.emit(context.erc725X, 'Executed') .withArgs( txParams.Operations[0], txParams.to[0], txParams.values[0], - "0x00000000" // no function selector + '0x00000000', // no function selector ) - .to.emit(context.erc725X, "Executed") + .to.emit(context.erc725X, 'Executed') .withArgs( txParams.Operations[1], txParams.to[1], txParams.values[1], - "0x00000000" // no function selector + '0x00000000', // no function selector ); const balanceAfter = await context.accounts.anyone.getBalance(); - expect( - balanceBefore.add(txParams.values[0]).add(txParams.values[1]) - ).to.equal(balanceAfter); + expect(balanceBefore.add(txParams.values[0]).add(txParams.values[1])).to.equal( + balanceAfter, + ); }); }); - describe("When non-owner is executing", () => { - it("should revert", async () => { + + describe('When non-owner is executing', () => { + it('should revert', async () => { const txParams = { Operations: [OPERATION_TYPE.CALL, OPERATION_TYPE.CALL], - to: [ - context.accounts.anyone.address, - context.accounts.anyone.address, - ], - values: [ - ethers.utils.parseEther("1"), - ethers.utils.parseEther("1"), - ], - data: ["0x", "0x"], + to: [context.accounts.anyone.address, context.accounts.anyone.address], + values: [ethers.utils.parseEther('1'), ethers.utils.parseEther('1')], + data: ['0x', '0x'], }; await expect( context.erc725X .connect(context.accounts.anyone) - ["execute(uint256[],address[],uint256[],bytes[])"]( + .executeBatch( txParams.Operations, txParams.to, txParams.values, - txParams.data - ) - ).to.be.revertedWith("Ownable: caller is not the owner"); + txParams.data, + ), + ).to.be.revertedWith('Ownable: caller is not the owner'); }); }); }); - describe("When testing combining operations", () => { + describe('When testing combining operations', () => { let targetContract: Counter; let contractThatReverts: ReturnTest; let selfdestructContract: SelfDestruct; @@ -2093,24 +1955,20 @@ export const shouldBehaveLikeERC725X = ( before(async () => { const [deployer] = await ethers.getSigners(); targetContract = await new Counter__factory(deployer).deploy(); - contractThatReverts = await new ReturnTest__factory( - deployer - ).deploy(); - selfdestructContract = await new SelfDestruct__factory( - deployer - ).deploy(); + contractThatReverts = await new ReturnTest__factory(deployer).deploy(); + selfdestructContract = await new SelfDestruct__factory(deployer).deploy(); }); - describe("When combining 2 CALL Operations", () => { - describe("When both pass", () => { - it("should pass and emit 2 Executed Event", async () => { + describe('When combining 2 CALL Operations', () => { + describe('When both pass', () => { + it('should pass and emit 2 Executed Event', async () => { const txParams = { Operations: [OPERATION_TYPE.CALL, OPERATION_TYPE.CALL], to: [targetContract.address, targetContract.address], values: [0, 0], data: [ - targetContract.interface.encodeFunctionData("increment"), - targetContract.interface.encodeFunctionData("get"), + targetContract.interface.encodeFunctionData('increment'), + targetContract.interface.encodeFunctionData('get'), ], }; @@ -2119,39 +1977,39 @@ export const shouldBehaveLikeERC725X = ( await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256[],address[],uint256[],bytes[])"]( + .executeBatch( txParams.Operations, txParams.to, txParams.values, - txParams.data - ) + txParams.data, + ), ) - .to.emit(context.erc725X, "Executed") + .to.emit(context.erc725X, 'Executed') .withArgs( txParams.Operations[0], txParams.to[0], txParams.values[0], - txParams.data[0].substr(0, 10) + txParams.data[0].substr(0, 10), ) - .to.emit(context.erc725X, "Executed") + .to.emit(context.erc725X, 'Executed') .withArgs( txParams.Operations[1], txParams.to[1], txParams.values[1], - txParams.data[1].substr(0, 10) + txParams.data[1].substr(0, 10), ); const countAfter = await targetContract.callStatic.count(); expect(countBefore.add(1)).to.equal(countAfter); }); - it("should return array of bytes as return values", async () => { + it('should return array of bytes as return values', async () => { const txParams = { Operations: [OPERATION_TYPE.CALL, OPERATION_TYPE.CALL], to: [targetContract.address, targetContract.address], values: [0, 0], data: [ - targetContract.interface.encodeFunctionData("increment"), - targetContract.interface.encodeFunctionData("get"), + targetContract.interface.encodeFunctionData('increment'), + targetContract.interface.encodeFunctionData('get'), ], }; @@ -2159,34 +2017,31 @@ export const shouldBehaveLikeERC725X = ( const result = await context.erc725X .connect(context.accounts.owner) - .callStatic["execute(uint256[],address[],uint256[],bytes[])"]( + .callStatic.executeBatch( txParams.Operations, txParams.to, txParams.values, - txParams.data + txParams.data, ); expect(result).to.eql([ - "0x", - ethers.utils.hexZeroPad( - ethers.utils.hexlify(countBefore.add(1)), - 32 - ), + '0x', + ethers.utils.hexZeroPad(ethers.utils.hexlify(countBefore.add(1)), 32), ]); }); }); - describe("When one call revert", () => { - it("should revert with the reason of the call that reverts", async () => { + describe('When one call revert', () => { + it('should revert with the reason of the call that reverts', async () => { const txParams = { Operations: [OPERATION_TYPE.CALL, OPERATION_TYPE.CALL], to: [targetContract.address, contractThatReverts.address], values: [0, 0], data: [ - targetContract.interface.encodeFunctionData("increment"), + targetContract.interface.encodeFunctionData('increment'), contractThatReverts.interface.encodeFunctionData( - "functionThatRevertsWithErrorString", - ["Revert please"] + 'functionThatRevertsWithErrorString', + ['Revert please'], ), ], }; @@ -2194,30 +2049,30 @@ export const shouldBehaveLikeERC725X = ( await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256[],address[],uint256[],bytes[])"]( + .executeBatch( txParams.Operations, txParams.to, txParams.values, - txParams.data - ) - ).to.be.revertedWith("Revert please"); + txParams.data, + ), + ).to.be.revertedWith('Revert please'); }); }); - describe("When both revert", () => { - it("should revert with the first revert reason", async () => { + describe('When both revert', () => { + it('should revert with the first revert reason', async () => { const txParams = { Operations: [OPERATION_TYPE.CALL, OPERATION_TYPE.CALL], to: [contractThatReverts.address, contractThatReverts.address], values: [0, 0], data: [ contractThatReverts.interface.encodeFunctionData( - "functionThatRevertsWithErrorString", - ["Revert with one"] + 'functionThatRevertsWithErrorString', + ['Revert with one'], ), contractThatReverts.interface.encodeFunctionData( - "functionThatRevertsWithErrorString", - ["Revert with two"] + 'functionThatRevertsWithErrorString', + ['Revert with two'], ), ], }; @@ -2225,26 +2080,26 @@ export const shouldBehaveLikeERC725X = ( await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256[],address[],uint256[],bytes[])"]( + .executeBatch( txParams.Operations, txParams.to, txParams.values, - txParams.data - ) - ).to.be.revertedWith("Revert with one"); + txParams.data, + ), + ).to.be.revertedWith('Revert with one'); }); }); }); - describe("When combining CALL and CREATE Operations", () => { - describe("When both pass", () => { - it("should pass and emit 1 Executed and 1 ContractCreated Event", async () => { + describe('When combining CALL and CREATE Operations', () => { + describe('When both pass', () => { + it('should pass and emit 1 Executed and 1 ContractCreated Event', async () => { const txParams = { Operations: [OPERATION_TYPE.CALL, OPERATION_TYPE.CREATE], to: [targetContract.address, ethers.constants.AddressZero], values: [0, 0], data: [ - targetContract.interface.encodeFunctionData("increment"), + targetContract.interface.encodeFunctionData('increment'), WithoutConstructorContractBytecode, ], }; @@ -2253,11 +2108,11 @@ export const shouldBehaveLikeERC725X = ( const result = await context.erc725X .connect(context.accounts.owner) - .callStatic["execute(uint256[],address[],uint256[],bytes[])"]( + .callStatic.executeBatch( txParams.Operations, txParams.to, txParams.values, - txParams.data + txParams.data, ); const contractAddress = ethers.utils.getAddress(result[1]); @@ -2265,92 +2120,84 @@ export const shouldBehaveLikeERC725X = ( await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256[],address[],uint256[],bytes[])"]( + .executeBatch( txParams.Operations, txParams.to, txParams.values, - txParams.data - ) + txParams.data, + ), ) - .to.emit(context.erc725X, "Executed") + .to.emit(context.erc725X, 'Executed') .withArgs( txParams.Operations[0], txParams.to[0], txParams.values[0], - txParams.data[0].substr(0, 10) + txParams.data[0].substr(0, 10), ) - .to.emit(context.erc725X, "ContractCreated") + .to.emit(context.erc725X, 'ContractCreated') .withArgs( txParams.Operations[1], contractAddress, txParams.values[1], - ethers.utils.hexZeroPad("0x00", 32) + ethers.utils.hexZeroPad('0x00', 32), ); - const codeOfContractCreated = await provider.getCode( - contractAddress - ); + const codeOfContractCreated = await provider.getCode(contractAddress); - expect(codeOfContractCreated).to.equal( - WithoutConstructorContractDeployedBytecode - ); + expect(codeOfContractCreated).to.equal(WithoutConstructorContractDeployedBytecode); const countAfter = await targetContract.callStatic.count(); expect(countBefore.add(1)).to.equal(countAfter); }); - it("should return array of bytes as return values and contractCreated", async () => { + it('should return array of bytes as return values and contractCreated', async () => { const txParams = { Operations: [OPERATION_TYPE.CALL, OPERATION_TYPE.CREATE], to: [targetContract.address, ethers.constants.AddressZero], values: [0, 0], data: [ - targetContract.interface.encodeFunctionData("increment"), + targetContract.interface.encodeFunctionData('increment'), WithoutConstructorContractBytecode, ], }; const result = await context.erc725X .connect(context.accounts.owner) - .callStatic["execute(uint256[],address[],uint256[],bytes[])"]( + .callStatic.executeBatch( txParams.Operations, txParams.to, txParams.values, - txParams.data + txParams.data, ); // real creation await context.erc725X .connect(context.accounts.owner) - ["execute(uint256[],address[],uint256[],bytes[])"]( + .executeBatch( txParams.Operations, txParams.to, txParams.values, - txParams.data + txParams.data, ); const returnValueOfCall = result[0]; - expect(returnValueOfCall).to.equal("0x"); + expect(returnValueOfCall).to.equal('0x'); const contractAddress = ethers.utils.getAddress(result[1]); - const codeOfContractCreated = await provider.getCode( - contractAddress - ); - expect(codeOfContractCreated).to.equal( - WithoutConstructorContractDeployedBytecode - ); + const codeOfContractCreated = await provider.getCode(contractAddress); + expect(codeOfContractCreated).to.equal(WithoutConstructorContractDeployedBytecode); }); }); - describe("When one call revert", () => { - it("should revert with the reason of the call that reverts", async () => { + describe('When one call revert', () => { + it('should revert with the reason of the call that reverts', async () => { const txParams = { Operations: [OPERATION_TYPE.CALL, OPERATION_TYPE.CREATE], to: [contractThatReverts.address, ethers.constants.AddressZero], values: [0, 0], data: [ contractThatReverts.interface.encodeFunctionData( - "functionThatRevertsWithErrorString", - ["Revert please"] + 'functionThatRevertsWithErrorString', + ['Revert please'], ), WithoutConstructorContractBytecode, ], @@ -2359,129 +2206,111 @@ export const shouldBehaveLikeERC725X = ( await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256[],address[],uint256[],bytes[])"]( + .executeBatch( txParams.Operations, txParams.to, txParams.values, - txParams.data - ) - ).to.be.revertedWith("Revert please"); + txParams.data, + ), + ).to.be.revertedWith('Revert please'); }); }); }); - describe("When combining CREATE and CREATE2 Operations", () => { - describe("When both pass", () => { - it("should pass and emit 2 ContractCreated Event and return array of contractCreated addresses", async () => { + describe('When combining CREATE and CREATE2 Operations', () => { + describe('When both pass', () => { + it('should pass and emit 2 ContractCreated Event and return array of contractCreated addresses', async () => { const txParams = { Operations: [OPERATION_TYPE.CREATE, OPERATION_TYPE.CREATE], - to: [ - ethers.constants.AddressZero, - ethers.constants.AddressZero, - ], + to: [ethers.constants.AddressZero, ethers.constants.AddressZero], values: [0, 0], - data: [ - WithoutConstructorContractBytecode, - WithoutConstructorContractBytecode, - ], + data: [WithoutConstructorContractBytecode, WithoutConstructorContractBytecode], }; const contractsAddresses = await context.erc725X .connect(context.accounts.owner) - .callStatic["execute(uint256[],address[],uint256[],bytes[])"]( + .callStatic.executeBatch( txParams.Operations, txParams.to, txParams.values, - txParams.data + txParams.data, ); await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256[],address[],uint256[],bytes[])"]( + .executeBatch( txParams.Operations, txParams.to, txParams.values, - txParams.data - ) + txParams.data, + ), ) - .to.emit(context.erc725X, "ContractCreated") + .to.emit(context.erc725X, 'ContractCreated') .withArgs( txParams.Operations[0], ethers.utils.getAddress(contractsAddresses[0]), txParams.values[0], - ethers.utils.hexZeroPad("0x00", 32) + ethers.utils.hexZeroPad('0x00', 32), ) - .to.emit(context.erc725X, "ContractCreated") + .to.emit(context.erc725X, 'ContractCreated') .withArgs( txParams.Operations[1], ethers.utils.getAddress(contractsAddresses[1]), txParams.values[1], - ethers.utils.hexZeroPad("0x00", 32) + ethers.utils.hexZeroPad('0x00', 32), ); const codeOfContractCreated1 = await provider.getCode( - ethers.utils.getAddress(contractsAddresses[0]) + ethers.utils.getAddress(contractsAddresses[0]), ); const codeOfContractCreated2 = await provider.getCode( - ethers.utils.getAddress(contractsAddresses[1]) + ethers.utils.getAddress(contractsAddresses[1]), ); - expect(codeOfContractCreated1).to.equal( - WithoutConstructorContractDeployedBytecode - ); + expect(codeOfContractCreated1).to.equal(WithoutConstructorContractDeployedBytecode); - expect(codeOfContractCreated2).to.equal( - WithoutConstructorContractDeployedBytecode - ); + expect(codeOfContractCreated2).to.equal(WithoutConstructorContractDeployedBytecode); }); }); - describe("When one creation revert", () => { - it("should revert with the reason of the creation that reverts", async () => { + describe('When one creation revert', () => { + it('should revert with the reason of the creation that reverts', async () => { const txParams = { Operations: [OPERATION_TYPE.CREATE, OPERATION_TYPE.CREATE], - to: [ - contractThatReverts.address, - context.accounts.anyone.address, - ], + to: [contractThatReverts.address, context.accounts.anyone.address], values: [0, 0], - data: [ - WithoutConstructorContractBytecode, - WithoutConstructorContractBytecode, - ], + data: [WithoutConstructorContractBytecode, WithoutConstructorContractBytecode], }; await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256[],address[],uint256[],bytes[])"]( + .executeBatch( txParams.Operations, txParams.to, txParams.values, - txParams.data - ) + txParams.data, + ), ).to.be.revertedWithCustomError( context.erc725X, - "ERC725X_CreateOperationsRequireEmptyRecipientAddress" + 'ERC725X_CreateOperationsRequireEmptyRecipientAddress', ); }); }); }); - describe("When combining DELEGATECALL and CALL Operations", () => { - describe("When calling after destructing the contract", () => { - it("should pass and emit 2 Executed Event and then be destructed", async () => { + describe('When combining DELEGATECALL and CALL Operations', () => { + describe('When calling after destructing the contract', () => { + it('should pass and emit 2 Executed Event and then be destructed', async () => { const txParams = { Operations: [OPERATION_TYPE.DELEGATECALL, OPERATION_TYPE.CALL], to: [selfdestructContract.address, targetContract.address], values: [0, 0], data: [ - selfdestructContract.interface.encodeFunctionData( - "destroyMe" - ), - targetContract.interface.encodeFunctionData("increment"), + selfdestructContract.interface.encodeFunctionData('destroyMe'), + targetContract.interface.encodeFunctionData('increment'), ], }; @@ -2490,171 +2319,137 @@ export const shouldBehaveLikeERC725X = ( await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256[],address[],uint256[],bytes[])"]( + .executeBatch( txParams.Operations, txParams.to, txParams.values, - txParams.data - ) + txParams.data, + ), ) - .to.emit(context.erc725X, "Executed") + .to.emit(context.erc725X, 'Executed') .withArgs( txParams.Operations[0], txParams.to[0], txParams.values[0], - txParams.data[0].substr(0, 10) + txParams.data[0].substr(0, 10), ) - .to.emit(context.erc725X, "Executed") + .to.emit(context.erc725X, 'Executed') .withArgs( txParams.Operations[1], txParams.to[1], txParams.values[1], - txParams.data[1].substr(0, 10) + txParams.data[1].substr(0, 10), ); const countAfter = await targetContract.callStatic.count(); expect(countBefore.add(1)).to.equal(countAfter); - const codeAtERC725X = await provider.getCode( - context.erc725X.address - ); + const codeAtERC725X = await provider.getCode(context.erc725X.address); - expect(codeAtERC725X).to.equal("0x"); + expect(codeAtERC725X).to.equal('0x'); }); }); }); }); - describe("When providing wrong operation type with other operations", () => { + describe('When providing wrong operation type with other operations', () => { describe("when it's the first operation in the operation list", () => { - it("should revert", async () => { + it('should revert', async () => { const txParams = { Operations: [5, OPERATION_TYPE.CALL], - to: [ - context.accounts.anyone.address, - context.accounts.anyone.address, - ], + to: [context.accounts.anyone.address, context.accounts.anyone.address], values: [0, 0], - data: ["0x", "0x"], + data: ['0x', '0x'], }; await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256[],address[],uint256[],bytes[])"]( + .executeBatch( txParams.Operations, txParams.to, txParams.values, - txParams.data - ) - ).to.be.revertedWithCustomError( - context.erc725X, - "ERC725X_UnknownOperationType" - ); + txParams.data, + ), + ).to.be.revertedWithCustomError(context.erc725X, 'ERC725X_UnknownOperationType'); }); }); describe("when it's the last operation in the operation list", () => { - it("should revert", async () => { + it('should revert', async () => { const txParams = { Operations: [OPERATION_TYPE.CALL, 5], - to: [ - context.accounts.anyone.address, - context.accounts.anyone.address, - ], + to: [context.accounts.anyone.address, context.accounts.anyone.address], values: [0, 0], - data: ["0x", "0x"], + data: ['0x', '0x'], }; await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256[],address[],uint256[],bytes[])"]( + .executeBatch( txParams.Operations, txParams.to, txParams.values, - txParams.data - ) - ).to.be.revertedWithCustomError( - context.erc725X, - "ERC725X_UnknownOperationType" - ); + txParams.data, + ), + ).to.be.revertedWithCustomError(context.erc725X, 'ERC725X_UnknownOperationType'); }); }); }); - describe("Edge cases ", () => { - describe("When sending value in second call greater than the balance", () => { - it("should revert with the custom error", async () => { + describe('Edge cases ', () => { + describe('When sending value in second call greater than the balance', () => { + it('should revert with the custom error', async () => { const txParams = { Operations: [OPERATION_TYPE.CALL, OPERATION_TYPE.CALL], - to: [ - context.accounts.anyone.address, - context.accounts.anyone.address, - ], - values: [ - ethers.utils.parseEther("10"), - ethers.utils.parseEther("99"), - ], - data: ["0x", "0x"], + to: [context.accounts.anyone.address, context.accounts.anyone.address], + values: [ethers.utils.parseEther('10'), ethers.utils.parseEther('99')], + data: ['0x', '0x'], }; - const contractBalance = await provider.getBalance( - context.erc725X.address - ); + const contractBalance = await provider.getBalance(context.erc725X.address); await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256[],address[],uint256[],bytes[])"]( + .executeBatch( txParams.Operations, txParams.to, txParams.values, - txParams.data - ) + txParams.data, + ), ) - .to.be.revertedWithCustomError( - context.erc725X, - "ERC725X_InsufficientBalance" - ) - .withArgs( - contractBalance.sub(txParams.values[0]), - txParams.values[1] - ); + .to.be.revertedWithCustomError(context.erc725X, 'ERC725X_InsufficientBalance') + .withArgs(contractBalance.sub(txParams.values[0]), txParams.values[1]); }); }); - describe("When passing un-equal parameters number", () => { - describe("for OperationsType", () => { - it("should revert with the custom error", async () => { + describe('When passing un-equal parameters number', () => { + describe('for OperationsType', () => { + it('should revert with the custom error', async () => { const txParams = { Operations: [OPERATION_TYPE.CALL], - to: [ - context.accounts.anyone.address, - context.accounts.anyone.address, - ], - values: [ - ethers.utils.parseEther("10"), - ethers.utils.parseEther("99"), - ], - data: ["0x", "0x"], + to: [context.accounts.anyone.address, context.accounts.anyone.address], + values: [ethers.utils.parseEther('10'), ethers.utils.parseEther('99')], + data: ['0x', '0x'], }; await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256[],address[],uint256[],bytes[])"]( + .executeBatch( txParams.Operations, txParams.to, txParams.values, - txParams.data - ) + txParams.data, + ), ).to.be.revertedWithCustomError( context.erc725X, - "ERC725X_ExecuteParametersLengthMismatch" + 'ERC725X_ExecuteParametersLengthMismatch', ); }); }); - describe("for to", () => { - it("should revert with the custom error", async () => { + describe('for to', () => { + it('should revert with the custom error', async () => { const txParams = { Operations: [OPERATION_TYPE.CALL, OPERATION_TYPE.CALL], to: [ @@ -2662,117 +2457,99 @@ export const shouldBehaveLikeERC725X = ( context.accounts.anyone.address, context.accounts.anyone.address, ], - values: [ - ethers.utils.parseEther("10"), - ethers.utils.parseEther("99"), - ], - data: ["0x", "0x"], + values: [ethers.utils.parseEther('10'), ethers.utils.parseEther('99')], + data: ['0x', '0x'], }; await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256[],address[],uint256[],bytes[])"]( + .executeBatch( txParams.Operations, txParams.to, txParams.values, - txParams.data - ) + txParams.data, + ), ).to.be.revertedWithCustomError( context.erc725X, - "ERC725X_ExecuteParametersLengthMismatch" + 'ERC725X_ExecuteParametersLengthMismatch', ); }); }); - describe("for values", () => { - it("should revert with the custom error", async () => { + describe('for values', () => { + it('should revert with the custom error', async () => { const txParams = { Operations: [OPERATION_TYPE.CALL, OPERATION_TYPE.CALL], - to: [ - context.accounts.anyone.address, - context.accounts.anyone.address, - ], + to: [context.accounts.anyone.address, context.accounts.anyone.address], values: [ - ethers.utils.parseEther("10"), - ethers.utils.parseEther("99"), - ethers.utils.parseEther("99"), + ethers.utils.parseEther('10'), + ethers.utils.parseEther('99'), + ethers.utils.parseEther('99'), ], - data: ["0x", "0x"], + data: ['0x', '0x'], }; await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256[],address[],uint256[],bytes[])"]( + .executeBatch( txParams.Operations, txParams.to, txParams.values, - txParams.data - ) + txParams.data, + ), ).to.be.revertedWithCustomError( context.erc725X, - "ERC725X_ExecuteParametersLengthMismatch" + 'ERC725X_ExecuteParametersLengthMismatch', ); }); }); - describe("for data", () => { - it("should revert with the custom error", async () => { + describe('for data', () => { + it('should revert with the custom error', async () => { const txParams = { Operations: [OPERATION_TYPE.CALL, OPERATION_TYPE.CALL], - to: [ - context.accounts.anyone.address, - context.accounts.anyone.address, - ], - values: [ - ethers.utils.parseEther("10"), - ethers.utils.parseEther("10"), - ], - data: ["0x", "0x", "0x"], + to: [context.accounts.anyone.address, context.accounts.anyone.address], + values: [ethers.utils.parseEther('10'), ethers.utils.parseEther('10')], + data: ['0x', '0x', '0x'], }; await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256[],address[],uint256[],bytes[])"]( + .executeBatch( txParams.Operations, txParams.to, txParams.values, - txParams.data - ) + txParams.data, + ), ).to.be.revertedWithCustomError( context.erc725X, - "ERC725X_ExecuteParametersLengthMismatch" + 'ERC725X_ExecuteParametersLengthMismatch', ); }); }); - describe("for more than 1 parameter", () => { - it("should revert with the custom error", async () => { + describe('for more than 1 parameter', () => { + it('should revert with the custom error', async () => { const txParams = { Operations: [OPERATION_TYPE.CALL], - to: [ - context.accounts.anyone.address, - context.accounts.anyone.address, - ], - values: [ - ethers.utils.parseEther("10"), - ethers.utils.parseEther("10"), - ], - data: ["0x", "0x", "0x"], + to: [context.accounts.anyone.address, context.accounts.anyone.address], + values: [ethers.utils.parseEther('10'), ethers.utils.parseEther('10')], + data: ['0x', '0x', '0x'], }; await expect( context.erc725X .connect(context.accounts.owner) - ["execute(uint256[],address[],uint256[],bytes[])"]( + .executeBatch( txParams.Operations, txParams.to, txParams.values, - txParams.data - ) + txParams.data, + ), ).to.be.revertedWithCustomError( context.erc725X, - "ERC725X_ExecuteParametersLengthMismatch" + 'ERC725X_ExecuteParametersLengthMismatch', ); }); }); @@ -2789,7 +2566,7 @@ export type ERC725XInitializeTestContext = { }; export const shouldInitializeLikeERC725X = ( - buildContext: () => Promise + buildContext: () => Promise, ) => { let context: ERC725XInitializeTestContext; @@ -2797,20 +2574,17 @@ export const shouldInitializeLikeERC725X = ( context = await buildContext(); }); - describe("when the contract was initialized", () => { - it("should have registered the ERC165 interface", async () => { - expect(await context.erc725X.supportsInterface(INTERFACE_ID.ERC165)).to.be - .true; + describe('when the contract was initialized', () => { + it('should have registered the ERC165 interface', async () => { + expect(await context.erc725X.supportsInterface(INTERFACE_ID.ERC165)).to.be.true; }); - it("should have registered the ERC725X interface", async () => { + it('should have registered the ERC725X interface', async () => { expect(await context.erc725X.supportsInterface(INTERFACE_ID.ERC725X)); }); - it("should have set the correct owner", async () => { - expect(await context.erc725X.callStatic.owner()).to.equal( - context.deployParams.newOwner - ); + it('should have set the correct owner', async () => { + expect(await context.erc725X.callStatic.owner()).to.equal(context.deployParams.newOwner); }); }); }; diff --git a/implementations/test/ERC725X.test.ts b/implementations/test/ERC725X.test.ts index e9c0da5e..df1698ce 100644 --- a/implementations/test/ERC725X.test.ts +++ b/implementations/test/ERC725X.test.ts @@ -1,18 +1,18 @@ -import { ethers } from "hardhat"; -import { expect } from "chai"; -import { ERC725X__factory, ERC725XInit__factory } from "../types"; +import { ethers } from 'hardhat'; +import { expect } from 'chai'; +import { ERC725X__factory, ERC725XInit__factory } from '../types'; import { getNamedAccounts, shouldBehaveLikeERC725X, shouldInitializeLikeERC725X, ERC725XTestContext, -} from "./ERC725X.behaviour"; +} from './ERC725X.behaviour'; -import { deployProxy } from "./fixtures"; +import { deployProxy } from './fixtures'; -describe("ERC725X", () => { - describe("when using ERC725X contract with constructor", () => { +describe('ERC725X', () => { + describe('when using ERC725X contract with constructor', () => { const buildTestContext = async (): Promise => { const accounts = await getNamedAccounts(); @@ -20,15 +20,13 @@ describe("ERC725X", () => { newOwner: accounts.owner.address, }; - const erc725X = await new ERC725X__factory(accounts.owner).deploy( - deployParams.newOwner - ); + const erc725X = await new ERC725X__factory(accounts.owner).deploy(deployParams.newOwner); return { accounts, erc725X, deployParams }; }; - describe("when deploying the contract", () => { - it("should revert when giving address(0) as owner", async () => { + describe('when deploying the contract', () => { + it('should revert when giving address(0) as owner', async () => { const accounts = await getNamedAccounts(); const deployParams = { @@ -36,13 +34,11 @@ describe("ERC725X", () => { }; await expect( - new ERC725X__factory(accounts.owner).deploy(deployParams.newOwner) - ).to.be.revertedWith( - "Ownable: new owner is the zero address" - ); + new ERC725X__factory(accounts.owner).deploy(deployParams.newOwner), + ).to.be.revertedWith('Ownable: new owner is the zero address'); }); - describe("once the contract was deployed", () => { + describe('once the contract was deployed', () => { let context: ERC725XTestContext; beforeEach(async () => { @@ -60,12 +56,12 @@ describe("ERC725X", () => { }); }); - describe("when testing deployed contract", () => { + describe('when testing deployed contract', () => { shouldBehaveLikeERC725X(buildTestContext); }); }); - describe("when using ERC725X contract with proxy", () => { + describe('when using ERC725X contract with proxy', () => { const buildTestContext = async (): Promise => { const accounts = await getNamedAccounts(); @@ -73,57 +69,46 @@ describe("ERC725X", () => { newOwner: accounts.owner.address, }; - const erc725XBase = await new ERC725XInit__factory( - accounts.owner - ).deploy(); + const erc725XBase = await new ERC725XInit__factory(accounts.owner).deploy(); - const erc725XProxy = await deployProxy( - erc725XBase.address, - accounts.owner - ); + const erc725XProxy = await deployProxy(erc725XBase.address, accounts.owner); const erc725X = erc725XBase.attach(erc725XProxy); return { accounts, erc725X, deployParams }; }; const initializeProxy = async (context: ERC725XTestContext) => { - return context.erc725X["initialize(address)"]( - context.deployParams.newOwner - ); + return context.erc725X['initialize(address)'](context.deployParams.newOwner); }; - describe("when deploying the base implementation contract", () => { - it("prevent any address from calling the initialize(...) function on the implementation", async () => { + describe('when deploying the base implementation contract', () => { + it('prevent any address from calling the initialize(...) function on the implementation', async () => { const accounts = await ethers.getSigners(); - const erc725XBase = await new ERC725XInit__factory( - accounts[0] - ).deploy(); + const erc725XBase = await new ERC725XInit__factory(accounts[0]).deploy(); const randomCaller = accounts[1]; - await expect( - erc725XBase["initialize(address)"](randomCaller.address) - ).to.be.revertedWith("Initializable: contract is already initialized"); + await expect(erc725XBase['initialize(address)'](randomCaller.address)).to.be.revertedWith( + 'Initializable: contract is already initialized', + ); }); }); - describe("when deploying the contract as proxy", () => { + describe('when deploying the contract as proxy', () => { let context: ERC725XTestContext; beforeEach(async () => { context = await buildTestContext(); }); - it("should revert when initializing with address(0) as owner", async () => { + it('should revert when initializing with address(0) as owner', async () => { await expect( - context.erc725X["initialize(address)"](ethers.constants.AddressZero) - ).to.be.revertedWith( - "Ownable: new owner is the zero address" - ); + context.erc725X['initialize(address)'](ethers.constants.AddressZero), + ).to.be.revertedWith('Ownable: new owner is the zero address'); }); - describe("when initializing the contract", () => { + describe('when initializing the contract', () => { shouldInitializeLikeERC725X(async () => { const { erc725X, deployParams } = context; const initializeTransaction = await initializeProxy(context); @@ -136,24 +121,24 @@ describe("ERC725X", () => { }); }); - describe("when calling initialize more than once", () => { - it("should revert", async () => { + describe('when calling initialize more than once', () => { + it('should revert', async () => { await initializeProxy(context); await expect(initializeProxy(context)).to.be.revertedWith( - "Initializable: contract is already initialized" + 'Initializable: contract is already initialized', ); }); }); }); - describe("when testing deployed contract", () => { + describe('when testing deployed contract', () => { shouldBehaveLikeERC725X(() => buildTestContext().then(async (context) => { await initializeProxy(context); return context; - }) + }), ); }); }); diff --git a/implementations/test/ERC725Y.behaviour.ts b/implementations/test/ERC725Y.behaviour.ts index 99f6269a..4cff0d0b 100644 --- a/implementations/test/ERC725Y.behaviour.ts +++ b/implementations/test/ERC725Y.behaviour.ts @@ -1,21 +1,17 @@ -import { ethers } from "hardhat"; -import { expect } from "chai"; +import { ethers } from 'hardhat'; +import { expect } from 'chai'; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; -import { AddressZero } from "@ethersproject/constants"; -import type { TransactionResponse } from "@ethersproject/abstract-provider"; +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; +import { AddressZero } from '@ethersproject/constants'; +import type { TransactionResponse } from '@ethersproject/abstract-provider'; // types -import { - ERC725Y, - ERC725YWriter__factory, - ERC725YReader__factory, -} from "../types"; +import { ERC725Y, ERC725YWriter__factory, ERC725YReader__factory } from '../types'; -import { bytecode as ERC725Bytecode } from "../artifacts/contracts/ERC725.sol/ERC725.json"; +import { bytecode as ERC725Bytecode } from '../artifacts/contracts/ERC725.sol/ERC725.json'; // constants -import { INTERFACE_ID } from "../constants"; +import { INTERFACE_ID } from '../constants'; export type ERC725YTestAccounts = { owner: SignerWithAddress; @@ -44,28 +40,23 @@ export type ERC725YTestContext = { deployParams: ERC725YDeployParams; }; -export const shouldBehaveLikeERC725Y = ( - buildContext: () => Promise -) => { +export const shouldBehaveLikeERC725Y = (buildContext: () => Promise) => { let context: ERC725YTestContext; beforeEach(async () => { context = await buildContext(); }); - describe("When testing ownership", () => { - describe("When owner is transferring ownership", () => { - it("should pass and emit OwnershipTransferred event", async () => { + describe('When testing ownership', () => { + describe('When owner is transferring ownership', () => { + it('should pass and emit OwnershipTransferred event', async () => { await expect( context.erc725Y .connect(context.accounts.owner) - .transferOwnership(context.accounts.anyone.address) + .transferOwnership(context.accounts.anyone.address), ) - .to.emit(context.erc725Y, "OwnershipTransferred") - .withArgs( - context.accounts.owner.address, - context.accounts.anyone.address - ); + .to.emit(context.erc725Y, 'OwnershipTransferred') + .withArgs(context.accounts.owner.address, context.accounts.anyone.address); const accountOwner = await context.erc725Y.callStatic.owner(); @@ -73,22 +64,20 @@ export const shouldBehaveLikeERC725Y = ( }); }); - describe("When non-owner is transferring ownership", () => { - it("should revert", async () => { + describe('When non-owner is transferring ownership', () => { + it('should revert', async () => { await expect( context.erc725Y .connect(context.accounts.anyone) - .transferOwnership(context.accounts.anyone.address) - ).to.be.revertedWith("Ownable: caller is not the owner"); + .transferOwnership(context.accounts.anyone.address), + ).to.be.revertedWith('Ownable: caller is not the owner'); }); }); - describe("When owner is renouncing ownership", () => { - it("should pass and emit OwnershipTransferred event", async () => { - await expect( - context.erc725Y.connect(context.accounts.owner).renounceOwnership() - ) - .to.emit(context.erc725Y, "OwnershipTransferred") + describe('When owner is renouncing ownership', () => { + it('should pass and emit OwnershipTransferred event', async () => { + await expect(context.erc725Y.connect(context.accounts.owner).renounceOwnership()) + .to.emit(context.erc725Y, 'OwnershipTransferred') .withArgs(context.accounts.owner.address, AddressZero); const accountOwner = await context.erc725Y.callStatic.owner(); @@ -97,893 +86,751 @@ export const shouldBehaveLikeERC725Y = ( }); }); - describe("When non-owner is renouncing ownership", () => { - it("should revert", async () => { + describe('When non-owner is renouncing ownership', () => { + it('should revert', async () => { await expect( - context.erc725Y.connect(context.accounts.anyone).renounceOwnership() - ).to.be.revertedWith("Ownable: caller is not the owner"); + context.erc725Y.connect(context.accounts.anyone).renounceOwnership(), + ).to.be.revertedWith('Ownable: caller is not the owner'); }); }); }); - describe("When testing setting data", () => { - describe("When sending value to setData", () => { - it("should revert when sending value to setData(..)", async () => { + describe('When testing setting data', () => { + describe('When sending value to setData', () => { + it('should revert when sending value to setData(..)', async () => { let value = 100; const txParams = { - dataKey: ethers.utils.solidityKeccak256(["string"], ["FirstDataKey"]), - dataValue: "0xaabbccdd", + dataKey: ethers.utils.solidityKeccak256(['string'], ['FirstDataKey']), + dataValue: '0xaabbccdd', }; await expect( context.erc725Y .connect(context.accounts.owner) - ["setData(bytes32,bytes)"](txParams.dataKey, txParams.dataValue, { + .setData(txParams.dataKey, txParams.dataValue, { value: value, - }) - ).to.be.revertedWithCustomError( - context.erc725Y, - "ERC725Y_MsgValueDisallowed" - ); + }), + ).to.be.revertedWithCustomError(context.erc725Y, 'ERC725Y_MsgValueDisallowed'); }); - it("should revert when sending value to setData(..) Array", async () => { + it('should revert when sending value to setDataBatch(..)', async () => { let value = 100; const txParams = { - dataKey: [ - ethers.utils.solidityKeccak256(["string"], ["FirstDataKey"]), - ], - dataValue: ["0xaabbccdd"], + dataKey: [ethers.utils.solidityKeccak256(['string'], ['FirstDataKey'])], + dataValue: ['0xaabbccdd'], }; await expect( context.erc725Y .connect(context.accounts.owner) - ["setData(bytes32[],bytes[])"]( - txParams.dataKey, - txParams.dataValue, - { - value: value, - } - ) - ).to.be.revertedWithCustomError( - context.erc725Y, - "ERC725Y_MsgValueDisallowed" - ); + .setDataBatch(txParams.dataKey, txParams.dataValue, { + value: value, + }), + ).to.be.revertedWithCustomError(context.erc725Y, 'ERC725Y_MsgValueDisallowed'); }); }); - describe("When using setData(bytes32,bytes)", () => { - describe("When owner is setting data", () => { - it("should pass and emit DataChanged event", async () => { + describe('When using setData', () => { + describe('When owner is setting data', () => { + it('should pass and emit DataChanged event', async () => { const txParams = { - dataKey: ethers.utils.solidityKeccak256( - ["string"], - ["FirstDataKey"] - ), - dataValue: "0xaabbccdd", + dataKey: ethers.utils.solidityKeccak256(['string'], ['FirstDataKey']), + dataValue: '0xaabbccdd', }; await expect( context.erc725Y .connect(context.accounts.owner) - ["setData(bytes32,bytes)"](txParams.dataKey, txParams.dataValue) + .setData(txParams.dataKey, txParams.dataValue), ) - .to.emit(context.erc725Y, "DataChanged") + .to.emit(context.erc725Y, 'DataChanged') .withArgs(txParams.dataKey, txParams.dataValue); - const fetchedData = await context.erc725Y.callStatic[ - "getData(bytes32)" - ](txParams.dataKey); + const fetchedData = await context.erc725Y.getData( + txParams.dataKey, + ); expect(fetchedData).to.equal(txParams.dataValue); }); }); - describe("When non-owner is setting data", () => { - it("should revert", async () => { + describe('When non-owner is setting data', () => { + it('should revert', async () => { const txParams = { - dataKey: ethers.utils.solidityKeccak256( - ["string"], - ["FirstDataKey"] - ), - dataValue: "0xaabbccdd", + dataKey: ethers.utils.solidityKeccak256(['string'], ['FirstDataKey']), + dataValue: '0xaabbccdd', }; await expect( context.erc725Y .connect(context.accounts.anyone) - ["setData(bytes32,bytes)"](txParams.dataKey, txParams.dataValue) - ).to.be.revertedWith("Ownable: caller is not the owner"); + .setData(txParams.dataKey, txParams.dataValue), + ).to.be.revertedWith('Ownable: caller is not the owner'); - const fetchedData = await context.erc725Y.callStatic[ - "getData(bytes32)" - ](txParams.dataKey); + const fetchedData = await context.erc725Y.getData( + txParams.dataKey, + ); - expect(fetchedData).to.equal("0x"); + expect(fetchedData).to.equal('0x'); }); }); - describe("When interacting from a smart Contract", () => { + describe('When interacting from a smart Contract', () => { let erc725YWriter; beforeEach(async () => { - erc725YWriter = await new ERC725YWriter__factory( - context.accounts.anyone - ).deploy(); + erc725YWriter = await new ERC725YWriter__factory(context.accounts.anyone).deploy(); await context.erc725Y .connect(context.accounts.owner) .transferOwnership(erc725YWriter.address); }); - it("should pass and emit DataChanged event", async () => { + it('should pass and emit DataChanged event', async () => { const txParams = { - dataKey: ethers.utils.solidityKeccak256( - ["string"], - ["FirstDataKey"] - ), - dataValue: "0xaabbccdd", + dataKey: ethers.utils.solidityKeccak256(['string'], ['FirstDataKey']), + dataValue: '0xaabbccdd', }; await expect( erc725YWriter .connect(context.accounts.owner) - .callSetDataSingle( - context.erc725Y.address, - txParams.dataKey, - txParams.dataValue - ) + .callSetData(context.erc725Y.address, txParams.dataKey, txParams.dataValue), ) - .to.emit(context.erc725Y, "DataChanged") + .to.emit(context.erc725Y, 'DataChanged') .withArgs(txParams.dataKey, txParams.dataValue); - const fetchedData = await context.erc725Y.callStatic[ - "getData(bytes32)" - ](txParams.dataKey); + const fetchedData = await context.erc725Y.getData( + txParams.dataKey, + ); expect(fetchedData).to.equal(txParams.dataValue); }); }); - describe("When interacting from an EOA", () => { - describe("when setting a new data Key", () => { - it("should pass and emit DataChanged event", async () => { + describe('When interacting from an EOA', () => { + describe('when setting a new data Key', () => { + it('should pass and emit DataChanged event', async () => { const txParams = { - dataKey: ethers.utils.solidityKeccak256( - ["string"], - ["FirstDataKey"] - ), - dataValue: "0xaabbccdd", + dataKey: ethers.utils.solidityKeccak256(['string'], ['FirstDataKey']), + dataValue: '0xaabbccdd', }; await expect( context.erc725Y .connect(context.accounts.owner) - ["setData(bytes32,bytes)"](txParams.dataKey, txParams.dataValue) + .setData(txParams.dataKey, txParams.dataValue), ) - .to.emit(context.erc725Y, "DataChanged") + .to.emit(context.erc725Y, 'DataChanged') .withArgs(txParams.dataKey, txParams.dataValue); - const fetchedData = await context.erc725Y.callStatic[ - "getData(bytes32)" - ](txParams.dataKey); + const fetchedData = await context.erc725Y.getData( + txParams.dataKey, + ); expect(fetchedData).to.equal(txParams.dataValue); }); }); - describe("when updating an existing data Key", () => { + describe('when updating an existing data Key', () => { let tx1Params; before(async () => { tx1Params = { - dataKey: ethers.utils.solidityKeccak256( - ["string"], - ["FirstDataKey"] - ), - dataValue: "0xaabbccdd", + dataKey: ethers.utils.solidityKeccak256(['string'], ['FirstDataKey']), + dataValue: '0xaabbccdd', }; // Setting for first time await context.erc725Y .connect(context.accounts.owner) - ["setData(bytes32,bytes)"]( - tx1Params.dataKey, - tx1Params.dataValue - ); + .setData(tx1Params.dataKey, tx1Params.dataValue); - const fetchedData = await context.erc725Y.callStatic[ - "getData(bytes32)" - ](tx1Params.dataKey); + const fetchedData = await context.erc725Y.getData( + tx1Params.dataKey, + ); expect(fetchedData).to.equal(tx1Params.dataValue); }); - it("should pass and emit DataChanged event", async () => { + it('should pass and emit DataChanged event', async () => { const tx2Params = { dataKey: tx1Params.dataKey, - dataValue: "0xaabbccdd", + dataValue: '0xaabbccdd', }; await expect( context.erc725Y .connect(context.accounts.owner) - ["setData(bytes32,bytes)"]( - tx2Params.dataKey, - tx2Params.dataValue - ) + .setData(tx2Params.dataKey, tx2Params.dataValue), ) - .to.emit(context.erc725Y, "DataChanged") + .to.emit(context.erc725Y, 'DataChanged') .withArgs(tx2Params.dataKey, tx2Params.dataValue); - const fetchedData = await context.erc725Y.callStatic[ - "getData(bytes32)" - ](tx2Params.dataKey); + const fetchedData = await context.erc725Y.getData( + tx2Params.dataKey, + ); expect(fetchedData).to.equal(tx2Params.dataValue); }); }); - describe("when removing an existing data Key", () => { + describe('when removing an existing data Key', () => { let tx1Params; before(async () => { tx1Params = { - dataKey: ethers.utils.solidityKeccak256( - ["string"], - ["FirstDataKey"] - ), - dataValue: "0xaabbccdd", + dataKey: ethers.utils.solidityKeccak256(['string'], ['FirstDataKey']), + dataValue: '0xaabbccdd', }; // Setting for first time await context.erc725Y .connect(context.accounts.owner) - ["setData(bytes32,bytes)"]( - tx1Params.dataKey, - tx1Params.dataValue - ); + .setData(tx1Params.dataKey, tx1Params.dataValue); - const fetchedData = await context.erc725Y.callStatic[ - "getData(bytes32)" - ](tx1Params.dataKey); + const fetchedData = await context.erc725Y.getData( + tx1Params.dataKey, + ); expect(fetchedData).to.equal(tx1Params.dataValue); }); - it("should pass and emit DataChanged event", async () => { + it('should pass and emit DataChanged event', async () => { const tx2Params = { dataKey: tx1Params.dataKey, - dataValue: "0x", + dataValue: '0x', }; await expect( context.erc725Y .connect(context.accounts.owner) - ["setData(bytes32,bytes)"]( - tx2Params.dataKey, - tx2Params.dataValue - ) + .setData(tx2Params.dataKey, tx2Params.dataValue), ) - .to.emit(context.erc725Y, "DataChanged") + .to.emit(context.erc725Y, 'DataChanged') .withArgs(tx2Params.dataKey, tx2Params.dataValue); - const fetchedData = await context.erc725Y.callStatic[ - "getData(bytes32)" - ](tx2Params.dataKey); + const fetchedData = await context.erc725Y.getData( + tx2Params.dataKey, + ); expect(fetchedData).to.equal(tx2Params.dataValue); }); }); - describe("when setting large bytes in the storage", () => { - it("should pass and emit DataChanged event", async () => { + describe('when setting large bytes in the storage', () => { + it('should pass and emit DataChanged event', async () => { const txParams = { - dataKey: ethers.utils.solidityKeccak256( - ["string"], - ["BytecodeOfMyFavoriteContract"] - ), + dataKey: ethers.utils.solidityKeccak256(['string'], ['BytecodeOfMyFavoriteContract']), dataValue: ERC725Bytecode, }; await expect( context.erc725Y .connect(context.accounts.owner) - ["setData(bytes32,bytes)"](txParams.dataKey, txParams.dataValue) + .setData(txParams.dataKey, txParams.dataValue), ) - .to.emit(context.erc725Y, "DataChanged") + .to.emit(context.erc725Y, 'DataChanged') .withArgs(txParams.dataKey, txParams.dataValue); - const fetchedData = await context.erc725Y.callStatic[ - "getData(bytes32)" - ](txParams.dataKey); + const fetchedData = await context.erc725Y.getData( + txParams.dataKey, + ); expect(fetchedData).to.equal(txParams.dataValue); }); }); }); }); - describe("When using setData(bytes32[],bytes[])", () => { - describe("When owner is setting data", () => { - it("should pass and emit DataChanged event", async () => { + + describe('When using setDataBatch', () => { + it('should revert if all parameters are empty arrays [] []', async () => { + const dataKeys = []; + const dataValues = []; + + await expect( + context.erc725Y + .connect(context.accounts.owner) + .setDataBatch(dataKeys, dataValues), + ).to.be.revertedWithCustomError(context.erc725Y, 'ERC725Y_DataKeysValuesEmptyArray'); + }); + + it('should revert if at least one of the parameters is an empty array []', async () => { + const dataKeys = [ + ethers.utils.solidityKeccak256(['string'], ['FirstDataKey']), + ethers.utils.solidityKeccak256(['string'], ['SecondDataKey']), + ]; + const dataValues = []; + + await expect( + context.erc725Y + .connect(context.accounts.owner) + .setDataBatch(dataKeys, dataValues), + ) + .to.be.revertedWithCustomError(context.erc725Y, 'ERC725Y_DataKeysValuesLengthMismatch') + }); + + describe('When owner is setting data', () => { + it('should pass and emit DataChanged event', async () => { const txParams = { - dataKey: ethers.utils.solidityKeccak256( - ["string"], - ["FirstDataKey"] - ), - dataValue: "0xaabbccdd", + dataKey: ethers.utils.solidityKeccak256(['string'], ['FirstDataKey']), + dataValue: '0xaabbccdd', }; await expect( context.erc725Y .connect(context.accounts.owner) - ["setData(bytes32[],bytes[])"]( - [txParams.dataKey], - [txParams.dataValue] - ) + .setDataBatch([txParams.dataKey], [txParams.dataValue]), ) - .to.emit(context.erc725Y, "DataChanged") + .to.emit(context.erc725Y, 'DataChanged') .withArgs(txParams.dataKey, txParams.dataValue); - const fetchedData = await context.erc725Y.callStatic[ - "getData(bytes32)" - ](txParams.dataKey); + const fetchedData = await context.erc725Y.getData( + txParams.dataKey, + ); expect(fetchedData).to.equal(txParams.dataValue); }); }); - describe("When non-owner is setting data", () => { - it("should revert", async () => { + describe('When non-owner is setting data', () => { + it('should revert', async () => { const txParams = { - dataKey: ethers.utils.solidityKeccak256( - ["string"], - ["FirstDataKey"] - ), - dataValue: "0xaabbccdd", + dataKey: ethers.utils.solidityKeccak256(['string'], ['FirstDataKey']), + dataValue: '0xaabbccdd', }; await expect( context.erc725Y .connect(context.accounts.anyone) - ["setData(bytes32[],bytes[])"]( - [txParams.dataKey], - [txParams.dataValue] - ) - ).to.be.revertedWith("Ownable: caller is not the owner"); + .setDataBatch([txParams.dataKey], [txParams.dataValue]), + ).to.be.revertedWith('Ownable: caller is not the owner'); - const fetchedData = await context.erc725Y.callStatic[ - "getData(bytes32)" - ](txParams.dataKey); + const fetchedData = await context.erc725Y.getData( + txParams.dataKey, + ); - expect(fetchedData).to.equal("0x"); + expect(fetchedData).to.equal('0x'); }); }); - describe("When interacting from a smart Contract", () => { + describe('When interacting from a smart Contract', () => { let erc725YWriter; beforeEach(async () => { - erc725YWriter = await new ERC725YWriter__factory( - context.accounts.anyone - ).deploy(); + erc725YWriter = await new ERC725YWriter__factory(context.accounts.anyone).deploy(); await context.erc725Y .connect(context.accounts.owner) .transferOwnership(erc725YWriter.address); }); - it("should pass and emit DataChanged event", async () => { + it('should pass and emit DataChanged event', async () => { const txParams = { - dataKey: ethers.utils.solidityKeccak256( - ["string"], - ["FirstDataKey"] - ), - dataValue: "0xaabbccdd", + dataKey: ethers.utils.solidityKeccak256(['string'], ['FirstDataKey']), + dataValue: '0xaabbccdd', }; await expect( erc725YWriter .connect(context.accounts.owner) - .callSetDataArray( - context.erc725Y.address, - [txParams.dataKey], - [txParams.dataValue] - ) + .callSetDataBatch(context.erc725Y.address, [txParams.dataKey], [txParams.dataValue]), ) - .to.emit(context.erc725Y, "DataChanged") + .to.emit(context.erc725Y, 'DataChanged') .withArgs(txParams.dataKey, txParams.dataValue); - const fetchedData = await context.erc725Y.callStatic[ - "getData(bytes32)" - ](txParams.dataKey); + const fetchedData = await context.erc725Y.getData( + txParams.dataKey, + ); expect(fetchedData).to.equal(txParams.dataValue); }); }); - describe("When interacting from an EOA", () => { - describe("when setting a new data Key", () => { - it("should pass and emit DataChanged event", async () => { + describe('When interacting from an EOA', () => { + describe('when setting a new data Key', () => { + it('should pass and emit DataChanged event', async () => { const txParams = { - dataKey: ethers.utils.solidityKeccak256( - ["string"], - ["FirstDataKey"] - ), - dataValue: "0xaabbccdd", + dataKey: ethers.utils.solidityKeccak256(['string'], ['FirstDataKey']), + dataValue: '0xaabbccdd', }; await expect( context.erc725Y .connect(context.accounts.owner) - ["setData(bytes32[],bytes[])"]( - [txParams.dataKey], - [txParams.dataValue] - ) + .setDataBatch([txParams.dataKey], [txParams.dataValue]), ) - .to.emit(context.erc725Y, "DataChanged") + .to.emit(context.erc725Y, 'DataChanged') .withArgs(txParams.dataKey, txParams.dataValue); - const fetchedData = await context.erc725Y.callStatic[ - "getData(bytes32)" - ](txParams.dataKey); + const fetchedData = await context.erc725Y.getData( + txParams.dataKey, + ); expect(fetchedData).to.equal(txParams.dataValue); }); }); - describe("when updating an existing data Key", () => { + describe('when updating an existing data Key', () => { let tx1Params; before(async () => { tx1Params = { - dataKey: ethers.utils.solidityKeccak256( - ["string"], - ["FirstDataKey"] - ), - dataValue: "0xaabbccdd", + dataKey: ethers.utils.solidityKeccak256(['string'], ['FirstDataKey']), + dataValue: '0xaabbccdd', }; // Setting for first time await context.erc725Y .connect(context.accounts.owner) - ["setData(bytes32[],bytes[])"]( - [tx1Params.dataKey], - [tx1Params.dataValue] - ); + .setDataBatch([tx1Params.dataKey], [tx1Params.dataValue]); - const fetchedData = await context.erc725Y.callStatic[ - "getData(bytes32)" - ](tx1Params.dataKey); + const fetchedData = await context.erc725Y.getData( + tx1Params.dataKey, + ); expect(fetchedData).to.equal(tx1Params.dataValue); }); - it("should pass and emit DataChanged event", async () => { + it('should pass and emit DataChanged event', async () => { const tx2Params = { dataKey: tx1Params.dataKey, - dataValue: "0xaabbccdd", + dataValue: '0xaabbccdd', }; await expect( context.erc725Y .connect(context.accounts.owner) - ["setData(bytes32[],bytes[])"]( - [tx2Params.dataKey], - [tx2Params.dataValue] - ) + .setDataBatch([tx2Params.dataKey], [tx2Params.dataValue]), ) - .to.emit(context.erc725Y, "DataChanged") + .to.emit(context.erc725Y, 'DataChanged') .withArgs(tx2Params.dataKey, tx2Params.dataValue); - const fetchedData = await context.erc725Y.callStatic[ - "getData(bytes32)" - ](tx2Params.dataKey); + const fetchedData = await context.erc725Y.getData( + tx2Params.dataKey, + ); expect(fetchedData).to.equal(tx2Params.dataValue); }); }); - describe("when removing an existing data Key", () => { + describe('when removing an existing data Key', () => { let tx1Params; before(async () => { tx1Params = { - dataKey: ethers.utils.solidityKeccak256( - ["string"], - ["FirstDataKey"] - ), - dataValue: "0xaabbccdd", + dataKey: ethers.utils.solidityKeccak256(['string'], ['FirstDataKey']), + dataValue: '0xaabbccdd', }; // Setting for first time await context.erc725Y .connect(context.accounts.owner) - ["setData(bytes32[],bytes[])"]( - [tx1Params.dataKey], - [tx1Params.dataValue] - ); + .setDataBatch([tx1Params.dataKey], [tx1Params.dataValue]); - const fetchedData = await context.erc725Y.callStatic[ - "getData(bytes32)" - ](tx1Params.dataKey); + const fetchedData = await context.erc725Y.getData( + tx1Params.dataKey, + ); expect(fetchedData).to.equal(tx1Params.dataValue); }); - it("should pass and emit DataChanged event", async () => { + it('should pass and emit DataChanged event', async () => { const tx2Params = { dataKey: tx1Params.dataKey, - dataValue: "0x", + dataValue: '0x', }; await expect( context.erc725Y .connect(context.accounts.owner) - ["setData(bytes32[],bytes[])"]( - [tx2Params.dataKey], - [tx2Params.dataValue] - ) + .setDataBatch([tx2Params.dataKey], [tx2Params.dataValue]), ) - .to.emit(context.erc725Y, "DataChanged") + .to.emit(context.erc725Y, 'DataChanged') .withArgs(tx2Params.dataKey, tx2Params.dataValue); - const fetchedData = await context.erc725Y.callStatic[ - "getData(bytes32)" - ](tx2Params.dataKey); + const fetchedData = await context.erc725Y.getData( + tx2Params.dataKey, + ); expect(fetchedData).to.equal(tx2Params.dataValue); }); }); - describe("when setting large bytes in the storage", () => { - it("should pass and emit DataChanged event", async () => { + describe('when setting large bytes in the storage', () => { + it('should pass and emit DataChanged event', async () => { const txParams = { - dataKey: ethers.utils.solidityKeccak256( - ["string"], - ["BytecodeOfMyFavoriteContract"] - ), + dataKey: ethers.utils.solidityKeccak256(['string'], ['BytecodeOfMyFavoriteContract']), dataValue: ERC725Bytecode, }; await expect( context.erc725Y .connect(context.accounts.owner) - ["setData(bytes32[],bytes[])"]( - [txParams.dataKey], - [txParams.dataValue] - ) + .setDataBatch([txParams.dataKey], [txParams.dataValue]), ) - .to.emit(context.erc725Y, "DataChanged") + .to.emit(context.erc725Y, 'DataChanged') .withArgs(txParams.dataKey, txParams.dataValue); - const fetchedData = await context.erc725Y.callStatic[ - "getData(bytes32)" - ](txParams.dataKey); + const fetchedData = await context.erc725Y.getData( + txParams.dataKey, + ); expect(fetchedData).to.equal(txParams.dataValue); }); }); - describe("when data keys length != data values length", () => { - it("should revert", async () => { + describe('when data keys length != data values length', () => { + it('should revert', async () => { const txParams = { - dataKey: ethers.utils.solidityKeccak256( - ["string"], - ["FirstDataKey"] - ), - dataValue: "0xaabbccdd", + dataKey: ethers.utils.solidityKeccak256(['string'], ['FirstDataKey']), + dataValue: '0xaabbccdd', }; await expect( context.erc725Y .connect(context.accounts.owner) - ["setData(bytes32[],bytes[])"]( + .setDataBatch( [txParams.dataKey, txParams.dataKey], - [txParams.dataValue] - ) + [txParams.dataValue], + ), ) .to.be.revertedWithCustomError( context.erc725Y, - "ERC725Y_DataKeysValuesLengthMismatch" + 'ERC725Y_DataKeysValuesLengthMismatch', ) - .withArgs(2, 1); }); }); }); }); }); - describe("When testing getting data", () => { - describe("When using getData(bytes32)", () => { - describe("When owner is setting data", () => { + describe('When testing getting data', () => { + describe('When using getData(bytes32)', () => { + describe('When owner is setting data', () => { let txParams; beforeEach(async () => { txParams = { - dataKey: ethers.utils.solidityKeccak256( - ["string"], - ["FirstDataKey"] - ), - dataValue: "0xaabbccdd", + dataKey: ethers.utils.solidityKeccak256(['string'], ['FirstDataKey']), + dataValue: '0xaabbccdd', }; await context.erc725Y .connect(context.accounts.owner) - ["setData(bytes32,bytes)"](txParams.dataKey, txParams.dataValue); + .setData(txParams.dataKey, txParams.dataValue); }); - it("should pass", async () => { + it('should pass', async () => { const result = await context.erc725Y .connect(context.accounts.owner) - .callStatic["getData(bytes32)"](txParams.dataKey); + .getData(txParams.dataKey); expect(result).to.equal(txParams.dataValue); }); }); - describe("When non-owner is setting data", () => { + describe('When non-owner is setting data', () => { let txParams; beforeEach(async () => { txParams = { - dataKey: ethers.utils.solidityKeccak256( - ["string"], - ["FirstDataKey"] - ), - dataValue: "0xaabbccdd", + dataKey: ethers.utils.solidityKeccak256(['string'], ['FirstDataKey']), + dataValue: '0xaabbccdd', }; await context.erc725Y .connect(context.accounts.owner) - ["setData(bytes32,bytes)"](txParams.dataKey, txParams.dataValue); + .setData(txParams.dataKey, txParams.dataValue); }); - it("should pass", async () => { + it('should pass', async () => { const result = await context.erc725Y .connect(context.accounts.anyone) - .callStatic["getData(bytes32)"](txParams.dataKey); + .getData(txParams.dataKey); expect(result).to.equal(txParams.dataValue); }); }); - describe("When interacting from a smart Contract", () => { + describe('When interacting from a smart Contract', () => { let erc725YReader; let txParams; beforeEach(async () => { - erc725YReader = await new ERC725YReader__factory( - context.accounts.anyone - ).deploy(); + erc725YReader = await new ERC725YReader__factory(context.accounts.anyone).deploy(); txParams = { - dataKey: ethers.utils.solidityKeccak256( - ["string"], - ["FirstDataKey"] - ), - dataValue: "0xaabbccdd", + dataKey: ethers.utils.solidityKeccak256(['string'], ['FirstDataKey']), + dataValue: '0xaabbccdd', }; await context.erc725Y .connect(context.accounts.owner) - ["setData(bytes32,bytes)"](txParams.dataKey, txParams.dataValue); + .setData(txParams.dataKey, txParams.dataValue); }); - it("should pass", async () => { + it('should pass', async () => { const result = await erc725YReader .connect(context.accounts.anyone) - .callStatic.callGetDataSingle( - context.erc725Y.address, - txParams.dataKey - ); + .callStatic.callGetData(context.erc725Y.address, txParams.dataKey); expect(result).to.equal(txParams.dataValue); }); }); - describe("When interacting from an EOA", () => { - describe("When getting normal sizeData", () => { + describe('When interacting from an EOA', () => { + describe('When getting normal sizeData', () => { let txParams; beforeEach(async () => { txParams = { - dataKey: ethers.utils.solidityKeccak256( - ["string"], - ["FirstDataKey"] - ), - dataValue: "0xaabbccdd", + dataKey: ethers.utils.solidityKeccak256(['string'], ['FirstDataKey']), + dataValue: '0xaabbccdd', }; await context.erc725Y .connect(context.accounts.owner) - ["setData(bytes32,bytes)"](txParams.dataKey, txParams.dataValue); + .setData(txParams.dataKey, txParams.dataValue); }); - it("should pass", async () => { + it('should pass', async () => { const result = await context.erc725Y .connect(context.accounts.owner) - .callStatic["getData(bytes32)"](txParams.dataKey); + .getData(txParams.dataKey); expect(result).to.equal(txParams.dataValue); }); }); - describe("When getting big sizeData", () => { + describe('When getting big sizeData', () => { let txParams; beforeEach(async () => { txParams = { - dataKey: ethers.utils.solidityKeccak256( - ["string"], - ["FirstDataKey"] - ), + dataKey: ethers.utils.solidityKeccak256(['string'], ['FirstDataKey']), dataValue: ERC725Bytecode, }; await context.erc725Y .connect(context.accounts.owner) - ["setData(bytes32,bytes)"](txParams.dataKey, txParams.dataValue); + .setData(txParams.dataKey, txParams.dataValue); }); - it("should pass", async () => { + it('should pass', async () => { const result = await context.erc725Y .connect(context.accounts.owner) - .callStatic["getData(bytes32)"](txParams.dataKey); + .getData(txParams.dataKey); expect(result).to.equal(txParams.dataValue); }); }); }); }); - describe("When using getData(bytes32[])", () => { - describe("When owner is setting data", () => { + describe('When using getDataBatch(bytes32[])', () => { + describe('When owner is setting data', () => { let txParams; beforeEach(async () => { txParams = { - dataKey: ethers.utils.solidityKeccak256( - ["string"], - ["FirstDataKey"] - ), - dataValue: "0xaabbccdd", + dataKey: ethers.utils.solidityKeccak256(['string'], ['FirstDataKey']), + dataValue: '0xaabbccdd', }; await context.erc725Y .connect(context.accounts.owner) - ["setData(bytes32[],bytes[])"]( - [txParams.dataKey], - [txParams.dataValue] - ); + .setDataBatch([txParams.dataKey], [txParams.dataValue]); }); - it("should pass", async () => { + it('should pass', async () => { const [result] = await context.erc725Y .connect(context.accounts.owner) - .callStatic["getData(bytes32[])"]([txParams.dataKey]); + .getDataBatch([txParams.dataKey]); expect(result).to.equal(txParams.dataValue); }); }); - describe("When non-owner is setting data", () => { + describe('When non-owner is setting data', () => { let txParams; beforeEach(async () => { txParams = { - dataKey: ethers.utils.solidityKeccak256( - ["string"], - ["FirstDataKey"] - ), - dataValue: "0xaabbccdd", + dataKey: ethers.utils.solidityKeccak256(['string'], ['FirstDataKey']), + dataValue: '0xaabbccdd', }; await context.erc725Y .connect(context.accounts.owner) - ["setData(bytes32[],bytes[])"]( - [txParams.dataKey], - [txParams.dataValue] - ); + .setDataBatch([txParams.dataKey], [txParams.dataValue]); }); - it("should pass", async () => { + it('should pass', async () => { const [result] = await context.erc725Y .connect(context.accounts.anyone) - .callStatic["getData(bytes32[])"]([txParams.dataKey]); + .getDataBatch([txParams.dataKey]); expect(result).to.equal(txParams.dataValue); }); }); - describe("When interacting from a smart Contract", () => { + describe('When interacting from a smart Contract', () => { let erc725YReader; let txParams; beforeEach(async () => { - erc725YReader = await new ERC725YReader__factory( - context.accounts.anyone - ).deploy(); + erc725YReader = await new ERC725YReader__factory(context.accounts.anyone).deploy(); txParams = { - dataKey: ethers.utils.solidityKeccak256( - ["string"], - ["FirstDataKey"] - ), - dataValue: "0xaabbccdd", + dataKey: ethers.utils.solidityKeccak256(['string'], ['FirstDataKey']), + dataValue: '0xaabbccdd', }; await context.erc725Y .connect(context.accounts.owner) - ["setData(bytes32[],bytes[])"]( - [txParams.dataKey], - [txParams.dataValue] - ); + .setDataBatch([txParams.dataKey], [txParams.dataValue]); }); - it("should pass", async () => { + it('should pass', async () => { const [result] = await erc725YReader .connect(context.accounts.anyone) - .callStatic.callGetDataArray(context.erc725Y.address, [ - txParams.dataKey, - ]); + .callStatic.callGetDataBatch(context.erc725Y.address, [txParams.dataKey]); expect(result).to.equal(txParams.dataValue); }); }); - describe("When interacting from an EOA", () => { - describe("When getting normal sizeData", () => { + describe('When interacting from an EOA', () => { + describe('When getting normal sizeData', () => { let txParams; beforeEach(async () => { txParams = { - dataKey: ethers.utils.solidityKeccak256( - ["string"], - ["FirstDataKey"] - ), - dataValue: "0xaabbccdd", + dataKey: ethers.utils.solidityKeccak256(['string'], ['FirstDataKey']), + dataValue: '0xaabbccdd', }; await context.erc725Y .connect(context.accounts.owner) - ["setData(bytes32[],bytes[])"]( - [txParams.dataKey], - [txParams.dataValue] - ); + .setDataBatch([txParams.dataKey], [txParams.dataValue]); }); - it("should pass", async () => { + it('should pass', async () => { const [result] = await context.erc725Y .connect(context.accounts.owner) - .callStatic["getData(bytes32[])"]([txParams.dataKey]); + .getDataBatch([txParams.dataKey]); expect(result).to.equal(txParams.dataValue); }); }); - describe("When getting big sizeData", () => { + describe('When getting big sizeData', () => { let txParams; beforeEach(async () => { txParams = { - dataKey: ethers.utils.solidityKeccak256( - ["string"], - ["FirstDataKey"] - ), + dataKey: ethers.utils.solidityKeccak256(['string'], ['FirstDataKey']), dataValue: ERC725Bytecode, }; await context.erc725Y .connect(context.accounts.owner) - ["setData(bytes32[],bytes[])"]( - [txParams.dataKey], - [txParams.dataValue] - ); + .setDataBatch([txParams.dataKey], [txParams.dataValue]); }); - it("should pass", async () => { + it('should pass', async () => { const [result] = await context.erc725Y .connect(context.accounts.owner) - .callStatic["getData(bytes32[])"]([txParams.dataKey]); + .getDataBatch([txParams.dataKey]); expect(result).to.equal(txParams.dataValue); }); }); - describe("When getting many entries", () => { + describe('When getting many entries', () => { let txParams; beforeEach(async () => { txParams = { - dataKey1: ethers.utils.solidityKeccak256( - ["string"], - ["FirstDataKey"] - ), - dataValue1: "0xddccbbaa", - dataKey2: ethers.utils.solidityKeccak256( - ["string"], - ["SecondDataKey"] - ), - dataValue2: "0xaabbccdd", + dataKey1: ethers.utils.solidityKeccak256(['string'], ['FirstDataKey']), + dataValue1: '0xddccbbaa', + dataKey2: ethers.utils.solidityKeccak256(['string'], ['SecondDataKey']), + dataValue2: '0xaabbccdd', }; await context.erc725Y .connect(context.accounts.owner) - ["setData(bytes32[],bytes[])"]( + .setDataBatch( [txParams.dataKey1, txParams.dataKey2], - [txParams.dataValue1, txParams.dataValue2] + [txParams.dataValue1, txParams.dataValue2], ); }); - it("should pass", async () => { + it('should pass', async () => { const [result1, result2] = await context.erc725Y .connect(context.accounts.owner) - .callStatic["getData(bytes32[])"]([ - txParams.dataKey1, - txParams.dataKey2, - ]); + .getDataBatch([txParams.dataKey1, txParams.dataKey2]); expect(result1).to.equal(txParams.dataValue1); expect(result2).to.equal(txParams.dataValue2); @@ -1001,7 +848,7 @@ export type ERC725YInitializeTestContext = { }; export const shouldInitializeLikeERC725Y = ( - buildContext: () => Promise + buildContext: () => Promise, ) => { let context: ERC725YInitializeTestContext; @@ -1009,20 +856,17 @@ export const shouldInitializeLikeERC725Y = ( context = await buildContext(); }); - describe("when the contract was initialized", () => { - it("should have registered the ERC165 interface", async () => { - expect(await context.erc725Y.supportsInterface(INTERFACE_ID.ERC165)).to.be - .true; + describe('when the contract was initialized', () => { + it('should have registered the ERC165 interface', async () => { + expect(await context.erc725Y.supportsInterface(INTERFACE_ID.ERC165)).to.be.true; }); - it("should have registered the ERC725Y interface", async () => { + it('should have registered the ERC725Y interface', async () => { expect(await context.erc725Y.supportsInterface(INTERFACE_ID.ERC725Y)); }); - it("should have set the correct owner", async () => { - expect(await context.erc725Y.callStatic.owner()).to.be.equal( - context.deployParams.newOwner - ); + it('should have set the correct owner', async () => { + expect(await context.erc725Y.callStatic.owner()).to.be.equal(context.deployParams.newOwner); }); }); }; diff --git a/implementations/test/ERC725Y.test.ts b/implementations/test/ERC725Y.test.ts index e0f825c8..26eee1fa 100644 --- a/implementations/test/ERC725Y.test.ts +++ b/implementations/test/ERC725Y.test.ts @@ -1,18 +1,18 @@ -import { ethers } from "hardhat"; -import { expect } from "chai"; -import { ERC725Y__factory, ERC725YInit__factory } from "../types"; +import { ethers } from 'hardhat'; +import { expect } from 'chai'; +import { ERC725Y__factory, ERC725YInit__factory } from '../types'; import { getNamedAccounts, shouldBehaveLikeERC725Y, shouldInitializeLikeERC725Y, ERC725YTestContext, -} from "./ERC725Y.behaviour"; +} from './ERC725Y.behaviour'; -import { deployProxy } from "./fixtures"; +import { deployProxy } from './fixtures'; -describe("ERC725Y", () => { - describe("when using ERC725Y contract with constructor", () => { +describe('ERC725Y', () => { + describe('when using ERC725Y contract with constructor', () => { const buildTestContext = async (): Promise => { const accounts = await getNamedAccounts(); @@ -20,21 +20,19 @@ describe("ERC725Y", () => { newOwner: accounts.owner.address, }; - const erc725Y = await new ERC725Y__factory(accounts.owner).deploy( - deployParams.newOwner - ); + const erc725Y = await new ERC725Y__factory(accounts.owner).deploy(deployParams.newOwner); return { accounts, erc725Y, deployParams }; }; - describe("when deploying the contract", () => { + describe('when deploying the contract', () => { let context: ERC725YTestContext; beforeEach(async () => { context = await buildTestContext(); }); - it("should revert when giving address(0) as owner", async () => { + it('should revert when giving address(0) as owner', async () => { const accounts = await getNamedAccounts(); const deployParams = { @@ -42,13 +40,11 @@ describe("ERC725Y", () => { }; await expect( - new ERC725Y__factory(accounts.owner).deploy(deployParams.newOwner) - ).to.be.revertedWith( - "Ownable: new owner is the zero address" - ); + new ERC725Y__factory(accounts.owner).deploy(deployParams.newOwner), + ).to.be.revertedWith('Ownable: new owner is the zero address'); }); - describe("once the contract was deployed", () => { + describe('once the contract was deployed', () => { shouldInitializeLikeERC725Y(async () => { const { erc725Y, deployParams } = context; return { @@ -60,12 +56,12 @@ describe("ERC725Y", () => { }); }); - describe("when testing deployed contract", () => { + describe('when testing deployed contract', () => { shouldBehaveLikeERC725Y(buildTestContext); }); }); - describe("when using ERC725Y contract with proxy", () => { + describe('when using ERC725Y contract with proxy', () => { const buildTestContext = async (): Promise => { const accounts = await getNamedAccounts(); @@ -73,57 +69,46 @@ describe("ERC725Y", () => { newOwner: accounts.owner.address, }; - const erc725YBase = await new ERC725YInit__factory( - accounts.owner - ).deploy(); + const erc725YBase = await new ERC725YInit__factory(accounts.owner).deploy(); - const erc725YProxy = await deployProxy( - erc725YBase.address, - accounts.owner - ); + const erc725YProxy = await deployProxy(erc725YBase.address, accounts.owner); const erc725Y = erc725YBase.attach(erc725YProxy); return { accounts, erc725Y, deployParams }; }; const initializeProxy = async (context: ERC725YTestContext) => { - return context.erc725Y["initialize(address)"]( - context.deployParams.newOwner - ); + return context.erc725Y['initialize(address)'](context.deployParams.newOwner); }; - describe("when deploying the base implementation contract", () => { - it("prevent any address from calling the initialize(...) function on the implementation", async () => { + describe('when deploying the base implementation contract', () => { + it('prevent any address from calling the initialize(...) function on the implementation', async () => { const accounts = await ethers.getSigners(); - const erc725YBase = await new ERC725YInit__factory( - accounts[0] - ).deploy(); + const erc725YBase = await new ERC725YInit__factory(accounts[0]).deploy(); const randomCaller = accounts[1]; - await expect( - erc725YBase["initialize(address)"](randomCaller.address) - ).to.be.revertedWith("Initializable: contract is already initialized"); + await expect(erc725YBase['initialize(address)'](randomCaller.address)).to.be.revertedWith( + 'Initializable: contract is already initialized', + ); }); }); - describe("when deploying the contract as proxy", () => { + describe('when deploying the contract as proxy', () => { let context: ERC725YTestContext; beforeEach(async () => { context = await buildTestContext(); }); - it("should revert when initializing with address(0) as owner", async () => { + it('should revert when initializing with address(0) as owner', async () => { await expect( - context.erc725Y["initialize(address)"](ethers.constants.AddressZero) - ).to.be.revertedWith( - "Ownable: new owner is the zero address" - ); + context.erc725Y['initialize(address)'](ethers.constants.AddressZero), + ).to.be.revertedWith('Ownable: new owner is the zero address'); }); - describe("when initializing the contract", () => { + describe('when initializing the contract', () => { shouldInitializeLikeERC725Y(async () => { const { erc725Y, deployParams } = context; const initializeTransaction = await initializeProxy(context); @@ -136,24 +121,24 @@ describe("ERC725Y", () => { }); }); - describe("when calling initialize more than once", () => { - it("should revert", async () => { + describe('when calling initialize more than once', () => { + it('should revert', async () => { await initializeProxy(context); await expect(initializeProxy(context)).to.be.revertedWith( - "Initializable: contract is already initialized" + 'Initializable: contract is already initialized', ); }); }); }); - describe("when testing deployed contract", () => { + describe('when testing deployed contract', () => { shouldBehaveLikeERC725Y(() => buildTestContext().then(async (context) => { await initializeProxy(context); return context; - }) + }), ); }); }); diff --git a/implementations/test/fixtures.ts b/implementations/test/fixtures.ts index 15cc6508..06991277 100644 --- a/implementations/test/fixtures.ts +++ b/implementations/test/fixtures.ts @@ -1,20 +1,20 @@ -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; export async function deployProxy( baseContractAddress: string, - deployer: SignerWithAddress + deployer: SignerWithAddress, ): Promise { /** * @see https://blog.openzeppelin.com/deep-dive-into-the-minimal-proxy-contract/ * The first 10 x hex opcodes copy the runtime code into memory and return it. */ const eip1167RuntimeCodeTemplate = - "0x3d602d80600a3d3981f3363d3d373d3d3d363d73bebebebebebebebebebebebebebebebebebebebe5af43d82803e903d91602b57fd5bf3"; + '0x3d602d80600a3d3981f3363d3d373d3d3d363d73bebebebebebebebebebebebebebebebebebebebe5af43d82803e903d91602b57fd5bf3'; // deploy proxy contract let proxyBytecode = eip1167RuntimeCodeTemplate.replace( - "bebebebebebebebebebebebebebebebebebebebe", - baseContractAddress.substr(2) + 'bebebebebebebebebebebebebebebebebebebebe', + baseContractAddress.substr(2), ); let tx = await deployer.sendTransaction({ data: proxyBytecode,