Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
13461529 | 1180 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Contract Name:
Router
Compiler Version
v0.8.6+commit.11564f7e
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.6; import "@yield-protocol/utils-v2/contracts/utils/RevertMsgExtractor.sol"; import "@yield-protocol/utils-v2/contracts/utils/IsContract.sol"; /// @dev Router forwards calls between two contracts, so that any permissions /// given to the original caller are stripped from the call. /// This is useful when implementing generic call routing functions on contracts /// that might have ERC20 approvals or AccessControl authorizations. contract Router { using IsContract for address; address immutable public owner; constructor () { owner = msg.sender; } /// @dev Allow users to route calls to a pool, to be used with batch function route(address target, bytes calldata data) external payable returns (bytes memory result) { require(msg.sender == owner, "Only owner"); require(target.isContract(), "Target is not a contract"); bool success; (success, result) = target.call(data); if (!success) revert(RevertMsgExtractor.getRevertMsg(result)); } }
// SPDX-License-Identifier: MIT // Taken from https://github.com/sushiswap/BoringSolidity/blob/441e51c0544cf2451e6116fe00515e71d7c42e2c/contracts/BoringBatchable.sol pragma solidity >=0.6.0; library RevertMsgExtractor { /// @dev Helper function to extract a useful revert message from a failed call. /// If the returned data is malformed or not correctly abi encoded then this call can fail itself. function getRevertMsg(bytes memory returnData) internal pure returns (string memory) { // If the _res length is less than 68, then the transaction failed silently (without a revert message) if (returnData.length < 68) return "Transaction reverted silently"; assembly { // Slice the sighash. returnData := add(returnData, 0x04) } return abi.decode(returnData, (string)); // All that remains is the revert string } }
// SPDX-License-Identifier: MIT // Taken from Address.sol from OpenZeppelin. pragma solidity ^0.8.0; library IsContract { /// @dev Returns true if `account` is a contract. function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. return account.code.length > 0; } }
{ "optimizer": { "enabled": true, "runs": 1000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"route","outputs":[{"internalType":"bytes","name":"result","type":"bytes"}],"stateMutability":"payable","type":"function"}]
Contract Creation Code
60a060405234801561001057600080fd5b5033606081901b608052610495610037600039600081816040015260ac01526104956000f3fe6080604052600436106100295760003560e01c80638da5cb5b1461002e578063c6f334121461007f575b600080fd5b34801561003a57600080fd5b506100627f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b61009261008d36600461026c565b61009f565b60405161007691906103e6565b6060336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461011e5760405162461bcd60e51b815260206004820152600a60248201527f4f6e6c79206f776e65720000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6001600160a01b0384163b6101755760405162461bcd60e51b815260206004820152601860248201527f546172676574206973206e6f74206120636f6e747261637400000000000000006044820152606401610115565b6000846001600160a01b031684846040516101919291906103d6565b6000604051808303816000865af19150503d80600081146101ce576040519150601f19603f3d011682016040523d82523d6000602084013e6101d3565b606091505b5092509050806101ff576101e682610207565b60405162461bcd60e51b815260040161011591906103e6565b509392505050565b606060448251101561024c57505060408051808201909152601d81527f5472616e73616374696f6e2072657665727465642073696c656e746c79000000602082015290565b6004820191508180602001905181019061026691906102fd565b92915050565b60008060006040848603121561028157600080fd5b83356001600160a01b038116811461029857600080fd5b9250602084013567ffffffffffffffff808211156102b557600080fd5b818601915086601f8301126102c957600080fd5b8135818111156102d857600080fd5b8760208285010111156102ea57600080fd5b6020830194508093505050509250925092565b60006020828403121561030f57600080fd5b815167ffffffffffffffff8082111561032757600080fd5b818401915084601f83011261033b57600080fd5b81518181111561034d5761034d610430565b604051601f8201601f19908116603f0116810190838211818310171561037557610375610430565b8160405282815287602084870101111561038e57600080fd5b61039f836020830160208801610400565b979650505050505050565b600081518084526103c2816020860160208601610400565b601f01601f19169290920160200192915050565b8183823760009101908152919050565b6020815260006103f960208301846103aa565b9392505050565b60005b8381101561041b578181015183820152602001610403565b8381111561042a576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea264697066735822122022f2bc2ff8337797205081269ba37d2c0b2d782621a976afe0a806c421b4417c64736f6c63430008060033
Deployed Bytecode
0x6080604052600436106100295760003560e01c80638da5cb5b1461002e578063c6f334121461007f575b600080fd5b34801561003a57600080fd5b506100627f0000000000000000000000006cb18ff2a33e981d1e38a663ca056c0a5265066a81565b6040516001600160a01b0390911681526020015b60405180910390f35b61009261008d36600461026c565b61009f565b60405161007691906103e6565b6060336001600160a01b037f0000000000000000000000006cb18ff2a33e981d1e38a663ca056c0a5265066a161461011e5760405162461bcd60e51b815260206004820152600a60248201527f4f6e6c79206f776e65720000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6001600160a01b0384163b6101755760405162461bcd60e51b815260206004820152601860248201527f546172676574206973206e6f74206120636f6e747261637400000000000000006044820152606401610115565b6000846001600160a01b031684846040516101919291906103d6565b6000604051808303816000865af19150503d80600081146101ce576040519150601f19603f3d011682016040523d82523d6000602084013e6101d3565b606091505b5092509050806101ff576101e682610207565b60405162461bcd60e51b815260040161011591906103e6565b509392505050565b606060448251101561024c57505060408051808201909152601d81527f5472616e73616374696f6e2072657665727465642073696c656e746c79000000602082015290565b6004820191508180602001905181019061026691906102fd565b92915050565b60008060006040848603121561028157600080fd5b83356001600160a01b038116811461029857600080fd5b9250602084013567ffffffffffffffff808211156102b557600080fd5b818601915086601f8301126102c957600080fd5b8135818111156102d857600080fd5b8760208285010111156102ea57600080fd5b6020830194508093505050509250925092565b60006020828403121561030f57600080fd5b815167ffffffffffffffff8082111561032757600080fd5b818401915084601f83011261033b57600080fd5b81518181111561034d5761034d610430565b604051601f8201601f19908116603f0116810190838211818310171561037557610375610430565b8160405282815287602084870101111561038e57600080fd5b61039f836020830160208801610400565b979650505050505050565b600081518084526103c2816020860160208601610400565b601f01601f19169290920160200192915050565b8183823760009101908152919050565b6020815260006103f960208301846103aa565b9392505050565b60005b8381101561041b578181015183820152602001610403565b8381111561042a576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea264697066735822122022f2bc2ff8337797205081269ba37d2c0b2d782621a976afe0a806c421b4417c64736f6c63430008060033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ 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.