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

chore(core): add sanity checks in evm to dfc endpoints #816

Merged
merged 13 commits into from
Mar 28, 2023

Conversation

pierregee
Copy link

@pierregee pierregee commented Mar 24, 2023

What this PR does / why we need it:

Add sanity checks if the evm transaction is valid

  • Check if the transaction is using correct name and signature in handleTransaction endpoint
  • Check if the transaction is using correct name and signature in allocateDfcFund endpoint
  • User will be intentionally stuck in the screenshot below instead if the contract address, name or signature doesn't match

image

Which issue(s) does this PR fixes?:

Fixes #

Additional comments?:

Developer Checklist:

  • Read your code changes at least once
  • No console errors on web
  • Tested on Light mode and Dark mode*
  • Your UI implementation visually matched the rendered design*
  • Unit tests*
  • Added e2e tests*
  • Added translations*

@pierregee pierregee temporarily deployed to AWS ECR March 24, 2023 03:44 — with GitHub Actions Inactive
@netlify
Copy link

netlify bot commented Mar 24, 2023

Deploy Preview for quantumbridge ready!

Name Link
🔨 Latest commit b1445d2
🔍 Latest deploy log https://app.netlify.com/sites/quantumbridge/deploys/642260b132516700085c94db
😎 Deploy Preview https://deploy-preview-816--quantumbridge.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions github-actions bot added the kind/chore Non feature change label Mar 24, 2023
@pierregee pierregee temporarily deployed to AWS ECR March 24, 2023 03:56 — with GitHub Actions Inactive
@pierregee pierregee temporarily deployed to AWS ECR March 24, 2023 05:13 — with GitHub Actions Inactive
@pierregee pierregee temporarily deployed to AWS ECR March 24, 2023 06:13 — with GitHub Actions Inactive
@pierregee pierregee temporarily deployed to AWS ECR March 24, 2023 06:28 — with GitHub Actions Inactive
@pierregee pierregee changed the title chore(core): add sec checks in evm to dfc endpoints [WIP] chore(core): add sanity checks in evm to dfc endpoints [WIP] Mar 24, 2023
@pierregee pierregee temporarily deployed to AWS ECR March 27, 2023 05:41 — with GitHub Actions Inactive
@pierregee pierregee temporarily deployed to AWS ECR March 27, 2023 05:51 — with GitHub Actions Inactive
@pierregee pierregee temporarily deployed to AWS ECR March 27, 2023 05:58 — with GitHub Actions Inactive
@pierregee pierregee temporarily deployed to AWS ECR March 27, 2023 06:03 — with GitHub Actions Inactive
@pierregee pierregee changed the title chore(core): add sanity checks in evm to dfc endpoints [WIP] chore(core): add sanity checks in evm to dfc endpoints Mar 27, 2023
@pierregee pierregee marked this pull request as ready for review March 27, 2023 08:05
@pierregee pierregee requested a review from lykalabrada as a code owner March 27, 2023 08:05
@Abhishekkochar Abhishekkochar self-requested a review March 27, 2023 08:20
@pierregee pierregee temporarily deployed to AWS ECR March 28, 2023 03:36 — with GitHub Actions Inactive
@thedoublejay thedoublejay merged commit 4876743 into main Mar 28, 2023
thedoublejay pushed a commit that referenced this pull request Mar 28, 2023
* add another sanity check

* chore(core): add sec checks in evm to dfc endpoints

* use clearer variable names

* remove comment

* check txn validity before accessing db

* pass 0 confirmations and revert name

* rename comments

* rename comments

* revert reodering condition

* fix typo

* update e2e

---------

Co-authored-by: cuongquangnam <[email protected]>
thedoublejay added a commit that referenced this pull request Mar 29, 2023
* feature(ui-ux): refetch hot wallet balance and transfer guard (#763)

* init

* refactor on transfer token flow

* code cleanup

* code cleanup

* code cleanup -S

* code cleanup

* code cleanup

* resolve pr comment -S

* resolve pr comment

* fix getBalanceFn response type

* code cleanup

---------

Co-authored-by: JJ Adonis <[email protected]>
Co-authored-by: Pierre Gee <[email protected]>

* chore(ops): enable DFI on client (#804)

chore: enable DFI on client

* feature(ui-ux): added liquidity overview screen (#794)

* feature(ui-ux): added liquidity overview screen

* added Link component

* added Disclosure for mobile view

* removed env variables

* removed unused api endpoint

* lint fix

* fixed width in small screen

* renamed router

* added tool tip and added fetch balances on network change

* minor ui updates

* hide navigation when bridge is down

* desc update

* minor fix

* minor updates

* updated hotWalletAddress to HotWalletAddress

* chore: update dfi label on ethereum

Refactor TokenInfo prop and rename component

---------

Co-authored-by: Keng Ye <[email protected]>
Co-authored-by: Keng Ye <[email protected]>

* chore: re-add dfi into client

* feature(ui-ux): added on click event on entire token header bar while closing (#821)

* feature(ui-ux): added test ids for better cypress testing on liquidity screen (#837)

feature(ui-ux): added testids for better cypress testing on liquidity screen

* chore(ui-ux): update warning message when balance is insufficient (#841)

* feat: add reserved utxo on client form

* feat: support all token for liquidity check

* chore: add liquidity as dependency

* revert: all previous changes

Only update warning message when insufficient balance

* chore(ui-ux): claim - prevent txn hook from running on load (#731)

* chore(refactor): claim - prevent txn hook from running on load

* fix(ui-ux): fix lint error

* bump(deps): update dependency react-secure-storage to ^1.2.0 (#839)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* bump(deps): update @waveshq/walletkit to ^0.43.0 (#842)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* bump(deps): update dependency @netlify/plugin-nextjs to ^4.33.0 (#845)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat(server): check for hot wallet DFI balance when crafting send tx (#843)

feat: check for hot wallet DFI balance when crafting send tx

* bump(deps): update dependency @fastify/compress to ^6.2.1 (#844)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat(server): Add another sanity check for decodeTxnData (#811)

* add another sanity check

* Update apps/server/src/ethereum/services/EVMTransactionConfirmerService.ts

Co-authored-by: Lee Wei Yuan <[email protected]>

---------

Co-authored-by: JJ Adonis <[email protected]>
Co-authored-by: Lee Wei Yuan <[email protected]>

* chore(core): add sanity checks in evm to dfc endpoints (#816)

* add another sanity check

* chore(core): add sec checks in evm to dfc endpoints

* use clearer variable names

* remove comment

* check txn validity before accessing db

* pass 0 confirmations and revert name

* rename comments

* rename comments

* revert reodering condition

* fix typo

* update e2e

---------

Co-authored-by: cuongquangnam <[email protected]>

* fix(ui-ux): fix disabled claim btn (#852)

* fix(ui-ux): trial fix, claim btn is disabled on some machines

* fix(ui-ux): fix disabled claim btn

* fix(ui-ux): fix disabled claim button for eth (#853)

---------

Co-authored-by: Julio Caesar <[email protected]>
Co-authored-by: Pierre Gee <[email protected]>
Co-authored-by: Keng Ye <[email protected]>
Co-authored-by: Harsh R <[email protected]>
Co-authored-by: Keng Ye <[email protected]>
Co-authored-by: Lyka Labrada <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: cuongquangnam <[email protected]>
Co-authored-by: Lee Wei Yuan <[email protected]>
Co-authored-by: Pierre Gee <[email protected]>
Co-authored-by: cuongquangnam <[email protected]>
thedoublejay added a commit that referenced this pull request Apr 3, 2023
* feature(ui-ux): added liquidity overview screen

* added Link component

* added Disclosure for mobile view

* removed env variables

* removed unused api endpoint

* lint fix

* fixed width in small screen

* renamed router

* added tool tip and added fetch balances on network change

* feature(ui-ux): refetch hot wallet balance and transfer guard (#763)

* init

* refactor on transfer token flow

* code cleanup

* code cleanup

* code cleanup -S

* code cleanup

* code cleanup

* resolve pr comment -S

* resolve pr comment

* fix getBalanceFn response type

* code cleanup

---------

Co-authored-by: JJ Adonis <[email protected]>
Co-authored-by: Pierre Gee <[email protected]>

* chore(ops): enable DFI on client (#804)

chore: enable DFI on client

* minor ui updates

* hide navigation when bridge is down

* desc update

* minor fix

* minor updates

* updated hotWalletAddress to HotWalletAddress

* added navigation check, PoB link, liquidity validation, addresses checks, basic responsiveness check for mobile elements;

* update port number;

* feature(ui-ux): added liquidity overview screen (#794)

* feature(ui-ux): added liquidity overview screen

* added Link component

* added Disclosure for mobile view

* removed env variables

* removed unused api endpoint

* lint fix

* fixed width in small screen

* renamed router

* added tool tip and added fetch balances on network change

* minor ui updates

* hide navigation when bridge is down

* desc update

* minor fix

* minor updates

* updated hotWalletAddress to HotWalletAddress

* chore: update dfi label on ethereum

Refactor TokenInfo prop and rename component

---------

Co-authored-by: Keng Ye <[email protected]>
Co-authored-by: Keng Ye <[email protected]>

* prettifier;

* Navigation test update;

* chore: re-add dfi into client

* moved navigation check to mobile; add ipad viewport;

* feature(ui-ux): added on click event on entire token header bar while closing (#821)

* prettify;

* feature(ui-ux): added test ids for better cypress testing on liquidity screen (#837)

feature(ui-ux): added testids for better cypress testing on liquidity screen

* chore(ui-ux): update warning message when balance is insufficient (#841)

* feat: add reserved utxo on client form

* feat: support all token for liquidity check

* chore: add liquidity as dependency

* revert: all previous changes

Only update warning message when insufficient balance

* chore(ui-ux): claim - prevent txn hook from running on load (#731)

* chore(refactor): claim - prevent txn hook from running on load

* fix(ui-ux): fix lint error

* bump(deps): update dependency react-secure-storage to ^1.2.0 (#839)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* bump(deps): update @waveshq/walletkit to ^0.43.0 (#842)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* bump(deps): update dependency @netlify/plugin-nextjs to ^4.33.0 (#845)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat(server): check for hot wallet DFI balance when crafting send tx (#843)

feat: check for hot wallet DFI balance when crafting send tx

* bump(deps): update dependency @fastify/compress to ^6.2.1 (#844)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat(server): Add another sanity check for decodeTxnData (#811)

* add another sanity check

* Update apps/server/src/ethereum/services/EVMTransactionConfirmerService.ts

Co-authored-by: Lee Wei Yuan <[email protected]>

---------

Co-authored-by: JJ Adonis <[email protected]>
Co-authored-by: Lee Wei Yuan <[email protected]>

* chore(core): add sanity checks in evm to dfc endpoints (#816)

* add another sanity check

* chore(core): add sec checks in evm to dfc endpoints

* use clearer variable names

* remove comment

* check txn validity before accessing db

* pass 0 confirmations and revert name

* rename comments

* rename comments

* revert reodering condition

* fix typo

* update e2e

---------

Co-authored-by: cuongquangnam <[email protected]>

* fix(ui-ux): fix disabled claim btn (#852)

* fix(ui-ux): trial fix, claim btn is disabled on some machines

* fix(ui-ux): fix disabled claim btn

* fix(ui-ux): fix disabled claim button for eth (#853)

* add TN/MN liquidity checks; add test ids;

* added testid for navigation check;

* added testid for mobile responsiveness check;

* prettify;

* prettify;

* refactored; add network configs;

* prettify;

* fix lint; rename test ids;gi

* rename testid;

---------

Co-authored-by: Harsh <[email protected]>
Co-authored-by: Keng Ye <[email protected]>
Co-authored-by: Julio Caesar <[email protected]>
Co-authored-by: JJ Adonis <[email protected]>
Co-authored-by: Pierre Gee <[email protected]>
Co-authored-by: Harsh R <[email protected]>
Co-authored-by: Keng Ye <[email protected]>
Co-authored-by: Lyka Labrada <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: cuongquangnam <[email protected]>
Co-authored-by: Lee Wei Yuan <[email protected]>
Co-authored-by: Pierre Gee <[email protected]>
Co-authored-by: cuongquangnam <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/chore Non feature change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants