Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hydai/c38d68a9efc1dc43e02d1883c1dbea4a to your computer and use it in GitHub Desktop.
Save hydai/c38d68a9efc1dc43e02d1883c1dbea4a to your computer and use it in GitHub Desktop.
./solc/solc --ir ~/workspace/soll/test/solidity/stringCompare.sol
Unimplemented feature:
/solidity/libsolidity/codegen/YulUtilFunctions.cpp(1077): Throw in function solidity::frontend::YulUtilFunctions::updateStorageValueFunction(const solidity::frontend::Type&, const std::optional<unsigned int>&)::<lambda()>
Dynamic exception type: boost::exception_detail::clone_impl<solidity::langutil::UnimplementedFeatureError>
std::exception::what:
[solidity::util::tag_comment*] =
pragma solidity ^0.6.0;
contract Service {
mapping(string => string) accounts;
// test: acc="abc", pw="123"
function createAccount(string memory acc, string memory pw) public {
accounts[acc] = pw;
}
// test: acc="abc", pw="1"; get false
// test: acc="abc", pw="123"; get true
function checkLogin(string memory acc, string memory pw) public view returns (bool) {
if (keccak256(bytes(accounts[acc])) == keccak256(bytes(pw)))
return true;
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment