// SPDX-License-Identifier: MIT pragma solidity 0.8.26; interface IArbSysWithdraw { function withdrawEth(address destination) external payable returns (uint256); } /// @title Ambrosia bridge, Elysium -> HyperEVM /// @notice Starts a canonical withdrawal of HYPE to HyperEVM through ArbSys and keeps 0.5% for the team. /// The HYPE becomes claimable on HyperEVM once the rollup confirms it (about 6-7 days); anyone may /// execute the claim, and it always pays `to`. No owner, no funds held. contract AmbrosiaBridgeOut { uint256 public constant FEE_BPS = 50; uint256 public constant MIN_AMOUNT = 0.001 ether; IArbSysWithdraw public constant ARBSYS = IArbSysWithdraw(address(0x64)); address public immutable team; uint256 public count; uint256 public totalBridged; uint256 public totalFees; event Withdrawn(uint256 indexed id, address indexed from, address indexed to, uint256 amount, uint256 fee, uint256 position); error TooSmall(); error SendFailed(); constructor(address team_) { team = team_; } function withdraw(address to) external payable returns (uint256 position) { if (msg.value < MIN_AMOUNT) revert TooSmall(); uint256 fee = msg.value * FEE_BPS / 10_000; uint256 amount = msg.value - fee; position = ARBSYS.withdrawEth{value: amount}(to); (bool ok,) = team.call{value: fee}(""); if (!ok) revert SendFailed(); uint256 id = ++count; totalBridged += amount; totalFees += fee; emit Withdrawn(id, msg.sender, to, amount, fee, position); } }