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

Remove deposits maximum total assets limit #332

Merged
merged 16 commits into from
Apr 4, 2024
Merged

Remove deposits maximum total assets limit #332

merged 16 commits into from
Apr 4, 2024

Conversation

nkuba
Copy link
Member

@nkuba nkuba commented Apr 3, 2024

We no longer want to enforce a maximum limit for total assets under management. In this PR we remove code related to the maximum total assets limit in stBTC contract.
Additionally, the Bitcoin Depositor contract can be simplified as it won't need to queue deposits anymore due to the maximum assets limit being reached.

nkuba added 7 commits April 3, 2024 17:35
We want to remove the maximum limit for funds held by stBTC contract to
accept deposits without any cap.
Since stBTC doesn't have max total assets limit anymore, we don't need
to track the limits in the BitcoinDepositor contract.
We no longer need to queue the stake requests as there is no limit for
stBTC deposits.
Copy link

netlify bot commented Apr 3, 2024

Deploy Preview for acre-dapp-testnet ready!

Name Link
🔨 Latest commit 7613aad
🔍 Latest deploy log https://app.netlify.com/sites/acre-dapp-testnet/deploys/660e7eab0984500008273b72
😎 Deploy Preview https://deploy-preview-332--acre-dapp-testnet.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

nkuba added 5 commits April 3, 2024 19:11
We remove test contracts used to test upgradeability as these tests fell
like testing OpenZeppelin plugin. Every change to the V1 contract
requires us to reflect the changes in the test contracts which is a pain
for maintanance.
Reflect changes from V1 contracts in V2 contracts defined for upgrades
testing.
We don't need this TODO as minimum deposit amount is managed by
`minStake` function.
@nkuba nkuba requested a review from dimpar April 3, 2024 17:52
@nkuba nkuba marked this pull request as ready for review April 3, 2024 17:52
@nkuba nkuba self-assigned this Apr 3, 2024
@nkuba nkuba added the 🔗 Solidity Solidity contracts label Apr 3, 2024
core/contracts/stBTC.sol Outdated Show resolved Hide resolved
@dimpar
Copy link
Member

dimpar commented Apr 4, 2024

13_stbtc_update_deposit_parameters.ts has to be cleaned from the maximumTotalAssets param as well.

core/contracts/AcreBitcoinDepositor.sol Show resolved Hide resolved
/// @param depositKey Deposit key identifying the deposit.
/// @param caller Address that finalized the stake request.
/// @param queuedAmount Amount of queued tBTC tokens.
event StakeRequestQueued(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This event is also being used in dApp subgraphs e.g. one of the usage is in acre-bitcoin-depositor.ts. There are other places. We should probably let know front-end folks about this change.

Same for other deleted events

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

core/test/AcreBitcoinDepositor.test.ts Outdated Show resolved Hide resolved
@nkuba
Copy link
Member Author

nkuba commented Apr 4, 2024

13_stbtc_update_deposit_parameters.ts has to be cleaned from the maximumTotalAssets param as well.

Updated in d38052d

@nkuba nkuba requested a review from dimpar April 4, 2024 08:42
@dimpar dimpar enabled auto-merge April 4, 2024 08:52
@dimpar dimpar merged commit 30e1e95 into main Apr 4, 2024
24 checks passed
@dimpar dimpar deleted the remove-max-limit branch April 4, 2024 10:22
dimpar added a commit that referenced this pull request Apr 4, 2024
This PR is a follow-up from #332.
Since we removed deposit requests queueing we can combine
`finalizeBridging` and `finalizeStake` functions.
We include a couple of other small changes in this PR to optimize gas
usage.

Before:
```
|  AcreBitcoinDepositor  ·  finalizeStake    ·          -  ·          -  ·      208140  ·            9  ·          -  │
·························|···················|·············|·············|··············|···············|··············
|  AcreBitcoinDepositor  ·  initializeStake  ·     145693  ·     145717  ·      145711  ·            8  ·          -  │
```

After:
```
|  AcreBitcoinDepositor  ·  finalizeStake    ·     176104  ·     204304  ·      192218  ·           14  ·          -  │
·························|···················|·············|·············|··············|···············|··············
|  AcreBitcoinDepositor  ·  initializeStake  ·     145886  ·     145910  ·      145903  ·            7  ·          -  │
```
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