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

ERC4626 custom asset balance tracking and inflation attack check #5

Open
JayusJay opened this issue Nov 11, 2024 · 0 comments
Open

Comments

@JayusJay
Copy link
Contributor

function totalAssets() public view override returns (uint256) {
return IERC20(asset()).balanceOf(address(this)) + fundsInTrading;
}

Though you are accurately tracking amount of funds being utilized in strategies and the rest, this contract is still susceptible to the inflation attack.

I recomment using only a single state variable to track the balance of the vault and do not rely on asset.balanceOfAddress(this)

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

No branches or pull requests

1 participant