Skip to content

Commit

Permalink
chore: update dependencies and solc
Browse files Browse the repository at this point in the history
  • Loading branch information
vittominacori committed Oct 18, 2024
1 parent ea3a321 commit f80d311
Show file tree
Hide file tree
Showing 20 changed files with 900 additions and 401 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
[![Coverage Status](https://codecov.io/gh/vittominacori/eth-token-recover/graph/badge.svg)](https://codecov.io/gh/vittominacori/eth-token-recover)
[![MIT licensed](https://img.shields.io/github/license/vittominacori/eth-token-recover.svg)](https://github.com/vittominacori/eth-token-recover/blob/master/LICENSE)

TokenRecover allows to recover any ERC20 or NFT (ERC721) token sent into the contract and send them to a receiver.
TokenRecover allows to recover any ERC-20 or NFT (ERC-721) token sent into the contract and sends them to a receiver.

There are lots of tokens lost forever into Smart Contracts (see [OMG](https://etherscan.io/address/0xd26114cd6ee289accf82350c8d8487fedb8a0c07) token balances).
Each Ethereum contract, as well as any EVM compatible contract, is a potential token trap for ERC20 or ERC721 tokens.
Each Ethereum contract, as well as any EVM compatible contract, is a potential token trap for ERC-20 or ERC-721 tokens.
They can't be recovered, so it means money losses for end users.

By using TokenRecover, any smart contract can offer users a robust solution for reclaiming mistakenly or erroneously sent tokens, enhancing the overall user experience and confidence in the decentralized ecosystem.
Expand All @@ -27,7 +27,7 @@ The `recover` contracts define internal methods that can be used in derived cont

[RecoverERC20.sol](https://github.com/vittominacori/eth-token-recover/blob/master/contracts/recover/RecoverERC20.sol)

Allows to recover any ERC20 token sent into the contract and send them to a receiver.
Allows to recover any ERC-20 token sent into the contract and sends them to a receiver.

> [!WARNING]
> It allows everyone to recover tokens. Access controls MUST be defined in derived contracts.
Expand All @@ -48,7 +48,7 @@ abstract contract RecoverERC20 {

[RecoverERC721.sol](https://github.com/vittominacori/eth-token-recover/blob/master/contracts/recover/RecoverERC721.sol)

Allows to recover any ERC721 token sent into the contract and send them to a receiver.
Allows to recover any ERC-721 token sent into the contract and sends them to a receiver.

> [!WARNING]
> It allows everyone to recover tokens. Access controls MUST be defined in derived contracts.
Expand All @@ -73,7 +73,7 @@ The below contracts define high level code that can be inherited as is or extend

[ERC20Recover.sol](https://github.com/vittominacori/eth-token-recover/blob/master/contracts/ERC20Recover.sol)

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 ERC-20 token sent into the contract and sends them to a receiver.

> [!IMPORTANT]
> This contract is `Ownable` and restricts access to recover method to owner only.
Expand All @@ -98,7 +98,7 @@ contract MyContract is ERC20Recover {

[ERC721Recover.sol](https://github.com/vittominacori/eth-token-recover/blob/master/contracts/ERC721Recover.sol)

Allows the contract owner to recover any ERC721 token sent into the contract and send them to a receiver.
Allows the contract owner to recover any ERC-721 token sent into the contract and sends them to a receiver.

> [!IMPORTANT]
> This contract is `Ownable` and restricts access to recover method to owner only.
Expand All @@ -123,7 +123,7 @@ contract MyContract is ERC721Recover {

[TokenRecover.sol](https://github.com/vittominacori/eth-token-recover/blob/master/contracts/TokenRecover.sol)

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 ERC-20 or ERC-721 token sent into the contract and sends them to a receiver.

> [!IMPORTANT]
> This contract is `Ownable` and restricts access to recover methods to owner only.
Expand Down
2 changes: 1 addition & 1 deletion analysis/description-table/ERC20Recover.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

| File Name | SHA-1 Hash |
|-------------|--------------|
| dist/ERC20Recover.dist.sol | 66e1aacb6d494ad2bc1f71f0a989b9810b90fe69 |
| dist/ERC20Recover.dist.sol | 0a4cf00b0e318c15178e5dbbe4842f236d61409f |


### Contracts Description Table
Expand Down
2 changes: 1 addition & 1 deletion analysis/description-table/ERC721Recover.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

| File Name | SHA-1 Hash |
|-------------|--------------|
| dist/ERC721Recover.dist.sol | 162f5def82b6e2ba5783548cc1b14072c77af033 |
| dist/ERC721Recover.dist.sol | 0d1358f3bebad15a918b2d1dcd8f990c2f8c1151 |


### Contracts Description Table
Expand Down
2 changes: 1 addition & 1 deletion analysis/description-table/TokenRecover.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

| File Name | SHA-1 Hash |
|-------------|--------------|
| dist/TokenRecover.dist.sol | b0726e6cf80636cf56da692490a5dfcf8d3c332e |
| dist/TokenRecover.dist.sol | f1895b2e64de7570f41162023049f10ca3226f0f |


### Contracts Description Table
Expand Down
2 changes: 1 addition & 1 deletion analysis/description-table/TokenRecoverLegacy.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

| File Name | SHA-1 Hash |
|-------------|--------------|
| dist/TokenRecoverLegacy.dist.sol | da05ab7cb73da21066ca2cafc351c2428be2a5f4 |
| dist/TokenRecoverLegacy.dist.sol | f5ff152d12a953b6d3f252502cf2886209d53e78 |


### Contracts Description Table
Expand Down
4 changes: 2 additions & 2 deletions contracts/ERC20Recover.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {RecoverERC20} from "./recover/RecoverERC20.sol";

/**
* @title ERC20Recover
* @dev Allows the contract owner to recover any ERC20 token sent into the contract and send them to a receiver.
* @dev Allows the contract owner to recover any ERC-20 token sent into the contract and sends them to a receiver.
*/
abstract contract ERC20Recover is Ownable, RecoverERC20 {
/**
Expand All @@ -17,7 +17,7 @@ abstract contract ERC20Recover is Ownable, RecoverERC20 {
constructor(address initialOwner) Ownable(initialOwner) {}

/**
* @dev Recovers a `tokenAmount` of the ERC20 `tokenAddress` locked into this contract
* @dev Recovers a `tokenAmount` of the ERC-20 `tokenAddress` locked into this contract
* and sends them to the `tokenReceiver` address.
*
* NOTE: restricting access to owner only. See `RecoverERC20::_recoverERC20`.
Expand Down
4 changes: 2 additions & 2 deletions contracts/ERC721Recover.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {RecoverERC721} from "./recover/RecoverERC721.sol";

/**
* @title ERC721Recover
* @dev Allows the contract owner to recover any ERC721 token sent into the contract and send them to a receiver.
* @dev Allows the contract owner to recover any ERC-721 token sent into the contract and sends them to a receiver.
*/
abstract contract ERC721Recover is Ownable, RecoverERC721 {
/**
Expand All @@ -17,7 +17,7 @@ abstract contract ERC721Recover is Ownable, RecoverERC721 {
constructor(address initialOwner) Ownable(initialOwner) {}

/**
* @dev Recovers the `tokenId` of the ERC721 `tokenAddress` locked into this contract
* @dev Recovers the `tokenId` of the ERC-721 `tokenAddress` locked into this contract
* and sends it to the `tokenReceiver` address.
*
* NOTE: restricting access to owner only. See `RecoverERC721::_recoverERC721`.
Expand Down
7 changes: 4 additions & 3 deletions contracts/TokenRecover.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import {RecoverERC721} from "./recover/RecoverERC721.sol";

/**
* @title TokenRecover
* @dev Allows the contract owner to recover any ERC20 or ERC721 token sent into the contract and send them to a receiver.
* @dev Allows the contract owner to recover any ERC-20 or ERC-721 token sent into the contract
* and sends them to a receiver.
*/
abstract contract TokenRecover is Ownable, RecoverERC20, RecoverERC721 {
/**
Expand All @@ -18,7 +19,7 @@ abstract contract TokenRecover is Ownable, RecoverERC20, RecoverERC721 {
constructor(address initialOwner) Ownable(initialOwner) {}

/**
* @dev Recovers a `tokenAmount` of the ERC20 `tokenAddress` locked into this contract
* @dev Recovers a `tokenAmount` of the ERC-20 `tokenAddress` locked into this contract
* and sends them to the `tokenReceiver` address.
*
* NOTE: restricting access to owner only. See `RecoverERC20::_recoverERC20`.
Expand All @@ -32,7 +33,7 @@ abstract contract TokenRecover is Ownable, RecoverERC20, RecoverERC721 {
}

/**
* @dev Recovers the `tokenId` of the ERC721 `tokenAddress` locked into this contract
* @dev Recovers the `tokenId` of the ERC-721 `tokenAddress` locked into this contract
* and sends it to the `tokenReceiver` address.
*
* NOTE: restricting access to owner only. See `RecoverERC721::_recoverERC721`.
Expand Down
4 changes: 2 additions & 2 deletions contracts/legacy/TokenRecoverLegacy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {RecoverERC20} from "../recover/RecoverERC20.sol";

/**
* @title TokenRecoverLegacy
* @dev Allows the contract owner to recover any ERC20 token sent into the contract and send them to `owner()`.
* @dev Allows the contract owner to recover any ERC-20 token sent into the contract and sends them to `owner()`.
*
* WARNING: The deployer address will automatically be set as contract owner.
*
Expand All @@ -22,7 +22,7 @@ abstract contract TokenRecoverLegacy is Ownable, RecoverERC20 {
constructor() Ownable(_msgSender()) {}

/**
* @dev Recovers a `tokenAmount` of the ERC20 `tokenAddress` locked into this contract
* @dev Recovers a `tokenAmount` of the ERC-20 `tokenAddress` locked into this contract
* and sends them to the `owner()` address.
*
* NOTE: restricting access to owner only. See `RecoverERC20::_recoverERC20`.
Expand Down
4 changes: 2 additions & 2 deletions contracts/recover/RecoverERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

/**
* @title RecoverERC20
* @dev Allows to recover any ERC20 token sent into the contract and send them to a receiver.
* @dev Allows to recover any ERC-20 token sent into the contract and sends them to a receiver.
*/
abstract contract RecoverERC20 {
/**
* @dev Recovers a `tokenAmount` of the ERC20 `tokenAddress` locked into this contract
* @dev Recovers a `tokenAmount` of the ERC-20 `tokenAddress` locked into this contract
* and sends them to the `tokenReceiver` address.
*
* WARNING: it allows everyone to recover tokens. Access controls MUST be defined in derived contracts.
Expand Down
4 changes: 2 additions & 2 deletions contracts/recover/RecoverERC721.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";

/**
* @title RecoverERC721
* @dev Allows to recover any ERC721 token sent into the contract and send them to a receiver.
* @dev Allows to recover any ERC-721 token sent into the contract and sends them to a receiver.
*/
abstract contract RecoverERC721 {
/**
* @dev Recovers the `tokenId` of the ERC721 `tokenAddress` locked into this contract
* @dev Recovers the `tokenId` of the ERC-721 `tokenAddress` locked into this contract
* and sends it to the `tokenReceiver` address.
*
* WARNING: it allows everyone to recover tokens. Access controls MUST be defined in derived contracts.
Expand Down
20 changes: 10 additions & 10 deletions dist/ERC20Recover.dist.sol
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// SPDX-License-Identifier: MIT

// Sources flattened with hardhat v2.22.11 https://hardhat.org
// Sources flattened with hardhat v2.22.13 https://hardhat.org



// File @openzeppelin/contracts/utils/Context.sol@v5.0.2
// File @openzeppelin/contracts/utils/Context.sol@v5.1.0

// Original license: SPDX_License_Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
Expand Down Expand Up @@ -36,7 +36,7 @@ abstract contract Context {
}


// File @openzeppelin/contracts/access/Ownable.sol@v5.0.2
// File @openzeppelin/contracts/access/Ownable.sol@v5.1.0

// Original license: SPDX_License_Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
Expand Down Expand Up @@ -138,15 +138,15 @@ abstract contract Ownable is Context {
}


// File @openzeppelin/contracts/token/ERC20/IERC20.sol@v5.0.2
// File @openzeppelin/contracts/token/ERC20/IERC20.sol@v5.1.0

// Original license: SPDX_License_Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
* @dev Interface of the ERC20 standard as defined in the EIP.
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
interface IERC20 {
/**
Expand Down Expand Up @@ -229,11 +229,11 @@ pragma solidity ^0.8.20;

/**
* @title RecoverERC20
* @dev Allows to recover any ERC20 token sent into the contract and send them to a receiver.
* @dev Allows to recover any ERC-20 token sent into the contract and sends them to a receiver.
*/
abstract contract RecoverERC20 {
/**
* @dev Recovers a `tokenAmount` of the ERC20 `tokenAddress` locked into this contract
* @dev Recovers a `tokenAmount` of the ERC-20 `tokenAddress` locked into this contract
* and sends them to the `tokenReceiver` address.
*
* WARNING: it allows everyone to recover tokens. Access controls MUST be defined in derived contracts.
Expand All @@ -257,7 +257,7 @@ pragma solidity ^0.8.20;

/**
* @title ERC20Recover
* @dev Allows the contract owner to recover any ERC20 token sent into the contract and send them to a receiver.
* @dev Allows the contract owner to recover any ERC-20 token sent into the contract and sends them to a receiver.
*/
abstract contract ERC20Recover is Ownable, RecoverERC20 {
/**
Expand All @@ -266,7 +266,7 @@ abstract contract ERC20Recover is Ownable, RecoverERC20 {
constructor(address initialOwner) Ownable(initialOwner) {}

/**
* @dev Recovers a `tokenAmount` of the ERC20 `tokenAddress` locked into this contract
* @dev Recovers a `tokenAmount` of the ERC-20 `tokenAddress` locked into this contract
* and sends them to the `tokenReceiver` address.
*
* NOTE: restricting access to owner only. See `RecoverERC20::_recoverERC20`.
Expand Down
34 changes: 17 additions & 17 deletions dist/ERC721Recover.dist.sol
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// SPDX-License-Identifier: MIT

// Sources flattened with hardhat v2.22.11 https://hardhat.org
// Sources flattened with hardhat v2.22.13 https://hardhat.org



// File @openzeppelin/contracts/utils/Context.sol@v5.0.2
// File @openzeppelin/contracts/utils/Context.sol@v5.1.0

// Original license: SPDX_License_Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
Expand Down Expand Up @@ -36,7 +36,7 @@ abstract contract Context {
}


// File @openzeppelin/contracts/access/Ownable.sol@v5.0.2
// File @openzeppelin/contracts/access/Ownable.sol@v5.1.0

// Original license: SPDX_License_Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
Expand Down Expand Up @@ -138,16 +138,16 @@ abstract contract Ownable is Context {
}


// File @openzeppelin/contracts/utils/introspection/IERC165.sol@v5.0.2
// File @openzeppelin/contracts/utils/introspection/IERC165.sol@v5.1.0

// Original license: SPDX_License_Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
* @dev Interface of the ERC-165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[ERC].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
Expand All @@ -158,7 +158,7 @@ interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
Expand All @@ -167,15 +167,15 @@ interface IERC165 {
}


// File @openzeppelin/contracts/token/ERC721/IERC721.sol@v5.0.2
// File @openzeppelin/contracts/token/ERC721/IERC721.sol@v5.1.0

// Original license: SPDX_License_Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721.sol)
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.20;

/**
* @dev Required interface of an ERC721 compliant contract.
* @dev Required interface of an ERC-721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
Expand Down Expand Up @@ -225,7 +225,7 @@ interface IERC721 is IERC165 {

/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
* are aware of the ERC-721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
Expand All @@ -244,7 +244,7 @@ interface IERC721 is IERC165 {
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
* WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC-721
* or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
* understand this adds an external call which potentially creates a reentrancy vulnerability.
*
Expand Down Expand Up @@ -312,11 +312,11 @@ pragma solidity ^0.8.20;

/**
* @title RecoverERC721
* @dev Allows to recover any ERC721 token sent into the contract and send them to a receiver.
* @dev Allows to recover any ERC-721 token sent into the contract and sends them to a receiver.
*/
abstract contract RecoverERC721 {
/**
* @dev Recovers the `tokenId` of the ERC721 `tokenAddress` locked into this contract
* @dev Recovers the `tokenId` of the ERC-721 `tokenAddress` locked into this contract
* and sends it to the `tokenReceiver` address.
*
* WARNING: it allows everyone to recover tokens. Access controls MUST be defined in derived contracts.
Expand Down Expand Up @@ -345,7 +345,7 @@ pragma solidity ^0.8.20;

/**
* @title ERC721Recover
* @dev Allows the contract owner to recover any ERC721 token sent into the contract and send them to a receiver.
* @dev Allows the contract owner to recover any ERC-721 token sent into the contract and sends them to a receiver.
*/
abstract contract ERC721Recover is Ownable, RecoverERC721 {
/**
Expand All @@ -354,7 +354,7 @@ abstract contract ERC721Recover is Ownable, RecoverERC721 {
constructor(address initialOwner) Ownable(initialOwner) {}

/**
* @dev Recovers the `tokenId` of the ERC721 `tokenAddress` locked into this contract
* @dev Recovers the `tokenId` of the ERC-721 `tokenAddress` locked into this contract
* and sends it to the `tokenReceiver` address.
*
* NOTE: restricting access to owner only. See `RecoverERC721::_recoverERC721`.
Expand Down
Loading

0 comments on commit f80d311

Please sign in to comment.