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

[TASK] Support Native and PSP22 Token in the Mixer contract #40

Open
dharjeezy opened this issue Jun 2, 2022 · 4 comments · May be fixed by #78
Open

[TASK] Support Native and PSP22 Token in the Mixer contract #40

dharjeezy opened this issue Jun 2, 2022 · 4 comments · May be fixed by #78
Assignees
Labels
difficulty: medium 🚩 feature ➕ p3 🔵 Issues should be resolved eventually

Comments

@dharjeezy
Copy link
Contributor

dharjeezy commented Jun 2, 2022

We are following the PSP22 Token standard which is similar to the ERC-20. We need to ensure that the contract is able to do transfer both in native tokens and psp22 standard token.

A todo was put up here

@dutterbutter dutterbutter changed the title [TODO] Support Native and PSP22 Token in the Mixer contract [TASK] Support Native and PSP22 Token in the Mixer contract Jun 16, 2022
@iTranscend
Copy link
Contributor

Hi @dharjeezy @dutterbutter

I noticed that work on this issue has not yet started. Can I take a stab at it?

In my attempt to understand what the issue requires I have a question regarding the desired interface for the mixer module.

I looked at the vanchor contract and noticed that there are separate functions for dealing with native and PSP22 tokens. ref1 | ref2
Should there be separate functions for handling native and psp22 token depositions into, and withdrawals from the mixer?

@drewstone
Copy link
Contributor

drewstone commented Jul 14, 2022 via email

@dharjeezy
Copy link
Contributor Author

dharjeezy commented Jul 14, 2022

So, @iTranscend you will need to do these:

  1. Introduce a PSP22 token_address optional property in mixer storage. With this, if the token_address is set, then we can always do a transfer to the recipient and pay relayer the fee of the PSP22 Token. If the PSP22 token_address is not set in the mixer contract storage, then we do a native token transfer in the mixer for the recipient and possibly pay the relayer fee with native token transfer too.

  2. We also need to introduce another contract function which will be non-payable for depositing/accepting PSP22 token into the mixer. This contract function will fail to execute(throw an error) if there is no PSP22 token address set for the mixer contract.

  3. Finally, We'd need to add another integration test for testing PSP22 token deposit and withdrawal in the mixer.

@iTranscend
Copy link
Contributor

Oh, great. Thanks a lot for the detailed responses @drewstone & @dharjeezy.
I'll go ahead to work on the outlined tasks and open a PR soonest.

@dharjeezy dharjeezy assigned iTranscend and unassigned dharjeezy Jul 18, 2022
@dutterbutter dutterbutter added p3 🔵 Issues should be resolved eventually and removed p2 🟡 Issue should be resolved soon labels Aug 4, 2022
@iTranscend iTranscend linked a pull request Aug 30, 2022 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: medium 🚩 feature ➕ p3 🔵 Issues should be resolved eventually
Projects
Status: Not Started 🕧
Development

Successfully merging a pull request may close this issue.

4 participants