SBAs allows any platform on the Celo blockchain to on board their users trough subscriptions that include the ability to mint some credits (ERC20) to the user based on the amount of super tokens being streamed. These features allow flexible tiers based subscriptions with an smooth on boarding.
Under the hood, our SBA Manager smart contract (SBAM) takes care of everything. The SBAM itself is a SuperApp and an ERC20 token that has the ability to call an ERC6551Registry and create Token Bound Accounts (TBAs). These TBAs are bound to the OutflowNFT* that is minted whenever every CFA starts and destroyed after ends the CFA. This way we can ensure that the user is only able to access their SBA while he/she continues streaming to the SBAM aka being a subscriptor. After cancel an stream, any user may recover access to their SBA just starting a new stream.
*Since GoodDollar does not implement the CIF/COF NFTs, we have deployed a custom one that is called from the SBAM leveraging SuperApp callbacks
The main problem I encountered is that GoodDollar does not implement the Outflow and Inflow NFTs, so I had to implement my own simplified version of the Outflow NFT. Another great challenge was the constraints of ERCs, protocols and chains. Thought, every piece of the puzzle finally find its place.
Technologies used
Discussion