Oko contract explorer
Contract

Code for 0x219b…ef2a

Since block 13723993

Verified contract

  1. // SPDX-License-Identifier: LGPL-3.0-or-later
  2. // Taken from: https://github.com/gnosis/safe-contracts/blob/development/contracts/proxies/GnosisSafeProxy.sol
  3. pragma solidity ^0.7.0;
  4. /// @title IProxy - Helper interface to access masterCopy of the Proxy on-chain
  5. /// @author Richard Meissner - <richard@gnosis.io>
  6. interface IProxy {
  7. function masterCopy() external view returns (address);
  8. }
  9. /// @title WalletProxy - Generic proxy contract allows to execute all transactions applying the code of a master contract.
  10. /// @author Stefan George - <stefan@gnosis.io>
  11. /// @author Richard Meissner - <richard@gnosis.io>
  12. contract WalletProxy {
  13. // masterCopy always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated.
  14. // To reduce deployment costs this variable is internal and needs to be retrieved via `getStorageAt`
  15. address internal masterCopy;
  16. /// @dev Constructor function sets address of master copy contract.
  17. /// @param _masterCopy Master copy address.
  18. constructor(address _masterCopy)
  19. {
  20. require(_masterCopy != address(0), "Invalid master copy address provided");
  21. masterCopy = _masterCopy;
  22. }
  23. /// @dev Fallback function forwards all transactions and returns all received return data.
  24. fallback()
  25. payable
  26. external
  27. {
  28. // solium-disable-next-line security/no-inline-assembly
  29. assembly {
  30. let _masterCopy := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff)
  31. // 0xa619486e == keccak("masterCopy()"). The value is right padded to 32-bytes with 0s
  32. if eq(calldataload(0), 0xa619486e00000000000000000000000000000000000000000000000000000000) {
  33. mstore(0, _masterCopy)
  34. return(0, 0x20)
  35. }
  36. calldatacopy(0, 0, calldatasize())
  37. let success := delegatecall(gas(), _masterCopy, 0, calldatasize(), 0, 0)
  38. returndatacopy(0, 0, returndatasize())
  39. if eq(success, 0) { revert(0, returndatasize()) }
  40. return(0, returndatasize())
  41. }
  42. }
  43. }

Contract sourced from Etherscan. Solidity version v0.7.6+commit.7338295f.

Panoramix decompilation

# Palkeoramix decompiler. 

def storage:
  stor0 is address at storage 0

def _fallback(?) payable: # default function
  if call.func_hash == 0xa619486e00000000000000000000000000000000000000000000000000000000:
      return stor0
  delegate stor0 with:
     funct call.data[0 len 4]
       gas gas_remaining wei
      args call.data[4 len calldata.size - 4]
  if not delegate.return_code:
      revert with ext_call.return_data[0 len return_data.size]
  return ext_call.return_data[0 len return_data.size]

Decompilation generated by Panoramix.

Raw bytecode

0x6080604052600073ffffffffffffffffffffffffffffffffffffffff8154167fa619486e0000000000000000000000000000000000000000000000000000000082351415604e57808252602082f35b3682833781823684845af490503d82833e806067573d82fd5b503d81f3fea2646970667358221220676404d5a2e50e328cc18fc786619f9629ae43d7ff695286c941717f0a1541e564736f6c63430007060033