ETH Price: $3,018.36 (-7.93%)

Contract

0x1bF78bE42cD72bbFCCEEf67dCC0a0E2a0EB5da57
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

1 Internal Transaction found.

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block
From
To
134615292021-10-21 14:22:241180 days ago1634826144  Contract Creation0 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Router

Compiler Version
v0.8.6+commit.11564f7e

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion
File 1 of 3 : Router.sol
// 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));
    }
}

File 2 of 3 : RevertMsgExtractor.sol
// 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
    }
}

File 3 of 3 : IsContract.sol
// 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;
  }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 1000
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"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"}]

60a060405234801561001057600080fd5b5033606081901b608052610495610037600039600081816040015260ac01526104956000f3fe6080604052600436106100295760003560e01c80638da5cb5b1461002e578063c6f334121461007f575b600080fd5b34801561003a57600080fd5b506100627f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b61009261008d36600461026c565b61009f565b60405161007691906103e6565b6060336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461011e5760405162461bcd60e51b815260206004820152600a60248201527f4f6e6c79206f776e65720000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6001600160a01b0384163b6101755760405162461bcd60e51b815260206004820152601860248201527f546172676574206973206e6f74206120636f6e747261637400000000000000006044820152606401610115565b6000846001600160a01b031684846040516101919291906103d6565b6000604051808303816000865af19150503d80600081146101ce576040519150601f19603f3d011682016040523d82523d6000602084013e6101d3565b606091505b5092509050806101ff576101e682610207565b60405162461bcd60e51b815260040161011591906103e6565b509392505050565b606060448251101561024c57505060408051808201909152601d81527f5472616e73616374696f6e2072657665727465642073696c656e746c79000000602082015290565b6004820191508180602001905181019061026691906102fd565b92915050565b60008060006040848603121561028157600080fd5b83356001600160a01b038116811461029857600080fd5b9250602084013567ffffffffffffffff808211156102b557600080fd5b818601915086601f8301126102c957600080fd5b8135818111156102d857600080fd5b8760208285010111156102ea57600080fd5b6020830194508093505050509250925092565b60006020828403121561030f57600080fd5b815167ffffffffffffffff8082111561032757600080fd5b818401915084601f83011261033b57600080fd5b81518181111561034d5761034d610430565b604051601f8201601f19908116603f0116810190838211818310171561037557610375610430565b8160405282815287602084870101111561038e57600080fd5b61039f836020830160208801610400565b979650505050505050565b600081518084526103c2816020860160208601610400565b601f01601f19169290920160200192915050565b8183823760009101908152919050565b6020815260006103f960208301846103aa565b9392505050565b60005b8381101561041b578181015183820152602001610403565b8381111561042a576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea264697066735822122022f2bc2ff8337797205081269ba37d2c0b2d782621a976afe0a806c421b4417c64736f6c63430008060033

Deployed Bytecode

0x6080604052600436106100295760003560e01c80638da5cb5b1461002e578063c6f334121461007f575b600080fd5b34801561003a57600080fd5b506100627f0000000000000000000000006cb18ff2a33e981d1e38a663ca056c0a5265066a81565b6040516001600160a01b0390911681526020015b60405180910390f35b61009261008d36600461026c565b61009f565b60405161007691906103e6565b6060336001600160a01b037f0000000000000000000000006cb18ff2a33e981d1e38a663ca056c0a5265066a161461011e5760405162461bcd60e51b815260206004820152600a60248201527f4f6e6c79206f776e65720000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6001600160a01b0384163b6101755760405162461bcd60e51b815260206004820152601860248201527f546172676574206973206e6f74206120636f6e747261637400000000000000006044820152606401610115565b6000846001600160a01b031684846040516101919291906103d6565b6000604051808303816000865af19150503d80600081146101ce576040519150601f19603f3d011682016040523d82523d6000602084013e6101d3565b606091505b5092509050806101ff576101e682610207565b60405162461bcd60e51b815260040161011591906103e6565b509392505050565b606060448251101561024c57505060408051808201909152601d81527f5472616e73616374696f6e2072657665727465642073696c656e746c79000000602082015290565b6004820191508180602001905181019061026691906102fd565b92915050565b60008060006040848603121561028157600080fd5b83356001600160a01b038116811461029857600080fd5b9250602084013567ffffffffffffffff808211156102b557600080fd5b818601915086601f8301126102c957600080fd5b8135818111156102d857600080fd5b8760208285010111156102ea57600080fd5b6020830194508093505050509250925092565b60006020828403121561030f57600080fd5b815167ffffffffffffffff8082111561032757600080fd5b818401915084601f83011261033b57600080fd5b81518181111561034d5761034d610430565b604051601f8201601f19908116603f0116810190838211818310171561037557610375610430565b8160405282815287602084870101111561038e57600080fd5b61039f836020830160208801610400565b979650505050505050565b600081518084526103c2816020860160208601610400565b601f01601f19169290920160200192915050565b8183823760009101908152919050565b6020815260006103f960208301846103aa565b9392505050565b60005b8381101561041b578181015183820152602001610403565b8381111561042a576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea264697066735822122022f2bc2ff8337797205081269ba37d2c0b2d782621a976afe0a806c421b4417c64736f6c63430008060033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
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.