Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

A Bit Sale - Clear dirty bits #585

Merged
merged 1 commit into from
Apr 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion solidity/contracts/scripts/FundingScript.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ contract FundingScript {

// Verify _extraData is a call to unqualifiedDepositToTbtc.
bytes4 functionSignature;
assembly { functionSignature := mload(add(_extraData, 0x20)) }
assembly {
functionSignature := and(mload(add(_extraData, 0x20)), not(0xff))
}
require(
functionSignature == vendingMachine.unqualifiedDepositToTbtc.selector,
"Bad _extraData signature. Call must be to unqualifiedDepositToTbtc."
Expand Down
4 changes: 3 additions & 1 deletion solidity/contracts/scripts/RedemptionScript.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ contract RedemptionScript {

// Verify _extraData is a call to tbtcToBtc.
bytes4 functionSignature;
assembly { functionSignature := mload(add(_extraData, 0x20)) }
assembly {
functionSignature := and(mload(add(_extraData, 0x20)), not(0xff))
}
require(
functionSignature == vendingMachine.tbtcToBtc.selector,
"Bad _extraData signature. Call must be to tbtcToBtc."
Expand Down