Skip to content
Verified contractPartialMIT

TokenProxy

Address0x5ecc4bf4ae0eb3ec6cc043064ac46803a49612e6
Balance

0 ETH

 

Transactions

2

 

Compiler

solc 0.8.24

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.24+commit.e11b9ed9
Language
solidity
Optimization
No
License
MIT
Match
Partialcreation code: no, runtime code: yes
Verified on Sourcify
Created in block
26,339,442
Creation transaction
0x433d54d94f…923a68cfb2
Proxy implementation
0x9b5c9a32…0d061f4aDigitalInkStorehouseV32

TokenProxy.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

contract TokenProxy {
    bytes32 private constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
    bytes32 private constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016eaf15eb9e8e9f03347e2db6a3ec1e1cb0;

    constructor(address _implementation) {
        _setImplementation(_implementation);
        _setAdmin(msg.sender);
    }

    function _delegate(address implementation_) internal virtual {
        assembly {
            calldatacopy(0, 0, calldatasize())
            let result := delegatecall(gas(), implementation_, 0, calldatasize(), 0, 0)
            returndatacopy(0, 0, returndatasize())
            switch result
            case 0 { revert(0, returndatasize()) }
            default { return(0, returndatasize()) }
        }
    }

    fallback() external payable virtual {
        _delegate(_getImplementation());
    }

    receive() external payable virtual {
        _delegate(_getImplementation());
    }

    function _getImplementation() internal view returns (address impl) {
        assembly {
            impl := sload(_IMPLEMENTATION_SLOT)
        }
    }

    function _setImplementation(address newImplementation) internal {
        assembly {
            sstore(_IMPLEMENTATION_SLOT, newImplementation)
        }
    }

    function _getAdmin() internal view returns (address adm) {
        assembly {
            adm := sload(_ADMIN_SLOT)
        }
    }

    function _setAdmin(address newAdmin) internal {
        assembly {
            sstore(_ADMIN_SLOT, newAdmin)
        }
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": false
  },
  "remappings": []
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.