Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0xDE4749911e7A2bc47c0EF8F88e5832728729DeE1
Balance 0 ETH
Nonce 70
Code Size 3644 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

3644 bytes
0x608060405234801561001057600080fd5b50600436106100415760003560e01c806307ab4218146100465780638615724e14610062578063b921a24614610092575b600080fd5b610060600480360381019061005b9190610703565b6100c2565b005b61007c6004803603810190610077919061077f565b6101b8565b60405161008991906108b8565b60405180910390f35b6100ac60048036038101906100a791906108da565b61029b565b6040516100b99190610932565b60405180910390f35b60008151905080848490501461010d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610104906109aa565b60405180910390fd5b60005b818110156101b157600061013d8483815181106101305761012f6109ca565b5b602002602001015161032b565b90507fd1db1937acfa9c18cf25d115dd434404964900224c895d075dd7f1dbd133f72e868684818110610173576101726109ca565b5b90506020028101906101859190610a08565b8360405161019593929190610a98565b60405180910390a15080806101a990610b03565b915050610110565b5050505050565b6060815167ffffffffffffffff8111156101d5576101d46104f2565b5b6040519080825280602002602001820160405280156102035781602001602082028036833780820191505090505b50905060005b825181101561029557610235838281518110610228576102276109ca565b5b602002602001015161029b565b828281518110610248576102476109ca565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050808061028d90610b03565b915050610209565b50919050565b6000806102a783610414565b9050600083805190602001209050600082805190602001209050600060ff60f81b3084846040516020016102de9493929190610c0b565b60405160208183030381529060405280519060200120905060008160001c90506000813b9050600081111561031b57819650505050505050610326565b600096505050505050505b919050565b60008073ffffffffffffffffffffffffffffffffffffffff1661034d8361029b565b73ffffffffffffffffffffffffffffffffffffffff1614610378576103718261029b565b905061040f565b600061038383610414565b9050600083805190602001209050808251602084016000f59250600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361040c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161040390610ca5565b60405180910390fd5b50505b919050565b60606000826040516020016104299190610d76565b604051602081830303815290604052905060008160405160200161044d9190610de4565b60405160208183030381529060405290508092505050919050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f8401126104a1576104a061047c565b5b8235905067ffffffffffffffff8111156104be576104bd610481565b5b6020830191508360208202830111156104da576104d9610486565b5b9250929050565b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61052a826104e1565b810181811067ffffffffffffffff82111715610549576105486104f2565b5b80604052505050565b600061055c610468565b90506105688282610521565b919050565b600067ffffffffffffffff821115610588576105876104f2565b5b602082029050602081019050919050565b600080fd5b600067ffffffffffffffff8211156105b9576105b86104f2565b5b6105c2826104e1565b9050602081019050919050565b82818337600083830152505050565b60006105f16105ec8461059e565b610552565b90508281526020810184848401111561060d5761060c610599565b5b6106188482856105cf565b509392505050565b600082601f8301126106355761063461047c565b5b81356106458482602086016105de565b91505092915050565b600061066161065c8461056d565b610552565b9050808382526020820190506020840283018581111561068457610683610486565b5b835b818110156106cb57803567ffffffffffffffff8111156106a9576106a861047c565b5b8086016106b68982610620565b85526020850194505050602081019050610686565b5050509392505050565b600082601f8301126106ea576106e961047c565b5b81356106fa84826020860161064e565b91505092915050565b60008060006040848603121561071c5761071b610472565b5b600084013567ffffffffffffffff81111561073a57610739610477565b5b6107468682870161048b565b9350935050602084013567ffffffffffffffff81111561076957610768610477565b5b610775868287016106d5565b9150509250925092565b60006020828403121561079557610794610472565b5b600082013567ffffffffffffffff8111156107b3576107b2610477565b5b6107bf848285016106d5565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061081f826107f4565b9050919050565b61082f81610814565b82525050565b60006108418383610826565b60208301905092915050565b6000602082019050919050565b6000610865826107c8565b61086f81856107d3565b935061087a836107e4565b8060005b838110156108ab5781516108928882610835565b975061089d8361084d565b92505060018101905061087e565b5085935050505092915050565b600060208201905081810360008301526108d2818461085a565b905092915050565b6000602082840312156108f0576108ef610472565b5b600082013567ffffffffffffffff81111561090e5761090d610477565b5b61091a84828501610620565b91505092915050565b61092c81610814565b82525050565b60006020820190506109476000830184610923565b92915050565b600082825260208201905092915050565b7f4d69736d617463686564206c656e677468730000000000000000000000000000600082015250565b600061099460128361094d565b915061099f8261095e565b602082019050919050565b600060208201905081810360008301526109c381610987565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112610a2557610a246109f9565b5b80840192508235915067ffffffffffffffff821115610a4757610a466109fe565b5b602083019250600182023603831315610a6357610a62610a03565b5b509250929050565b6000610a77838561094d565b9350610a848385846105cf565b610a8d836104e1565b840190509392505050565b60006040820190508181036000830152610ab3818587610a6b565b9050610ac26020830184610923565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000819050919050565b6000610b0e82610af9565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610b4057610b3f610aca565b5b600182019050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b6000819050919050565b610b92610b8d82610b4b565b610b77565b82525050565b60008160601b9050919050565b6000610bb082610b98565b9050919050565b6000610bc282610ba5565b9050919050565b610bda610bd582610814565b610bb7565b82525050565b6000819050919050565b6000819050919050565b610c05610c0082610be0565b610bea565b82525050565b6000610c178287610b81565b600182019150610c278286610bc9565b601482019150610c378285610bf4565b602082019150610c478284610bf4565b60208201915081905095945050505050565b7f4445504c4f594d454e545f4641494c4544000000000000000000000000000000600082015250565b6000610c8f60118361094d565b9150610c9a82610c59565b602082019050919050565b60006020820190508181036000830152610cbe81610c82565b9050919050565b600081905092915050565b60008082015250565b6000610ce6600183610cc5565b9150610cf182610cd0565b600182019050919050565b600081519050919050565b600081905092915050565b60005b83811015610d30578082015181840152602081019050610d15565b83811115610d3f576000848401525b50505050565b6000610d5082610cfc565b610d5a8185610d07565b9350610d6a818560208601610d12565b80840191505092915050565b6000610d8182610cd9565b9150610d8d8284610d45565b915081905092915050565b7f600b5981380380925939f3000000000000000000000000000000000000000000600082015250565b6000610dce600b83610cc5565b9150610dd982610d98565b600b82019050919050565b6000610def82610dc1565b9150610dfb8284610d45565b91508190509291505056fea264697066735822122058ece0d5629ac8ee1f80e7ab01ccca9d842a027dbcaf3e6731c3fc94367aa4ab64736f6c634300080d0033

Verified Source Code Full Match

Compiler: v0.8.13+commit.abaa5c0e EVM: london Optimization: No
FileDeployer.sol 129 lines
//SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.13;

contract FileDeployer {
    /**
     * @notice Emitted with deployed content address
     * @param name Content name
     * @param contentAddress Content address
     */
    event DeployedContent(string name, address contentAddress);

    /**
     * @notice Used to deploy bytes as a contract's bytecode
     * @param contents Contents to be deployed as bytecode
     */
    function deploy(string[] calldata names, bytes[] memory contents) external {
        uint256 contentsLength = contents.length;
        require(names.length == contentsLength, "Mismatched lengths");
        for (uint256 i = 0; i < contentsLength; i++) {
            address contentAddress = _write(contents[i]);

            emit DeployedContent(names[i], contentAddress);
        }
    }

    /**
     * @notice prepare `creationCode``
     */
    function _prepareCreationCode(
        bytes memory data
    ) private pure returns (bytes memory) {
        // Prefix the bytecode with a STOP opcode to ensure it cannot be called.
        bytes memory runtimeCode = abi.encodePacked(hex"00", data);

        bytes memory creationCode = abi.encodePacked(
            //---------------------------------------------------------------------------------------------------------------//
            // Opcode  | Opcode + Arguments  | Description  | Stack View                                                     //
            //---------------------------------------------------------------------------------------------------------------//
            // 0x60    |  0x600B             | PUSH1 11     | codeOffset                                                     //
            // 0x59    |  0x59               | MSIZE        | 0 codeOffset                                                   //
            // 0x81    |  0x81               | DUP2         | codeOffset 0 codeOffset                                        //
            // 0x38    |  0x38               | CODESIZE     | codeSize codeOffset 0 codeOffset                               //
            // 0x03    |  0x03               | SUB          | (codeSize - codeOffset) 0 codeOffset                           //
            // 0x80    |  0x80               | DUP          | (codeSize - codeOffset) (codeSize - codeOffset) 0 codeOffset   //
            // 0x92    |  0x92               | SWAP3        | codeOffset (codeSize - codeOffset) 0 (codeSize - codeOffset)   //
            // 0x59    |  0x59               | MSIZE        | 0 codeOffset (codeSize - codeOffset) 0 (codeSize - codeOffset) //
            // 0x39    |  0x39               | CODECOPY     | 0 (codeSize - codeOffset)                                      //
            // 0xf3    |  0xf3               | RETURN       |                                                                //
            //---------------------------------------------------------------------------------------------------------------//
            hex"60_0B_59_81_38_03_80_92_59_39_F3", // Returns all code in the contract except for the first 11 (0B in hex) bytes.
            runtimeCode // The bytecode we want the contract to have after deployment. Capped at 1 byte less than the code size limit.
        );

        return creationCode;
    }

    /* solhint-disable max-line-length */
    /**
     * @notice Write bytecode to an address
     * @ author SOLMATE
     */
    function _write(bytes memory data) private returns (address pointer) {
        if (getBytesAddress(data) != address(0)) {
            return getBytesAddress(data);
        }

        bytes memory creationCode = _prepareCreationCode(data);
        bytes32 salt = keccak256(data);

        /// @solidity memory-safe-assembly
        assembly {
            // Deploy a new contract with the generated creation code.
            // We start 32 bytes into the code to avoid copying the byte length.
            pointer := create2(
                0,
                add(creationCode, 32),
                mload(creationCode),
                salt
            )
        }

        require(pointer != address(0), "DEPLOYMENT_FAILED");
    }

    /**
     * @notice check if content was already deployed
     * @ author VERSE
     */
    function getDataAddresses(
        bytes[] memory contents
    ) public view returns (address[] memory addresses) {
        addresses = new address[](contents.length);

        for (uint256 i = 0; i < contents.length; i++) {
            addresses[i] = getBytesAddress(bytes(contents[i]));
        }

        return addresses;
    }

    /**
     * @notice check if data was already deployed
     * @ author VERSE
     */
    function getBytesAddress(bytes memory data) public view returns (address) {
        bytes memory creationCode = _prepareCreationCode(data);

        bytes32 salt = keccak256(data);
        bytes32 initCodeHash = keccak256(creationCode);
        bytes32 predictedAddressHash = keccak256(
            abi.encodePacked(bytes1(0xff), address(this), salt, initCodeHash)
        );
        address predictedAddress = address(
            uint160(uint256(predictedAddressHash))
        );

        uint256 size;
        assembly {
            size := extcodesize(predictedAddress)
        }
        if (size > 0) {
            // Contract exists at this address, return the address
            return predictedAddress;
        } else {
            // No contract exists at this address, return zero address
            return address(0);
        }
    }
}

Read Contract

getBytesAddress 0xb921a246 → address
getDataAddresses 0x8615724e → address[]

Write Contract 1 functions

These functions modify contract state and require a wallet transaction to execute.

deploy 0x07ab4218
string[] names
bytes[] contents

Recent Transactions

No transactions found for this address