Verified contractPartial
UpgradeableProxy
Address0x89ddeccfac8ad6dffc51e3080671e84f6faafbcd
- Balance
0.245584 ETH
- Transactions
175
- Compiler
solc 0.5.10
- Same code
8,327 more contracts
Details
- Compiler
- solc 0.5.10+commit.5a6ea5b1
- Language
- solidity
- Optimization
- No
- License
- Not stated
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 8,474,558
- Creation transaction
- 0x824f24f0e7…eb6f5e2825
UpgradeableProxy.sol
// Recovered by EthereumHistory (ethereumhistory.com) -sw
pragma solidity ^0.5.0;
contract SelfAuthorized {
modifier authorized() {
require(msg.sender == address(this), "Method can only be called from this contract");
_;
}
}
contract MasterCopy is SelfAuthorized {
// masterCopy always needs to be first declared variable, to ensure that it is at the same location as in the Proxy contract.
// It should also always be ensured that the address is stored alone (uses a full word)
address masterCopy;
/// @dev Allows to upgrade the contract. This can only be done via a Safe transaction.
/// @param _masterCopy New contract address.
function changeMasterCopy(address _masterCopy)
public
authorized
{
// Master copy address cannot be null.
require(_masterCopy != address(0), "Invalid master copy address provided");
masterCopy = _masterCopy;
}
}
/// Proxy that is its own master-copy holder: delegates every call to masterCopy (slot 0), which it can change itself.
contract UpgradeableProxy is MasterCopy {
constructor(address _masterCopy)
public
{
require(_masterCopy != address(0), "Invalid master copy address provided");
masterCopy = _masterCopy;
}
function ()
external
payable
{
// solium-disable-next-line security/no-inline-assembly
assembly {
let masterCopy := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff)
calldatacopy(0, 0, calldatasize())
let success := delegatecall(gas, masterCopy, 0, calldatasize(), 0, 0)
returndatacopy(0, 0, returndatasize())
if eq(success, 0) { revert(0, returndatasize()) }
return(0, returndatasize())
}
}
}
Compiler settingsShow
{
"optimizer": {
"runs": 200,
"enabled": false
}
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.