The Across Bridge Plugin is a cutting-edge solution that integrates the Across Bridge interoperability protocol with BuildBear Sandboxes. This plugin empowers developers to simulate, test, and deploy cross-chain applications with unmatched speed and cost-efficiency. By leveraging the intent-based framework of Across Bridge, developers gain access to advanced tools for creating seamless cross-chain value transfers within a secure, BuildBear Sandbox environment.
Whether you're developing decentralized applications (dApps) or testing cross-chain solutions, the Across Bridge Plugin offers everything you need to streamline your development process.
Effortlessly transfer assets or data between multiple BuildBear Sandboxes using the Across Bridge protocol. Define, simulate, and execute cross-chain intents securely and efficiently within your Sandbox environment.
On-Chain Relayer Mimic: Simulate real-world or user-defined conditions by configuring whether quotes should reflect real-time on-chain values or mock values for testing purposes.
Intent Fulfillment Delay: Set custom delays for intent fulfillment to simulate varying network conditions and better analyze cross-chain transaction performance.
Create an intent specifying the source chain, destination chain, asset type, and transaction details.
const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"; // Bridge to the same address on the destination chain. // Note: If the depositor is not an EOA then the depositor's address // might not be valid on the destination chain. const depositor = <USER_ADDRESS>; const recipient = depositor; // Test WETH deposit. const inputToken = <ORIGIN_CHAIN_WETH_ADDRESS>; // The 0 address is resolved automatically to the equivalent supported // token on the the destination chain. Any other input/output token // combination should be advertised by the Across API available-routes // endpoint. const outputToken = ZERO_ADDRESS; // The outputAmount is set as the inputAmount - relay fees. // totalRelayFee.total is returned by the BuildBear-Across API suggested-fees // endpoint. const outputAmount = inputAmount.sub(BigNumber.from(response.totalRelayFee.total)); // fillDeadline: A fill deadline of 5 hours. Can be up to // SpokePool.getCurrentTime() + SpokePool.fillDeadlineBuffer() seconds. const fillDeadlineBuffer = 18000; const fillDeadline = Math.round(Date.now() / 1000) + fillDeadlineBuffer; // timestamp is returned by the BuildBear-Across API suggested-fees endpoint. // This should be _at least 2_ mainnet blocks behind the current time // for best service from relayers. const quoteTimestamp = response.timestamp; // Exclusive relayer and exclusivity deadline should be taken from the // Across API suggested-fees response. const exclusivityDeadline = response.exclusivityDeadline; const exclusiveRelayer = response.exclusiveRelayer; // No message will be executed post-fill on the destination chain. // See `Across+ Integration` for more information. const message = "0x";
Call the depositV3 method on the SpokePool of the source Sandbox.
Test various scenarios by adjusting configurations like relayer mimic settings, fulfillment delays, or transaction data to ensure your cross-chain application meets performance and reliability expectations.