You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unwrapped ERC20 token is deposited via the wrapAndDepositERC20 function on the MultiAssetVAnchor.sol contract.
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.
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.
Security, etc.
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.
The text was updated successfully, but these errors were encountered:
akileshtangella
changed the title
Token Ownership/Approval/Minting Rights in the MASP VAnchor
Token Ownership/Approval/Minting Rights in the VAnchor
Dec 5, 2022
Flow for ERC20s
wrapAndDepositERC20
function on theMultiAssetVAnchor.sol
contract.wrapAndDepositERC20
function takes in thefromTokenAddress
which is the address of the unwrapped ERC20 contract and thetoTokenAddress
which is the address of the wrapped ERC20 contract.wrapForAndSendTo
method on theTokenWrapper.sol
contract. The unwrapped ERC20 tokens being deposited are transferred to theFungibleTokenWrapper
and wrapped ERC20 tokens are minted to theMultiAssetVAnchor
.In the diagram below
a -> b
meansa
is owned byb
.Security, etc.
ERC20PresetMinterPauser
is not properly tranferred...the deployer of theFungibleTokenWrapper
can mint infinite wrapped tokens to themselves. Solution: Need to transfer minting rights to theMultiAssetVAnchor
.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:
transfer
the tokens to theFungibleTokenWrapper
. Rather each user mustapprove
theFungibleTokenWrapper
to be able to spend the unwrapped ERC20 tokens on their behalf. So something like this is not quite right.deposit
s already wrapped tokens, the user needs toapprove
theVAnchor
to spend wrapped tokens.The text was updated successfully, but these errors were encountered: