Transaction Hash:
Block:
19955780 at May-26-2024 06:15:47 PM +UTC
Transaction Fee:
0.00033544566315333 ETH
$0.67
Gas Used:
32,202 Gas / 10.416920165 Gwei
Emitted Events:
| 342 |
RelayReceiver.FundsForwardedWithData( data=0x0108DF26 )
|
Account State Difference:
| Address | Before | After | State Difference | ||
|---|---|---|---|---|---|
| 0x1BfF9B71...793E90C51 |
0.037597877577344456 Eth
Nonce: 0
|
0.000081754311319598 Eth
Nonce: 1
| 0.037516123266024858 | ||
|
0x95222290...5CC4BAfe5
Miner
| (beaverbuild) | 7.707207190635545489 Eth | 7.707211534455713027 Eth | 0.000004343820167538 | |
| 0xf70da978...8dfA3dbEF | (Relay: Solver) | 119.567516964788000821 Eth | 119.604697642390872349 Eth | 0.037180677602871528 |
Execution Trace
ETH 0.037180677602871528
RelayReceiver.CALL( )
- ETH 0.037180677602871528
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();
}
}
}