UX Illustration

A high level visualization of a user sequence

https://www.notion.so/superfluidhq/UX-Illustration-Old-bd75630bdcf640e2be1036fdb2ca5782


Specification

Niflot.sol

Imports

import { ERC721 } from "@openzeppelin/contracts/token/ERC721/ERC721.sol";

import { ISuperfluid, ISuperToken } from "@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/ISuperfluid.sol";

import {IConstantFlowAgreementV1} from "@superfluid-finance/ethereum-contracts/contracts/interfaces/agreements/IConstantFlowAgreementV1.sol";

import {CFAv1Library} from "@superfluid-finance/ethereum-contracts/contracts/apps/CFAv1Library.sol";

Inheritance

Is ERC721

Structs

struct niflotStatus {
	ISuperToken salaryToken,
	address sender,
	address receiver,
	uint256 duration,
	uint256 endTimeStamp,
	bool deactivated
}

State Variables

Events

// Token ID to info on the Niflot with Token ID
mapping(uint256 => niflotStatus) tokenIdToNiflotStatus;

// Whether account has minted a Niflot against the salary stream
// Used to prevent receiver from having multiple Niflot against same salary stream
mapping(address => bool) receiverHasActiveNiflot;

// The Niflot that an account possesses. Zero if none
// Used to prevent account from minting a Niflot against income from acquired Niflot
mapping(address => uint256) accountHasAcquiredNiflot;

// [RENAME!] Super Tokens acceptable for Niflot contract
mapping(ISuperToken => bool) acceptedSalaryTokens;

uint256 public tokenIds;

address public owner;
event NewNiflot(uint indexed tokenId, address indexed affiliate);
event NiflotDeactivated(uint tokenId);

Constructor

**constructor(ISuperfluid host, address owner)**

Description: Initialize CFAv1Library for us to easily use CFA functions in contract and set contract owner for permissions.