- 
                Notifications
    You must be signed in to change notification settings 
- Fork 6.2k
Open
Labels
Description
Abstract
Let's add support of type(State).typehash for structs, returning bytes32 hashed stringed structure.
Motivation
EIP-712 type hashes are pretty popular among smart contract of different companies. I believe it makes sense to support it on Solidity language layer.
Specification
bytes32 constant public STATE_TYPEHASH = keccak256(
    "State("
        "uint256 nonce,"
        "uint256 totalSpent,"
        "uint256 totalRefunded"
    ")"
);=>
struct State {
    uint256 nonce;
    uint256 totalSpent;
    uint256 totalRefunded;
}
bytes32 constant public STATE_TYPEHASH = type(State).typehash;Backwards Compatibility
Not sure
frangio, pcaversaccio, SevenSwen, Saw-mon-and-Natalie, NoahMarconi and 11 more
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Consider to Promote