Summary
Currently the campaign and rewards contracts are independent — registering in a campaign does not automatically credit the participant with rewards. Operators must manually batch-credit participants after the fact. For a seamless user experience and trustless reward distribution, the campaign contract should optionally invoke the rewards contract to credit a registration bonus upon successful registration.
Problem
There is no cross-contract call flow:
- Campaign contract does not know the rewards contract address
- Registration does not trigger any credit
- Operators must manually call
batch_credit after inspecting registration events
Acceptance Criteria
References
Summary
Currently the campaign and rewards contracts are independent — registering in a campaign does not automatically credit the participant with rewards. Operators must manually batch-credit participants after the fact. For a seamless user experience and trustless reward distribution, the campaign contract should optionally invoke the rewards contract to credit a registration bonus upon successful registration.
Problem
There is no cross-contract call flow:
batch_creditafter inspecting registration eventsAcceptance Criteria
rewards_contract: Option<Address>to campaign contract instance storageset_rewards_contract(admin, nonce, rewards_contract))admin function to configure the linked rewards contractregistration_bonus: u64field (admin-configurable, default 0 = no auto-credit)register(): ifrewards_contractis set andregistration_bonus > 0, callrewards.credit(campaign_admin, participant, bonus)via cross-contract invocationcredit_failedevent)docs/ARCHITECTURE_OVERVIEW.mdwith the new cross-contract flowReferences
contracts/campaign/src/lib.rscontracts/rewards/src/lib.rs