-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix integration tests after v1.1.0 release #718
Merged
Merged
Conversation
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
✅ Deploy Preview for acre-dapp-testnet canceled.
|
✅ Deploy Preview for acre-dapp canceled.
|
nkuba
changed the base branch from
main
to
mezo-allocator-withdraw-improvements
August 28, 2024 13:46
nkuba
changed the title
Solidity 1.1.0 fix integration tests
Fix integration tests after v1.1.0 release
Aug 28, 2024
This was referenced Aug 28, 2024
Merged
r-czajkowski
previously approved these changes
Aug 29, 2024
The allowance was set to 1000 stBTC in the initial deployment to mainnet.
We update block number for mainnet fork to the block after the latest version of contracts deployment. We also update the details of tBTC redemption transaction to reflect the current state of the mainnet tBTC redemption wallets.
These are the latest artifacts of MezoPortal for the mainnet and sepolia networks.
Since we're developing changes to the stBTC and MezoAllocator contracts, we need to upgrade them in the forked network to reflect the latest development changes on the forked network, to simulate the upgrade that will take place in the future.
We update the integration tests to reflect the latest changes to the MezoAllocator contract from 1b95419
nkuba
force-pushed
the
solidity-1.1.0-fix-integration-tests
branch
from
August 30, 2024 12:25
c74f22e
to
fd3a768
Compare
….0-fix-integration-tests
r-czajkowski
added a commit
that referenced
this pull request
Sep 3, 2024
Depends on: #716 In this PR we introduce a couple of improvements to the MezoAllocator contract related to withdrawals from the Mezo Portal. ### Check if the withdrawal amount exceeds the deposit balance (1b95419) Here we improve the withdrawal function to check if the withdrawal amount exceeds the deposit balance. If the withdrawal amount exceeds the deposit balance, the function will revert with a custom error message. Before these changes, since the Portal contract changed the handling of partial and full withdrawals the withdrawal function reverted on `depositBalance -= uint96(amount);` with: ``` panic code 0x11 (Arithmetic operation overflowed outside of an unchecked block) ``` ### Include unallocated MezoAllocator balance in `withdraw` and `releaseDeposit` (1b9ba17, 0440580) In bb42bce we included the current balance of the MezoAllocator contract in the `totalAssets` function result. The balance can come from a rewards transfer or any donation. We haven't considered this balance in the `withdraw` function, which could lead to blocking the last user withdrawing the funds, as the balance of assets owned by them calculated based on `totalAssets` function, couldn't be fully withdraw due to unallocated balance being stuck in the `MezoAllocator` contract. In 1b9ba17 we introduce possibility to withdraw funds from the unallocated contract balance. For the `releaseDeposit` function we could face a problem when the Mezo Portal deposit is already released but some tokens were donated to the MezoAllocator contract, since the `Porta.withdraw` function would be reverting as there is no deposit, we won't be able to transfer the unallocated funds in the same call. We fixed it in 0440580. > [!IMPORTANT] > Please ignore failing integration tests, as these will be fixed in #718
Base automatically changed from
mezo-allocator-withdraw-improvements
to
main
September 3, 2024 09:55
r-czajkowski
approved these changes
Sep 4, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Depends on: #717
In this PR we fix integration tests by updating the forked blocked number to reflect the latest version of deployed contracts.
We update the integration tests fixture function to upgrade the contracts on the forked network to the latest code from the development branch, so the tests are testing the code we are implementing.