Updating the SDK

Each SDK instance instantiated using the SDK factory is upgradable. If a user does not wish to use an upgradable proxy pattern the user can simply find the SDK version they like and instantiate the SDK instance directly. Only the proxy admin can update the SDK (by default this is the SDK instance manager).

Update Process

Update to current version

/// @notice Update SDK to the current factory version.
sdk.updateSdkVersion();

Update to a specific version

/// @notice Update SDK to the a specific version.
/// @dev In this example we fetch the latest SDK version from the factory
/// and set the SDK version to currentVersion - 1.
uint256 newVersion = IOpenflowSdkFactory(sdk.factory()).currentVersion()) - 1;
sdk.updateSdkVersion(versionNumber);

Update to a custom implementation

Important! If you are updating to a custom implementation address do so at your own risk.

It is critical to ensure the storage layout of the updated implementation remains in-tact or else you risk highly unexpected behavior.

/// @notice 
sdk.updateImplementation(newImplementationAddress);

Last updated