Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

abi.encodePacked causes compilation error. #1749

Open
Subway2023 opened this issue Mar 3, 2025 · 0 comments
Open

abi.encodePacked causes compilation error. #1749

Subway2023 opened this issue Mar 3, 2025 · 0 comments

Comments

@Subway2023
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant