solang icon indicating copy to clipboard operation
solang copied to clipboard

abi.encodePacked causes compilation error.

Open Subway2023 opened this issue 10 months ago • 0 comments

Version: v0.3.3: Atlantis Description: In abi.encodePacked(), being empty and including type(Test).name will both cause errors.

contract Test {
    function f() public pure returns (bytes32) {
        abi.encodePacked(type(Test).name);
    }
}
thread 'main' panicked at 'Found IntValue(IntValue { int_value: Value { name: "", address: 0x593c224b0150, is_const: true, is_null: false, is_undef: false, llvm_value: "i32 1415934836", llvm_type: "i32" } }) but expected PointerValue variant', /github/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/inkwell-0.2.0/src/values/enums.rs:302:13
contract Test {
    function f() public pure returns (bytes32) {
        abi.encodePacked();
    }
}
thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', src/codegen/encoding/mod.rs:159:46

Subway2023 avatar Mar 03 '25 13:03 Subway2023