The token
parameter is checked to guard against the zero address, but then the same parameter is validated using a list of whitelisted addresses, which should also cover the zero address check.
The implementation of depositFsGlp
fetches the stakedGlp
token in every call using the PirexGmx contract (platform
). Since this is a fixed token from the GMX protocol, consider using an immutable variable defined at construction time.
The function depositFsGlp
will approve the spending for the given amount in every call. Consider adding an infinite approval during contract construction, similar to how it's done with the gmxBaseReward
token.
The function fetches the total amount of assets in line 288 (in the if condition) and does the same calculation in line 290 (asset.balanceOf(address(this)) - assetsBeforeClaim
).
The pxGmx
variable is defined at construction and can't be modified by the contract. Consider using an immutable variable to save gas.