fix(contracts): repair broken merge artifacts on main - #1041
Merged
Conversation
main has not compiled since #1033/#1034/#1035 landed: two conflict resolutions kept both sides. - Error enum declared TooManyFeeSplitRecipients twice (= 19 and = 18), which also collided with AlreadyBackfilled = 19. Keep = 18, matching the canonical ABI table and the numbering #1033 established (18/19/20 = TooManyFeeSplitRecipients/AlreadyBackfilled/NotWhitelisted). - get_token_info_by_address kept both the new read_addr_keyed lookup from #1034 and the superseded instance-storage lookup, leaving a syntactically invalid duplicated let binding. Keep the persistent- storage form. - docs/contract-abi.md had three concatenated error tables from the same bad merges. Collapse to the single complete table, fix the recipient cap typo (20 -> 10), and correct the NotWhitelisted prose (code 18 -> 20). - Allow clippy::identity_op on the deliberate 1-bps test formula from #1025, which the clippy job could not reach while the crate was broken. cargo fmt, cargo clippy -D warnings, and 146 contract tests all pass.
Ejirowebfi
added a commit
to Bigg770/Stellar-forge
that referenced
this pull request
Jul 23, 2026
Resolve conflicts between the fee-split/metadata-URI PR and main's persistent-storage (Favourorg#1034), exact-fee (Favourorg#1035), whitelist (Favourorg#1033) and merge-repair (Favourorg#1041) changes: - Error enum: keep main's published 18/19/20 discriminants and append the PR's new variants as InvalidMetadataUri=21, ZeroFeeSplitEntry=22, MetadataFrozen=23. - set_metadata: keep the PR's URI validation and versioned-update/freeze semantics on top of main's persistent storage (migrate_addr_keyed / set_persistent), reentrancy lock, and charge-exactly-metadata_fee rule. - Rewrite the ipfs:// prefix check with String::copy_into_slice — the PR's String::get(i) does not exist in soroban-sdk 27. - freeze_metadata / views: migrate-aware persistent reads. - distribute_fee: keep the PR's largest-remainder allocation; update the Favourorg#918 tests to the new remainder policy (remainder goes to the largest-frac recipient, not treasury) and drop the PR's duplicate test_set_fee_split_too_many_recipients_rejected. - fuzz_fee_arithmetic: keep main's harness and invariants; rewrite model_distribute_fee to mirror the largest-remainder algorithm. - Fix the PR's uri-too-long fixture (was 115 bytes, comment claimed 129). - docs/contract-abi.md: merge both sides' set_metadata/set_fee_split sections, unified error table (18-23), union event table. cargo fmt / clippy -D warnings clean; 158 contract tests pass; fuzz workspace compiles.
github-actions Bot
pushed a commit
that referenced
this pull request
Jul 27, 2026
# [1.3.0](v1.2.0...v1.3.0) (2026-07-27) ### Bug Fixes * **#1024,#1023:** fee-split edge cases and metadata URI validation ([#1036](#1036)) ([e3174cb](e3174cb)), closes [#1024](#1024) [#1023](#1023) [#1024](#1024) [#1023](#1023) * **#1024,#1023:** fee-split edge cases and metadata URI validation ([#1037](#1037)) ([116d025](116d025)), closes [#1024](#1024) [#1023](#1023) [#1024](#1024) [#1023](#1023) * align adm_upd topic and add CI drift detection ([#1032](#1032)) ([872baa9](872baa9)) * **contracts:** add distribute_fee test coverage at realistic split sizes ([#918](#918)) ([#1025](#1025)) ([f9ec953](f9ec953)), closes [#919](#919) * **contracts:** charge exactly the required fee, not fee_payment ([#1035](#1035)) ([8654767](8654767)), closes [#1007](#1007) [#1007](#1007) [#1008](#1008) [#1008](#1008) * **contracts:** make token-factory initialize atomic with deployment ([#1029](#1029)) ([3e12de2](3e12de2)), closes [#1005](#1005) * **contracts:** move per-token bookkeeping to persistent storage ([#1034](#1034)) ([51c52bd](51c52bd)), closes [#1007](#1007) [#1007](#1007) * **contracts:** prove multi-step migrate pattern with synthetic v2 tests ([#919](#919)) ([#1026](#1026)) ([f9ef384](f9ef384)), closes [#918](#918) [#918](#918) * **contracts:** repair broken merge artifacts on main ([#1041](#1041)) ([6524e58](6524e58)), closes [1034/#1035](#1035) [#1033](#1033) [#1034](#1034) [#1025](#1025) * **contracts:** seed max-supply counter with initial_supply ([#1006](#1006)) ([#1031](#1031)) ([4a3e90d](4a3e90d)) * **frontend:** resolve token identity from contract, not events ([#1018](#1018)) ([#1030](#1030)) ([66bcb19](66bcb19)) * **security:** validate uploaded image content, not client-declared M… ([#1055](#1055)) ([ab1f253](ab1f253)), closes [#1002](#1002) [#1002](#1002) [#1056](#1056) [#1057](#1057) * **token-factory:** bound fee-split recipient count to prevent resource-exhaustion griefing ([#1027](#1027)) ([becd28f](becd28f)) ### Features * **frontend:** implement paginated global token listing (getAllTokens) ([#1028](#1028)) ([0e1b51e](0e1b51e)), closes [#1017](#1017)
|
🎉 This PR is included in version 1.3.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
mainhas not compiled since #1033, #1034 and #1035 landed. Two conflict resolutions kept both sides of the conflict, socargo check -p token-factoryfails with 7 errors onorigin/mainas of 8654767.This also explains why unrelated PRs (e.g. #1038) show red contract jobs — PR CI builds the merge with
main.What was broken
1. Duplicate error variant (
lib.rs)→
E0428(defined multiple times) andE0081(discriminant 19 assigned twice).2. Duplicated statement in
get_token_info_by_address(lib.rs) — the merge kept both #1034's newread_addr_keyedlookup and the supersededinstancestorage lookup, producing a syntactically invalid doubleletbinding.3. Three concatenated error tables in
docs/contract-abi.mdfrom the same bad merges, disagreeing with each other and with the code.Fix
TooManyFeeSplitRecipients = 18, matching the 18/19/20 numbering Feat/whitelist enforcement #1033 established and the canonical ABI table.read_addr_keyedform from fix(contracts): move per-token bookkeeping to persistent storage #1034.NotWhitelistedprose (code 18 → 20).#[allow(clippy::identity_op)]on the deliberate 1-bps test formula from fix(contracts): add distribute_fee test coverage at realistic split sizes (#918) #1025 — the clippy job could never reach it while the crate was broken.Verification
No behavioural change beyond making the crate compile; error discriminants are ABI, and the retained numbering is the one already published in the ABI docs.