Contracts
Specifications
A contract can become a treasury pay delegate by adhering to ISnowconePayDelegate3_1_1:
interface ISnowconePayDelegate3_1_1 is IERC165 {
function didPay(SnowconeDidPayData3_1_1 calldata data) external payable;
}
When extending pay functionality with a delegate, the protocol will pass a SnowconeDidPayData3_1_1 to the didPay(...) function:
struct SnowconeDidPayData3_1_1 {
address payer;
uint256 projectId;
uint256 currentFundingCycleConfiguration;
SnowconeTokenAmount amount;
SnowconeTokenAmount forwardedAmount;
uint256 projectTokenCount;
address beneficiary;
bool preferClaimedTokens;
string memo;
bytes dataSourceMetadata;
bytes payerMetadata;
}
struct SnowconeTokenAmount {
address token;
uint256 value;
uint256 decimals;
uint256 currency;
}
The msg.sender to the delegate will be the payment terminal that facilitated the payment.
In payment terminals based on the SnowconePayoutRedemptionPaymentTerminal3_1_1, such as SnowconeETHPaymentTerminal3_1_1's and SnowconeERC20PaymentTerminal3_1_1's, the pay delegate hook gets called after the project's tokens have been minted and distributed. View the docs.
Ensure to only allow trusted contracts to access the didPay(...) transaction.
Attaching
New delegate contracts should be deployed independently. Once deployed, its address can be returned from a data source hook. See how to build a data source for more.
Examples
Last updated
Was this helpful?