Address: 0x748dD4d9da3fd46797FE55C0b54c329dDc06558D
Balance (XRP): 0 XRP
Bytecode: 0x608080604052600436101561001c575b50361561001a575f80fd5b005b5f3560e01c90816309c5eabe14610287575080631bf44db414610091576394b41e5214610049575f61000f565b3461008d575f36600319011261008d576040517f000000000000000000000000ca11bde05977b3631167028862be2a173976ca116001600160a01b03168152602090f35b5f80fd5b606036600319011261008d576004356001600160a01b03811680820361008d576044356001600160401b03811161008d576100d0903690600401610359565b9290916101a0575b50815f929183926040519283928337810183815203907f000000000000000000000000ca11bde05977b3631167028862be2a173976ca115af4610119610460565b901561014557610135816020806101419451830101910161049c565b60405191829182610386565b0390f35b60405162461bcd60e51b815260206004820152602d60248201527f547261696c734d756c746963616c6c33526f757465723a2070756c6c416e644560448201526c1e1958dd5d194819985a5b1959609a1b6064820152608490fd5b5f80916040518260208201916323b872dd60e01b83523360248201523060448201526024356064820152606481526101d9608482610410565b51925af16101e5610460565b81610250575b50156101f757826100d8565b60405162461bcd60e51b815260206004820152602b60248201527f547261696c734d756c746963616c6c33526f757465723a207472616e7366657260448201526a119c9bdb4819985a5b195960aa1b6064820152608490fd5b8051801592508215610265575b5050836101eb565b819250906020918101031261008d576020610280910161048f565b838061025d565b602036600319011261008d576004356001600160401b03811161008d57815f926102b684933690600401610359565b80918337810183815203907f000000000000000000000000ca11bde05977b3631167028862be2a173976ca115af46102ec610460565b901561030857610135816020806101419451830101910161049c565b60405162461bcd60e51b815260206004820152602360248201527f547261696c734d756c746963616c6c33526f757465723a2063616c6c206661696044820152621b195960ea1b6064820152608490fd5b9181601f8401121561008d578235916001600160401b03831161008d576020838186019501011161008d57565b602081016020825282518091526040820191602060408360051b8301019401925f915b8383106103b857505050505090565b90919293946020806060600193603f1986820301875282808b5180511515845201516040828401528051918291826040860152018484015e5f828201840152601f01601f1916010197019594919091019201906103a9565b90601f801991011681019081106001600160401b0382111761043157604052565b634e487b7160e01b5f52604160045260245ffd5b6001600160401b03811161043157601f01601f191660200190565b3d1561048a573d9061047182610445565b9161047f6040519384610410565b82523d5f602084013e565b606090565b5190811515820361008d57565b60208183031261008d578051906001600160401b03821161008d57019080601f8301121561008d578151916001600160401b038311610431578260051b604051936104ea6020830186610410565b84526020808501918301019183831161008d5760208101915b83831061051257505050505090565b82516001600160401b03811161008d578201906040828703601f19011261008d5760405191604083018381106001600160401b038211176104315760405261055c6020820161048f565b835260408101516001600160401b03811161008d5760209101019086601f8301121561008d5781519261058e84610445565b61059b6040519182610410565b848152886020868601011161008d575f6020868197828098018386015e830101528382015281520192019161050356fea2646970667358221220a2258d46ffe22995b3e3a20da11f0730af8b0395f323749a07445e3cc0a61c1364736f6c634300081e0033
TrailsMulticall3Router.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.24; // Local interface definitions to avoid import issues interface IMulticall3 { struct Call3 { address target; bool allowFailure; bytes callData; } struct Result { bool success; bytes returnData; } function aggregate3(Call3[] calldata calls) external payable returns (Result[] memory returnData); } interface IERC20 { function transferFrom(address from, address to, uint256 amount) external returns (bool); } /** * @title TrailsMulticall3Router * @author Shun Kakinoki * @notice A wrapper to execute multiple calls via DELEGATECALL to preserve the original msg.sender. * @dev This contract mimics the Multicall3 interface but executes sub-calls via DELEGATECALL * to ensure that for the sub-calls, msg.sender is the original caller of this contract. * This is useful for smart contract wallets (intent addresses) that need to control msg.sender. */ contract TrailsMulticall3Router { // ------------------------------------------------------------------------- // Immutable Variables // ------------------------------------------------------------------------- address public immutable multicall3 = 0xcA11bde05977b3631167028862bE2a173976CA11; // ------------------------------------------------------------------------- // Public Functions // ------------------------------------------------------------------------- /** * @notice Aggregates multiple calls in a single transaction. * @dev See the contract-level documentation for the logic on how the call is performed. * @param data The data to execute. * @return returnResults The result of the execution. (Expects the underlying data returned to be an array of IMulticall3.Result) */ function execute(bytes calldata data) public payable returns (IMulticall3.Result[] memory returnResults) { (bool success, bytes memory returnData) = multicall3.delegatecall(data); require(success, "TrailsMulticall3Router: call failed"); return abi.decode(returnData, (IMulticall3.Result[])); } /** * @notice Pull ERC20 from msg.sender, then delegatecall into Multicall3. * @dev Requires prior approval to this router for at least 'amount'. * Reverts if transferFrom or the delegatecall fails. Returns IMulticall3.Result[]. */ function pullAndExecute(address token, uint256 amount, bytes calldata data) public payable returns (IMulticall3.Result[] memory returnResults) { if (token != address(0)) { _safeTransferFrom(token, msg.sender, address(this), amount); } (bool success, bytes memory returnData) = multicall3.delegatecall(data); require(success, "TrailsMulticall3Router: pullAndExecute failed"); return abi.decode(returnData, (IMulticall3.Result[])); } // ------------------------------------------------------------------------- // Internal Functions // ------------------------------------------------------------------------- function _safeTransferFrom(address token, address from, address to, uint256 amount) internal { (bool ok, bytes memory res) = token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, amount)); require(ok && (res.length == 0 || abi.decode(res, (bool))), "TrailsMulticall3Router: transferFrom failed"); } // ------------------------------------------------------------------------- // Receive ETH // ------------------------------------------------------------------------- /// @notice Receive ETH receive() external payable {} }
Gas Token: