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

Token Ownership/Approval/Minting Rights in the VAnchor #213

Open
akileshtangella opened this issue Dec 2, 2022 · 0 comments
Open

Token Ownership/Approval/Minting Rights in the VAnchor #213

akileshtangella opened this issue Dec 2, 2022 · 0 comments

Comments

@akileshtangella
Copy link
Contributor

akileshtangella commented Dec 2, 2022

Flow for ERC20s

  1. Unwrapped ERC20 token is deposited via the wrapAndDepositERC20 function on the MultiAssetVAnchor.sol contract.
  2. The wrapAndDepositERC20 function takes in the fromTokenAddress which is the address of the unwrapped ERC20 contract and the toTokenAddress which is the address of the wrapped ERC20 contract.
  3. This calls the wrapForAndSendTo method on the TokenWrapper.sol contract. The unwrapped ERC20 tokens being deposited are transferred to the FungibleTokenWrapper and wrapped ERC20 tokens are minted to the MultiAssetVAnchor.

In the diagram below a -> b means a is owned by b.
image

Security, etc.

  1. If minting right of ERC20PresetMinterPauser is not properly tranferred...the deployer of the FungibleTokenWrapper can mint infinite wrapped tokens to themselves. Solution: Need to transfer minting rights to the MultiAssetVAnchor.

Approvals

It is possible for an ERC20 token owner, Alice, to approve a spender, Bob, to spend a certain number of tokens (known as the allowance) on her behalf. In the Webb private asset transfer system, this pattern is used in the following places:

  • When a user deposits unwrapped ERC20 tokens, they don't directly transfer the tokens to the FungibleTokenWrapper. Rather each user must approve the FungibleTokenWrapper to be able to spend the unwrapped ERC20 tokens on their behalf. So something like this is not quite right.
  • In the scenario, in which the user deposits already wrapped tokens, the user needs to approve the VAnchor to spend wrapped tokens.
@akileshtangella akileshtangella changed the title Token Ownership/Approval/Minting Rights in the MASP VAnchor Token Ownership/Approval/Minting Rights in the VAnchor Dec 5, 2022
@github-project-automation github-project-automation bot moved this to Not Started 🕧 in Webb Universe Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Not Started 🕧
Development

No branches or pull requests

1 participant