Ethereum: EIP -3448 metadata length – is it binding or optional?
Ethereum EIP-3448 specification for some time was the topic of discussion between creators and researchers. One of the main aspects of this standard is the length of the metadata that the last 32 bytes (one word) by byte code is shown. However, as you delve into the specifications, it becomes clear that the metadata length requirement may not be completely mandatory.
Specification
EIP-3448 is a self-evident contract with Ethereum Blockchain, allowing developers to create custom smart contracts. The specification describes several important aspects of this new standard, including:
- Metadata Length
: As mentioned earlier, the last 32 bytes (one word) of bytes code must indicate the length of the metadata in bytes.
- Type definitions : EIP-3448 defines two type definitions:
0x00and ‘0x01’. These species mark metadata that can be included in any byte code.
optional or mandatory?
At first glance, the length of metadata seems to be a mandatory requirement. However, after closer examination of the specification, we see that there are some nuances to consider:
1
- Types of metadata : Specification also allows any by -code to include metadata types, regardless of their length.
3.
Conclusion
In conclusion, although the length of the metadata is a mandatory requirement, as stated by EIP-3448, there is no need to strictly include this information in the byte code. Creators who decide to install custom metadata types or rely on default values can freely ignore this aspect of the specification. However, developers who need strict compliance with this standard may be worth adding the parameter of the Metadatal Length.
CODE EXAMPLE
Here’s an example of how you can install EIP-3448 Solidity:
`Solidarity
Pragma solidity ^0.8.0;
Example of metadata of the contract {
// Metadata length is 64 bytes by default
UINT256 metadatal length = 64;
Function Setmetadata () Public {
// Include metadata type and value
Metadatap: = 0x01;
UINT256 Metadatavalue = 0x1234567890ABCDEF;
// …
}
}
`
In this example, the Metadatalength parameter is not included in the byte code. Instead, we rely on default values to determine our metadata.
Conclusion
EIP-3448 is an important standard for Ethereum Blockchain smart contracts. Although the length of the metadata is a mandatory requirement, it is necessary to take into account the nuances of this specification and whether your use is required. By incorporating the MetadatalEngth parameter or relying on default values, the developers can ensure that their code meets the EIP-3448 standards as well as to meet their specific requirements.