Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support for encode function #171

Open
dongyu123 opened this issue Sep 6, 2021 · 0 comments
Open

Support for encode function #171

dongyu123 opened this issue Sep 6, 2021 · 0 comments

Comments

@dongyu123
Copy link

dongyu123 commented Sep 6, 2021

  • First, much thanks to your contribution.
  • But I find encode function is not supported.
  • My contract is test/libsolidity/semanticTests/abiEncoderV1/abi_encode_call.sol
contract C {
    bool x;

    function c(uint256 a, uint256[] memory b) public {
        require(a == 5);
        require(b.length == 2);
        require(b[0] == 6);
        require(b[1] == 7);
        x = true;
    }

    function f() public returns (bool) {
        uint256 a = 5;
        uint256[] memory b = new uint256[](2);
        b[0] = 6;
        b[1] = 7;
        //(bool success, ) = address(this).call(
        //    abi.encodeWithSignature("c(uint256,uint256[])", a, b)
        //);
        (bool success, ) = address(this).call(c(a, b));
        require(success);
        return x;
    }
}
// ====
// compileViaYul: also
// ----
// f() -> true

and the result is

test/libsolidity/semanticTests/abiEncoderV1/abi_encode_call.sol:18:13: solc-verify error: Member without corresponding declaration: encodeWithSignature
test/libsolidity/semanticTests/abiEncoderV1/abi_encode_call.sol:18:13: solc-verify error: Only identifiers are supported as function calls
  • My command is solc-verify.py test/libsolidity/semanticTests/abiEncoderV1/abi_encode_call.sol
    and my branch is 0.8.
  • Would you tell if encode function is not supported, or my command is wrong?
  • Thank u very much!
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant