Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decimals of FixedStablecoins #77

Open
code423n4 opened this issue Jul 7, 2021 · 1 comment
Open

decimals of FixedStablecoins #77

code423n4 opened this issue Jul 7, 2021 · 1 comment
Labels

Comments

@code423n4
Copy link
Contributor

Handle

pauliax

Vulnerability details

Impact

FixedStablecoins constructor does not validate that addresses in the array are not empty, != address(0), and relies that the creator passes the correct values for decimals. The comment next to USDC (0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48) says that it is supposed to have 6 decimals:
uint256 public immutable USDC_DECIMALS; // = 1E6;
However, when querying the actual value on Etherscan, it shows 0 decimals: https://etherscan.io/address/0xa2327a938febf5fec13bacfb16ae10ecbc4cbdcf#readContract The problem with USDC is that it uses a proxy pattern thus the implementation could change (decimals could change but in practice, I think it is very unlikely).

Recommended Mitigation Steps

I think it would be better not to pass decimals separately and rely on the correctness of the input but use IERC20Detailed and query the decimals in code. Always querying the decimals on the go may be very inefficient and bring new attack vectors so I think you need to do here an assumption that decimals of upgradeable tokens won't change.

@code423n4 code423n4 added 1 (Low Risk) bug Something isn't working labels Jul 7, 2021
code423n4 added a commit that referenced this issue Jul 7, 2021
@kitty-the-kat
Copy link
Collaborator

We dont expect to see any changes to underlying decimals of stablecoins, worst case scenario we can redeploy the affected contracts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants