-
Notifications
You must be signed in to change notification settings - Fork 256
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
Allow deposit by someone who is not a token owner #101
Comments
Hello @bogdan , given that https://github.com/OpenZeppelin/openzeppelin-contracts/blob/4961a51cc736c7d4aa9bd2e11e4cbbaff73efee9/contracts/token/ERC721/ERC721.sol#L181 kind check is implemented in root contract and |
@itzmeanjan nope, here the problem is in the |
Yes, I get it now. For ERC721 we can probably implement it. |
Would you be able to send one PR @bogdan ? |
Motivation
In our app we want to provide people a better user experience when they deposit their tokens to polygon.
That is why we want
RootChainManager#depositFor
to be callable by an address that is not a token owner (like approved or approved for all).Problem
That is not currently possible with
MintableERC721Predicate
(I didn't check others, but it is probably the same issue there).Here is why:
RootChainManager
always uses_msgSender
as adepositor
:pos-portal/contracts/root/RootChainManager/RootChainManager.sol
Line 313 in 88dbf0a
depositor
is always passed as a first argument toERC721#safeTransferFrom
which should always be a token owner:pos-portal/contracts/root/TokenPredicates/MintableERC721Predicate.sol
Line 94 in 88dbf0a
Solution
Use
ERC721#ownerOf
instead ofdepositor
when callingERC721#safeTransferFrom
.If that is not acceptable, can you explain a motivation of this limitation?
The text was updated successfully, but these errors were encountered: