Skip to content

Extract the Membrane Contract Address #1932

@joe-bowman

Description

@joe-bowman

Extract and Document the Membrane Contract Address

The address “osmo1gy5gpqqlth0jpm9ydxlmff6g5mpnfvrfxd3mfc8dhyt03waumtzqt8exxr” is used in multiple places:

  • app/upgrades/v1_9.go (upgrade handler)
  • x/participationrewards/keeper/submodule_membrane_test.go
  • utils/cw_test.go

To avoid duplication and ensure correctness:

• Extract this literal into a single constant (for example prtypes.MembraneContractAddress) in your module’s types or config package.
• Replace the hardcoded strings in the upgrade handler and both test files with that constant:

- ContractAddress: "osmo1gy5gpqqlth0jpm9ydxlmff6g5mpnfvrfxd3mfc8dhyt03waumtzqt8exxr",
+ ContractAddress: prtypes.MembraneContractAddress,

• Add a doc comment on the constant explaining its origin (mainnet deployment tx or protocol spec) and its role in the Membrane protocol.
• Optionally, update your module’s README or upgrade notes to reference this constant and its purpose.

This centralizes future updates and makes the address’s provenance clear.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

                ContractAddress: prtypes.MembraneContractAddress,
🤖 Prompt for AI Agents
In app/upgrades/v1_9.go at line 26 and the related test files, the Membrane
contract address is hardcoded multiple times. Extract this address into a single
constant named MembraneContractAddress in your module’s types or config package.
Replace all occurrences of the hardcoded string in the upgrade handler and test
files with this constant. Add a doc comment to the constant explaining its
origin and role in the Membrane protocol. Optionally, update the module’s README
or upgrade notes to reference this constant and its purpose.

Originally posted by @coderabbitai[bot] in #1931 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions