Merge main into release/v3.x-new for v3.6.10 release#411
Merge main into release/v3.x-new for v3.6.10 release#411p-offtermatt merged 5 commits intorelease/v3.x-newfrom
Conversation
* Implement CCTP Inflow Adapter * added changelog * addresses PR comments, recompiled contracts, regenerated schema * recompile contracts * removed DestinationAddress struct- keep just the EVM address instead * Contracts after recompilation with `make compile`
* Add claim contract for weight-based fund distribution A CosmWasm contract that allows an admin to create distributions by sending funds along with a list of (address, weight) pairs. Users claim their proportional share across all active distributions in a single transaction. Expired distributions can be swept by anyone, returning unclaimed funds to a configured treasury address. Supports multi-denom distributions, duplicate address accumulation, lazy cleanup of expired claim entries, and proper storage error propagation. * Fix formatting and add Cargo.lock * Add PR link to changelog entry * Add paginated claim history query Records what each user claimed (amounts, timestamp, distribution ID) and exposes it via a ClaimHistory query with start_after/limit pagination. * Address PR review comments - Fix claim cleanup rollback: return Ok (no BankMsg) when only expired entries are cleaned up, instead of Err which rolls back state changes - Rename DistributionAlreadySwept to NoFundsToSweep (covers both swept and fully-claimed cases) - Use Addr as HashMap key to avoid double addr_validate - Sum weights during iteration instead of separate pass - Filter out zero-weight claim entries - Add funds attribute to create_distribution response - Add swept_funds attribute to sweep_expired response - Record claim history even for 0 funds claimed (leaves a trace)
* Add dry run deposit query to inflow vault contract Add a DryRunDeposit query that calculates how many vault shares would be minted for a given deposit amount without executing the deposit. This allows users and frontends to preview share amounts before committing. Closes #407 * Update changelog entry to reference PR #408 * Document that DryRunDeposit does not enforce the deposit cap
* Prepare v3.6.10 release * Fix filename --------- Co-authored-by: arlai-mk <arlai@moonkitt.com>
There was a problem hiding this comment.
Pull request overview
Merges main into release/v3.x-new to prepare the v3.6.10 release, including new contract features (CCTP adapter + claim contract) and an additional Inflow Vault query.
Changes:
- Added
DryRunDepositquery to the Inflow Vault contract + TS client/types + schema updates and tests. - Introduced new CosmWasm contracts:
cctp-adapterandclaim, plus generated TS bindings and JSON schemas. - Bumped workspace/contract versions to
3.6.10, updated checksums, schema generation targets, and Neutron binary version used in tooling/CI.
Reviewed changes
Copilot reviewed 78 out of 99 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| ts_types/InflowVaultBase.types.ts | Adds dry_run_deposit query type. |
| ts_types/InflowVaultBase.client.ts | Adds dryRunDeposit query client method. |
| ts_types/InflowCCTPAdapterBase.types.ts | New generated TS types for CCTP adapter. |
| ts_types/InflowCCTPAdapterBase.client.ts | New generated TS client for CCTP adapter. |
| ts_types/ClaimBase.types.ts | New generated TS types for claim contract. |
| ts_types/ClaimBase.client.ts | New generated TS client for claim contract. |
| packages/interface/src/inflow_vault.rs | Adds DryRunDeposit to Rust interface QueryMsg. |
| contracts/tribute/src/migration/migrate.rs | Updates migration comment to v3.6.10. |
| contracts/tribute/schema/tribute.json | Bumps schema contract version to 3.6.10. |
| contracts/token-info-providers/st-token-info-provider/src/migrate.rs | Updates migration comment to v3.6.10. |
| contracts/token-info-providers/st-token-info-provider/schema/st-token-info-provider.json | Bumps schema contract version to 3.6.10. |
| contracts/token-info-providers/lsm-token-info-provider/src/migrate.rs | Updates migration comment to v3.6.10. |
| contracts/token-info-providers/lsm-token-info-provider/schema/lsm-token-info-provider.json | Bumps schema contract version to 3.6.10. |
| contracts/token-info-providers/d-token-info-provider/src/migrate.rs | Updates migration comment to v3.6.10. |
| contracts/token-info-providers/d-token-info-provider/schema/d-token-info-provider.json | Bumps schema contract version to 3.6.10. |
| contracts/marketplace/schema/marketplace.json | Bumps schema contract version to 3.6.10. |
| contracts/inflow/vault/src/testing.rs | Adds unit test coverage for DryRunDeposit. |
| contracts/inflow/vault/src/migration/migrate.rs | Updates migration comment to v3.6.10. |
| contracts/inflow/vault/src/contract.rs | Implements DryRunDeposit query handler and logic. |
| contracts/inflow/vault/schema/vault.json | Adds dry_run_deposit query + response schema; bumps version. |
| contracts/inflow/vault/schema/raw/response_to_dry_run_deposit.json | New raw schema for DryRunDeposit response. |
| contracts/inflow/vault/schema/raw/query.json | Adds dry_run_deposit to raw query schema. |
| contracts/inflow/user-registry/schema/user-registry.json | Bumps schema contract version to 3.6.10. |
| contracts/inflow/skip-adapter/schema/skip-adapter.json | Bumps schema contract version to 3.6.10. |
| contracts/inflow/proxy/schema/proxy.json | Bumps schema contract version to 3.6.10. |
| contracts/inflow/mars-adapter/schema/mars-adapter.json | Bumps schema contract version to 3.6.10. |
| contracts/inflow/ibc-adapter/schema/ibc-adapter.json | Bumps schema contract version to 3.6.10. |
| contracts/inflow/control-center/src/migration/migrate.rs | Updates migration comment to v3.6.10. |
| contracts/inflow/control-center/schema/control-center.json | Bumps schema contract version to 3.6.10. |
| contracts/inflow/cctp-adapter/src/validation.rs | Adds depositor/admin/executor and address validation utilities. |
| contracts/inflow/cctp-adapter/src/testing_standard_adapter.rs | Adds standard adapter interface unit tests. |
| contracts/inflow/cctp-adapter/src/testing_mocks.rs | Adds mock deps/helpers for CCTP adapter tests. |
| contracts/inflow/cctp-adapter/src/testing_custom_adapter.rs | Adds custom adapter (chains/admins/executors/addresses/transfer) tests. |
| contracts/inflow/cctp-adapter/src/testing.rs | Placeholder test module. |
| contracts/inflow/cctp-adapter/src/state.rs | Introduces CCTP adapter state/storage types. |
| contracts/inflow/cctp-adapter/src/noble.rs | Adds Noble Orbiter memo construction utilities + tests. |
| contracts/inflow/cctp-adapter/src/msg.rs | Defines instantiate/execute/query messages and responses. |
| contracts/inflow/cctp-adapter/src/lib.rs | Wires up CCTP adapter modules and tests. |
| contracts/inflow/cctp-adapter/src/ibc.rs | Adds IBC fee query + IBC transfer message builder. |
| contracts/inflow/cctp-adapter/src/error.rs | Defines CCTP adapter contract errors. |
| contracts/inflow/cctp-adapter/schema/raw/response_to_standard_query.json | Raw schema for standard query binary response. |
| contracts/inflow/cctp-adapter/schema/raw/response_to_custom_query.json | Raw schema for custom query binary response. |
| contracts/inflow/cctp-adapter/schema/raw/query.json | Raw schema for query wrapper and query variants. |
| contracts/inflow/cctp-adapter/schema/raw/instantiate.json | Raw schema for CCTP adapter instantiate msg. |
| contracts/inflow/cctp-adapter/schema/raw/execute.json | Raw schema for CCTP adapter execute msg. |
| contracts/inflow/cctp-adapter/Cargo.toml | Adds new cctp-adapter crate manifest. |
| contracts/hydro/src/migration/migrate.rs | Updates migration comment to v3.6.10. |
| contracts/hydro/schema/hydro.json | Bumps schema contract version to 3.6.10. |
| contracts/gatekeeper/schema/gatekeeper.json | Bumps schema contract version to 3.6.10. |
| contracts/dao-voting-adapter/schema/dao-voting-adapter.json | Bumps schema contract version to 3.6.10. |
| contracts/claim/src/testing.rs | Adds unit tests for claim distributions/claims/sweeps/history. |
| contracts/claim/src/state.rs | Adds claim contract state/storage definitions. |
| contracts/claim/src/query.rs | Adds claim contract query messages + response types. |
| contracts/claim/src/msg.rs | Adds claim contract instantiate/execute messages. |
| contracts/claim/src/lib.rs | Wires up claim contract modules and tests. |
| contracts/claim/src/error.rs | Defines claim contract errors. |
| contracts/claim/src/contract.rs | Implements claim contract instantiate/execute/query logic. |
| contracts/claim/schema/raw/response_to_pending_claims.json | Raw schema for pending claims response. |
| contracts/claim/schema/raw/response_to_distribution.json | Raw schema for distribution response. |
| contracts/claim/schema/raw/response_to_config.json | Raw schema for config response. |
| contracts/claim/schema/raw/response_to_claim_history.json | Raw schema for claim history response. |
| contracts/claim/schema/raw/query.json | Raw schema for claim contract queries. |
| contracts/claim/schema/raw/instantiate.json | Raw schema for claim contract instantiate msg. |
| contracts/claim/schema/raw/execute.json | Raw schema for claim contract execute msg. |
| contracts/claim/schema/claim.json | Generated bundled schema for claim contract. |
| contracts/claim/Cargo.toml | Adds new claim crate manifest. |
| artifacts/checksums.txt | Updates wasm checksums and adds new contract artifacts. |
| Makefile | Adds schema + ts-codegen targets for CCTP adapter and claim. |
| Dockerfile | Updates NEUTROND_VERSION used in build image. |
| Cargo.toml | Adds new workspace members and bumps version to 3.6.10. |
| CHANGELOG | Adds v3.6.10 release notes and reorders one older bullet. |
| .github/workflows/populate-staging-contracts.yml | Updates downloaded Neutron binary and removes NTRN staging steps. |
| .changelog/v3.6.10/summary.md | Adds v3.6.10 changelog summary date. |
| .changelog/v3.6.10/features/408-dry-run-deposit-query.md | Adds changelog entry for dry-run deposit query. |
| .changelog/v3.6.10/features/405-claim-contract.md | Adds changelog entry for claim contract. |
| .changelog/v3.6.10/features/396-cctp-adapter.md | Adds changelog entry for CCTP adapter. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let memo = json!({ | ||
| "orbiter": { | ||
| "pre_actions": [{ | ||
| "id": "ACTION_FEE", | ||
| "attributes": { | ||
| "@type": "/noble.orbiter.controller.action.v2.FeeAttributes", | ||
| "fees_info": [{ | ||
| "recipient": bridging_config.noble_fee_recipient, | ||
| "amount": { | ||
| "value": fee_amount.to_string() | ||
| } | ||
| }] | ||
| } | ||
| }], | ||
| "forwarding": { | ||
| "protocol_id": "PROTOCOL_CCTP", | ||
| "attributes": { | ||
| "@type": "/noble.orbiter.controller.forwarding.v1.CCTPAttributes", | ||
| "destination_domain": bridging_config.destination_domain, | ||
| "mint_recipient": mint_recipient_base64, | ||
| "destination_caller": destination_caller_base64 | ||
| }, | ||
| "passthrough_payload": "" | ||
| } | ||
| } | ||
| }); |
There was a problem hiding this comment.
bridging_config is a borrowed &BridgingConfig, but the JSON construction is attempting to move bridging_config.noble_fee_recipient (a String) out of it, which won’t compile. Use a borrowed value (e.g., &bridging_config.noble_fee_recipient) or clone the string before inserting into json!().
| /// Validates that the address is exactly 40 hex characters (excluding 0x prefix). | ||
| pub fn normalize_evm_address(address: &str) -> Result<String, ContractError> { | ||
| let address = address.trim(); | ||
| let hex_str = address.strip_prefix("0x").unwrap_or(address); |
There was a problem hiding this comment.
The docstring says addresses with or without the 0x prefix are accepted, but strip_prefix("0x") only strips lowercase 0x. Inputs like 0X... will fail validation due to length. Consider stripping both 0x and 0X (or doing a case-insensitive prefix check) to match the documented behavior.
| let hex_str = address.strip_prefix("0x").unwrap_or(address); | |
| let hex_str = address | |
| .strip_prefix("0x") | |
| .or_else(|| address.strip_prefix("0X")) | |
| .unwrap_or(address); |
| *entry += claim.weight; | ||
| total_weight += claim.weight; |
There was a problem hiding this comment.
Uint128 arithmetic via += can overflow and wrap in release builds (Wasm), which could corrupt total_weight/per-address weights and skew claim shares. Use checked arithmetic (e.g., checked_add) and return a ContractError on overflow to avoid silent wraparound.
| *entry += claim.weight; | |
| total_weight += claim.weight; | |
| *entry = entry | |
| .checked_add(claim.weight) | |
| .ok_or(ContractError::Overflow {})?; | |
| total_weight = total_weight | |
| .checked_add(claim.weight) | |
| .ok_or(ContractError::Overflow {})?; |
| /// Helper to accumulate coins into a vec, merging same denoms. | ||
| fn add_coin(coins: &mut Vec<Coin>, denom: &str, amount: Uint128) { | ||
| if let Some(coin) = coins.iter_mut().find(|c| c.denom == denom) { | ||
| coin.amount += amount; | ||
| } else { | ||
| coins.push(Coin { | ||
| denom: denom.to_string(), | ||
| amount, | ||
| }); | ||
| } | ||
| } |
There was a problem hiding this comment.
coin.amount += amount can overflow and wrap in release builds, potentially producing incorrect payout amounts when aggregating across multiple distributions/denoms. Consider using checked_add and propagating an error (or otherwise handling overflow explicitly).
| let err = execute(deps.as_mut(), env, info, msg_lowercase).unwrap_err(); | ||
| assert!( | ||
| matches!(err, ContractError::DestinationAddressAlreadyExists { .. }), | ||
| "Expected MintRecipientAlreadyExists error, got: {:?}", |
There was a problem hiding this comment.
The assertion message references MintRecipientAlreadyExists, but the actual expected error is DestinationAddressAlreadyExists. Updating the message will make test failures easier to understand.
| "Expected MintRecipientAlreadyExists error, got: {:?}", | |
| "Expected DestinationAddressAlreadyExists error, got: {:?}", |
PR Review — Merge main → release/v3.x-new (v3.6.10)This is a release-prep merge bringing three new features: a CCTP adapter, a claim contract, and a dry-run deposit query for the vault. The review focuses on the new source code added in these three areas. Claim Contract (
|
| Area | Finding | Severity |
|---|---|---|
| Claim | Silent Ok when all pending claims are expired, no funds sent |
|
| Claim | Zero-fund history entries recorded for expired-claim calls | ℹ️ Minor |
| Claim | No migrate entry point |
ℹ️ Minor |
| CCTP | No sudo / IBC ack+timeout handler — funds could get stuck |
|
| CCTP | ADMINS as linear Vec vs Map inconsistency |
ℹ️ Minor |
| CCTP | get_executor_exists is dead code |
ℹ️ Minor |
| CCTP | Bridging fee in USDC not documented in msg types | ℹ️ Minor |
| CCTP | ibc_default_timeout_seconds = 0 not rejected |
ℹ️ Minor |
| Vault | Dry-run deposit implementation is correct | ✅ |
Merge main (up to the v3.6.10 release prep commit) into the release branch to prepare for the v3.6.10 tag and GitHub release.
Excludes PR #395 which landed on main after the release prep.
Important: Merge this PR with a merge commit (not squash).