Allows the contract owner to recover any ERC-20 token sent into the contract and sends them to a receiver.
constructor(address initialOwner) internalInitializes the contract setting the address provided by the deployer as the initial owner.
function recoverERC20(address tokenAddress, address tokenReceiver, uint256 tokenAmount) public virtual_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._
| 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. |
Allows the contract owner to recover any ERC-721 token sent into the contract and sends them to a receiver.
constructor(address initialOwner) internalInitializes the contract setting the address provided by the deployer as the initial owner.
function recoverERC721(address tokenAddress, address tokenReceiver, uint256 tokenId, bytes data) public virtual_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._
| 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. |
Allows the contract owner to recover any ERC-20 or ERC-721 token sent into the contract and sends them to a receiver.
constructor(address initialOwner) internalInitializes the contract setting the address provided by the deployer as the initial owner.
function recoverERC20(address tokenAddress, address tokenReceiver, uint256 tokenAmount) public virtual_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._
| 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. |
function recoverERC721(address tokenAddress, address tokenReceiver, uint256 tokenId, bytes data) public virtual_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._
| 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. |
_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.
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() internalInitializes the contract setting the deployer as the initial owner.
function recoverERC20(address tokenAddress, uint256 tokenAmount) public virtual_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._
| Name | Type | Description |
|---|---|---|
| tokenAddress | address | The contract address of the token to recover. |
| tokenAmount | uint256 | Number of tokens to be recovered. |
Allows to recover any ERC-20 token sent into the contract and sends them to a receiver.
function _recoverERC20(address tokenAddress, address tokenReceiver, uint256 tokenAmount) internal virtual_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._
| 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. |
Allows to recover any ERC-721 token sent into the contract and sends them to a receiver.
function _recoverERC721(address tokenAddress, address tokenReceiver, uint256 tokenId, bytes data) internal virtual_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._
| 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. |