Skip to content

feat: expose governance authority address via precompile query#1212

Open
abhijitkrm wants to merge 1 commit into
cosmos:mainfrom
abhijitkrm:feat/gov-precompile-authority-query
Open

feat: expose governance authority address via precompile query#1212
abhijitkrm wants to merge 1 commit into
cosmos:mainfrom
abhijitkrm:feat/gov-precompile-authority-query

Conversation

@abhijitkrm

Copy link
Copy Markdown

Description

This PR adds a getAuthority() view function to the governance precompile (0x0805) that returns the governance module account address in both Bech32 and EVM hex formats. This allows smart contracts and dApps to discover the authority address required for parameter-change and software-upgrade proposals without querying Cosmos LCD/gRPC endpoints out-of-band.

Previously, EVM-only dApps were limited to text/signaling proposals because the authority field required by MsgUpdateParams and MsgSoftwareUpgrade messages could not be determined on-chain.

Files to review

  • precompiles/gov/IGov.sol — added getAuthority() to the Solidity interface
  • precompiles/gov/abi.json — added the ABI entry
  • precompiles/gov/query.go — added GetAuthorityMethod constant and GetAuthority function (derives via authtypes.NewModuleAddress(govtypes.ModuleName))
  • precompiles/gov/gov.go — added GetAuthorityMethod case in the Execute switch
  • precompiles/testutil/contracts/GovCaller.sol — added getAuthority() wrapper for contract-call tests
  • tests/integration/precompiles/gov/test_query.go — unit test
  • tests/integration/precompiles/gov/test_integration.go — integration test (direct + contract call)

How to review

  1. Review the GetAuthority function in precompiles/gov/query.go — it derives the gov module account address and returns it in both Bech32 and hex formats.
  2. Run the unit test: cd evmd && go test -tags=test -run "TestGovPrecompileTestSuite/TestGetAuthority" ./tests/integration/precompiles/gov/ -v
  3. Run the integration tests: cd evmd && go test -tags=test -run "TestGovPrecompileIntegrationTestSuite" ./tests/integration/precompiles/gov/ -v
  4. To verify end-to-end on a localnet, see the steps in the linked issue.

Closes: #1211


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • tackled an existing issue or discussed with a team member
  • left instructions on how to review the changes
  • targeted the main branch

@abhijitkrm abhijitkrm marked this pull request as ready for review July 1, 2026 08:57
@abhijitkrm abhijitkrm requested a review from a team as a code owner July 1, 2026 08:57
@greptile-apps

greptile-apps Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

PR author is not in the allowed authors list.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Governance authority address not exposed via EVM precompile

1 participant