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
As reported by @bjartek, the interface for metadata resolution on escrowed NFTs is lacking. At a minimum a caller should be able to:
Resolve a view against an escrowed NFT
Get views supported by an escrowed NFT
Originally, the idea of exposing a reference to an escrowed resource sounded like a potential vulnerability given the ability to downcast the reference. However, any project implementing an NFT in a manner that would expose sensitive methods by downcasting form a publicly available reference (see ViewResolver.ResolverCollection.borrowViewResolver) would be doing so against the intended use of the ecosystem standards and so would be vulnerable in any context, not exclusively from escrow.
What we'll likely do then is simply add the ability to borrow an escrowed NFT as a &{ViewResolver.Resolver} to FlowEVMBridgeNFTEscrow with a signature like:
Updating to reflect recent conversations. Any non-view method calling through to an escrowed resource should be protected with view to ensure state in the escrowed resource cannot be mutated by external actors. To ensure metadata can be resolved, scripts should be updated to support retrieval of metadata solely within the context of a script which is inherently non-mutating.
Description
As reported by @bjartek, the interface for metadata resolution on escrowed NFTs is lacking. At a minimum a caller should be able to:
Originally, the idea of exposing a reference to an escrowed resource sounded like a potential vulnerability given the ability to downcast the reference. However, any project implementing an NFT in a manner that would expose sensitive methods by downcasting form a publicly available reference (see
ViewResolver.ResolverCollection.borrowViewResolver
) would be doing so against the intended use of the ecosystem standards and so would be vulnerable in any context, not exclusively from escrow.What we'll likely do then is simply add the ability to borrow an escrowed NFT as a
&{ViewResolver.Resolver}
toFlowEVMBridgeNFTEscrow
with a signature like:We'll of course also want to add a similar method to
FlowEVMBridgeTokenEscrow
The text was updated successfully, but these errors were encountered: