Skip to content
This repository was archived by the owner on Nov 10, 2023. It is now read-only.

(Fix) - #1561 Outgoing instead of custom tx for sending collectibles#1567

Merged
Agupane merged 19 commits intodevelopmentfrom
feature/#1561-outgoing-as-custom-tx
Nov 10, 2020
Merged

(Fix) - #1561 Outgoing instead of custom tx for sending collectibles#1567
Agupane merged 19 commits intodevelopmentfrom
feature/#1561-outgoing-as-custom-tx

Conversation

@Agupane
Copy link
Contributor

@Agupane Agupane commented Nov 3, 2020

Closes #1561

Update: This will also fix #1325

Description

  • The main point of the fix is on the isSendERC721Transaction function, which checks if there is a tokenID on the tx params
  • I read the code and found that the function getTxData wasn't easy to read to I improved it a little

Note about #1325:

  • I refactored the logic of isSendERC721Transaction because the old way in which it was checking if a tx is or not an ERC721 transaction wasn't working well and wasn't very accurate. I think later when we use the all transaction API this function won't be needed anymore. But right now wasn't working well. I started debugging issue Incorrect amount for ERC20 token transfer #1325 and found that this function was returning true for the transaction and it's an ERC20 tx not an ERC721. That's why the frontend was always displaying 1 as the number of transferred tokens

It looks like this now:
image

@github-actions
Copy link

github-actions bot commented Nov 3, 2020

CLA Assistant Lite All Contributors have signed the CLA.

@Agupane Agupane self-assigned this Nov 3, 2020
@Agupane Agupane marked this pull request as ready for review November 3, 2020 15:30
@github-actions
Copy link

github-actions bot commented Nov 3, 2020

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 1 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@ghost
Copy link

ghost commented Nov 3, 2020

Travis automatic deployment:
https://pr1567--safereact.review.gnosisdev.com/rinkeby/app

@ghost
Copy link

ghost commented Nov 3, 2020

Travis automatic deployment:
https://pr1567--safereact.review.gnosisdev.com/volta/app

@ghost
Copy link

ghost commented Nov 4, 2020

Travis automatic deployment:
https://pr1567--safereact.review.gnosisdev.com/volta/app

@ghost
Copy link

ghost commented Nov 4, 2020

Travis automatic deployment:
https://pr1567--safereact.review.gnosisdev.com/rinkeby/app

Copy link
Contributor

@fernandomg fernandomg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful refactor on getTxData. Can we add tests to it? To be sure that nothing went wrong.

Also left a couple comments.

(isTokenTransfer(tx) && !knownTokens?.get(tx.to))
(txCode?.includes(SAFE_TRANSFER_FROM_WITHOUT_DATA_HASH) && !sameAddress(tx.to, ENS_TOKEN_CONTRACT)) ||
(isTokenTransfer(tx) && !knownTokens?.get(tx.to)) ||
hasERC721Transfer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how reliable this isSendERC721Transaction function is.

Is it safe to just rely on what the tx-service returns? If so, maybe we can just verify that hasERC721Transfer @dasanra, any opinion?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I refactored this could you check this again?

@ghost
Copy link

ghost commented Nov 5, 2020

Travis automatic deployment:
https://pr1567--safereact.review.gnosisdev.com/rinkeby/app

@ghost
Copy link

ghost commented Nov 5, 2020

Travis automatic deployment:
https://pr1567--safereact.review.gnosisdev.com/volta/app

@ghost
Copy link

ghost commented Nov 5, 2020

Travis automatic deployment:
https://pr1567--safereact.review.gnosisdev.com/rinkeby/app

@ghost
Copy link

ghost commented Nov 5, 2020

Travis automatic deployment:
https://pr1567--safereact.review.gnosisdev.com/volta/app

@ghost
Copy link

ghost commented Nov 5, 2020

Travis automatic deployment:
https://pr1567--safereact.review.gnosisdev.com/volta/app

@ghost
Copy link

ghost commented Nov 5, 2020

Travis automatic deployment:
https://pr1567--safereact.review.gnosisdev.com/rinkeby/app

@ghost
Copy link

ghost commented Nov 5, 2020

Travis automatic deployment:
https://pr1567--safereact.review.gnosisdev.com/rinkeby/app

@ghost
Copy link

ghost commented Nov 5, 2020

Travis automatic deployment:
https://pr1567--safereact.review.gnosisdev.com/volta/app

@ghost
Copy link

ghost commented Nov 6, 2020

Travis automatic deployment:
https://pr1567--safereact.review.gnosisdev.com/rinkeby/app

@ghost
Copy link

ghost commented Nov 6, 2020

Travis automatic deployment:
https://pr1567--safereact.review.gnosisdev.com/volta/app

@ghost
Copy link

ghost commented Nov 9, 2020

Travis automatic deployment:
https://pr1567--safereact.review.gnosisdev.com/volta/app

@ghost
Copy link

ghost commented Nov 9, 2020

Travis automatic deployment:
https://pr1567--safereact.review.gnosisdev.com/rinkeby/app

@ghost
Copy link

ghost commented Nov 10, 2020

Travis automatic deployment:
https://pr1567--safereact.review.gnosisdev.com/rinkeby/app

@ghost
Copy link

ghost commented Nov 10, 2020

Travis automatic deployment:
https://pr1567--safereact.review.gnosisdev.com/volta/app

@francovenica
Copy link
Contributor

Safes I used for testing:
0x9913B9180C20C6b0F21B6480c84422F6ebc4B808
0xD0BA3370F0cb4F2baB99c5CB6B2E6e3013682720 (this one was created for this PR)

I had an issue where the outgoing Tx of the collectible was labeled as Cancelled for a while. So I repeated the process 3 more times and I didn't had that issue anymore
image.png

I saw other weird stuff that are unrelated to the ticket, like the safe not recognizing me as owner for a few secs.
I talked with Agu Pane and it seems that is all related to the backend.

Since the issue of the outging tx for collectibles is not being labeled as "Custom Tx" anymore I can pass this ticket, and I'll test the feature further when 1574 reaches to Final QA

@ghost
Copy link

ghost commented Nov 10, 2020

Travis automatic deployment:
https://pr1567--safereact.review.gnosisdev.com/rinkeby/app

@ghost
Copy link

ghost commented Nov 10, 2020

Travis automatic deployment:
https://pr1567--safereact.review.gnosisdev.com/volta/app

@Agupane Agupane merged commit ca73200 into development Nov 10, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Nov 10, 2020
@fernandomg fernandomg deleted the feature/#1561-outgoing-as-custom-tx branch November 10, 2020 20:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[xDai] Outgoing NFTs TX is displayed as custom interaction till is executed and some time after execution Incorrect amount for ERC20 token transfer

4 participants