CementDAO/Fixidity

Have a version which is all static functions

asselstine opened this issue · 2 comments

Due to the way our deployment works, I cannot use this because of the way the library is designed.

It would be great if the FixidityLib was purely functional, such that all values are passed in. I.e.

library FixidityLib {
    function (...) internal pure view {
    }
}

That way it's very flexible in how it can be used. Whether as an external library, contract, or otherwise.

In the meantime I've simply copied the code over.

Hello,
thanks for the report. Can you explain a bit further about the way our deployment works?
Cementdao is using fixidity to its project and depending on the deployment pipeline it may work for some and not for others, and obviously, that is not the objective.

And I apologize, but I didn't understand the question It would be great if the FixidityLib was purely functional. It is purely functional and we are only passing values to functions.

static functions is a term not commonly used with Solidity, so it's kind of a misnomer here.

What I meant was if all the functions were internal pure view so that if the user wants to they can in-line the functions into a contract, rather than have to deploy the whole contract.

Because the functions are all public pure view the library must be deployed first and then linked to.

It would be nice to have the option to simply inline the functions.

As for the deployment, looking a little further into ZeppelinOS revealed that it can handle library linking and deployment automatically. It wasn't evident to me, but it works!