0
function doSomething(uint256  _someAmount) external {

I accidentally made a double space between uint256 and _someAmount

Does this make any difference, or is it okay?

Do these 2 lines work the same way, or is there any effect by the double space?

function doSomething(uint256  _someAmount) external {
function doSomething(uint256 _someAmount) external {

1 Answer 1

2

They are both the same.

this can easily be tested in Remix by creating a contract with both methods and it will tell you that they conflict as they are parsed as the same.

Even when you look at the generated abi you will see that the spaces was trimmed.

In general the parameter name does not influence the low level abi details (e.g. the method id) as this is the hash of the function name and the parameter types (e.g. keccak256("doSomething(uint256)")) and solidity will trim all spaces for this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.