Integration with funding sources

To integrate with funding sources clrfund needs a permanent matching pool address.

Example 1: A crypto system with continuous token issuance (similar to 1Hive), where community wants to allocate some portion of issued tokens using quadratic funding protocol.
Example 2: A community formed around DeFi protocol wants to use some portion of collected fees to fund public goods.

One way to achieve this is to keep matcing funds in a standalone matching pool contract that is controlled by the funding source (as suggested earlier in another thread).

The interface of the matching pool contract may look like this:

interface IMatchingPool {

  function transferFunds(address _token, address _recipient) external;
}

The FundingRoundFactory should call transferFunds() method when the funding round is finalized to transfer funds from the matching pool to the funding round contract (_recipient). The funding source can control who is allowed to call transferFunds() and implement arbitrary logic inside it. For example they can limit the rate of transfers or automatically exchange their token to round’s native token (_token). They can also switch to another clrfund instance in case of upgrade or attack.

If you are interested in integrating with clrfund, please give your feedback :slight_smile:

1 Like

Should the interface also include function getClaimable(address _token, address _recipient) so that an address can know how much it can actually claim before calling transferFuns()?

Could you give an example of its usage?

Here’s how I imagine FundingRoundFactory will call the matching pool contract at the end of the round:

...
FundingRound currentRound = getCurrentRound();
try matchingPool.transferFunds(address(currentRound.nativeToken()), address(currentRound)) {
} catch { }
currentRound.finalize(...);
...

We can also pull matching funds from multiple sources.

Yeah, so I’m imagining a scenario where each round the factory pulls funds from multiple sources.

Before calling transferFunds(), it would be good to know that each funding source will emit more value than it costs to claim the funds.

I think we should simply use standard ERC20 methods allowance() and transferFrom(). The big advantage is that it will allow us to pull funds from any contract or EOA.

1 Like

The Owner will be able to add and remove funding sources from which factory will pull matching funds at the end of each round. Any eth address with pre-approved tokens can be a funding source.

1 Like