livepeer / protocol

Livepeer protocol
MIT License
154 stars 45 forks source link

Store the hash of the contract names as a constant #564

Open RiccardoBiosas opened 2 years ago

RiccardoBiosas commented 2 years ago

The contract getters use the hash of a contract name to fetch the corresponding address from the registry. Currently, they calculate the hash of the contract on the spot every time they are called, hence I suggest that we could save a bit of gas by storing the hash of the protocol contracts' names as a constant in a shared contract/embedded library.

RiccardoBiosas commented 2 years ago

Note: could potentially converge with https://github.com/livepeer/protocol/issues/563