Skip to content

Type tuple() is not implicitly convertible to expected type bool #5655

Answered by aaankeet
darshilmistry asked this question in Q&A
Discussion options

You must be logged in to vote

@darshilmistry

In transfer function success is of type of bool but you are assigning its value to a tuple on line 3 which is not allowed. A boolean can either be true or false.

That's why you are getting this error : Type tuple() is not implicitly convertible to expected type bool.

function transfer(address to, uint256 amount) external override returns (bool){
        bool success = false;
        if(to == address(0)) revert PI__invalidAddress(to);

        success = Transfer(msg.sender, to, amount);

        return success;
    
    }

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@aaankeet
Comment options

@aaankeet
Comment options

@darshilmistry
Comment options

@aaankeet
Comment options

Answer selected by darshilmistry
@darshilmistry
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants