Skip to content

Commit

Permalink
V_B data for issue #507
Browse files Browse the repository at this point in the history
  • Loading branch information
code423n4 committed Sep 19, 2022
1 parent 2d4135e commit c833afd
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions data/V_B-Q.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
### 1. depositETH double work

There is a `depositETH` function in a `Vault` smart contract. The function accepts ether, deposit it to WETH contract and transfer wrapped tokens to the sender. Later the funds will be transferred as a ERC20 token from users account to smart contract.

The alternative approach can be just accepting the ether, that which will reduce the cost of depositing a lot and clarify the logic.

### 2. symbol == "rY2K" check

The Vault smart contract has the following check in the `beforeWithdraw` function:

```solidity
if (
keccak256(abi.encodePacked(symbol)) ==
keccak256(abi.encodePacked("rY2K"))
) {
...
}
```

It makes no sense to do this check every time the function is called, it's better to do this check once in the constructor and store the result as an `immutable` variable.

0 comments on commit c833afd

Please sign in to comment.