Skip to content

Commit 48de702

Browse files
Transpile cff1e67
1 parent 1d01948 commit 48de702

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 4.8.1
4+
5+
* `ERC4626`: Use staticcall instead of call when fetching underlying ERC-20 decimals. ([#3943](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3943))
6+
37
## 4.8.0 (2022-11-08)
48

59
* `TimelockController`: Added a new `admin` constructor parameter that is assigned the admin role instead of the deployer account. ([#3722](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3722))

contracts/token/ERC20/extensions/ERC4626Upgradeable.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ abstract contract ERC4626Upgradeable is Initializable, ERC20Upgradeable, IERC462
5050
/**
5151
* @dev Attempts to fetch the asset decimals. A return value of false indicates that the attempt failed in some way.
5252
*/
53-
function _tryGetAssetDecimals(IERC20Upgradeable asset_) private returns (bool, uint8) {
54-
(bool success, bytes memory encodedDecimals) = address(asset_).call(
53+
function _tryGetAssetDecimals(IERC20Upgradeable asset_) private view returns (bool, uint8) {
54+
(bool success, bytes memory encodedDecimals) = address(asset_).staticcall(
5555
abi.encodeWithSelector(IERC20MetadataUpgradeable.decimals.selector)
5656
);
5757
if (success && encodedDecimals.length >= 32) {

0 commit comments

Comments
 (0)