Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add transferFrom and approve to input address for ERC20 contract #271

Merged
merged 3 commits into from
Nov 7, 2023

Conversation

seaona
Copy link
Contributor

@seaona seaona commented Nov 7, 2023

What

This PR adds the ability to perform transferFrom function calls, and do the complete flow (from approve to transfer from) dynamically to the desired addresses.
Notice the ERC20 token already had transferFrom and approve support, so there is no need to change anything on the contract level.

How

  • The default address for the approve input is the one that was previously hardcoded. The reason for that is because this way, we don't need to change any existing e2e tests relying on approving to that address. You can change the address just by entering a different input
  • The transferFrom addresses can be changed dynamically with an input element
  • The approve amount is still hardcoded, as this can be changed from the UI if desired
  • The transferFrom amount is hardcoded, as there is no relevance on which amount we are transferring

Screenshots

  • UI

Screenshot from 2023-11-07 13-02-24

  • Transfer From complete flow
transfer-from-flow.mp4

Manual Testing Steps

  1. Deploy an ERC20 token contract
  2. Approve from address A to address B
  3. Change to address B
  4. Perform a transfer from, from address A to address B

@seaona seaona changed the title feat: add transferFrom and approve for ERC20 contract feat: add transferFrom and approve to input address for ERC20 contract Nov 7, 2023
@seaona seaona merged commit 64a9db2 into main Nov 7, 2023
4 checks passed
@seaona seaona deleted the transfer-from branch November 7, 2023 16:59
@legobeat legobeat mentioned this pull request Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants