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

QA Report #95

Open
code423n4 opened this issue May 12, 2022 · 2 comments
Open

QA Report #95

code423n4 opened this issue May 12, 2022 · 2 comments
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax

Comments

@code423n4
Copy link
Contributor

1. Incompatability with deflationary / fee-on-transfer tokens

  • Function Cally.createVault function takes a tokenIdOrAmount parameter but this parameter is not the actual transferred amount for fee-on-transfer / deflationary (or other rebasing) tokens in case tokenType = ERC20

Impact

  • The actual deposited amount might be lower than the specified depositAmount of the function parameter.
  • And when users exercise or withdraw they not only receive less than expected amount but also take funds of other vaults with the same vault.token too, causes loss of funds.

Proof-of-concept

Recommended Mitigation Steps

  • Transfer the tokens first and compare pre-/after token balances to compute the actual amount.

2. Vault id will start from 3 not from 1.

  • In Cally.createVault() function, vaultIndex += 2 is done before assigning it to vaultId. So vaultId will start from 3 and optionId will start from 4. There will not have tokenId = 0 or tokenId = 1
  • This is okay, but it’s kind of abnormal. And it’s just a QA issue.

Proof of concept

Recommended Mitigation Steps

  • Assign vaultIndex to vaultId before add 2.
vaultId = vaultIndex;
vaultIndex += 2;
@code423n4 code423n4 added bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax labels May 12, 2022
code423n4 added a commit that referenced this issue May 12, 2022
@outdoteth
Copy link
Collaborator

this can be bumped to medium severity:

  1. Incompatability with deflationary / fee-on-transfer tokens: Fee-on-transfer tokens are not supported #39

@HardlyDifficult
Copy link
Collaborator

Moved fee on transfer report to #326

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Projects
None yet
Development

No branches or pull requests

3 participants