-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |