Add functions with mutex to ReentrantERC20Token and update IExchange with missing function
This commit is contained in:
parent
24906138c7
commit
d373f5488a
@ -39,6 +39,16 @@ contract ISignatureValidator {
|
||||
)
|
||||
external;
|
||||
|
||||
/// @dev Approves/unnapproves an OrderValidator contract to verify signatures on signer's behalf
|
||||
/// using the `OrderValidator` signature type.
|
||||
/// @param validatorAddress Address of Validator contract.
|
||||
/// @param approval Approval or disapproval of Validator contract.
|
||||
function setOrderValidatorApproval(
|
||||
address validatorAddress,
|
||||
bool approval
|
||||
)
|
||||
external;
|
||||
|
||||
/// @dev Verifies that a signature for a hash is valid.
|
||||
/// @param hash Message hash that is signed.
|
||||
/// @param signerAddress Address of signer.
|
||||
|
@ -50,7 +50,9 @@ contract ReentrantERC20Token is
|
||||
CANCEL_ORDER,
|
||||
BATCH_CANCEL_ORDERS,
|
||||
CANCEL_ORDERS_UP_TO,
|
||||
PRE_SIGN,
|
||||
SET_SIGNATURE_VALIDATOR_APPROVAL,
|
||||
SET_ORDER_VALIDATOR_APPROVAL,
|
||||
NONE
|
||||
}
|
||||
|
||||
@ -161,12 +163,23 @@ contract ReentrantERC20Token is
|
||||
exchange.cancelOrdersUpTo.selector,
|
||||
1
|
||||
);
|
||||
} else if (currentFunctionId == uint8(ExchangeFunction.PRE_SIGN)) {
|
||||
callData = abi.encodeWithSelector(
|
||||
exchange.preSign.selector,
|
||||
uint256(getRandomAddress())
|
||||
);
|
||||
} else if (currentFunctionId == uint8(ExchangeFunction.SET_SIGNATURE_VALIDATOR_APPROVAL)) {
|
||||
callData = abi.encodeWithSelector(
|
||||
exchange.setSignatureValidatorApproval.selector,
|
||||
getRandomAddress(),
|
||||
false
|
||||
);
|
||||
} else if (currentFunctionId == uint8(ExchangeFunction.SET_ORDER_VALIDATOR_APPROVAL)) {
|
||||
callData = abi.encodeWithSelector(
|
||||
exchange.setOrderValidatorApproval.selector,
|
||||
getRandomAddress(),
|
||||
false
|
||||
);
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user