diff --git a/.solcover.js b/.solcover.js index cb597f9..08db639 100644 --- a/.solcover.js +++ b/.solcover.js @@ -1,6 +1,6 @@ module.exports = { norpc: true, - testCommand: 'npm run hardhat:test', - compileCommand: 'npm run hardhat:compile', + testCommand: 'npm test', + compileCommand: 'npm run compile', skipFiles: ['mocks'], }; diff --git a/analysis/control-flow/TokenRecoverLegacy.png b/analysis/control-flow/TokenRecoverLegacy.png index 130e807..701eaea 100644 Binary files a/analysis/control-flow/TokenRecoverLegacy.png and b/analysis/control-flow/TokenRecoverLegacy.png differ diff --git a/dist/ERC20Recover.dist.sol b/dist/ERC20Recover.dist.sol index 0bce80f..c51db3e 100644 --- a/dist/ERC20Recover.dist.sol +++ b/dist/ERC20Recover.dist.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -// Sources flattened with hardhat v2.18.3 https://hardhat.org +// Sources flattened with hardhat v2.19.0 https://hardhat.org diff --git a/dist/ERC721Recover.dist.sol b/dist/ERC721Recover.dist.sol index 5f18ed3..9b3ff46 100644 --- a/dist/ERC721Recover.dist.sol +++ b/dist/ERC721Recover.dist.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -// Sources flattened with hardhat v2.18.3 https://hardhat.org +// Sources flattened with hardhat v2.19.0 https://hardhat.org diff --git a/dist/TokenRecover.dist.sol b/dist/TokenRecover.dist.sol index da65793..3d52f0c 100644 --- a/dist/TokenRecover.dist.sol +++ b/dist/TokenRecover.dist.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -// Sources flattened with hardhat v2.18.3 https://hardhat.org +// Sources flattened with hardhat v2.19.0 https://hardhat.org diff --git a/dist/TokenRecoverLegacy.dist.sol b/dist/TokenRecoverLegacy.dist.sol index b941e73..4d3d005 100644 --- a/dist/TokenRecoverLegacy.dist.sol +++ b/dist/TokenRecoverLegacy.dist.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -// Sources flattened with hardhat v2.18.3 https://hardhat.org +// Sources flattened with hardhat v2.19.0 https://hardhat.org diff --git a/docs/index.md b/docs/index.md index 79ea89a..3bc6f44 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,30 +1,25 @@ # Solidity API -## TokenRecoverLegacy - -_Allows the contract owner to recover any ERC20 token sent into the contract and send them to `owner()`. - -WARNING: The deployer address will automatically be set as contract owner. +## ERC20Recover -NOTE: this is a legacy version of `TokenRecover` that works as v4.x and earlier and MAY be removed in future releases. -We highly recommend to keep the code updated to use newer versions of the recover._ +_Allows the contract owner to recover any ERC20 token sent into the contract and send them to a receiver._ ### constructor ```solidity -constructor() internal +constructor(address initialOwner) internal ``` -_Initializes the contract setting the deployer as the initial owner._ +_Initializes the contract setting the address provided by the deployer as the initial owner._ ### recoverERC20 ```solidity -function recoverERC20(address tokenAddress, uint256 tokenAmount) public virtual +function recoverERC20(address tokenAddress, address tokenReceiver, uint256 tokenAmount) public virtual ``` _Recovers a `tokenAmount` of the ERC20 `tokenAddress` locked into this contract -and sends them to the `owner()` address. +and sends them to the `tokenReceiver` address. NOTE: restricting access to owner only. See `RecoverERC20::_recoverERC20`._ @@ -33,34 +28,44 @@ NOTE: restricting access to owner only. See `RecoverERC20::_recoverERC20`._ | Name | Type | Description | | ---- | ---- | ----------- | | tokenAddress | address | The contract address of the token to recover. | +| tokenReceiver | address | The address that will receive the recovered tokens. | | tokenAmount | uint256 | Number of tokens to be recovered. | -## RecoverERC20 +## ERC721Recover -_Allows to recover any ERC20 token sent into the contract and send them to a receiver._ +_Allows the contract owner to recover any ERC721 token sent into the contract and send them to a receiver._ -### _recoverERC20 +### constructor ```solidity -function _recoverERC20(address tokenAddress, address tokenReceiver, uint256 tokenAmount) internal virtual +constructor(address initialOwner) internal ``` -_Recovers a `tokenAmount` of the ERC20 `tokenAddress` locked into this contract -and sends them to the `tokenReceiver` address. +_Initializes the contract setting the address provided by the deployer as the initial owner._ -WARNING: it allows everyone to recover tokens. Access controls MUST be defined in derived contracts._ +### recoverERC721 + +```solidity +function recoverERC721(address tokenAddress, address tokenReceiver, uint256 tokenId, bytes data) public virtual +``` + +_Recovers the `tokenId` of the ERC721 `tokenAddress` locked into this contract +and sends it to the `tokenReceiver` address. + +NOTE: restricting access to owner only. See `RecoverERC721::_recoverERC721`._ #### Parameters | Name | Type | Description | | ---- | ---- | ----------- | | tokenAddress | address | The contract address of the token to recover. | -| tokenReceiver | address | The address that will receive the recovered tokens. | -| tokenAmount | uint256 | Number of tokens to be recovered. | +| tokenReceiver | address | The address that will receive the recovered token. | +| tokenId | uint256 | The identifier for the NFT to be recovered. | +| data | bytes | Additional data with no specified format. | -## ERC20Recover +## TokenRecover -_Allows the contract owner to recover any ERC20 token sent into the contract and send them to a receiver._ +_Allows the contract owner to recover any ERC20 or ERC721 token sent into the contract and send them to a receiver._ ### constructor @@ -89,18 +94,6 @@ NOTE: restricting access to owner only. See `RecoverERC20::_recoverERC20`._ | tokenReceiver | address | The address that will receive the recovered tokens. | | tokenAmount | uint256 | Number of tokens to be recovered. | -## ERC721Recover - -_Allows the contract owner to recover any ERC721 token sent into the contract and send them to a receiver._ - -### constructor - -```solidity -constructor(address initialOwner) internal -``` - -_Initializes the contract setting the address provided by the deployer as the initial owner._ - ### recoverERC721 ```solidity @@ -121,26 +114,31 @@ NOTE: restricting access to owner only. See `RecoverERC721::_recoverERC721`._ | tokenId | uint256 | The identifier for the NFT to be recovered. | | data | bytes | Additional data with no specified format. | -## TokenRecover +## TokenRecoverLegacy -_Allows the contract owner to recover any ERC20 or ERC721 token sent into the contract and send them to a receiver._ +_Allows the contract owner to recover any ERC20 token sent into the contract and send them to `owner()`. + +WARNING: The deployer address will automatically be set as contract owner. + +NOTE: this is a legacy version of `TokenRecover` that works as v4.x and earlier and MAY be removed in future releases. +We highly recommend to keep the code updated to use newer versions of the recover._ ### constructor ```solidity -constructor(address initialOwner) internal +constructor() internal ``` -_Initializes the contract setting the address provided by the deployer as the initial owner._ +_Initializes the contract setting the deployer as the initial owner._ ### recoverERC20 ```solidity -function recoverERC20(address tokenAddress, address tokenReceiver, uint256 tokenAmount) public virtual +function recoverERC20(address tokenAddress, uint256 tokenAmount) public virtual ``` _Recovers a `tokenAmount` of the ERC20 `tokenAddress` locked into this contract -and sends them to the `tokenReceiver` address. +and sends them to the `owner()` address. NOTE: restricting access to owner only. See `RecoverERC20::_recoverERC20`._ @@ -149,28 +147,30 @@ NOTE: restricting access to owner only. See `RecoverERC20::_recoverERC20`._ | Name | Type | Description | | ---- | ---- | ----------- | | tokenAddress | address | The contract address of the token to recover. | -| tokenReceiver | address | The address that will receive the recovered tokens. | | tokenAmount | uint256 | Number of tokens to be recovered. | -### recoverERC721 +## RecoverERC20 + +_Allows to recover any ERC20 token sent into the contract and send them to a receiver._ + +### _recoverERC20 ```solidity -function recoverERC721(address tokenAddress, address tokenReceiver, uint256 tokenId, bytes data) public virtual +function _recoverERC20(address tokenAddress, address tokenReceiver, uint256 tokenAmount) internal virtual ``` -_Recovers the `tokenId` of the ERC721 `tokenAddress` locked into this contract -and sends it to the `tokenReceiver` address. +_Recovers a `tokenAmount` of the ERC20 `tokenAddress` locked into this contract +and sends them to the `tokenReceiver` address. -NOTE: restricting access to owner only. See `RecoverERC721::_recoverERC721`._ +WARNING: it allows everyone to recover tokens. Access controls MUST be defined in derived contracts._ #### Parameters | Name | Type | Description | | ---- | ---- | ----------- | | tokenAddress | address | The contract address of the token to recover. | -| tokenReceiver | address | The address that will receive the recovered token. | -| tokenId | uint256 | The identifier for the NFT to be recovered. | -| data | bytes | Additional data with no specified format. | +| tokenReceiver | address | The address that will receive the recovered tokens. | +| tokenAmount | uint256 | Number of tokens to be recovered. | ## RecoverERC721 diff --git a/hardhat.config.js b/hardhat.config.js index 7ce7213..0b69ae6 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -7,7 +7,7 @@ require('solidity-docgen'); module.exports = { defaultNetwork: 'hardhat', solidity: { - version: '0.8.22', + version: '0.8.23', settings: { evmVersion: 'shanghai', optimizer: { diff --git a/package-lock.json b/package-lock.json index 004c45d..c4f6224 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "eth-token-recover", - "version": "6.1.0", + "version": "6.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "eth-token-recover", - "version": "6.1.0", + "version": "6.1.1", "license": "MIT", "dependencies": { "@openzeppelin/contracts": "5.0.0" @@ -16,23 +16,23 @@ "@nomiclabs/hardhat-web3": "^2.0.0", "@openzeppelin/test-helpers": "^0.5.16", "chai": "^4.3.10", - "eslint": "^8.52.0", + "eslint": "^8.53.0", "eslint-config-prettier": "^9.0.0", "eslint-config-standard": "^17.1.0", "eslint-plugin-mocha-no-only": "^1.1.1", "graphlib": "^2.1.8", - "hardhat": "^2.18.3", + "hardhat": "^2.19.0", "hardhat-exposed": "^0.3.13", "hardhat-gas-reporter": "^1.0.9", - "prettier": "^3.0.3", - "prettier-plugin-solidity": "^1.1.3", + "prettier": "^3.1.0", + "prettier-plugin-solidity": "^1.2.0", "rimraf": "^5.0.5", - "sol2uml": "^2.5.16", - "solhint": "^3.6.2", + "sol2uml": "^2.5.18", + "solhint": "^4.0.0", "solhint-plugin-openzeppelin": "file:scripts/solhint-custom", "solidity-coverage": "^0.8.5", "solidity-docgen": "^0.6.0-beta.36", - "surya": "^0.4.10", + "surya": "^0.4.11", "truffle": "^5.11.5", "vuepress": "^1.9.10", "vuepress-plugin-google-gtag": "^1.0.1", @@ -2203,9 +2203,9 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", - "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.3.tgz", + "integrity": "sha512-yZzuIG+jnVu6hNSzFEN07e8BxF3uAzYtQb6uDkaYZLo6oYZDCq454c5kB8zxnzfCYyP4MIuyBn10L0DqwujTmA==", "dev": true, "dependencies": { "ajv": "^6.12.4", @@ -2226,9 +2226,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.52.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.52.0.tgz", - "integrity": "sha512-mjZVbpaeMZludF2fsWLD0Z9gCref1Tk4i9+wddjRvpUNqqcndPkBD09N/Mapey0b3jaXbLm2kICwFv2E64QinA==", + "version": "8.53.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.53.0.tgz", + "integrity": "sha512-Kn7K8dx/5U6+cT1yEhpX1w4PCSg0M+XyRILPgvwcEBjerFWCwQj5sbr3/VmxqV0JGHCBCzyd6LxypEuehypY1w==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -4136,6 +4136,47 @@ "node": ">=14" } }, + "node_modules/@pnpm/config.env-replace": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz", + "integrity": "sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==", + "dev": true, + "engines": { + "node": ">=12.22.0" + } + }, + "node_modules/@pnpm/network.ca-file": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@pnpm/network.ca-file/-/network.ca-file-1.0.2.tgz", + "integrity": "sha512-YcPQ8a0jwYU9bTdJDpXjMi7Brhkr1mXsXrUJvjqM2mQDgkRiz8jFaQGOdaLxgjtUfQgZhKy/O3cG/YwmgKaxLA==", + "dev": true, + "dependencies": { + "graceful-fs": "4.2.10" + }, + "engines": { + "node": ">=12.22.0" + } + }, + "node_modules/@pnpm/network.ca-file/node_modules/graceful-fs": { + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "dev": true + }, + "node_modules/@pnpm/npm-conf": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-2.2.2.tgz", + "integrity": "sha512-UA91GwWPhFExt3IizW6bOeY/pQ0BkuNwKjk9iQW9KqxluGCrg4VenZ0/L+2Y0+ZOtme72EVvg6v0zo3AMQRCeA==", + "dev": true, + "dependencies": { + "@pnpm/config.env-replace": "^1.1.0", + "@pnpm/network.ca-file": "^1.0.1", + "config-chain": "^1.1.11" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/@protobufjs/aspromise": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", @@ -4424,9 +4465,9 @@ } }, "node_modules/@solidity-parser/parser": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.16.1.tgz", - "integrity": "sha512-PdhRFNhbTtu3x8Axm0uYpqOy/lODYQK+MlYSgqIsq2L8SFYEHJPHNUiOTAJbDGzNjjr1/n9AcIayxafR/fWmYw==", + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.16.2.tgz", + "integrity": "sha512-PI9NfoA3P8XK2VBkK5oIfRgKDsicwDZfkVq9ZTBCQYGOP1N2owgY2dyLGyU5/J/hQs8KRk55kdmvTLjy3Mu3vg==", "dev": true, "dependencies": { "antlr4ts": "^0.5.0-alpha.4" @@ -9650,9 +9691,9 @@ } }, "node_modules/acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz", + "integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -12792,6 +12833,16 @@ "dev": true, "optional": true }, + "node_modules/config-chain": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", + "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", + "dev": true, + "dependencies": { + "ini": "^1.3.4", + "proto-list": "~1.2.1" + } + }, "node_modules/configstore": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", @@ -15623,15 +15674,15 @@ } }, "node_modules/eslint": { - "version": "8.52.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.52.0.tgz", - "integrity": "sha512-zh/JHnaixqHZsolRB/w9/02akBk9EPrOs9JwcTP2ek7yL5bVvXuRariiaAjjoJ5DvuwQ1WAE/HsMz+w17YgBCg==", + "version": "8.53.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.53.0.tgz", + "integrity": "sha512-N4VuiPjXDUa4xVeV/GC/RV3hQW9Nw+Y463lkWaKKXKYMvmRiRDAtfpuPFLN+E1/6ZhyR8J2ig+eVREnYgUsiag==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.2", - "@eslint/js": "8.52.0", + "@eslint/eslintrc": "^2.1.3", + "@eslint/js": "8.53.0", "@humanwhocodes/config-array": "^0.11.13", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -22286,9 +22337,9 @@ } }, "node_modules/globals": { - "version": "13.21.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.21.0.tgz", - "integrity": "sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==", + "version": "13.23.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", + "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -22553,9 +22604,9 @@ } }, "node_modules/hardhat": { - "version": "2.18.3", - "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.18.3.tgz", - "integrity": "sha512-JuYaTG+4ZHVjEHCW5Hn6jCHH3LpO75dtgznZpM/dLv12RcSlw/xHbeQh3FAsGahQr1epKryZcZEMHvztVZHe0g==", + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.19.0.tgz", + "integrity": "sha512-kMpwovOEfrFRQXEopCP+JTcKVwSYVj8rnXE0LynxDqnh06yvyKCQknmXL6IVYTHQL6Csysc/yNbCHQbjSeJGpA==", "dev": true, "dependencies": { "@ethersproject/abi": "^5.1.2", @@ -29239,9 +29290,9 @@ } }, "node_modules/prettier": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", - "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.0.tgz", + "integrity": "sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" @@ -29254,20 +29305,20 @@ } }, "node_modules/prettier-plugin-solidity": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/prettier-plugin-solidity/-/prettier-plugin-solidity-1.1.3.tgz", - "integrity": "sha512-fQ9yucPi2sBbA2U2Xjh6m4isUTJ7S7QLc/XDDsktqqxYfTwdYKJ0EnnywXHwCGAaYbQNK+HIYPL1OemxuMsgeg==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/prettier-plugin-solidity/-/prettier-plugin-solidity-1.2.0.tgz", + "integrity": "sha512-fgxcUZpVAP+LlRfy5JI5oaAkXGkmsje2VJ5krv/YMm+rcTZbIUwFguSw5f+WFuttMjpDm6wB4UL7WVkArEfiVA==", "dev": true, "dependencies": { - "@solidity-parser/parser": "^0.16.0", - "semver": "^7.3.8", + "@solidity-parser/parser": "^0.16.2", + "semver": "^7.5.4", "solidity-comments-extractor": "^0.0.7" }, "engines": { - "node": ">=12" + "node": ">=16" }, "peerDependencies": { - "prettier": ">=2.3.0 || >=3.0.0-alpha.0" + "prettier": ">=2.3.0" } }, "node_modules/prettier-plugin-solidity/node_modules/lru-cache": { @@ -29370,6 +29421,12 @@ "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", "dev": true }, + "node_modules/proto-list": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", + "dev": true + }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -31682,17 +31739,17 @@ } }, "node_modules/sol2uml": { - "version": "2.5.16", - "resolved": "https://registry.npmjs.org/sol2uml/-/sol2uml-2.5.16.tgz", - "integrity": "sha512-VEBCFuCr8xVle7ePClojhf/4O/H9qupnZM1uhgQXB6mfX5sKttRDIaUrSisguZJ9rW0WjI/GgXWolpErYQNQCg==", + "version": "2.5.18", + "resolved": "https://registry.npmjs.org/sol2uml/-/sol2uml-2.5.18.tgz", + "integrity": "sha512-lwyH8Xh5rY//2UAKqnu7R8DTxS7oAFM1eJEYTUyq0tNhC4H9zzyg9f0lshyxSTV1BDvdJiobITonS5ySQaHhLg==", "dev": true, "dependencies": { "@aduh95/viz.js": "^3.7.0", "@solidity-parser/parser": "^0.16.1", - "axios": "^1.3.4", + "axios": "^1.6.0", "axios-debug-log": "^1.0.0", "cli-color": "^2.0.3", - "commander": "^11.0.0", + "commander": "^11.1.0", "convert-svg-to-png": "^0.6.4", "debug": "^4.3.4", "diff-match-patch": "^1.0.5", @@ -31704,6 +31761,17 @@ "sol2uml": "lib/sol2uml.js" } }, + "node_modules/sol2uml/node_modules/axios": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.1.tgz", + "integrity": "sha512-vfBmhDpKafglh0EldBEbVuoe7DyAavGSLWhuSm5ZSEKQnHhBf0xAAwybbNH1IkrJNGnS/VG4I5yxig1pCEXE4g==", + "dev": true, + "dependencies": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "node_modules/sol2uml/node_modules/commander": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", @@ -31954,9 +32022,9 @@ } }, "node_modules/solhint": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/solhint/-/solhint-3.6.2.tgz", - "integrity": "sha512-85EeLbmkcPwD+3JR7aEMKsVC9YrRSxd4qkXuMzrlf7+z2Eqdfm1wHWq1ffTuo5aDhoZxp2I9yF3QkxZOxOL7aQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/solhint/-/solhint-4.0.0.tgz", + "integrity": "sha512-bFViMcFvhqVd/HK3Roo7xZXX5nbujS7Bxeg5vnZc9QvH0yCWCrQ38Yrn1pbAY9tlKROc6wFr+rK1mxYgYrjZgA==", "dev": true, "dependencies": { "@solidity-parser/parser": "^0.16.0", @@ -31970,6 +32038,7 @@ "glob": "^8.0.3", "ignore": "^5.2.4", "js-yaml": "^4.1.0", + "latest-version": "^7.0.0", "lodash": "^4.17.21", "pluralize": "^8.0.0", "semver": "^7.5.2", @@ -31988,6 +32057,30 @@ "resolved": "scripts/solhint-custom", "link": true }, + "node_modules/solhint/node_modules/@sindresorhus/is": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz", + "integrity": "sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==", + "dev": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" + } + }, + "node_modules/solhint/node_modules/@szmarczak/http-timer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", + "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", + "dev": true, + "dependencies": { + "defer-to-connect": "^2.0.1" + }, + "engines": { + "node": ">=14.16" + } + }, "node_modules/solhint/node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -32021,6 +32114,33 @@ "balanced-match": "^1.0.0" } }, + "node_modules/solhint/node_modules/cacheable-lookup": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", + "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", + "dev": true, + "engines": { + "node": ">=14.16" + } + }, + "node_modules/solhint/node_modules/cacheable-request": { + "version": "10.2.14", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.14.tgz", + "integrity": "sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==", + "dev": true, + "dependencies": { + "@types/http-cache-semantics": "^4.0.2", + "get-stream": "^6.0.1", + "http-cache-semantics": "^4.1.1", + "keyv": "^4.5.3", + "mimic-response": "^4.0.0", + "normalize-url": "^8.0.0", + "responselike": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + } + }, "node_modules/solhint/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -32055,6 +32175,63 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/solhint/node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "dev": true, + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/solhint/node_modules/decompress-response/node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/solhint/node_modules/defer-to-connect": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", + "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/solhint/node_modules/form-data-encoder": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-2.1.4.tgz", + "integrity": "sha512-yDYSgNMraqvnxiEXO4hi88+YZxaHC6QKzb5N84iRCTDeRO7ZALpir/lVmf/uXUhnwUr2O4HU8s/n6x+yNjQkHw==", + "dev": true, + "engines": { + "node": ">= 14.17" + } + }, + "node_modules/solhint/node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/solhint/node_modules/glob": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", @@ -32074,6 +32251,31 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/solhint/node_modules/got": { + "version": "12.6.1", + "resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz", + "integrity": "sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==", + "dev": true, + "dependencies": { + "@sindresorhus/is": "^5.2.0", + "@szmarczak/http-timer": "^5.0.1", + "cacheable-lookup": "^7.0.0", + "cacheable-request": "^10.2.8", + "decompress-response": "^6.0.0", + "form-data-encoder": "^2.1.2", + "get-stream": "^6.0.1", + "http2-wrapper": "^2.1.10", + "lowercase-keys": "^3.0.0", + "p-cancelable": "^3.0.0", + "responselike": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sindresorhus/got?sponsor=1" + } + }, "node_modules/solhint/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -32083,6 +32285,33 @@ "node": ">=8" } }, + "node_modules/solhint/node_modules/latest-version": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-7.0.0.tgz", + "integrity": "sha512-KvNT4XqAMzdcL6ka6Tl3i2lYeFDgXNCuIX+xNx6ZMVR1dFq+idXd9FLKNMOIx0t9mJ9/HudyX4oZWXZQ0UJHeg==", + "dev": true, + "dependencies": { + "package-json": "^8.1.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/solhint/node_modules/lowercase-keys": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", + "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/solhint/node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -32095,6 +32324,18 @@ "node": ">=10" } }, + "node_modules/solhint/node_modules/mimic-response": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", + "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/solhint/node_modules/minimatch": { "version": "5.1.6", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", @@ -32107,6 +32348,45 @@ "node": ">=10" } }, + "node_modules/solhint/node_modules/normalize-url": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz", + "integrity": "sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==", + "dev": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/solhint/node_modules/p-cancelable": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", + "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", + "dev": true, + "engines": { + "node": ">=12.20" + } + }, + "node_modules/solhint/node_modules/package-json": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-8.1.1.tgz", + "integrity": "sha512-cbH9IAIJHNj9uXi196JVsRlt7cHKak6u/e6AkL/bkRelZ7rlL3X1YKxsZwa36xipOEKAsdtmaG6aAJoM1fx2zA==", + "dev": true, + "dependencies": { + "got": "^12.1.0", + "registry-auth-token": "^5.0.1", + "registry-url": "^6.0.0", + "semver": "^7.3.7" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/solhint/node_modules/prettier": { "version": "2.8.8", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", @@ -32123,6 +32403,48 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/solhint/node_modules/registry-auth-token": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.0.2.tgz", + "integrity": "sha512-o/3ikDxtXaA59BmZuZrJZDJv8NMDGSj+6j6XaeBmHw8eY1i1qd9+6H+LjVvQXx3HN6aRCGa1cUdJ9RaJZUugnQ==", + "dev": true, + "dependencies": { + "@pnpm/npm-conf": "^2.1.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/solhint/node_modules/registry-url": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-6.0.1.tgz", + "integrity": "sha512-+crtS5QjFRqFCoQmvGduwYWEBng99ZvmFvF+cUJkGYF1L1BfU8C6Zp9T7f5vPAwyLkUExpvK+ANVZmGU49qi4Q==", + "dev": true, + "dependencies": { + "rc": "1.2.8" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/solhint/node_modules/responselike": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", + "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", + "dev": true, + "dependencies": { + "lowercase-keys": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/solhint/node_modules/semver": { "version": "7.5.4", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", @@ -33149,9 +33471,9 @@ } }, "node_modules/surya": { - "version": "0.4.10", - "resolved": "https://registry.npmjs.org/surya/-/surya-0.4.10.tgz", - "integrity": "sha512-zCM6wdEEs4pMAPD1t+CQWw5uTcVKrhusle6cD9oXbKg3WeaTeBmRxP8RpJXqqDBX9ztDI2aRNpvfGAx8hkplCA==", + "version": "0.4.11", + "resolved": "https://registry.npmjs.org/surya/-/surya-0.4.11.tgz", + "integrity": "sha512-SsDGqYQ1XCkGfCutLQ5s0Es2Tt41lY4FcrxlMiiOzPVJbD3AclI+Cot2SbtXuw/CeqRqaugLE5B95tfMDsRp9g==", "dev": true, "dependencies": { "@solidity-parser/parser": "^0.16.1", diff --git a/package.json b/package.json index f0a8745..0af2079 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eth-token-recover", - "version": "6.1.0", + "version": "6.1.1", "description": "TokenRecover allows to recover any ERC20 or ERC721 token sent into the contract and send them to a receiver.", "files": [ "contracts", @@ -57,23 +57,23 @@ "@nomiclabs/hardhat-web3": "^2.0.0", "@openzeppelin/test-helpers": "^0.5.16", "chai": "^4.3.10", - "eslint": "^8.52.0", + "eslint": "^8.53.0", "eslint-config-prettier": "^9.0.0", "eslint-config-standard": "^17.1.0", "eslint-plugin-mocha-no-only": "^1.1.1", "graphlib": "^2.1.8", - "hardhat": "^2.18.3", + "hardhat": "^2.19.0", "hardhat-exposed": "^0.3.13", "hardhat-gas-reporter": "^1.0.9", - "prettier": "^3.0.3", - "prettier-plugin-solidity": "^1.1.3", + "prettier": "^3.1.0", + "prettier-plugin-solidity": "^1.2.0", "rimraf": "^5.0.5", - "sol2uml": "^2.5.16", - "solhint": "^3.6.2", + "sol2uml": "^2.5.18", + "solhint": "^4.0.0", "solhint-plugin-openzeppelin": "file:scripts/solhint-custom", "solidity-coverage": "^0.8.5", "solidity-docgen": "^0.6.0-beta.36", - "surya": "^0.4.10", + "surya": "^0.4.11", "truffle": "^5.11.5", "vuepress": "^1.9.10", "vuepress-plugin-google-gtag": "^1.0.1", diff --git a/truffle-config.js b/truffle-config.js index 49a114e..eb31b22 100644 --- a/truffle-config.js +++ b/truffle-config.js @@ -1,7 +1,7 @@ module.exports = { compilers: { solc: { - version: '0.8.22', + version: '0.8.23', settings: { optimizer: { enabled: true,