Transfer 'verified' tokens (ERC20) with a message. Contract used in YouTube video: https://youtu.be/Eue8r1FjNqo
The ERC20Transfer smart contract facilitates transfers of ERC20 tokens. It provides an additional layer of control and functionality compared to direct transfers between wallets.
This contract allows for owner-level control over the tokens that can be transferred. The owner of the contract can verify specific tokens to be transferable through this contract.
Each transfer made through the contract can be accompanied by an optional message, and upon the completion of the transaction, an event is emitted that logs important details of the transaction.
Owner Verification: Only the owner of the contract can verify new tokens that can be transferred via this contract.
Token Verification: Before any transfer, the contract checks whether the token being transferred is a verified token.
Transfer Functionality: Users can use this contract to transfer their ERC20 tokens to another wallet. The function also checks if the sender has enough balance to carry out the transaction.
Transaction Details: Each transaction is logged as an event with details such as sender, receiver, amount, optional message, and the date of the transaction.
Verified Token Retrieval: A function is provided to fetch a list of all tokens verified by the contract owner.
Adding a Verified Token: The owner can call the addVerifiedToken function with the address of the ERC20 token they wish to add to the verified list.
Removing a Verified Token: The owner can call the removeVerifiedToken function with the address of the ERC20 token they wish to remove from the verified list.
Fetching Verified Tokens: Anyone can call the getVerifiedTokens function to fetch a list of all verified tokens.
Making a Transfer: A user can call the transfer function to transfer a specified amount of a verified token to another wallet. They need to provide the token contract's address, recipient's address, amount to transfer, and an optional message.
Remember that the owner has the ability to verify and remove tokens that can be transferred through this contract. Always check if a token is verified before trying to transfer it via this contract. It is also important to note that the contract does not store transaction data on-chain, but rather emits them as events.
_token | address |
Jun 26, 2023
Unlicense