Repository navigation
Conversation
Adds a PancakeSwap Infinity hook that integrates Spraay Protocol's on-chain batch payment contract, enabling pool operators to push-distribute tokens (ERC-20 and native BNB/ETH) to up to 200 recipients in a single transaction. Supports BNB Chain and Base. - src/pool-cl/batch-distribute/BatchDistributeHook.sol - Deploy scripts and chain configs for BSC and Base mainnet - 26 unit tests + 2 live fork tests (all passing) - No existing files modified
Author
|
Cross-link: the same push-model
The Solidity logic is identical to this PR; only the hook harness changed (V4 encodes permissions in the hook address instead of Other DEX integrations: sushi-labs/sushiswap#2324, balancer/scaffold-balancer-v3#138 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
BatchDistributeHookthat connects Spraay Protocol's on-chain batch payment contract to PancakeSwap Infinity, giving pool operators push-model token distribution — send ERC-20 tokens or native BNB/ETH to up to 200 recipients in one transaction.This hook is now part of the
@spraay/dex-adaptersSDK on npm, which provides a unified TypeScript interface for batch distribution across DEXes (PancakeSwap, SushiSwap, and direct Spraay calls). Developers can integrate without touching Solidity:The SDK handles deployment, operator management, pool registration, fee calculation, allowance checks, and simulation — all through the same
distribute/distributeEqual/estimateCostinterface shared across adapters.Source: github.com/plagtech/spraay-dex-adapters
How it works
batchDistributeorbatchDistributeEqualon the hook, which forwards to Spraay's verifiedsprayToken/sprayETH/sprayEqualcontractsafterInitializeregisters pools;afterDonateemitsDonationReceivedevents for indexer correlationamount + feefrom the operator, approves Spraay, and calls it in the same transaction. Nothing stays in the hookFiles added
This PR adds files only — no existing files are modified.
src/pool-cl/batch-distribute/BatchDistributeHook.sol— hook contractsrc/pool-cl/batch-distribute/interfaces/ISpraay.sol— Spraay interface (matches deployed bytecode)src/pool-cl/batch-distribute/SpraayAddresses.sol— verified contract addressesscript/06_DeployBatchDistributeHook.s.sol+ config files — deployment scripts for BNB Chain and Basetest/pool-cl/BatchDistributeHook.t.sol— 26 unit teststest/pool-cl/BatchDistributeHook.fork.t.sol— 2 fork tests against live Spraay contractsSupported chains
Test plan
Disclosure
I am the author of Spraay Protocol. This PR and the
## Summary@spraay/dex-adaptersSDK are offered as open-source tooling for the PancakeSwap ecosystem.Adds a
BatchDistributeHookthat connects [Spraay Protocol](https://spraay.app)'s on-chain batch payment contract to PancakeSwap Infinity, giving pool operators push-model token distribution — send ERC-20 tokens or native BNB/ETH to up to 200 recipients in one transaction.This hook is now part of the
[@spraay/dex-adapters](https://www.npmjs.com/package/@spraay/dex-adapters)SDK on npm, which provides a unified TypeScript interface for batch distribution across DEXes (PancakeSwap, SushiSwap, and direct Spraay calls). Developers can integrate without touching Solidity:The SDK handles deployment, operator management, pool registration, fee calculation, allowance checks, and simulation — all through the same
distribute/distributeEqual/estimateCostinterface shared across adapters.Source: [github.com/plagtech/spraay-dex-adapters](https://github.com/plagtech/spraay-dex-adapters)
How it works
batchDistributeorbatchDistributeEqualon the hook, which forwards to Spraay's verifiedsprayToken/sprayETH/sprayEqualcontractsafterInitializeregisters pools;afterDonateemitsDonationReceivedevents for indexer correlationamount + feefrom the operator, approves Spraay, and calls it in the same transaction. Nothing stays in the hookFiles added
This PR adds files only — no existing files are modified.
src/pool-cl/batch-distribute/BatchDistributeHook.sol— hook contractsrc/pool-cl/batch-distribute/interfaces/ISpraay.sol— Spraay interface (matches deployed bytecode)src/pool-cl/batch-distribute/SpraayAddresses.sol— verified contract addressesscript/06_DeployBatchDistributeHook.s.sol+ config files — deployment scripts for BNB Chain and Basetest/pool-cl/BatchDistributeHook.t.sol— 26 unit teststest/pool-cl/BatchDistributeHook.fork.t.sol— 2 fork tests against live Spraay contractsSupported chains
0x3093a2951FB77b3beDfB8BA20De645F7413432C10x1646452F98E36A3c9Cfc3eDD8868221E207B5eECTest plan
Disclosure
I am the author of Spraay Protocol. This PR and the
@spraay/dex-adaptersSDK are offered as open-source tooling for the PancakeSwap ecosystem.