Skip to content

Conversation

@thedarkjester
Copy link
Contributor

@thedarkjester thedarkjester commented Dec 16, 2025

Description

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested?

  • Test A
  • Test B

How has this been benchmarked?

  • Benchmark A, on Macbook pro M1, 32GB RAM
  • Benchmark B, on x86 Intel xxx, 16GB RAM

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I did not modify files generated from templates
  • golangci-lint does not output errors locally
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Note

Introduces configurable extensibility for Solidity verifier generation.

  • New export options in backend/solidity: WithImport, WithInterface, WithConstants, WithConstructor, WithFunctions, plus helpers SortedImports() and InterfaceDeclaration()
  • Update Groth16 and Plonk templates to render sorted imports, contract is ... interface list, and optional Constants/Constructor/Functions blocks
  • Add tests (options_test.go) validating import sorting, interface declaration formatting, and propagation of constants/constructor/functions

Written by Cursor Bugbot for commit 68f676d. This will update automatically on new commits. Configure here.

@ivokub ivokub added dep: linea Issues affecting Linea downstream priority: P2-medium Issue priority: medium feat: solidity labels Dec 17, 2025
@ivokub ivokub self-assigned this Dec 17, 2025
@ivokub
Copy link
Collaborator

ivokub commented Dec 17, 2025

The plan to integrate the configuration is as follows:

  • add Solidity export options:
    • Withlmport -- multiple options. Every line goes to separate row
    • WithInheretance -- can allow multiple. In this case have to format accordingly
    • WithConstants -- additional constants to whatever is defined in the template
    • WithFunctions -- aditionnal functions which can be included in the template
      And then we replace during contract generation. On Linea side we then provide the corresponding parameters for different cases (test case generation).

Timeline-wise -- can do after new year's.

@ivokub
Copy link
Collaborator

ivokub commented Jan 10, 2026

I made the changes. I'll double check soon.

{{ range $imp := .Cfg.SortedImports }}
{{ $imp }}
{{- end }}
{{ end }}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imports placed before pragma statement in Solidity template

Medium Severity

The template places import statements before the pragma solidity statement. According to Solidity documentation and best practices, the standard source file layout order is: SPDX License Identifier → Pragma → Imports. The current template generates imports between the SPDX comment and pragma when imports are provided. While some Solidity versions may accept this ordering, it violates the standard file layout and may cause issues with Solidity linters, formatters, and static analysis tools. The import block should be moved to appear after the pragma solidity line.

Additional Locations (1)

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dep: linea Issues affecting Linea downstream feat: solidity priority: P2-medium Issue priority: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants