Open hats-bug-reporter[bot] opened 3 months ago
@rotcivegaf ?
The solidity compiler itself will throw an error when trying to compile a contract that has an unimplemented function
hey @rotcivegaf ,that itself is a issue right? and infact the _onDeposit
function is defined in the VaultBitcoinWallet.sol
, which makes no sense and acts like a dead
function
hey @rotcivegaf ,that itself is a issue right? and infact the
_onDeposit
function is defined in theVaultBitcoinWallet.sol
, which makes no sense and acts like adead
function
processDeposit same as _onDeposit are implemented on the VaultBitcoinWallet side, there is no issue. Can you just try to compile it please?
hey @party-for-illuminati ,
processDeposit same as _onDeposit are implemented on the VaultBitcoinWallet side
processDeposit()
is not implemented in VaultBitcoinWallet
side,it is correctly implemented in the BitcoinAbstractWallet as expected but the issue here is the _onDeposit()
function which is used in the processDeposit()
internally should be either implemented in the BitcoinAbstractWallet
or BitcoinProver,but the function is not implemented in neither contracts indeed this function is implemented in the VaultBitcoinWallet
which is not called by any function hence acts like dead function.
Does this seem clear to you? Can you please verify it?
hey @party-for-illuminati ,
processDeposit same as _onDeposit are implemented on the VaultBitcoinWallet side
processDeposit()
is not implemented inVaultBitcoinWallet
side,it is correctly implemented in the BitcoinAbstractWallet as expected but the issue here is the_onDeposit()
function which is used in theprocessDeposit()
internally should be either implemented in theBitcoinAbstractWallet
or BitcoinProver,but the function is not implemented in neither contracts indeed this function is implemented in theVaultBitcoinWallet
which is not called by any function hence acts like dead function.Does this seem clear to you? Can you please verify it?
This is not correct.
onDeposit shouldn't and cannot be implemented on BitcoinProver side
VaultBitcoinWallet is inherited from BitcoinAbstractWallet
As well as _onDeposit is implemented in VaultBitcoinWallet
Github username: -- Twitter username: -- Submission hash (on-chain): 0xf5f51c5cef88a7d2c6461dcbf472cb9718a38acb7bb7f4284450e43c27a48764 Severity: high
Description: Description\ The
ackTransaction
function in theBitcoinProver
contract is responsible for acknowledging and processing a Bitcoin transaction proof. Here, theackTransaction()
calls theprocessDeposit()
function in theBitcoinAbstractWallet.sol
through an interface.The
processDeposit()
function checks for the caller usingrequire(msg.sender == prover);
.Since the function is called from the BitcoinProver contract, this check passes, and it then calls the
_processDeposit()
function internally.However, the issue arises when the
_processDeposit()
function calls the_onDeposit
function.This function is responsible for handling deposits based on the provided
script ID
,value
,vault script hash
,recovery data
, andtransaction details
. Since theBitcoinAbstractWallet.sol
contract isabstract
, the_onDeposit()
function is not logically implemented (it is just declared).This function is supposed to be
overridden
in theBitcoinProver.sol
(the calling contract), but there is no logical implementation of the_onDeposit()
function in theBitcoinProver.sol
. As a result, when theackTransaction()
function is called, it alwaysreverts
. In fact, the_onDeposit
function is defined in theVaultBitcoinWallet.sol
, which makes no sense and acts like adead function
.Revised Code File (Optional)
By implementing and overriding the _onDeposit function in the BitcoinProver contract, you ensure that the ackTransaction function can successfully process deposits without reverting.