If you have built a custom Substrate-based chain and added Substrate pallets to enable on-chain governance (i.e. pallet_democracy, pallet_referenda).
How would you split the costs between participants of an on-chain governance proposal if it passes?
Since transaction fees are payed at the moment that you create or vote on a proposal I think only way to split the costs would be to calculate it after the proposal passes, and then have the treasury send refunds directly to the creator and voter accounts of that proposal or give them credit that they may claim.
So I think there would need to be function in the
on_finalize method of a custom pallet that detects when a proposal passes, calculate the overall amount spent on transaction fees by the creator and voter accounts, and then split that overall amount evenly across the list of accounts, and send the refund or setup a way for them to claim it.