feat(contracts): resolve issues #745, #744, #746, and #747 - #962
Merged
Idrhas merged 2 commits intoAug 4, 2026
Merged
Conversation
…m-credit#746, and Farm-credit#747 Detailed summary of implementations across Soroban smart contracts: 1. Issue Farm-credit#745 [Contract] Implement Batch Minting for Tree-NFT Certificates: - Added batch_mint to contracts/nft-certificate/src/lib.rs enabling verifiers to mint up to 50 certificates in a single transaction. - Enforced batch size limits (max 50, non-empty), input array length equality, pause checks, and individual metadata validation (tree_count > 0, co2_offset_kg > 0). - Updated global TOK_COUNT atomically and emitted btch_mnt event. Added corresponding unit tests. - Closes Farm-credit#745 2. Issue Farm-credit#744 [Contract] Add Emergency Pause Guard for Soroban Carbon Marketplace: - Added global circuit breaker mechanism (DataKey::Paused) in contracts/carbon-marketplace/src/lib.rs. - Added pause, unpause, and is_paused functions gated by admin authorization (admin.require_auth()). - Guarded state-changing operations (list, buy, cancel, amm_add_liquidity, amm_remove_liquidity, amm_swap_exact_in, order matching) with assert_not_paused checks. Added corresponding unit tests. - Closes Farm-credit#744 3. Issue Farm-credit#746 [Contract] Implement Dynamic Fee Tier System in Carbon Dex Swaps: - Implemented dynamic trade volume-based fee tier calculation (get_fee_bps) in contracts/carbon-marketplace/src/lib.rs: * Tier 1 (< 10,000 units): 30 bps (0.30%) * Tier 2 (10,000 - 100,000 units): 20 bps (0.20%) * Tier 3 (>= 100,000 units): 10 bps (0.10%) - Updated amm_swap_exact_in and amm_get_quote to compute DEX swap output and pool fee tracking dynamically based on trade size. Added corresponding unit tests. - Closes Farm-credit#746 4. Issue Farm-credit#747 [Contract] Add Slashing Penalty Escalation for Malicious Proof Verifiers: - Implemented exponential penalty escalation in contracts/verifier-staking/src/lib.rs for repeat offending verifiers. - Added OffenseCount tracking (DataKey::OffenseCount), get_offense_count, and slash_escalated function. - Calculated penalty multiplier 2^(n-1) where n is the 1-based offense count (capped at 16x), capping effective slash amount at remaining verifier stake. - Transferred slashed tokens to the replanting buffer pool and emitted offense escalation events. Added corresponding unit tests. - Closes Farm-credit#747 Closes Farm-credit#745, Farm-credit#744, Farm-credit#746, Farm-credit#747
|
@utilityjnr 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.
Detailed summary of implementations across Soroban smart contracts:
Issue [Contract] Implement Batch Minting for Tree-NFT Certificates #745 [Contract] Implement Batch Minting for Tree-NFT Certificates:
Issue [Contract] Add Emergency Pause Guard for Soroban Carbon Marketplace #744 [Contract] Add Emergency Pause Guard for Soroban Carbon Marketplace:
Issue [Contract] Implement Dynamic Fee Tier System in Carbon Dex Swaps #746 [Contract] Implement Dynamic Fee Tier System in Carbon Dex Swaps:
Issue [Contract] Add Slashing Penalty Escalation for Malicious Proof Verifiers #747 [Contract] Add Slashing Penalty Escalation for Malicious Proof Verifiers:
Closes #745, #744, #746, #747
Summary
Related Issue
Closes #
What Was Implemented
Implementation Details
Screenshots / Recordings
How to Test
Checklist
feat:,fix:, etc.)pnpm build)pnpm lint)