diff --git a/solidity/contracts/scripts/FundingScript.sol b/solidity/contracts/scripts/FundingScript.sol index 0e63b77b9..75f05e215 100644 --- a/solidity/contracts/scripts/FundingScript.sol +++ b/solidity/contracts/scripts/FundingScript.sol @@ -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." diff --git a/solidity/contracts/scripts/RedemptionScript.sol b/solidity/contracts/scripts/RedemptionScript.sol index 2b93aab59..6be235c33 100644 --- a/solidity/contracts/scripts/RedemptionScript.sol +++ b/solidity/contracts/scripts/RedemptionScript.sol @@ -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."