Skip to content
New issue

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

Have a version which is all static functions #4

Open
asselstine opened this issue May 10, 2019 · 2 comments
Open

Have a version which is all static functions #4

asselstine opened this issue May 10, 2019 · 2 comments

Comments

@asselstine
Copy link

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.

@vibern0
Copy link
Contributor

vibern0 commented May 11, 2019

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.

@asselstine
Copy link
Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants