Skip to content

Commit

Permalink
Rename stake to deposit in BitcoinDepositor (#341)
Browse files Browse the repository at this point in the history
We decided not to call the operation stake in the dapp, so for
consistency we align the naming here.
It makes it more consistent also with the AbstractBitcoinDepositor as we
call the operation deposit there.
  • Loading branch information
dimpar authored Apr 10, 2024
2 parents fb87c72 + f55afd0 commit edf8b3c
Show file tree
Hide file tree
Showing 18 changed files with 395 additions and 387 deletions.
190 changes: 93 additions & 97 deletions core/contracts/BitcoinDepositor.sol

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/contracts/BitcoinRedeemer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ contract BitcoinRedeemer is Ownable2StepUpgradeable, IReceiveApproval {
/// setup. This contract remains upgradable to have flexibility to handle
/// adjustments to tBTC Bridge changes.
/// @dev Redemption data should include a `redeemer` address matching the
/// address of the staker who is redeeming the shares. In case anything
/// address of the deposit owner who is redeeming the shares. In case anything
/// goes wrong during the tBTC unminting process, the redeemer will be
/// able to claim the tBTC tokens back from the tBTC Bank contract.
/// @param owner The owner of the stBTC tokens.
Expand Down
1 change: 0 additions & 1 deletion core/contracts/PausableOwnable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ abstract contract PausableOwnable is
/// @param newPauseAdmin New account that can trigger emergency
/// stop mechanism.
function updatePauseAdmin(address newPauseAdmin) external onlyOwner {
// TODO: Introduce a parameters update process.
if (newPauseAdmin == address(0)) {
revert ZeroAddress();
}
Expand Down
19 changes: 3 additions & 16 deletions core/contracts/stBTC.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ import {ZeroAddress} from "./utils/Errors.sol";
/// @title stBTC
/// @notice This contract implements the ERC-4626 tokenized vault standard. By
/// staking tBTC, users acquire a liquid staking token called stBTC,
/// commonly referred to as "shares". The staked tBTC is securely
/// deposited into Acre's vaults, where it generates yield over time.
/// commonly referred to as "shares".
/// Users have the flexibility to redeem stBTC, enabling them to
/// withdraw their staked tBTC along with the accrued yield.
/// withdraw their deposited tBTC along with the accrued yield.
/// @dev ERC-4626 is a standard to optimize and unify the technical parameters
/// of yield-bearing vaults. This contract facilitates the minting and
/// burning of shares (stBTC), which are represented as standard ERC20
Expand Down Expand Up @@ -99,7 +98,6 @@ contract stBTC is ERC4626Fees, PausableOwnable {
/// @notice Updates treasury wallet address.
/// @param newTreasury New treasury wallet address.
function updateTreasury(address newTreasury) external onlyOwner {
// TODO: Introduce a parameters update process.
if (newTreasury == address(0)) {
revert ZeroAddress();
}
Expand All @@ -118,16 +116,13 @@ contract stBTC is ERC4626Fees, PausableOwnable {
function updateMinimumDepositAmount(
uint256 newMinimumDepositAmount
) external onlyOwner {
// TODO: Introduce a parameters update process.
minimumDepositAmount = newMinimumDepositAmount;

emit MinimumDepositAmountUpdated(newMinimumDepositAmount);
}

// TODO: Implement a governed upgrade process that initiates an update and
// then finalizes it after a delay.
/// @notice Updates the dispatcher contract and gives it an unlimited
/// allowance to transfer staked tBTC.
/// allowance to transfer deposited tBTC.
/// @param newDispatcher Address of the new dispatcher contract.
function updateDispatcher(IDispatcher newDispatcher) external onlyOwner {
if (address(newDispatcher) == address(0)) {
Expand All @@ -139,10 +134,6 @@ contract stBTC is ERC4626Fees, PausableOwnable {
emit DispatcherUpdated(oldDispatcher, address(newDispatcher));
dispatcher = newDispatcher;

// TODO: Once withdrawal/rebalancing is implemented, we need to revoke the
// approval of the vaults share tokens from the old dispatcher and approve
// a new dispatcher to manage the share tokens.

if (oldDispatcher != address(0)) {
// Setting allowance to zero for the old dispatcher
IERC20(asset()).forceApprove(oldDispatcher, 0);
Expand All @@ -152,8 +143,6 @@ contract stBTC is ERC4626Fees, PausableOwnable {
IERC20(asset()).forceApprove(address(dispatcher), type(uint256).max);
}

// TODO: Implement a governed upgrade process that initiates an update and
// then finalizes it after a delay.
/// @notice Update the entry fee basis points.
/// @param newEntryFeeBasisPoints New value of the fee basis points.
function updateEntryFeeBasisPoints(
Expand All @@ -164,8 +153,6 @@ contract stBTC is ERC4626Fees, PausableOwnable {
emit EntryFeeBasisPointsUpdated(newEntryFeeBasisPoints);
}

// TODO: Implement a governed upgrade process that initiates an update and
// then finalizes it after a delay.
/// @notice Update the exit fee basis points.
/// @param newExitFeeBasisPoints New value of the fee basis points.
function updateExitFeeBasisPoints(
Expand Down
Loading

0 comments on commit edf8b3c

Please sign in to comment.