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

prevent duplicate tokens being added in adminJS #1777

Closed
divine-comedian opened this issue Aug 22, 2024 · 7 comments
Closed

prevent duplicate tokens being added in adminJS #1777

divine-comedian opened this issue Aug 22, 2024 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@divine-comedian
Copy link
Collaborator

On a few different occasions now we have had instances of donations going missing because of duplicate tokens being added to the adminJS. We should create some checks and error conditions to prevent this from recurring.

We should check two conditions when a user is adding a new token for a given network and throw an error if true

  • the token SYMBOL already exists in the DB on the given network
  • the token address already exists in the DB for the given network

the error thrown should be descriptive depending on the condition that triggers it

i.e "This token symbol already exists for {network}", "This token address already exists for this network"

@divine-comedian divine-comedian added the bug Something isn't working label Aug 22, 2024
@github-project-automation github-project-automation bot moved this to New Issues in All-Devs Aug 22, 2024
@divine-comedian
Copy link
Collaborator Author

@RamRamez have you had a chance to investigate this issue?

@divine-comedian divine-comedian moved this from New Issues to Dev Research in All-Devs Sep 23, 2024
@divine-comedian divine-comedian moved this from Dev Research to In Progress in All-Devs Sep 30, 2024
@RamRamez RamRamez moved this from In Progress to QA in All-Devs Oct 2, 2024
@RamRamez
Copy link
Collaborator

RamRamez commented Oct 2, 2024

@maryjaf please test and verify.

Users shouldn't be able to add a token when:

  • the token SYMBOL already exists in the DB on the given network
  • the token address already exists in the DB for the given network

(FYI We have a full page error for these scenarios and I couldn't customize the error page in adminjs)

@maryjaf
Copy link
Collaborator

maryjaf commented Oct 3, 2024

  • I can create new token with a symbol that is already exist @RamRamez

Image

but when I try to add token with address that is already exist on our db I got below error

Image

@maryjaf maryjaf self-assigned this Oct 3, 2024
@RamRamez
Copy link
Collaborator

RamRamez commented Oct 3, 2024

@maryjaf those tokens you added are on different chains. This was scenario:
"the token SYMBOL already exists in the DB on the given network"

The error you showed is ok.
"(FYI We have a full page error for these scenarios and I couldn't customize the error page in adminjs)"

@maryjaf
Copy link
Collaborator

maryjaf commented Oct 3, 2024

@maryjaf those tokens you added are on different chains. This was scenario:

image

@RamRamez
Copy link
Collaborator

RamRamez commented Oct 3, 2024

@maryjaf those tokens you added are on different chains. This was scenario:

image

@maryjaf This is the token I added myself for testing.

@maryjaf
Copy link
Collaborator

maryjaf commented Oct 3, 2024

now the Acs have bben passed .
Thanks @RamRamez

@maryjaf maryjaf moved this from QA to Done in All-Devs Oct 3, 2024
@divine-comedian divine-comedian closed this as completed by moving to Merged to Production in All-Devs Oct 3, 2024
@github-project-automation github-project-automation bot moved this from Merged to Production to Done in All-Devs Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

3 participants