Update Deposit comments and variable names
Use more descriptive variable names
@@ -89,20 +89,31 @@ contract Deposit {
/// @notice Anyone may provide a withdrawal proof to prove redemption
/// @dev The signers will be penalized if this is not called
+ /// @param _txVersion Transaction version number (4-byte LE)
+ /// @param _txInputVector All transaction inputs prepended by the number of inputs encoded as a VarInt, max 0xFC(252) inputs
+ /// @param _txOutputVector All transaction outputs prepended by the number of outputs encoded as a VarInt, max 0xFC(252) outputs
+ /// @param _txLocktime Final 4 bytes of the transaction
/// @param _merkleProof The merkle proof of inclusion of the tx in the bitcoin block
- /// @param _index The index of the tx in the Bitcoin block (1-indexed)
+ /// @param _txIndexInBlock The index of the tx in the Bitcoin block (0-indexed)
/// @param _bitcoinHeaders An array of tightly-packed bitcoin headers
- /// @return True if successful, otherwise revert
function provideRedemptionProof(
bytes4 _txVersion,
bytes memory _txInputVector,
bytes memory _txOutputVector,
bytes4 _txLocktime,
bytes memory _merkleProof,
- uint256 _index,
+ uint256 _txIndexInBlock,
bytes memory _bitcoinHeaders
) public returns (bool) {
- self.provideRedemptionProof(_txVersion, _txInputVector, _txOutputVector, _txLocktime, _merkleProof, _index, _bitcoinHeaders);
+ self.provideRedemptionProof(
+ _txVersion,
+ _txInputVector,
+ _txOutputVector,
+ _txLocktime,
+ _merkleProof,
+ _txIndexInBlock,
+ _bitcoinHeaders
+ );
return true;
}
@@ -186,7 +197,7 @@ contract Deposit {
/// @param _txLocktime Final 4 bytes of the transaction
/// @param _fundingOutputIndex Index of funding output in _txOutputVector (0-indexed)
/// @param _merkleProof The merkle proof of transaction inclusion in a block
- /// @param _txIndexInBlock Transaction index in the block (1-indexed)
+ /// @param _txIndexInBlock Transaction index in the block (0-indexed)
/// @param _bitcoinHeaders Single bytestring of 80-byte bitcoin headers, lowest height first
/// @return True if no errors are thrown
function provideFraudBTCFundingProof(
@@ -221,7 +232,7 @@ contract Deposit {
/// @param _txLocktime Final 4 bytes of the transaction
/// @param _fundingOutputIndex Index of funding output in _txOutputVector (0-indexed)
/// @param _merkleProof The merkle proof of transaction inclusion in a block
- /// @param _txIndexInBlock Transaction index in the block (1-indexed)
+ /// @param _txIndexInBlock Transaction index in the block (0-indexed)
/// @param _bitcoinHeaders Single bytestring of 80-byte bitcoin headers, lowest height first
/// @return True if no errors are thrown
function provideBTCFundingProof(
@@ -277,7 +288,7 @@ contract Deposit {
/// @param _txOutputVector All transaction outputs prepended by the number of outputs encoded as a VarInt, max 0xFC(252) outputs
/// @param _txLocktime Final 4 bytes of the transaction
/// @param _merkleProof The merkle proof of inclusion of the tx in the bitcoin block
- /// @param _index The index of the tx in the Bitcoin block (1-indexed)
+ /// @param _txIndexInBlock The index of the tx in the Bitcoin block (0-indexed)
/// @param _targetInputIndex Index of the input that spends the custodied UTXO
/// @param _bitcoinHeaders An array of tightly-packed bitcoin headers
/// @return True if successful, otherwise revert
