fix: correct funding-rate keys, faucet auth reuse, mainnet deploy gua… - #495
Merged
abayomicornelius merged 1 commit intoJul 25, 2026
Merged
Conversation
…rd, periphery docs - reader::get_funding_rate_info read funding/OI storage keyed by (market_token, market_token) instead of (market_token, long_token) / (market_token, short_token), silently returning zeros on real markets. Load the market and derive keys the same way get_funding_info already does. - TestFaucet::claim_many called account.require_auth() once per token inside a loop, tripping a Soroban auth-reuse failure on real signed transactions. Both claim and claim_many now authorize once per invocation via a shared do_claim helper. - make deploy-contract had no mainnet guard, so test_token/test_faucet could be deployed to mainnet through the generic target. Added an inline guard in mx/deploy.mk plus an on-chain network_id self-check in both contracts' initialize so a direct stellar contract invoke can't bypass it either. - fee_batch_sweeper, insurance_fund_router, market_util_reader, and order_cleanup were implemented and audited but missing from the README architecture diagram/contract map, the deployment runbook, and mx/common.mk's CONTRACTS list. Closes SO4-Markets#397, closes SO4-Markets#399, closes SO4-Markets#400, closes SO4-Markets#401
|
@zane1502 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was fixed (all verified via cargo test, plus an independent peer review pass)
long_token/short_token, matching get_funding_info. Added 2 tests.
token in a loop. Added a 2-token test.
two, doesn't touch other contracts); added a matching on-chain network_id self-check in both
contracts' initialize so even a raw stellar contract invoke can't bypass it. Added tests for
both.
the README architecture diagram/contract map/project tree, docs/deployment.md, and mx/common.mk.
Closes #397
Closes #399
Closes #400
Closes #401