provable-things / ethereum-api

Provable API for Ethereum smart contracts
https://docs.provable.xyz/#ethereum
MIT License
801 stars 428 forks source link

Update to the oraclizeAPI modifier to only update the connector address in storage if it has changed. #17

Closed AdamJLemmon closed 7 years ago

AdamJLemmon commented 7 years ago

Current implementation writes the connector address to storage for every query.

This change only does so if the address has changed and therefore saves a storage write on each query.

D-Nice commented 7 years ago

LGTM!

OAR.getAddress() is not assigned to variable for greater gas saving, as updates to the connector itself should be quite rare.