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

code size to deposit exceeds maximum code size #1884

Open
demos2022 opened this issue Aug 7, 2023 · 1 comment
Open

code size to deposit exceeds maximum code size #1884

demos2022 opened this issue Aug 7, 2023 · 1 comment

Comments

@demos2022
Copy link

// SPDX-License-Identifier: MIT

pragma solidity 0.6.0;
contract SimpleStorage {
uint256 favoriteNumber;
// This is a comment!
struct People {
uint256 favoriteNumber;
string name;
}
People[] public people;
mapping(string => uint256) public nameToFavoriteNumber;

function store(uint256 _favoriteNumber) public {
    favoriteNumber = _favoriteNumber;
}

function retrieve() public view returns (uint256){
    return favoriteNumber;
}
function addPerson(string memory _name, uint256 _favoriteNumber) public {
    people.push(People(_favoriteNumber, _name));
    nameToFavoriteNumber[_name] = _favoriteNumber;
}

}

This is my contract
I get this error message - alueError: {'message': 'VM Exception while processing transaction: code size to deposit exceeds maximum code size', 'stack': 'RuntimeError: VM Exception while processing transaction: code size to deposit exceeds maximum code size\n at LegacyTransaction.fillFromResult

If I remove all the functions from my contract, my transaction goes through

@xyz899
Copy link

xyz899 commented Aug 28, 2023

Hello,

Given the contract, it shouldn't exceed the EVM maximum code size limit, especially if you are deploying on Remix.

One possibility is the pragma version. You're using Solidity version 0.6.0; have you tried updating to a more recent version or confirming that all your dependencies are compatible with this version?

Here's how you can specify a newer version in your contract:

pragma solidity ^0.8.0;

Also, try deploying the contract on Remix IDE for debugging purposes. If it deploys successfully there, the issue could be specific to your local environment or the method you're using for deploying it.

Looking forward to your update.

FrostX

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

2 participants