Closed 0xScratch closed 9 months ago
thanks @Aryan9592! can i ask you to move this pr to this repo: https://github.com/Badger-Finance/badger-infra/blob/main/contracts/refillers/AutonomousDripper.sol ?
it is where the original source of the contract lives :)
Okay
Closing as it will be handled within the Dripper's repo.
This PR aims for two main changes:
for
loop: Well, the way these 'for' loops were structured in this smart contract were quite normal but kind of taking more gas than it needed to execute. Changingi++
to++i
, and using theunchecked
block alone can play a lot of effect. For more info, refer this -> https://gist.github.com/grGred/9bab8b9bad0cd42fc23d4e31e7347144#for-loops-improvement. This convo might help -> https://github.com/lurk-lab/solidity-verifier/pull/31uint256 count = 0;
touint256 count;
: Usually, default values of unsigned integers are 0 itself, thus there's no need to initialize any unsigned integer to 0. This same change takes effect in case ofbool dripped = false;
tobool dripped;