Save big amount of gas by using uint256 instead of bool in mapping
bool mappings cost an extra SLOAD per write since the EVM must read the slot, replace the bool bits, and rewrite it; uint256 sentinels avoid the read-modify-write.
Description
Booleans are more expensive than uint256 or any type that takes up a full word because each write operation emits an extra SLOAD to first read the slot's contents, replace the bits taken up by the boolean, and then write back.
mapping(address => mapping(address => bool)) private _operatorApprovals;mapping(address => bool) public sharedProxyAddresses;
Impact
By just using mapping(address => uint256), and having:
uint256 NOT_APPROVED = 1instead offalseuint256 APPROVED = 2instead oftrue
there can be a considerable difference on gas saved.
Recommended read: Save over a hundred thousand gas with this Solidity gas optimization tip.
Recommendation
Replace boolean mappings with uint256 sentinels using 1 and 2 as the off and on states respectively to avoid the SLOAD on every write.

