Deployed Official OpenZeppelin Contracts?

Hello!

When we Import smart contract from OpenZeppelin library, do we actually deploy each one of them? I was wondering if there was some official deployed contract that we can use instead of deploying new instance each time. Could we just all use one official contract and save on deployment cost this way?

3 Likes

Hello @madeindreams!

If you’re talking about contracts that you extend in your codebase, as it could be MyContract is ERC20, bear in mind that only the contracts you use end up being deployed. This is, before you deploy your code it will be compiled along with all its dependencies producing a single bytecode (or one per contract you’re deploying) and only that gets deployed.

And if you’re talking about having e.g. a single, canonical ERC20 implementation onchain and then deploying proxies that make use of its logic (but with each proxy having independent storage), we used to offer already-deployed contracts but we stopped maintaining them a long time ago due to lack of usage/demand.

1 Like