diff --git a/solidity/contracts/BitcoinRedeemer.sol b/solidity/contracts/BitcoinRedeemer.sol index 159a81dfd..f0c38b07f 100644 --- a/solidity/contracts/BitcoinRedeemer.sol +++ b/solidity/contracts/BitcoinRedeemer.sol @@ -46,9 +46,6 @@ contract BitcoinRedeemer is Ownable2StepUpgradeable, IReceiveApproval { /// Reverts if the TBTCVault address is zero. error TbtcVaultZeroAddress(); - /// Attempted to call receiveApproval for not supported token. - error UnsupportedToken(address token); - /// Attempted to call receiveApproval by supported token. error CallerNotAllowed(address caller); @@ -96,18 +93,16 @@ contract BitcoinRedeemer is Ownable2StepUpgradeable, IReceiveApproval { /// @notice Redeems shares for tBTC and requests bridging to Bitcoin. /// @param from Shares token holder executing redemption. /// @param amount Amount of shares to redeem. - /// @param token stBTC token address. /// @param extraData Redemption data in a format expected from /// `redemptionData` parameter of Bridge's `receiveBalanceApproval` /// function. function receiveApproval( address from, uint256 amount, - address token, + address, bytes calldata extraData ) external { - if (token != address(stbtc)) revert UnsupportedToken(token); - if (msg.sender != token) revert CallerNotAllowed(msg.sender); + if (msg.sender != address(stbtc)) revert CallerNotAllowed(msg.sender); if (extraData.length == 0) revert EmptyExtraData(); redeemSharesAndUnmint(from, amount, extraData); diff --git a/solidity/test/BitcoinDepositor.test.ts b/solidity/test/BitcoinDepositor.test.ts index 4cfb80283..ec5ec7d4d 100644 --- a/solidity/test/BitcoinDepositor.test.ts +++ b/solidity/test/BitcoinDepositor.test.ts @@ -748,7 +748,7 @@ describe("BitcoinDepositor", () => { extraDataValidTestData.forEach( ( { - depositOwner: expoectedDepositOwner, + depositOwner: expectedDepositOwner, referral: expectedReferral, extraData, }, @@ -759,7 +759,7 @@ describe("BitcoinDepositor", () => { await bitcoinDepositor.decodeExtraData(extraData) expect(actualDepositOwner, "invalid depositOwner").to.be.equal( - expoectedDepositOwner, + expectedDepositOwner, ) expect(actualReferral, "invalid referral").to.be.equal( expectedReferral, diff --git a/solidity/test/BitcoinRedeemer.test.ts b/solidity/test/BitcoinRedeemer.test.ts index 396391945..bdd06f226 100644 --- a/solidity/test/BitcoinRedeemer.test.ts +++ b/solidity/test/BitcoinRedeemer.test.ts @@ -63,7 +63,7 @@ describe("BitcoinRedeemer", () => { depositor.address, encodeBytes32String(""), ), - ).to.be.revertedWithCustomError(bitcoinRedeemer, "UnsupportedToken") + ).to.be.revertedWithCustomError(bitcoinRedeemer, "CallerNotAllowed") }) })