Closed code423n4 closed 1 year ago
https://github.com/code-423n4/2022-11-redactedcartel/blob/684627b7889e34ba7799e50074d138361f0f532b/src/PxERC20.sol#L45-L55 https://github.com/code-423n4/2022-11-redactedcartel/blob/684627b7889e34ba7799e50074d138361f0f532b/src/vaults/PirexERC4626.sol#L60-L78 https://github.com/code-423n4/2022-11-redactedcartel/blob/684627b7889e34ba7799e50074d138361f0f532b/src/vaults/PirexERC4626.sol#L80-L97
In AutoPxGmx.receiver and AutoPxGlp.deposit it is being checked to not be address(0) in order of not losing tokens by error, however in other places they are not being checked and can cause a loss of assets
AutoPxGmx.receiver
AutoPxGlp.deposit
address(0)
Possible loss of assets
mint https://github.com/code-423n4/2022-11-redactedcartel/blob/684627b7889e34ba7799e50074d138361f0f532b/src/PxERC20.sol#L45-L55 _mint(to, amount);
mint
deposit https://github.com/code-423n4/2022-11-redactedcartel/blob/684627b7889e34ba7799e50074d138361f0f532b/src/vaults/PirexERC4626.sol#L60-L78 _mint(receiver, shares);
deposit
mint https://github.com/code-423n4/2022-11-redactedcartel/blob/684627b7889e34ba7799e50074d138361f0f532b/src/vaults/PirexERC4626.sol#L80-L97 _mint(receiver, shares);
Check not to send tokens to 0 address
address(0) checks fall within QA
Duplicate of https://github.com/code-423n4/2022-11-redactedcartel-findings/issues/408
Lines of code
https://github.com/code-423n4/2022-11-redactedcartel/blob/684627b7889e34ba7799e50074d138361f0f532b/src/PxERC20.sol#L45-L55 https://github.com/code-423n4/2022-11-redactedcartel/blob/684627b7889e34ba7799e50074d138361f0f532b/src/vaults/PirexERC4626.sol#L60-L78 https://github.com/code-423n4/2022-11-redactedcartel/blob/684627b7889e34ba7799e50074d138361f0f532b/src/vaults/PirexERC4626.sol#L80-L97
Vulnerability details
tokens can get lost at some mint process
Impact
In
AutoPxGmx.receiver
andAutoPxGlp.deposit
it is being checked to not beaddress(0)
in order of not losing tokens by error, however in other places they are not being checked and can cause a loss of assetsGithub Permalinks
Possible loss of assets
mint
https://github.com/code-423n4/2022-11-redactedcartel/blob/684627b7889e34ba7799e50074d138361f0f532b/src/PxERC20.sol#L45-L55 _mint(to, amount);deposit
https://github.com/code-423n4/2022-11-redactedcartel/blob/684627b7889e34ba7799e50074d138361f0f532b/src/vaults/PirexERC4626.sol#L60-L78 _mint(receiver, shares);mint
https://github.com/code-423n4/2022-11-redactedcartel/blob/684627b7889e34ba7799e50074d138361f0f532b/src/vaults/PirexERC4626.sol#L80-L97 _mint(receiver, shares);Mitigation
Check not to send tokens to 0 address