def METHOD_NAME(params: ManageEntityParameters):
    metadata = get_grant_metadata_from_raw(params.metadata)
    if not metadata:
        raise IndexingValidationError(
            "Invalid Revoke Grant Transaction, unable to parse metadata"
        )
    grant_key = validate_grant_tx(params, metadata)
    existing_grant = params.existing_records["Grant"][grant_key]
    if grant_key in params.new_records["Grant"]:
        existing_grant = params.new_records["Grant"][grant_key][-1]
    revoked_grant = copy_record(
        existing_grant,
        params.block_number,
        params.event_blockhash,
        params.txhash,
        params.block_datetime,
    )
    revoked_grant.is_revoked = True
    validate_grant_record(revoked_grant)
    params.add_record(grant_key, revoked_grant)
    return revoked_grant