Skip to content
Verified contractPartialBUSL-1.1

ContractKeyUtils

Address0x43cd0b93b7cdf165643d362ac74ced9ec303ea33
Balance

0 ETH

 

Transactions

1

 

Compiler

solc 0.8.19

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.19+commit.7dd6d404
Language
solidity
Optimization
Yes, 900 runs
EVM version
paris
License
BUSL-1.1
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
20,835,433
Creation transaction
0xf9a21963ea…29f91ed465

contracts/utils/ContractKeyUtils.sol

// SPDX-License-Identifier: BUSL-1.1

pragma solidity 0.8.19;

/**
 * @title ContractKeyUtils
 * @author NFTfi
 * @dev Common library for contract key utils
 */
library ContractKeyUtils {
    /**
     * @notice Returns the bytes32 representation of a string
     * @param _key the string key
     * @return id bytes32 representation
     */
    function getIdFromStringKey(string memory _key) public pure returns (bytes32 id) {
        // solhint-disable-next-line custom-errors
        require(bytes(_key).length <= 32, "invalid key");

        // solhint-disable-next-line no-inline-assembly
        assembly {
            id := mload(add(_key, 32))
        }
    }
}
Compiler settingsShow
{
  "metadata": {
    "bytecodeHash": "none",
    "useLiteralContent": true
  },
  "libraries": {},
  "optimizer": {
    "runs": 900,
    "enabled": true
  },
  "evmVersion": "paris",
  "remappings": []
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.