跳到主要内容

Data source

What everyone needs to know

  • A data source contract is a way of providing extensions to a treasury that either override or augment the default JBPayoutRedemptionPaymentTerminal3_1_1 functionality.
  • A data source contract can be used to provide custom data to the JBPayoutRedemptionPaymentTerminal3_1_1.pay(...) transaction and/or the JBPayoutRedemptionPaymentTerminal3_1_1.redeemTokensOf(...) transaction.
  • A data source is passed contextual information from the transactions, from which it can derive custom data for the protocol to use to affect subsequent behaviors in the pay and redeem transactions. Contextual information from the pay transaction is passed to the data source in the form of JBPayParamsData , and contextual information from the redeem transaction is passed to the data source in the form of JBRedeemParamsData.
  • Data sources can revert under custom circumstances, which can be used to create a gated treasury, max token supply, min contribution amount, etc.
  • A data source is responsible for specifying any delegate hooks that should be triggered after the core functionality of a pay(...) or redeemTokensOf(...) transaction executes successfully.
  • Each IJBPaymentTerminal fork can leverage data sources in unique ways.

What you'll want to know if you're building

Get started building data sources.