We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Making the uint[19] because they never change and the compiler doesn't know when the array is going to stop.So make them static and that will save gas and confusion. https://github.com/code-423n4/2022-05-cally/blob/a2eefbbe6db5b65e81bd1ecb992a401be217a3e6/contracts/src/Cally.sol#L86 https://github.com/code-423n4/2022-05-cally/blob/a2eefbbe6db5b65e81bd1ecb992a401be217a3e6/contracts/src/Cally.sol#L88 With out the change 0.01354192ETH With change 0.01339456ETH
Non Initialized variables are already zero bec the slot is not filled and when inlinzed gets stored in storage which is a lot of gas (sstore opcode which is 25000 gas) https://github.com/code-423n4/2022-05-cally/blob/a2eefbbe6db5b65e81bd1ecb992a401be217a3e6/contracts/src/Cally.sol#L91 https://github.com/code-423n4/2022-05-cally/blob/a2eefbbe6db5b65e81bd1ecb992a401be217a3e6/contracts/src/Cally.sol#L90 https://github.com/code-423n4/2022-05-cally/blob/1849f9ee12434038aa80753266ce6a2f2b082c59/contracts/src/Cally.sol#L126 https://github.com/code-423n4/2022-05-cally/blob/1849f9ee12434038aa80753266ce6a2f2b082c59/contracts/src/Cally.sol#L363 —--------------------------------------------------------------------------------------------------------------------- Onlyowner function should be payable because payable does not check msg.value = 0 https://github.com/code-423n4/2022-05-cally/blob/a2eefbbe6db5b65e81bd1ecb992a401be217a3e6/contracts/src/Cally.sol#L115 https://github.com/code-423n4/2022-05-cally/blob/a2eefbbe6db5b65e81bd1ecb992a401be217a3e6/contracts/src/Cally.sol#L120
Cally.sol gas report
Deployment Cost ┆ Deployment Size ┆ ┆ ┆ ┆ │ ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤ │ 5376231 ┆ 23430 ┆ ┆ ┆ ┆ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤ │ setFee ┆ 2538 ┆ 16152 ┆ 24531 ┆ 24531 ┆ 5 │ ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌ withdrawProtocolFees ┆ 2490 ┆ 4985 ┆ 4985 ┆ 7480 ┆ 2
Cally.sol gas report with all the changes
Deployment Cost ┆ Deployment Size ┆ ┆ ┆ ┆ │ ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤ │ 5371031 ┆ 23404 ┆ ┆ ┆ ┆ │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤ │ setFee ┆ 2514 ┆ 16128 ┆ 24507 ┆ 24507 ┆ 5 │ ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌
withdrawProtocolFees ┆ 2466 ┆ 4961 ┆ 4961 ┆ 7456 ┆ 2
The text was updated successfully, but these errors were encountered:
simon135 issue #53
b7f9428
No branches or pull requests
Making the uint[19] because they never change and the compiler doesn't know when the array is going to stop.So make them static and that will save gas and confusion.
https://github.com/code-423n4/2022-05-cally/blob/a2eefbbe6db5b65e81bd1ecb992a401be217a3e6/contracts/src/Cally.sol#L86
https://github.com/code-423n4/2022-05-cally/blob/a2eefbbe6db5b65e81bd1ecb992a401be217a3e6/contracts/src/Cally.sol#L88
With out the change 0.01354192ETH
With change 0.01339456ETH
Non Initialized variables are already zero bec the slot is not filled and when inlinzed gets stored in storage which is a lot of gas (sstore opcode which is 25000 gas)
https://github.com/code-423n4/2022-05-cally/blob/a2eefbbe6db5b65e81bd1ecb992a401be217a3e6/contracts/src/Cally.sol#L91
https://github.com/code-423n4/2022-05-cally/blob/a2eefbbe6db5b65e81bd1ecb992a401be217a3e6/contracts/src/Cally.sol#L90
https://github.com/code-423n4/2022-05-cally/blob/1849f9ee12434038aa80753266ce6a2f2b082c59/contracts/src/Cally.sol#L126
https://github.com/code-423n4/2022-05-cally/blob/1849f9ee12434038aa80753266ce6a2f2b082c59/contracts/src/Cally.sol#L363
—---------------------------------------------------------------------------------------------------------------------
Onlyowner function should be payable because payable does not check msg.value = 0
https://github.com/code-423n4/2022-05-cally/blob/a2eefbbe6db5b65e81bd1ecb992a401be217a3e6/contracts/src/Cally.sol#L115
https://github.com/code-423n4/2022-05-cally/blob/a2eefbbe6db5b65e81bd1ecb992a401be217a3e6/contracts/src/Cally.sol#L120
Cally.sol gas report
Deployment Cost ┆ Deployment Size ┆ ┆ ┆ ┆ │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤
│ 5376231 ┆ 23430 ┆ ┆ ┆ ┆
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤
│ setFee ┆ 2538 ┆ 16152 ┆ 24531 ┆ 24531 ┆ 5 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌
withdrawProtocolFees ┆ 2490 ┆ 4985 ┆ 4985 ┆ 7480 ┆ 2
Cally.sol gas report with all the changes
Deployment Cost ┆ Deployment Size ┆ ┆ ┆ ┆ │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤
│ 5371031 ┆ 23404 ┆ ┆ ┆ ┆ │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤
│ setFee ┆ 2514 ┆ 16128 ┆ 24507 ┆ 24507 ┆ 5 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌
withdrawProtocolFees ┆ 2466 ┆ 4961 ┆ 4961 ┆ 7456 ┆ 2
The text was updated successfully, but these errors were encountered: