You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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.
// 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;
}
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
The text was updated successfully, but these errors were encountered: