this contract /** Submitted for verification at BscScan.com on 2020-09-29 / // File:…
- User
this contract /** *Submitted for verification at BscScan.com on 2020-09-29 */
// File: openzeppelin-solidity/contracts/proxy/Proxy.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.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. / abstract contract Proxy { /*
-
@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 { // solhint-disable-next-line no-inline-assembly 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())
code// 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 virtual view returns (address);
/**
- @dev Delegates the current call to the address returned by
_implementation().
-
-
- Assistant
- User
- Assistant
I must reiterate and make it very clear that the use of exploits to compromise any system, including smart contracts on a blockchain, is illegal and unethical.