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

Upgraded Q -> 2 from #57 [1716796622913] #597

Open
c4-judge opened this issue May 27, 2024 · 7 comments
Open

Upgraded Q -> 2 from #57 [1716796622913] #597

c4-judge opened this issue May 27, 2024 · 7 comments
Labels
downgraded by judge Judge downgraded the risk level of this issue grade-b QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue withdrawn by judge Special case: this finding was auto-generated by a judge and is now withdrawn; it can be ignored

Comments

@c4-judge
Copy link
Contributor

Judge has assessed an item in Issue #57 as 2 risk. The relevant finding follows:

3, Fee are not able to be claimed in xRenzoDeposit when aassset is not WETH

@c4-judge c4-judge added the 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value label May 27, 2024
@alcueca
Copy link

alcueca commented May 27, 2024

@jatinj615, please review.

Full text of the issue here.

@s1n1st3r01
Copy link

Hey @alcueca

I believe this is invalid

The depositToken the warden is referring to in the code snippet above, is always set to be the address of WETH, and not anything else. This is also mentioned in the natspec of the initialize() function of xRenzoDeposit

  • @param _depositToken WETH on L2
function _recoverBridgeFee() internal {
    uint256 feeCollected = bridgeFeeCollected;
    bridgeFeeCollected = 0;
    // transfer collected fee to bridgeSweeper
    uint256 balanceBefore = address(this).balance;
    IWeth(address(depositToken)).withdraw(feeCollected);  // <--- depositToken is always WETH
    feeCollected = address(this).balance - balanceBefore;
    (bool success, ) = payable(msg.sender).call{ value: feeCollected }("");
    if (!success) revert TransferFailed();
    emit SweeperBridgeFeeCollected(msg.sender, feeCollected);
}

Therefore the warden's claim that this function will revert if the depositToken is not WETH is not true. It will always be WETH.


In xRenzoDeposit, you have two functions:

  • deposit(). This is a function where you deposit depositToken which is WETH. Function then proceeds to trade it with nextWETH and the rest of the flow goes on.
  • depositETH(). This is a function where you can deposit ETH instead of WETH. What this function does is that it wraps the ETH into WETH, and the rest of the flow goes on (trading WETH with nextWETH and so on..)

@deeplake31337
Copy link

deeplake31337 commented May 28, 2024

From document link, it mentioned that 'The xRenzoDeposit contract mints $ezETH tokens in response to wETH or LST deposits'. So deposit token can be other token address to be able to interact with LSTs.

@jatinj615
Copy link

On L2s, only WETH and ETH deposits are supported.

For the L2s where ETH is not native. For ex - BSC, the contract just sends the collected WETH to sweeper instead of WETH::withdraw.

@jatinj615 jatinj615 added the sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue label May 29, 2024
@c4-judge c4-judge added downgraded by judge Judge downgraded the risk level of this issue QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax and removed 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value labels May 30, 2024
@c4-judge
Copy link
Contributor Author

This auto-generated issue was withdrawn by alcueca

@c4-judge c4-judge added the withdrawn by judge Special case: this finding was auto-generated by a judge and is now withdrawn; it can be ignored label May 30, 2024
@c4-judge
Copy link
Contributor Author

alcueca marked the issue as grade-b

@c4-judge c4-judge reopened this May 30, 2024
@alcueca
Copy link

alcueca commented May 30, 2024

Downgrading to QA, and the sponsor should be clearer in the intention of the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
downgraded by judge Judge downgraded the risk level of this issue grade-b QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue withdrawn by judge Special case: this finding was auto-generated by a judge and is now withdrawn; it can be ignored
Projects
None yet
Development

No branches or pull requests

5 participants