0
pragma solidity ^0.5.0;

...

function SearchByTenderId(string memory a) public view returns(string){
    string memory Id=a;
    if(keccak256(TenderId) == keccak256(Id)){
        return "TenderId is already existing,\n We con't Reapply";
    }
    else{
        return "We can apply for tender";
    }
0

You need to convert your arguments to bytes32 when using keccak256 which you can do with abi.encodePacked().

Like this:

if(keccak256(abi.encodePacked(TenderId)) == keccak256(abi.encodePacked(Id))){

Hope it helps.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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