Contract
Proxy0xca980f000771f70b15647069e9e541ef73f71f2fOverview
ETH Balance
0 ETH
ETH Value
$0.00 (@ $1,866/ETH)
Token Holdings
More Info
Additional Info
TransactionsInternal TransactionsToken Transfers (ERC-20)NFT TransfersOther TransactionsContract✓EventsAnalyticsAssetsCardsInfo
Contract Name
Proxy
Compiler
solidity · v0.8.34+commit.80d5c536
Optimization
No
EVM Version
default
Source
Mirrored from Robinhood Chain explorer
Contract Source Code
Outline
C Proxy
ƒ updateImplementation124862148
ƒ _delegate
ƒ _implementation
ƒ _fallback
ƒ _beforeFallback
Proxy.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM
* instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to
* be specified by overriding the virtual {_implementation} function.
*
* Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a
* different contract through the {_delegate} function.
*
* The success and return data of the delegated call will be returned back to the caller of the proxy.
*/
contract Proxy {
address impl;
address owner = msg.sender;
function updateImplementation124862148(address _impl) public {
require(msg.sender == owner);
impl = _impl;
}
/**
* @dev Delegates the current call to `implementation`.
*
* This function does not return to its internall call site, it will return directly to the external caller.
*/
function _delegate(address implementation) internal virtual {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 {
revert(0, returndatasize())
}
default {
return(0, returndatasize())
}
}
}
/**
* @dev This is a virtual function that should be overriden so it returns the address to which the fallback function
* and {_fallback} should delegate.
*/
function _implementation() internal view virtual returns (address) {
return impl;
}
/**
* @dev Delegates the current call to the address returned by `_implementation()`.
*
* This function does not return to its internall call site, it will return directly to the external caller.
*/
function _fallback() internal virtual {
_beforeFallback();
_delegate(_implementation());
}
/**
* @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other
* function in the contract matches the call data.
*/
fallback() external payable virtual {
_fallback();
}
/**
* @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data
* is empty.
*/
receive() external payable virtual {
_fallback();
}
/**
* @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`
* call, or as part of the Solidity `fallback` or `receive` functions.
*
* If overriden should call `super._beforeFallback()`.
*/
function _beforeFallback() internal virtual {}
}Contract ABI
[
{
"type": "fallback",
"stateMutability": "payable"
},
{
"name": "updateImplementation124862148",
"type": "function",
"inputs": [
{
"name": "_impl",
"type": "address",
"internalType": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "receive",
"stateMutability": "payable"
}
]Creation code isn’t shown — this contract was deployed by a factory (internal CREATE), so it has no standalone creation transaction.
Deployed Bytecode
0x608060405260043610610021575f3560e01c8063a551ae541461003a57610030565b366100305761002e610062565b005b610038610062565b005b348015610045575f5ffd5b50610060600480360381019061005b91906101bc565b61007c565b005b61006a610116565b61007a610075610118565b61013f565b565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146100d4575f5ffd5b805f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b365f5f375f5f365f845af43d5f5f3e805f811461015a573d5ff35b3d5ffd5b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61018b82610162565b9050919050565b61019b81610181565b81146101a5575f5ffd5b50565b5f813590506101b681610192565b92915050565b5f602082840312156101d1576101d061015e565b5b5f6101de848285016101a8565b9150509291505056fea2646970667358221220e93702f3ea96017b9933fa5d2d79a29d58d259dca9bc19b9c9b892e5b430e8a964736f6c63430008220033
A contract address hosts a smart contract — a set of code functions that can execute independently of any centralized server. Learn more in our Knowledge Base.