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

Issue G: Returning zero when the protocol is paused #389

Merged
merged 4 commits into from
May 3, 2024

Conversation

dimpar
Copy link
Member

@dimpar dimpar commented May 2, 2024

To stay compliant with the ERC4626 standard we need to return 0 in max* related functions when the protocol is paused.

To stay compliant with the ERC4626 standard we need to return 0 in max*
related functions when the protocol is paused.
Copy link

netlify bot commented May 2, 2024

Deploy Preview for acre-dapp-testnet canceled.

Name Link
🔨 Latest commit 48a2ddb
🔍 Latest deploy log https://app.netlify.com/sites/acre-dapp-testnet/deploys/6634d535258be90008d4e560

@dimpar dimpar requested review from r-czajkowski and nkuba May 2, 2024 13:54
@dimpar dimpar changed the title Returning zero when the protocol is paused Issue G: Returning zero when the protocol is paused May 2, 2024
@dimpar dimpar self-assigned this May 2, 2024
@dimpar dimpar added the 🔗 Solidity Solidity contracts label May 2, 2024
@dimpar dimpar marked this pull request as ready for review May 2, 2024 20:41
The following functions: deposit, withdraw, redeem, mint already check
if the contract is paused or not. This is validated in max*
related functions downstream, e.g. maxDeposit(). If the protocol is paused, these
max* functions will return zero and stop the flow by reverting a
transaction. One of the revert errors might be e.g.
ERC4626ExceededMaxDeposit. This way we simplify the flow a little bit
and save some gas.
@nkuba nkuba enabled auto-merge May 3, 2024 12:14
@nkuba nkuba merged commit a2e6113 into main May 3, 2024
25 checks passed
@nkuba nkuba deleted the return-zero-in-max-functions branch May 3, 2024 12:18
nkuba added a commit that referenced this pull request May 9, 2024
Depends on #389

Subtracted fees from `maxWithdraw()` function to align with the rest of
the protocol that touch redeem or withdrawal functionality.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔗 Solidity Solidity contracts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants