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

Correct contract for withdrawal #17

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shapeshed
Copy link

@shapeshed shapeshed commented Oct 10, 2024

This corrects the contract name for withdrawals as sendNFT should go to withdrawal_voucher_contract

@@ -328,7 +328,7 @@ After that, the user receives a withdrawal voucher that they can use to withdraw

### Withdrawal

Withdrawal of the ASSET implies sending the NFT to `withdrawal_manager` with the following message attached:
Withdrawal of the ASSET implies sending the NFT to `withdrawal_voucher_contract` with the following message attached:
Copy link
Contributor

Choose a reason for hiding this comment

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

these are different. withdrawal_voucher_contract - is NFT itself. withdrawal_manager - exchanges NFT to the unbonded assets

Copy link
Author

@shapeshed shapeshed Oct 10, 2024

Choose a reason for hiding this comment

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

If you send to withdrawal manager you get unauthorised as the message needs to go via the withdrawal_voucher_contract

https://github.com/hadronlabs-org/drop-contracts/blob/main/contracts/withdrawal-manager/src/contract.rs#L174-L177

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, in general when you sending NFT you interacting with NFT contract and not actually sending anything. In this particular case we call NFT contract method to transfer the ownership of this NFT item to withdrawal_manager and calling ReceiveNft handler in withdrawal_manager (which we may name as sending an NFT to withdrawal_manager)

Copy link
Author

Choose a reason for hiding this comment

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

Up to you guys what you want to do with this. I was integrating with your protocol and followed the documentation. It states withdrawal_mamager in the docs so I looked up the address here https://docs.drop.money/deployments/mainnet. After looking though on chain transactions I worked out I actually needed to send it to the address listed as withdawal_voucher_manager in the contract addresses and the sendNFT message then worked.

Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants