Skip to content

Commit

Permalink
read storage to local stack - claim
Browse files Browse the repository at this point in the history
  • Loading branch information
parodime committed Oct 17, 2024
1 parent b0b1fdd commit d8b8e14
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions packages/contracts-rfq/contracts/FastBridgeV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -300,17 +300,21 @@ contract FastBridgeV2 is Admin, IFastBridgeV2, IFastBridgeV2Errors {

BridgeTxDetails storage $ = bridgeTxDetails[transactionId];

address proofRelayer = $.proofRelayer;
BridgeStatus status = $.status;
uint40 proofBlockTimestamp = $.proofBlockTimestamp;

// update bridge tx status if able to claim origin collateral
if ($.status != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();
if (status != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();

// if "to" is zero addr, permissionlessly send funds to proven relayer
if (to == address(0)) {
to = $.proofRelayer;
} else if ($.proofRelayer != msg.sender) {
to = proofRelayer;
} else if (proofRelayer != msg.sender) {
revert SenderIncorrect();
}

if (_timeSince($.proofBlockTimestamp) <= DISPUTE_PERIOD) {
if (_timeSince(proofBlockTimestamp) <= DISPUTE_PERIOD) {
revert DisputePeriodNotPassed();
}

Expand All @@ -329,7 +333,7 @@ contract FastBridgeV2 is Admin, IFastBridgeV2, IFastBridgeV2Errors {
IERC20(token).safeTransfer(to, amount);
}

emit BridgeDepositClaimed(transactionId, $.proofRelayer, to, transaction.originToken, transaction.originAmount);
emit BridgeDepositClaimed(transactionId, proofRelayer, to, transaction.originToken, transaction.originAmount);
}

function bridgeStatuses(bytes32 transactionId) public view returns (BridgeStatus status) {
Expand Down

0 comments on commit d8b8e14

Please sign in to comment.