Skip to content

Commit

Permalink
Merge pull request #89 from Tapioca-DAO/CU-85ztxzhem-exercise-option-…
Browse files Browse the repository at this point in the history
…whitelist

CU-85ztxzhem: whitelist exercise option
  • Loading branch information
0xRektora authored Sep 21, 2023
2 parents 1523f6a + 58f0212 commit 598b790
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions contracts/tOFT/modules/BaseTOFTOptionsModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ contract BaseTOFTOptionsModule is TOFTCommon {
ICommonData.IApproval[] calldata approvals,
bytes calldata adapterParams
) external payable {
require(
cluster.isWhitelisted(
lzData.lzDstChainId,
tapSendData.tapOftAddress
),
"TOFT_UNAUTHORIZED"
); //fail fast

bytes32 toAddress = LzLib.addressToBytes32(optionsData.from);

(uint256 paymentTokenAmount, ) = _removeDust(
Expand Down Expand Up @@ -190,6 +198,11 @@ contract BaseTOFTOptionsModule is TOFTCommon {
)
);

require(
cluster.isWhitelisted(0, tapSendData.tapOftAddress),
"TOFT_UNAUTHORIZED"
); //fail fast

optionsData.paymentTokenAmount = _sd2ld(amountSD);
uint256 balanceBefore = balanceOf(address(this));
bool credited = creditedPackets[_srcChainId][_srcAddress][_nonce];
Expand Down

0 comments on commit 598b790

Please sign in to comment.