Bounty: Add SuperFluid Integration - 200 OP Reward
kamescg opened this issue Β· 8 comments
π¨βπ» User Story
As a Web3 developer I want to include "streaming" money features in my Web3 applications.
More specifically I want to use SuperFluid to easily send, delete and unwrap payments using the Super Token standard. The Super Token standard can wrap an existing ERC20 token or as a standalone ERC20 token with the Super Token enhancements.
π Disclaimer
To be eligible for the payout you must first get approval to work on the bounty.
- Join the β‘οΈTurboETH Discord channel
- Introduce yourself in the
general
channel - Announce your interest in the
bounty
channel
It's recommended to share a link to your personal Github account.
𧱠Project
Create a SuperFluid SDK integration for TurboETH. The SuperFluid integration should allow developers to easily start, claim and stop money flows.
Required Functionality:
Developer Tasks:
The SuperFluid integration requires both adding the core integration files and updating the demo application to showcase the SuperFluid features.
Integration
- Create Hook -
superlfuid/hooks/use-superfluid-with-wagmi-provider.ts
- Create Send Flow Component -
superlfuid/components/form-send-flow.tsx
- Create Delete Flow Component -
superlfuid/components/form-delete-flow.tsx
- Create Unwrap Component -
superlfuid/components/form-unwrap-super-token.tsx
The form-send-flow.tsx
component should wrap the createFlow
method.
The form-delete-flow.tsx
component should stop the flow using the deleteFlow
method.
The form-unwrap-super-token.tsx
component should unwrap the Super Token for the underlying asset.
Application
- Create Send Page -
app/(general)/integrations/superfluid/send/page.tsx
- Create Delete Page -
app/(general)/integrations/superfluid/delete/page.tsx
- Create Balance Page -
app/(general)/integrations/superfluid/balance/page.tsx
Developer Instructions
Form components should use react-hook-form
and zod
for form submission management and creating the component Typescript interfaces and types.
Reference of what the form should use:
https://ui.shadcn.com/docs/forms/react-hook-form
SuperFluid documentation uses Web3Modal
and ethers
packages in the "Initialization" section.
https://docs.superfluid.finance/superfluid/developers/sdk-core/sdk-core-initialization#operations
When integrating SuperFluid in TurboETH use the primary wallet connection manager and utility library: wagmi
and viem
.
A hook should be created to integrate SuperFluid with wagmi
.
The hook should look something like the code snippet below.
// use-superfluid-with-wagmi-provider.tsx
import { useEffect, useMemo, useState } from "react";
import { useChainId, useSigner } from "wagmi";
import { Framework } from "@superfluid-finance/sdk-core";
export function useSuperFluidWithWagmiProvider() {
const { data } = useSigner();
const chainId = useChainId();
return useMemo(async () => {
if (!data?.provider) return;
const sf = await Framework.create({
chainId: chainId,
provider: data?.provider?.provider, // this is the injected provider
});
}, []);
}
Potential File Structure
Integration
The SuperFluid integration should be added to the integrations/superfluid
folder.
integrations/superfluid
ββ components/
β ββ form-send-flow.tsx
β ββ form-stop-flow.tsx
β ββ form-unwrap-super-token.tsx
ββ hooks/
β ββ use-superfluid-with-wagmi-provider.ts
β ββ **/*.ts
ββ utils/
β ββ **/*.ts
ββ README.md
Application
The application pages should be added to the app/(general)/integrations/superfluid
folder.
app/(general)/integrations/superfluid
ββ start-flow
β ββ page.tsx
ββ stop-flow
β ββ page.tsx
ββ balance
β ββ page.tsx
π° Bounty Reward
The bounty reward is 225 OP tokens and TurboETH DevPass digital collectible.
TurboETH is the recipient of 18,271.88 OP Tokens from Optimism Retroactive Public Goods Funding. OP tokens earned from RPGF are helping fund TurboETH bounties.
Bonus: 50 OP will be awarded if flux.paradigm.xyz is used to help generate the template code in a meaningful way. Exported conversations must be made available to be eligible for the bonus reward.
Notice
The final integration may not resemble the proposed integration - that's O.K - a natural part of software development.
During development you might discover an original hypothesis doesn't make sense. No problem. Make a comment and clearly explain why a new approach is better than old one. Get rewarded for thinking out of the box.
The final bounty reward can be increased to match new bounty tasks.
Resources
- β‘οΈ TurboETH
- Overview - http://docs.turboeth.xyz
- π SuperFluid
- Application - https://superfluid.finance
- Documentation - https://docs.superfluid.finance/superfluid/developers/sdk-core
- Create Flow - https://docs.superfluid.finance/superfluid/developers/constant-flow-agreement-cfa/cfa-operations/write-methods/createflow
- Delete Flow - https://docs.superfluid.finance/superfluid/developers/constant-flow-agreement-cfa/cfa-operations/write-methods/deleteflow
Typo: "The form-delete-flow.tsx component should wrap the createFlow method."
Should say: "The form-delete-flow.tsx component should wrap the deleteFlow method."
@sunnyjaycer great catch π thank you. fixed.
interested
interested
Hey, there! I've started working on this. Can anyone please confirm it's not assigned to anyone else?
Hello,
I am interested in working on this, I have worked on many Superfluid related projects, and contributed to the Superfluid Console as well, from what I see in the specification you have done a good amount of research and everything makes sense.
@sunnyjaycer is a good reference, and you can check my Github.
============
I was reading through the spec, and noticed that you guys are missing a few things that are necessary for this to be a smooth complete experience.
- Changing stream amount <- good to have
- Wrapping ERC20s to supertokens (you only have unwrap listed in scope) <- very important
- Querying the SF subgraph to get all the users streams so they can view/edit/cancel them <- very important
- Including a source for the tokens (the SF tokenList) <- very important
@marthendalnunes is there a PR for this? I don't see the feature live