Skip to content

Conversation

BeratOz01
Copy link
Collaborator

Description

PATH: contracts/EncryptedERC.sol#L541-L543

The withdraw function in EncryptedERC contract accepts _amount, _tokenId, proof, input, _balancePCT parameters.

Inside the function there is a check:

{
// _amount should match with the amount in the proof
if (_amount != input[15]) {
revert InvalidProof();
}
}
As the _amount and input[15] parameters are given by the user, the check is redundant, as the user can give only one of them.

Remediation

Remove the _amount parameter and the if condition, and take the amount value from the proof, also fix in the EERC SDK’s withdraw call.

@BeratOz01 BeratOz01 added the enhancement New feature or request label Feb 13, 2025
@BeratOz01 BeratOz01 requested a review from Faedon February 13, 2025 14:44
@BeratOz01 BeratOz01 self-assigned this Feb 13, 2025
@Faedon Faedon force-pushed the fix/etrp_10_redundant_parameter_withdraw branch from 300de97 to 55b0221 Compare March 10, 2025 12:36
@Faedon Faedon merged commit 2a3a3c5 into main Mar 10, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants