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

Program Bug: Assign bytes from memory to storage causes account data too small #1291

Closed
Subway2023 opened this issue May 10, 2024 · 2 comments

Comments

@Subway2023
Copy link

@program_id("CpopnF1m51gjx1iWAbZorsdQPdZgcFfyzMTHUJtEhWoZ")
contract starter {
    @payer(payer)
    constructor(address payer) {
        print("Hello, World!");
    }
    bytes s;
    function h() external returns (bytes memory) {
        bytes memory m = new bytes(1);
        s = m;
    }
}
anchor test
Error: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: account data too small for instruction
@Nagaprasadvr
Copy link

U might have to allocate space when constructor is being called using @space()

@joncinque
Copy link

This is a question with solang, which is not part of this repo. Be sure to ask your question or post your issue to https://github.com/hyperledger/solang

@joncinque joncinque closed this as not planned Won't fix, can't repro, duplicate, stale Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants