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
29 changes: 1 addition & 28 deletions contracts/SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ abstract contract SpokePool is
// In this case the msg.value will be set to 0, indicating a "normal" ERC20 bridging action.
} else IERC20Upgradeable(originToken).safeTransferFrom(msg.sender, address(this), amount);

_emitDeposit(
emit FundsDeposited(
amount,
chainId(),
destinationChainId,
Expand Down Expand Up @@ -1103,7 +1103,6 @@ abstract contract SpokePool is
fillCounter[token] += _computeAmountPostFees(totalFillAmount, realizedLPFeePct);
}

// The following internal methods emit events with many params to overcome solidity stack too deep issues.
Copy link
Contributor Author

@pxrl pxrl Mar 6, 2023

Choose a reason for hiding this comment

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

Have removed this comment because I left _emitFillRelay() as a convenience. My thinking is that since it dereferences a lot of members of relayExecution and is called from multiple other functions, it's more practical to keep it as-is.

function _emitFillRelay(RelayExecution memory relayExecution, uint256 fillAmountPreFees) internal {
RelayExecutionInfo memory relayExecutionInfo = RelayExecutionInfo({
relayerFeePct: relayExecution.updatedRelayerFeePct,
Expand Down Expand Up @@ -1132,32 +1131,6 @@ abstract contract SpokePool is
);
}

function _emitDeposit(
uint256 amount,
uint256 originChainId,
uint256 destinationChainId,
int64 relayerFeePct,
uint32 depositId,
uint32 quoteTimestamp,
address originToken,
address recipient,
address depositor,
bytes memory message
) internal {
emit FundsDeposited(
amount,
originChainId,
destinationChainId,
relayerFeePct,
depositId,
quoteTimestamp,
originToken,
recipient,
depositor,
message
);
}

// Implementing contract needs to override this to ensure that only the appropriate cross chain admin can execute
// certain admin functions. For L2 contracts, the cross chain admin refers to some L1 address or contract, and for
// L1, this would just be the same admin of the HubPool.
Expand Down