Skip to content
Verified contractPartial

ProxyVersioned

Address0xd74bee51abbeff07a89dd90305667c1e17212afa
Balance

0 ETH

 

Transactions

222

 

Compiler

solc 0.4.26

 

Same code

2 more contracts

 

Details

Compiler
solc 0.4.26+commit.4563c3fc
Language
solidity
Optimization
Yes, 200 runs
License
Not stated
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
7,988,649
Creation transaction
0xb2846c772f…0d223a82be

ProxyVersioned.sol

pragma solidity ^0.4.21;

contract ProxyVersioned {
  address public owner;
  address public target;

  event ProxyTargetSet(address target);
  event ProxyOwnerChanged(address _owner);

  constructor () public{
    owner = msg.sender;
  }

  /**
   * @dev Throws if called by any account other than the owner.
   */
  modifier onlyOwner() {
    require(msg.sender == owner);
    _;
  }

  function setTarget(address _target) public onlyOwner {
    target = _target;
    emit ProxyTargetSet(_target);
  }

  function setOwner(address _owner) public onlyOwner {
    owner = _owner;
    emit ProxyOwnerChanged(_owner);
  }

  function () payable public {
    address _impl = target;
    require(_impl != address(0));

    assembly {
      let ptr := mload(0x40)
      calldatacopy(ptr, 0, calldatasize)
      let result := delegatecall(gas, _impl, ptr, calldatasize, 0, 0)
      let size := returndatasize
      returndatacopy(ptr, 0, size)

      switch result
      case 0 { revert(ptr, size) }
      default { return(ptr, size) }
    }
  }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": true
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.