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
{{ message }}
This repository was archived by the owner on Apr 18, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 18, 2026. It is now read-only.
Factorize mul, div, weightedAvg to minimize bytecode size #77
I won't spend much time for now on this, given that I don't believe the compiler will be smart enough to compile to something as gas-efficient as the current implementation (because we need to abstract a scale input to abstract multiplications, divisions, which is currently a library constant and would be input as a function argument on which operations are performed - operations that I don't believe the compiler will recognize as constant operations)
I would like to see morpho-utils completely revamped to do general fixed point maths instead of Aave/Compound specific maths. In this case this could be implemented.
This is just a random open-source idea that I think would benefit someone in the universe, but is blocked by a Solidity technical limit
Given it's an OS repo, we don't need to have everything sorted out here, we can just let ideas free and see if they are picked up, supported by others
Activity
MathisGD commentedon Dec 21, 2022
In favor of this.
Related to #57
MerlinEgalite commentedon Dec 21, 2022
As long as it improves readability while preserving gas efficiency I'm ok with that
MathisGD commentedon Dec 21, 2022
By the way, I don't think that it would change the bytecode size, but only the Solidity code size.
Rubilmax commentedon Jan 2, 2023
I won't spend much time for now on this, given that I don't believe the compiler will be smart enough to compile to something as gas-efficient as the current implementation (because we need to abstract a
scaleinput to abstract multiplications, divisions, which is currently a library constant and would be input as a function argument on which operations are performed - operations that I don't believe the compiler will recognize as constant operations)I believe it requires argotorg/solidity#891 to be addressed first
MathisGD commentedon Jan 2, 2023
I didn't know that it wasn't possible to import a lib in a lib. So we are stuck with this...
MerlinEgalite commentedon Apr 26, 2023
Should we close @Rubilmax ?
MathisGD commentedon Apr 26, 2023
I would like to see morpho-utils completely revamped to do general fixed point maths instead of Aave/Compound specific maths. In this case this could be implemented.
Edit: with this naming 👌
Rubilmax commentedon Apr 26, 2023
This is just a random open-source idea that I think would benefit someone in the universe, but is blocked by a Solidity technical limit
Given it's an OS repo, we don't need to have everything sorted out here, we can just let ideas free and see if they are picked up, supported by others