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

bugfix: celo transfers content being passed to the device #8840

Merged
merged 5 commits into from
Jan 9, 2025

Conversation

Wozacosta
Copy link
Contributor

@Wozacosta Wozacosta commented Jan 8, 2025

βœ… Checklist

  • npx changeset was attached.
  • Covered by automatic tests.
  • Impact of the changes:
    • ...

πŸ“ Description

Replace this text by a clear and concise description of what this pull request is about and why it is needed. Be sure to explain the problem you're addressing and the solution you're proposing.
For libraries, you can add a code sample of how to use it.
For bug fixes, you can explain the previous behaviour and how it was fixed.
In case of visual features, please attach screenshots or video recordings to demonstrate the changes.

Before (transfer to 0x1D5F344C7d5E7C3Fea434989B928fAb21B263246)

After

❓ Context

  • JIRA or GitHub link: LIVE-15650

🧐 Checklist for the PR Reviewers

  • The code aligns with the requirements described in the linked JIRA or GitHub issue.
  • The PR description clearly documents the changes made and explains any technical trade-offs or design decisions.
  • There are no undocumented trade-offs, technical debt, or maintainability issues.
  • The PR has been tested thoroughly, and any potential edge cases have been considered and handled.
  • Any new dependencies have been justified and documented.
  • Performance considerations have been taken into account. (changes have been profiled or benchmarked if necessary)

Copy link

vercel bot commented Jan 8, 2025

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
web-tools βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Jan 9, 2025 1:19pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
ledger-live-github-bot ⬜️ Ignored (Inspect) Visit Preview Jan 9, 2025 1:19pm
native-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Jan 9, 2025 1:19pm
react-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Jan 9, 2025 1:19pm

@live-github-bot live-github-bot bot added the common Has changes in live-common label Jan 8, 2025
@@ -118,6 +118,7 @@ const buildTransaction = async (account: CeloAccount, transaction: Transaction)

celoTransaction = {
...celoTransaction,
value: value.toFixed(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

broadcast fails when setting value here:

Shottr 2025-01-08 10 43 12
Transaction has been reverted by the EVM:
{
  "blockHash": "0xe74a3082ed28fd566e7171335ec751b939b3e240bdff9a27a69f4ea677f21f42",
  "blockNumber": 29731228,
  "contractAddress": null,
  "cumulativeGasUsed": 5769523,
  "effectiveGasPrice": 10000000000,
  "from": "0x849af8f177065ab056ed7bef4e473f5e7a6cee90",
  "gasUsed": 27078,
  "logs": [],
  "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  "status": false,
  "to": "0x471ece3750da237f93b8e339c536989b8978a438",
  "transactionHash": "0x7822bba8331a92a9b6584fd908bd06a6b401395b726661df4aa8c1f5ee0477f9",
  "transactionIndex": 43,
  "type": "0x0"
}

@@ -112,12 +112,14 @@ const buildTransaction = async (account: CeloAccount, transaction: Transaction)
from: account.freshAddress,
to: celoToken.address,
data: celoToken.transfer(transaction.recipient, value.toFixed()).txo.encodeABI(),
// value: `0x${value.toString(16)}`, // NOTE: this breaks at the estimateGas just below
Copy link
Contributor Author

Choose a reason for hiding this comment

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

setting value here (be it as value: value.toFixed or as an hex string, fails at the gas estimation (const gas = await kit.connection.estimateGasWithInflationFactor(celoTransaction);)

Copy link
Contributor

Choose a reason for hiding this comment

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

it looks like its sending CELO via an erc20 transfer. (ie data is populated) but a simple native transfer is cheaper and probably all thats needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Any idea why this had to be done? Commit message of the code i've replaced mentions Use erc20 for Celo token to fix precision issues. Maybe this went around a legacy behaviour

@Wozacosta
Copy link
Contributor Author

@Wozacosta Wozacosta marked this pull request as ready for review January 8, 2025 10:38
@Wozacosta Wozacosta requested a review from a team as a code owner January 8, 2025 10:38
Copy link
Contributor

@aaronmgdr aaronmgdr left a comment

Choose a reason for hiding this comment

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

nice

@Wozacosta Wozacosta changed the title wip: fix display, break broadcast bugfix: celo transfers content being passed to the device Jan 8, 2025
@Wozacosta Wozacosta merged commit ca55faf into develop Jan 9, 2025
54 of 55 checks passed
@Wozacosta Wozacosta deleted the bugfix/celo-display-transfer-amount branch January 9, 2025 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
common Has changes in live-common
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants