Skip to content
Merged
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
54 changes: 24 additions & 30 deletions contracts/SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1105,37 +1105,31 @@ abstract contract SpokePool is

// The following internal methods emit events with many params to overcome solidity stack too deep issues.
function _emitFillRelay(RelayExecution memory relayExecution, uint256 fillAmountPreFees) internal {
RelayExecutionInfo memory relayExecutionInfo;
// This separate struct is created entirely to avoid stack too deep errors.
{
relayExecutionInfo = RelayExecutionInfo({
relayerFeePct: relayExecution.updatedRelayerFeePct,
recipient: relayExecution.updatedRecipient,
message: relayExecution.updatedMessage,
isSlowRelay: relayExecution.slowFill,
payoutAdjustmentPct: relayExecution.payoutAdjustmentPct
});
}
RelayExecutionInfo memory relayExecutionInfo = RelayExecutionInfo({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great call -- I figured these would be necessary even with viaIR, but I was wrong!

relayerFeePct: relayExecution.updatedRelayerFeePct,
recipient: relayExecution.updatedRecipient,
message: relayExecution.updatedMessage,
isSlowRelay: relayExecution.slowFill,
payoutAdjustmentPct: relayExecution.payoutAdjustmentPct
});

{
emit FilledRelay(
relayExecution.relay.amount,
relayFills[relayExecution.relayHash],
fillAmountPreFees,
relayExecution.repaymentChainId,
relayExecution.relay.originChainId,
relayExecution.relay.destinationChainId,
relayExecution.relay.relayerFeePct,
relayExecution.relay.realizedLpFeePct,
relayExecution.relay.depositId,
relayExecution.relay.destinationToken,
msg.sender,
relayExecution.relay.depositor,
relayExecution.relay.recipient,
relayExecution.relay.message,
relayExecutionInfo
);
}
emit FilledRelay(
relayExecution.relay.amount,
relayFills[relayExecution.relayHash],
fillAmountPreFees,
relayExecution.repaymentChainId,
relayExecution.relay.originChainId,
relayExecution.relay.destinationChainId,
relayExecution.relay.relayerFeePct,
relayExecution.relay.realizedLpFeePct,
relayExecution.relay.depositId,
relayExecution.relay.destinationToken,
msg.sender,
relayExecution.relay.depositor,
relayExecution.relay.recipient,
relayExecution.relay.message,
relayExecutionInfo
);
}

function _emitDeposit(
Expand Down