Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

using return bool + fallback functions #5

Closed
rstormsf opened this issue Feb 21, 2018 · 1 comment
Closed

using return bool + fallback functions #5

rstormsf opened this issue Feb 21, 2018 · 1 comment

Comments

@rstormsf
Copy link

rstormsf commented Feb 21, 2018

https://github.com/jbaylina/eip820/blob/master/contracts/ExampleImplementer.sol#L5

pragma solidity ^0.4.18;

contract ExampleImplementer {
    function canImplementInterfaceForAddress(address addr, bytes32 interfaceHash) view public returns(bool) {
        return true;
    }
}

If I unlock the fallback function and provide some default behavior, then it would break those checks because of strange behavior by design in solidity if a method does not exist it will instead execute the fallback function, and if the fallback function does not raise an exception it will return 1 causing the check to pass.

The only solution that comes to my mind is to use some magic numbers. Maybe we should return uint which should be more than 0.

@0xjac
Copy link
Collaborator

0xjac commented Aug 3, 2018

@rstormsf nice catch.

This was actually closed in 78eb6fa.

@0xjac 0xjac closed this as completed Aug 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants