I am just writing to see if Zeppelin had discontinued support for upgradable Libraries in Solidity or if not, whether they would even solve my use case
Right now, we would just love a sub-set of our contracts functionality to be isolated.
The functionality will ideally accept a storage struct as an arg so we can access an internal mapping. A library seems like a perfect use case for this - however we would love for it to be upgradable. Past the blog post (https://medium.com/zeppelin-blog/proxy-libraries-in-solidity-79fbe4b970fd) in 2017.. I can't see anything from Zeppelin on this. Is it possible? Does it function just the same as a regular solidity lib? Would some special delegateCall needed on the sending side to access storage, or is it even possible through a proxy contract?
Definitely could, but was hoping to be able to utilise the native functionality provided by libraries (passing storage args, cheaper gas costs), although I understand that it may not be possible due to how libraries actually workā¦ and the best solution as you say may be to create a standard upgradable proxy.
It may be more efficient for us (in gas terms) to manage the version of the library that we are hoping to reference from within the contract (as we have system governors), rather than having some static proxy that requires an extra 1000 gas to pass through
After that 2017 post by @maraoz we didnāt develop the idea any further, so we donāt have an offering that you would be able to use out of the box.
Note that any implementation of an upgradeable library requires a CALL operation in order to find out which is the current library address, because of the way storage and DELEGATECALL interact. This implies that there will be a base cost of 700 (the cost of a CALL) in any such implementation, which makes the gas overhead comparable to a normal proxy contract.
I agree though that the gas savings of passing storage args might be greater.
Thanks for the info @frangio. This might be a stupid question, but do you know if it is possible to call a library at a specific address, rather than that which is compiled into the contract bytecode? Just wondering if itās possible to upgrade that way