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

As a member of a TC I can't provide liquidity for a whitelisted/non-whitelisted pair #415

Closed
kmw101 opened this issue Feb 24, 2022 · 7 comments · Fixed by confio/tfi#69
Closed
Assignees
Labels
bug Something isn't working Major Bugs that have a higher severity

Comments

@kmw101
Copy link

kmw101 commented Feb 24, 2022

Gist

#415 (comment)

Contract addresses were increased to 32 bytes and therefore the bech32 representation (65 chars). Max label size in wasmd is 128 chars

Description

I want to be able to create a permissionless token and then use to swap against a token linked to a Trusted Circle. When I do this in the application I get an error label is required, invalid request

To create the sequence

  • As a user I create a Digital Asset which is not connected to a Trusted Circle - in this example EURO.
  • I create a second Digital Asset which is connected to my Trusted Circle - in this example GREEN
  • Create a pair - in this case EURO vs GREEN

image

@kmw101 kmw101 added the bug Something isn't working label Feb 24, 2022
@abefernan
Copy link
Collaborator

abefernan commented Feb 24, 2022

When creating a pair, the label that is mentioned on the error comes from the pair_name that is set on the frontend.

The pair_name is the joined addresses from the tokens: <address-of-token-a>-<address-of-token-b>. When StakeOrDie implemented the createPair functionality, they decided to use "native" as a placeholder "address" for TGD, so when creating a pair between TGD and CW20, the pair_name looks like this: native-tgrade1whateverwhatevercw20address, and when both are CW20, it looks like this: tgrade1whateverwhatevercw20addressA-tgrade1whateverwhatevercw20addressB.

What I believe it's happening is the contracts does not support such long names, and from tgrade 0.6 (I think) the addresses are longer than before, so the pair creation works for native-tgrade1whateverwhatevercw20addressveryhumongousaddress but not for tgrade1whateverwhatevercw20addressveryhumongousaddressA-tgrade1whateverwhatevercw20addressveryhumongousaddressB.

I tried using only the last 8 characters from each address for the name: addressA-addressB and I succesfully created the pair. The problem is that I think the form for providing liquidity somehow relies on that name because the provide liquidity button does not work as usual, I'm currently taking a look at that issue. UPDATE: I just found why it was not working as usual.

@maurolacy
Copy link
Contributor

I also faced some issues with "label"-related errors. After creating a new token, the error "message index: 0: dispatch: submessages: label: is required: invalid request" is output when trying to provide liquidity to it.

Checking the code base, "label" seems to be an (optional) parameter to store when creating a new instance of a contract. Not sure why it's failing with "required" now.
Couldn't find any restrictions of length in the tfi code base, and neither in the tgrade one.

@alpe, could this be related to a new Cosmos SDK version?

@abefernan
Copy link
Collaborator

abefernan commented Feb 24, 2022

@maurolacy that is the exact issue we describe here. It happens here: https://github.com/confio/tfi/blob/main/contracts/tfi-factory/src/contract.rs#L151#L156.

I think this means label has a length limit we're exceeding.

@maurolacy
Copy link
Contributor

maurolacy commented Feb 24, 2022

Yes, but that code isn't failing. That's where the label is created. The code fails later, when that message is dispatched. And I couldn't find where.

@maurolacy
Copy link
Contributor

Do you have a workaround for this from the frontend? Perhaps the asset info names are not being set properly? Or they can be shortened?

@abefernan
Copy link
Collaborator

I do have a workaround for creating them but it seems a lot of the T-Market code relies on those addresses to be full, so a lot of things start to fail.

@alpe
Copy link
Contributor

alpe commented Feb 24, 2022

Contract addresses were increased to 32 bytes and therefore the bech32 representation (65 chars). Max label size in wasmd is 128 chars

@abefernan abefernan added this to the Patchnet bugfix milestone Feb 25, 2022
@BirgitPohl BirgitPohl added Critical Drop work! Do it now! Major Bugs that have a higher severity and removed Critical Drop work! Do it now! labels Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Major Bugs that have a higher severity
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants