Skip to content

AggLayer: create metadata from token information #2453

@mmagician

Description

@mmagician

Currently we set METADATA_HASH to 0s, but the proper construction of this requires that we encode token information (name, symbol, decimals) and hash that with keccak:

/**
 * @notice Returns the encoded token metadata
 * @param token Address of the token
 */

function getTokenMetadata(
    address token
) public view returns (bytes memory) {
    return
        abi.encode(
            _safeName(token),
            _safeSymbol(token),
            _safeDecimals(token)
        );
}

Also, handling the metadata for bridging of the gas token is different: https://github.com/agglayer/agglayer-contracts/blob/60d06fc3224792ce55dc2690d66b6719a73398e7/contracts/v2/PolygonZkEVMBridgeV2.sol#L335

Metadata

Metadata

Assignees

No one assigned

    Labels

    agglayerPRs or issues related to AggLayer bridging integration

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions