Closed code423n4 closed 3 years ago
a_delamo
In Sponsorable, the method _validateSponsorship is calling all the time
Sponsorable
_validateSponsorship
uint256 chainId; assembly { chainId := chainid() }
Being the chainId "static", we could keep the value cached and just refresh it from time to time?
Running on Remix the following code gives 134 gas cost.
function chain() external { uint256 chainId; assembly { chainId := chainid() } }
None
Storing the chainId in storage would require an SLOAD to access it, which is a lot more expensive.
SLOAD
SLOAD costs 200 gas. Closing as invalid.
Handle
a_delamo
Vulnerability details
Impact
In
Sponsorable
, the method_validateSponsorship
is calling all the timeBeing the chainId "static", we could keep the value cached and just refresh it from time to time?
Running on Remix the following code gives 134 gas cost.
Tools Used
None