Open snissn opened 1 year ago
BigNumbers is not a library that we actually need on the API. It is being used internally for mocks contracts only. However, any operation devs want to make over BigInt will require to use this library, so I guess devs will import it at the end. :/
By forcing optimizer=false
we are changing the defaults. It is fine as long as we have a very good reason to do it. Let's explore if it's absolutely needed though. Otherwise there's a chance of it failing in for random tools (like foundry in this case) in the future.
I don't have a solid answer here @maciejwitowski. BugNumbers is likely to be used by devs to handle bignum operations like mul or div. There is no other lib out there for that :/
But we are using it only in tests, right? Isn't there any workaround not to use it at all so we don't enforce this optimisation flag? I'm not sure what other devs have to do with it 😕 Do you mean that the optimisations won't be applied anyway when they use BigInts in their contracts?
So, I'm a solidity noob, but...
Shouldn't:
Be let freemem = mload(0x40)
?
Hey @emmanuelm41 @maciejwitowski would love to figure out a solution to this... Our codebase can't rely safely on the filecoin-solidity library because some of the API calls we make to the precompile require BigInt, and to make use of it, we then end up using BigNumber. Any library that relies on this code then can't be optimized, so we have to use more dangerous workaround
are we ok with optimizer=false?
I think the external/BigNumbers.sol is the blocker on changing this to true:
with optimizer=true i see the message when i run
forge build
::link: zboto Link