My understanding about ERC165 is that if a contract had implemented ERC165 then the sender contract can check for the supported interface before initiating the tx with the receiver contract address.

Like If I have a sender contract which only wants to transact with a receiver contract who had implemented function "received(uint, uint)"

but what will happned if the receiver contract had wrongly mention the info about the interface in the implementation of supportsInterface function?

In such case what are the major to prevent asset locking and other consequences?

1 Answer 1


Obviously you can't know on-chain whether the receiving contract has really implemented the interface or not (without some kind of stupid elaborate pre-testing). Or whether it's implemented in a way you'd expect.

I really wouldn't be worried about locking assets in that case. If the receiver is dumb enough to lie then it's their fault if they get assets stuck.

The only concern is re-entrancy attack and whether your implementation breaks if the receiver has some weird stuff - so write your code accordingly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.