Overview
S Balance
0 S
S Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 8 from a total of 8 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Multicall | 4036859 | 2 days ago | IN | 1.5 S | 0.00552095 | ||||
Multicall | 4032259 | 2 days ago | IN | 0 S | 0.00556621 | ||||
Multicall | 4025752 | 2 days ago | IN | 0 S | 0.0061591 | ||||
Multicall | 4024632 | 2 days ago | IN | 0.5 S | 0.00611622 | ||||
Multicall | 4024382 | 2 days ago | IN | 0.1 S | 0.00652908 | ||||
Multicall | 4024209 | 2 days ago | IN | 0.1 S | 0.00611483 | ||||
Multicall | 4022922 | 2 days ago | IN | 0 S | 0.00668779 | ||||
Multicall | 4022682 | 2 days ago | IN | 0 S | 0.00567762 |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
SiloRouter
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
Yes with 200 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.28; import {Address} from "openzeppelin5/utils/Address.sol"; /// @title SiloRouter /// @notice Silo Router is a utility contract that aims to improve UX. It can batch any number or combination /// of actions (Deposit, Withdraw, Borrow, Repay) and execute them in a single transaction. /// @dev SiloRouter requires only first action asset to be approved /// @custom:security-contact [email protected] contract SiloRouter { error EthTransferFailed(); error InvalidInputLength(); /// @dev needed for unwrapping WETH receive() external payable { // `execute` method calls `IWrappedNativeToken.withdraw()` // and we need to receive the withdrawn ETH unconditionally } /// @notice Multicall is a utility function /// that allows you to batch multiple calls to different contracts in a single transaction. /// @param targets The addresses of the contracts to call. /// @param data The data to be passed to each contract. /// @param values The values to be passed to each contract. /// @return results The results of each call. function multicall( address[] calldata targets, bytes[] calldata data, uint256[] calldata values ) external payable returns (bytes[] memory results) { require(targets.length == data.length && targets.length == values.length, InvalidInputLength()); results = new bytes[](targets.length); for (uint256 i = 0; i < targets.length; i++) { results[i] = Address.functionCallWithValue(targets[i], data[i], values[i]); } // if there is leftover ETH, send it back to the caller if (msg.value != 0 && address(this).balance != 0) { // solhint-disable-next-line avoid-low-level-calls (bool success,) = msg.sender.call{value: address(this).balance}(""); require(success, EthTransferFailed()); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol) pragma solidity ^0.8.20; import {Errors} from "./Errors.sol"; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev There's no code at `target` (it is not a contract). */ error AddressEmptyCode(address target); /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { if (address(this).balance < amount) { revert Errors.InsufficientBalance(address(this).balance, amount); } (bool success, ) = recipient.call{value: amount}(""); if (!success) { revert Errors.FailedCall(); } } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason or custom error, it is bubbled * up by this function (like regular Solidity function calls). However, if * the call reverted with no returned reason, this function reverts with a * {Errors.FailedCall} error. * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { if (address(this).balance < value) { revert Errors.InsufficientBalance(address(this).balance, value); } (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case * of an unsuccessful call. */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata ) internal view returns (bytes memory) { if (!success) { _revert(returndata); } else { // only check if target is a contract if the call was successful and the return data is empty // otherwise we already know that it was a contract if (returndata.length == 0 && target.code.length == 0) { revert AddressEmptyCode(target); } return returndata; } } /** * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the * revert reason or with a default {Errors.FailedCall} error. */ function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) { if (!success) { _revert(returndata); } else { return returndata; } } /** * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}. */ function _revert(bytes memory returndata) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert Errors.FailedCall(); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; /** * @dev Collection of common custom errors used in multiple contracts * * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library. * It is recommended to avoid relying on the error API for critical functionality. */ library Errors { /** * @dev The ETH balance of the account is not enough to perform the operation. */ error InsufficientBalance(uint256 balance, uint256 needed); /** * @dev A call to an address target failed. The target may have reverted. */ error FailedCall(); /** * @dev The deployment failed. */ error FailedDeployment(); }
{ "remappings": [ "forge-std/=gitmodules/forge-std/src/", "silo-foundry-utils/=gitmodules/silo-foundry-utils/contracts/", "properties/=gitmodules/crytic/properties/contracts/", "silo-core/=silo-core/", "silo-oracles/=silo-oracles/", "silo-vaults/=silo-vaults/", "ve-silo/=ve-silo/", "@openzeppelin/=gitmodules/openzeppelin-contracts-5/contracts/", "morpho-blue/=gitmodules/morpho-blue/src/", "openzeppelin5/=gitmodules/openzeppelin-contracts-5/contracts/", "openzeppelin5-upgradeable/=gitmodules/openzeppelin-contracts-upgradeable-5/contracts/", "chainlink/=gitmodules/chainlink/contracts/src/", "chainlink-ccip/=gitmodules/chainlink-ccip/contracts/src/", "uniswap/=gitmodules/uniswap/", "@uniswap/v3-core/=gitmodules/uniswap/v3-core/", "balancer-labs/v2-solidity-utils/=external/balancer-v2-monorepo/pkg/solidity-utils/contracts/", "balancer-labs/v2-interfaces/=external/balancer-v2-monorepo/pkg/interfaces/contracts/", "balancer-labs/v2-liquidity-mining/=external/balancer-v2-monorepo/pkg/liquidity-mining/contracts/", "@balancer-labs/=node_modules/@balancer-labs/", "@ensdomains/=node_modules/@ensdomains/", "@openzeppelin/contracts-upgradeable/=gitmodules/openzeppelin-contracts-upgradeable-5/contracts/", "@openzeppelin/contracts/=gitmodules/openzeppelin-contracts-5/contracts/", "@solidity-parser/=node_modules/@solidity-parser/", "ERC4626/=gitmodules/crytic/properties/lib/ERC4626/contracts/", "crytic/=gitmodules/crytic/", "ds-test/=gitmodules/openzeppelin-contracts-5/lib/forge-std/lib/ds-test/src/", "erc4626-tests/=gitmodules/openzeppelin-contracts-5/lib/erc4626-tests/", "halmos-cheatcodes/=gitmodules/morpho-blue/lib/halmos-cheatcodes/src/", "hardhat/=node_modules/hardhat/", "openzeppelin-contracts-5/=gitmodules/openzeppelin-contracts-5/", "openzeppelin-contracts-upgradeable-5/=gitmodules/openzeppelin-contracts-upgradeable-5/", "openzeppelin-contracts/=gitmodules/openzeppelin-contracts-upgradeable-5/lib/openzeppelin-contracts/", "prettier-plugin-solidity/=node_modules/prettier-plugin-solidity/", "proposals/=node_modules/proposals/", "solmate/=gitmodules/crytic/properties/lib/solmate/src/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "cancun", "viaIR": false, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[],"name":"EthTransferFailed","type":"error"},{"inputs":[],"name":"FailedCall","type":"error"},{"inputs":[{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"InsufficientBalance","type":"error"},{"inputs":[],"name":"InvalidInputLength","type":"error"},{"inputs":[{"internalType":"address[]","name":"targets","type":"address[]"},{"internalType":"bytes[]","name":"data","type":"bytes[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
6080604052348015600e575f5ffd5b5061059b8061001c5f395ff3fe608060405260043610610020575f3560e01c8063281818291461002b575f5ffd5b3661002757005b5f5ffd5b61003e61003936600461039b565b610054565b60405161004b919061043a565b60405180910390f35b6060858414801561006457508582145b61008157604051637db491eb60e01b815260040160405180910390fd5b8567ffffffffffffffff81111561009a5761009a6104be565b6040519080825280602002602001820160405280156100cd57816020015b60608152602001906001900390816100b85790505b5090505f5b868110156101a15761017c8888838181106100ef576100ef6104d2565b905060200201602081019061010491906104e6565b878784818110610116576101166104d2565b9050602002810190610128919061050c565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250899250889150869050818110610170576101706104d2565b90506020020135610227565b82828151811061018e5761018e6104d2565b60209081029190910101526001016100d2565b5034158015906101b057504715155b1561021d576040515f90339047908381818185875af1925050503d805f81146101f4576040519150601f19603f3d011682016040523d82523d5f602084013e6101f9565b606091505b505090508061021b57604051630db2c7f160e31b815260040160405180910390fd5b505b9695505050505050565b6060814710156102585760405163cf47918160e01b8152476004820152602481018390526044015b60405180910390fd5b5f5f856001600160a01b03168486604051610273919061054f565b5f6040518083038185875af1925050503d805f81146102ad576040519150601f19603f3d011682016040523d82523d5f602084013e6102b2565b606091505b50915091506102c28683836102ce565b925050505b9392505050565b6060826102e3576102de8261032a565b6102c7565b81511580156102fa57506001600160a01b0384163b155b1561032357604051639996b31560e01b81526001600160a01b038516600482015260240161024f565b50806102c7565b80511561033a5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b5f5f83601f840112610363575f5ffd5b50813567ffffffffffffffff81111561037a575f5ffd5b6020830191508360208260051b8501011115610394575f5ffd5b9250929050565b5f5f5f5f5f5f606087890312156103b0575f5ffd5b863567ffffffffffffffff8111156103c6575f5ffd5b6103d289828a01610353565b909750955050602087013567ffffffffffffffff8111156103f1575f5ffd5b6103fd89828a01610353565b909550935050604087013567ffffffffffffffff81111561041c575f5ffd5b61042889828a01610353565b979a9699509497509295939492505050565b5f602082016020835280845180835260408501915060408160051b8601019250602086015f5b828110156104b257603f19878603018452815180518087528060208301602089015e5f602082890101526020601f19601f83011688010196505050602082019150602084019350600181019050610460565b50929695505050505050565b634e487b7160e01b5f52604160045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b5f602082840312156104f6575f5ffd5b81356001600160a01b03811681146102c7575f5ffd5b5f5f8335601e19843603018112610521575f5ffd5b83018035915067ffffffffffffffff82111561053b575f5ffd5b602001915036819003821315610394575f5ffd5b5f82518060208501845e5f92019182525091905056fea2646970667358221220bfa7fa19b5912628b03089313b460fea3369cab8785bae79b3d695bc7766799f64736f6c634300081c0033
Deployed Bytecode
0x608060405260043610610020575f3560e01c8063281818291461002b575f5ffd5b3661002757005b5f5ffd5b61003e61003936600461039b565b610054565b60405161004b919061043a565b60405180910390f35b6060858414801561006457508582145b61008157604051637db491eb60e01b815260040160405180910390fd5b8567ffffffffffffffff81111561009a5761009a6104be565b6040519080825280602002602001820160405280156100cd57816020015b60608152602001906001900390816100b85790505b5090505f5b868110156101a15761017c8888838181106100ef576100ef6104d2565b905060200201602081019061010491906104e6565b878784818110610116576101166104d2565b9050602002810190610128919061050c565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250899250889150869050818110610170576101706104d2565b90506020020135610227565b82828151811061018e5761018e6104d2565b60209081029190910101526001016100d2565b5034158015906101b057504715155b1561021d576040515f90339047908381818185875af1925050503d805f81146101f4576040519150601f19603f3d011682016040523d82523d5f602084013e6101f9565b606091505b505090508061021b57604051630db2c7f160e31b815260040160405180910390fd5b505b9695505050505050565b6060814710156102585760405163cf47918160e01b8152476004820152602481018390526044015b60405180910390fd5b5f5f856001600160a01b03168486604051610273919061054f565b5f6040518083038185875af1925050503d805f81146102ad576040519150601f19603f3d011682016040523d82523d5f602084013e6102b2565b606091505b50915091506102c28683836102ce565b925050505b9392505050565b6060826102e3576102de8261032a565b6102c7565b81511580156102fa57506001600160a01b0384163b155b1561032357604051639996b31560e01b81526001600160a01b038516600482015260240161024f565b50806102c7565b80511561033a5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b5f5f83601f840112610363575f5ffd5b50813567ffffffffffffffff81111561037a575f5ffd5b6020830191508360208260051b8501011115610394575f5ffd5b9250929050565b5f5f5f5f5f5f606087890312156103b0575f5ffd5b863567ffffffffffffffff8111156103c6575f5ffd5b6103d289828a01610353565b909750955050602087013567ffffffffffffffff8111156103f1575f5ffd5b6103fd89828a01610353565b909550935050604087013567ffffffffffffffff81111561041c575f5ffd5b61042889828a01610353565b979a9699509497509295939492505050565b5f602082016020835280845180835260408501915060408160051b8601019250602086015f5b828110156104b257603f19878603018452815180518087528060208301602089015e5f602082890101526020601f19601f83011688010196505050602082019150602084019350600181019050610460565b50929695505050505050565b634e487b7160e01b5f52604160045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b5f602082840312156104f6575f5ffd5b81356001600160a01b03811681146102c7575f5ffd5b5f5f8335601e19843603018112610521575f5ffd5b83018035915067ffffffffffffffff82111561053b575f5ffd5b602001915036819003821315610394575f5ffd5b5f82518060208501845e5f92019182525091905056fea2646970667358221220bfa7fa19b5912628b03089313b460fea3369cab8785bae79b3d695bc7766799f64736f6c634300081c0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.