File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
contracts/token/ERC20/extensions Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -87,19 +87,16 @@ abstract contract ERC4626 is ERC20, IERC4626 {
87
87
*/
88
88
function _tryGetAssetDecimals (IERC20 asset_ ) private view returns (bool ok , uint8 assetDecimals ) {
89
89
Memory.Pointer ptr = Memory.getFreeMemoryPointer ();
90
- (bool success , bytes32 encodedDecimals , ) = LowLevelCall.staticcallReturn64Bytes (
90
+ (bool success , bytes32 returnedDecimals , ) = LowLevelCall.staticcallReturn64Bytes (
91
91
address (asset_),
92
92
abi.encodeCall (IERC20Metadata .decimals, ())
93
93
);
94
- if (success && LowLevelCall.returnDataSize () >= 32 ) {
95
- uint256 returnedDecimals = uint256 (encodedDecimals);
96
- if (returnedDecimals <= type (uint8 ).max) {
97
- Memory.setFreeMemoryPointer (ptr);
98
- return (true , uint8 (returnedDecimals));
99
- }
100
- }
101
94
Memory.setFreeMemoryPointer (ptr);
102
- return (false , 0 );
95
+
96
+ return
97
+ (success && LowLevelCall.returnDataSize () >= 32 && uint256 (returnedDecimals) <= type (uint8 ).max)
98
+ ? (true , uint8 (uint256 (returnedDecimals)))
99
+ : (false , 0 );
103
100
}
104
101
105
102
/**
You can’t perform that action at this time.
0 commit comments