Initialize the SDK

Import the SDK interface

Importing the SDK interface will allow you to quickly access the Openflow SDK factory and create an SDK instance.

import "openflow-contracts@0.0.1/src/interfaces/IOpenflow.sol";    

Create a new SDK instance

When the SDK instance is instantiated an SDK instance manager must be passed to the constructor. The instance manager is responsible for configuring the SDK. The instance manager can also perform swaps by calling out to the instance directly.

address sdkInstanceManager = msg.sender;
IOpenflowSdk sdk = IOpenflowFactory(_openflowFactory).newSdkInstance(
    sdkInstanceManager
);

Last updated