Transaction Hash:
Block:
21196423 at Nov-15-2024 11:38:11 PM +UTC
Transaction Fee:
0.000548809156912968 ETH
$1.13
Gas Used:
32,202 Gas / 17.042704084 Gwei
Emitted Events:
| 47 |
RelayReceiver.FundsForwardedWithData( data=0x043FCE55 )
|
Account State Difference:
| Address | Before | After | State Difference | ||
|---|---|---|---|---|---|
| 0x04A9D98e...6C61cB392 |
0.009944865223279597 Eth
Nonce: 137
|
0.006396056066366629 Eth
Nonce: 138
| 0.003548809156912968 | ||
|
0x313C8306...8fC091A38
Miner
| 7.109250038407194802 Eth | 7.109302685147565784 Eth | 0.000052646740370982 | ||
| 0xf70da978...8dfA3dbEF | (Relay: Solver) | 338.694879147940765515 Eth | 338.697879147940765515 Eth | 0.003 |
Execution Trace
ETH 0.003
RelayReceiver.CALL( )
- ETH 0.003
Relay: Solver.CALL( )
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;
contract RelayReceiver {
// --- Structs ---
struct Call {
address to;
bytes data;
uint256 value;
}
// --- Errors ---
error CallFailed();
error NativeTransferFailed();
error Unauthorized();
// --- Events ---
event FundsForwardedWithData(bytes data);
// --- Fields ---
address private immutable SOLVER;
// --- Constructor ---
constructor(address solver) {
SOLVER = solver;
}
// --- Public methods ---
fallback() external payable {
send(SOLVER, msg.value);
emit FundsForwardedWithData(msg.data);
}
function forward(bytes calldata data) external payable {
send(SOLVER, msg.value);
emit FundsForwardedWithData(data);
}
// --- Restricted methods ---
function makeCalls(Call[] calldata calls) external payable {
if (msg.sender != SOLVER) {
revert Unauthorized();
}
unchecked {
uint256 length = calls.length;
for (uint256 i; i < length; i++) {
Call memory c = calls[i];
(bool success, ) = c.to.call{value: c.value}(c.data);
if (!success) {
revert CallFailed();
}
}
}
}
// --- Internal methods ---
function send(address to, uint256 value) internal {
bool success;
assembly {
// Save gas by avoiding copying the return data to memory.
// Provide at most 100k gas to the internal call, which is
// more than enough to cover common use-cases of logic for
// receiving native tokens (eg. SCW payable fallbacks).
success := call(100000, to, value, 0, 0, 0, 0)
}
if (!success) {
revert NativeTransferFailed();
}
}
}