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
Currently, it would be possible to use staticcall for mirrorERC721 in order to detect if the contract is DN404 however this could also cause an issue with abi.decode since it doesn't catch decoding errors effectively
function _getMirrorERC721(addresspossibleDN404) internalviewreturns (addressresult) {
assembly {
mstore(0x00, 0x4ef41efc) // `mirrorERC721()`.ifand(
gt(returndatasize(), 0x1f),
staticcall(gas(), possibleDN404, 0x1c, 0x04, 0x00, 0x20)
) {
// If result is a non-zero address, contract is very likely DN404.
result :=shr(96, mload(0x0c))
}
}
}
Activity
Vectorized commentedon Feb 15, 2024
Vectorized commentedon Feb 15, 2024
Sounds like good suggestion.