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

Second parameter in solidity contact crashes my ethereum node #4917

Open
igorroman777 opened this issue Jan 14, 2025 · 6 comments
Open

Second parameter in solidity contact crashes my ethereum node #4917

igorroman777 opened this issue Jan 14, 2025 · 6 comments
Assignees
Labels
investigate Under investigation and may be a bug. v6 Issues regarding v6

Comments

@igorroman777
Copy link

Ethers Version

6.13.5

Search Terms

solidity

Describe the Problem

i have a solidity contact that worked with ethers 5. after switching to ethers 6 i have a weird effect: second parameter in the method causes a nternal server error in my ethereum node:
function set(uint x, uint256 itemAct) public { storedData = x; }

The following method works:
function set(uint x) public { storedData = x; }

Code Snippet

`function set(uint x, uint256 itemAct) public {
        storedData = x;
    }`

Contract ABI

pragma solidity 0.8.28;

contract SimpleStorage {
    uint storedData;

    function set(uint x, uint256 itemAct) public {
        storedData = x;
    }

    function get() public view returns (uint) {
        return storedData;
    }
}

Errors

No response

Environment

No response

Environment (Other)

No response

@igorroman777 igorroman777 added investigate Under investigation and may be a bug. v6 Issues regarding v6 labels Jan 14, 2025
@ricmoo
Copy link
Member

ricmoo commented Jan 14, 2025

Can you include the JavaScript you are using? It should definitely not be able to crash a node and I’ve used nearly identical code before, so it seems strange, I agree…

@igorroman777
Copy link
Author

igorroman777 commented Jan 14, 2025

Hi @ricmoo ,
So simple contract makes already problem, second parameter uint256 itemAct crashes node (500 Internal Server Error):

`pragma solidity 0.8.28;

contract SimpleStorage {
uint storedData;

function set(uint x, uint256 itemAct) public {
    storedData = x;
}

function get() public view returns (uint) {
    return storedData;
}

}`

@ricmoo
Copy link
Member

ricmoo commented Jan 14, 2025

But how are you calling this with Ethers.js? That is Solidity code, not JavaScript. :)

I don't think that code will compile in modern Solidity because the itemAct is unused. But if you have deployed it, how are you calling it from JavaScript?

@igorroman777
Copy link
Author

igorroman777 commented Jan 14, 2025

Code is compiled., no problem.
I deploy with ethers:

`const nftMarketplaceFactory = new ethers.ContractFactory(
marketplaceJson.abi,
marketplaceJson.bytecode,
signerWallet
);

const nftMarketplaceContract = await nftMarketplaceFactory.deploy({
gasLimit: 993721,
gasPrice: 772180220951,
nonce: 138
});
await nftMarketplaceContract.waitForDeployment();
const marketplaceAddress = await nftMarketplaceContract.getAddress();

console.log("nftMarketplace deployed to address: ", marketplaceAddress);`

and as I said, it works with one parameter.
Crazy?

@igorroman777
Copy link
Author

eth_sendRawTransaction is called with an argument.

Nothing is done with two arguments

@igorroman777
Copy link
Author

maybe this is an nginx problem:

server: spliin.com, request: "GET /wordpress/wp-admin/setup-config.php HTTP/1.1", host: "spliin.com" 2025/01/14 22:10:29 [error] 190968#190968: *3886083 open() "/var/www/spliin.com/html/wp-admin/setup-config.php" failed (2: No such file or directory), client: 162.158.95.31, server: spliin.com, request: "GET /wp-admin/setup-config.php HTTP/1.1", host: "spliin.com" 2025/01/14 22:13:25 [crit] 190972#190972: *3886433 open() "/var/lib/nginx/body/0000000071" failed (13: Permission denied), client: 87.152.174.57, server: spliin.com, request: "POST /v2/0xb47C9EB9faecd558b1C0 HTTP/1.1", host: "www.spliin.com"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigate Under investigation and may be a bug. v6 Issues regarding v6
Projects
None yet
Development

No branches or pull requests

2 participants