optimism icon indicating copy to clipboard operation
optimism copied to clipboard

contracts-bedrock: create `GovernanceDelegation` predeploy and connect with `GovernanceToken`

Open 0xfuturistic opened this issue 1 year ago • 9 comments

This PR implements the specs for GovernanceDelegation as defined in https://github.com/ethereum-optimism/specs/pull/247, and implements GovernanceTokenInterop to connect the GovernanceToken with GovernanceDelegation.

0xfuturistic avatar Jul 16 '24 20:07 0xfuturistic

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 84.98%. Comparing base (4c211fa) to head (91bb84f). Report is 3 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #11167   +/-   ##
========================================
  Coverage    84.98%   84.98%           
========================================
  Files           36       36           
  Lines         2784     2784           
========================================
  Hits          2366     2366           
  Misses         350      350           
  Partials        68       68           
Flag Coverage Δ
cannon-go-tests 84.98% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

codecov[bot] avatar Jul 16 '24 20:07 codecov[bot]

Semgrep found 1 sol-style-return-arg-fmt finding:

  • packages/contracts-bedrock/src/governance/Alligator.sol

Named return arguments to functions must be appended with an underscore (_)

Ignore this finding from sol-style-return-arg-fmt.

semgrep-app[bot] avatar Jul 16 '24 21:07 semgrep-app[bot]

Semgrep found 1 golang_fmt_errorf_no_params finding:

No fmt.Errorf invocations without fmt arguments allowed

Ignore this finding from golang_fmt_errorf_no_params.

Semgrep found 1 todos_require_linear finding:

Please create a GitHub ticket for this TODO.

Ignore this finding from todos_require_linear.

semgrep-app[bot] avatar Jul 22 '24 14:07 semgrep-app[bot]

GovernanceToken ready for review. Alligator WIP.

cairoeth avatar Jul 22 '24 17:07 cairoeth

GovernanceToken ready for review. Alligator WIP.

Do you want the individual contracts reviewed on their own? If so, its better to have them in their own PRs. We cannot merged in WIP alligator as part of this PR. I recommend checking our https://graphite.dev/blog/stacked-prs, this is how we handle coupled features

tynes avatar Jul 22 '24 20:07 tynes

Semgrep found 3 sol-style-doc-comment findings:

Javadoc-style comments are not allowed. Use /// style doc comments instead.

Ignore this finding from sol-style-doc-comment.

Semgrep found 1 todos_require_linear finding:

  • op-node/rollup/confdepth/conf_depth.go

Please create a GitHub ticket for this TODO.

Ignore this finding from todos_require_linear.

semgrep-app[bot] avatar Jul 24 '24 17:07 semgrep-app[bot]

Semgrep found 1 golang_fmt_errorf_no_params finding:

No fmt.Errorf invocations without fmt arguments allowed

Ignore this finding from golang_fmt_errorf_no_params.

semgrep-app[bot] avatar Jul 25 '24 16:07 semgrep-app[bot]

Semgrep found 2 todos_require_linear findings:

  • packages/chain-mon/src/wd-mon/constants.ts
  • packages/chain-mon/src/faultproof-wd-mon/constants.ts

Please create a GitHub ticket for this TODO.

Ignore this finding from todos_require_linear.

Semgrep found 1 detect-child-process finding:

  • packages/chain-mon/internal/multisig-mon/service.ts

Detected calls to child_process from a function argument account. This could lead to a command injection if the input is user controllable. Try to avoid calls to child_process, and if it is needed ensure user input is correctly sanitized or sandboxed.

View Dataflow Graph
flowchart LR
    classDef invis fill:white, stroke: none
    classDef default fill:#e7f5ff, color:#1c7fd6, stroke: none

    subgraph File0["<b>packages/chain-mon/internal/multisig-mon/service.ts</b>"]
        direction LR
        %% Source

        subgraph Source
            direction LR

            v0["<a href=https://github.com/ethereum-optimism/optimism/blob/f6a0841ad9067ad667f04ea0f3182847ca47f804/packages/chain-mon/internal/multisig-mon/service.ts#L152 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 152] account</a>"]
        end
        %% Intermediate

        subgraph Traces0[Traces]
            direction TB

            v2["<a href=https://github.com/ethereum-optimism/optimism/blob/f6a0841ad9067ad667f04ea0f3182847ca47f804/packages/chain-mon/internal/multisig-mon/service.ts#L152 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 152] account</a>"]
        end
        %% Sink

        subgraph Sink
            direction LR

            v1["<a href=https://github.com/ethereum-optimism/optimism/blob/f6a0841ad9067ad667f04ea0f3182847ca47f804/packages/chain-mon/internal/multisig-mon/service.ts#L160 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 160] `OP_SERVICE_ACCOUNT_TOKEN=${this.options.onePassServiceToken} op item list --format json --vault=&quot;${account.vault}&quot;</a>"]
        end
    end
    %% Class Assignment
    Source:::invis
    Sink:::invis

    Traces0:::invis
    File0:::invis

    %% Connections

    Source --> Traces0
    Traces0 --> Sink

Ignore this finding from detect-child-process.

semgrep-app[bot] avatar Jul 25 '24 20:07 semgrep-app[bot]

Semgrep found 1 sol-style-input-arg-fmt finding:

  • packages/contracts-bedrock/src/governance/GovernanceToken.sol

Inputs to functions must be prepended with an underscore (_)

Ignore this finding from sol-style-input-arg-fmt.

semgrep-app[bot] avatar Aug 08 '24 19:08 semgrep-app[bot]