Skip to content

Commit

Permalink
removes superfluid from life
Browse files Browse the repository at this point in the history
  • Loading branch information
parseb committed May 15, 2022
1 parent 86bd194 commit aa2bcd2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 61 deletions.
61 changes: 2 additions & 59 deletions contracts/CashCow.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "../interfaces/IUniswapV2Interfaces.sol";

import "parseb/[email protected]/contracts/interfaces/superfluid/ISuperfluid.sol";
import "parseb/[email protected]/contracts/interfaces/agreements/IConstantFlowAgreementV1.sol";

import "parseb/[email protected]/contracts/apps/CFAv1Library.sol";
import "parseb/[email protected]/contracts/interfaces/superfluid/ISuperTokenFactory.sol";
// import "parseb/[email protected]/contracts/interfaces/superfluid/ISuperToken.sol";


contract CashCow is ERC721("Cash Cow Quest", "COWQ") {
uint256 immutable MAXUINT = type(uint256).max - 1;
Expand All @@ -28,12 +21,6 @@ contract CashCow is ERC721("Cash Cow Quest", "COWQ") {
address public immutable sweeper;
uint256 public tempId;

/// superfluid
using CFAv1Library for CFAv1Library.InitData;
CFAv1Library.InitData public cfaV1;
address SFtokenFactory;
ISuperfluid host;


//// Errors
error TokenTransferFailed(address _token, uint256 _amount);
Expand All @@ -51,29 +38,15 @@ contract CashCow is ERC721("Cash Cow Quest", "COWQ") {
address _dai,
address _unifactory,
address _v2Router,
address _sweepTo,
address _superfluidHost,
address _superfluidTokenFactory
address _sweepTo
) {
UniFactory = IUniswapV2Factory(_unifactory);
V2Router = IUniswapV2Router01(_v2Router);
DAI = IERC20(_dai);
DAI.approve(_v2Router, MAXUINT);
sweeper = _sweepTo;
tempId = 1;

host = ISuperfluid(_superfluidHost);
SFtokenFactory = _superfluidTokenFactory;

cfaV1 = CFAv1Library.InitData(
host,
//here, we are deriving the address of the CFA using the host contract
IConstantFlowAgreementV1(
address(host.getAgreementClass(
keccak256("org.superfluid-finance.agreements.ConstantFlowAgreement.v1")
))
)
);

}

struct Cow {
Expand Down Expand Up @@ -263,37 +236,7 @@ contract CashCow is ERC721("Cash Cow Quest", "COWQ") {
returns (bool s)
{
Cow memory cow = cashCowById[_dealId];

// ISuperTokenFactory TF = ISuperTokenFactory(SFtokenFactory);

ISuperTokenFactory factory = host.getSuperTokenFactory();

factory.createERC20Wrapper(
IERC20(cashCowById[_dealId].owners[3]),
18,
1,
"FluidCow",
"aCow"
);
// ISuperToken t= ISuperTokenFactory(SFtokenFactory).createERC20Wrapper(
// IERC20(cashCowById[_dealId].owners[3]),
// 18,
// 1,
// "FluidCow",
// "aCow"
// );

// ISuperToken t = ISuperToken(cow.owners[3]);
//int96 tokensPerSecond = cow.amounts[2] / (cow.vestStartEnd[1] - cow.vestStartEnd[0]);
// // with optional user data

// createFlow(msg.sender, ISuperToken , 33342, bytes("cow"));
// cfaV1.updateFlow(receiver, token, flowRate, userData);
// cfaV1.deleteFlow(sender, receiver, token, userData);

// receiver - the address of the receiver
// token - the ISuperToken used in the flow
// flowRate - an int96 variable which represents the total amount of the token you'd like to send per second, denominated in wei

}

Expand Down
1 change: 0 additions & 1 deletion tests/0_default_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ def test_happy_cow(CCOW, DAI, VC):
assert sfToken.balanceOf(accounts[4].address) == 0
CCOW.VestDeal(1, {'from': accounts[4]})
chain.sleep(3342 * 10)
assert sfToken.balanceOf(accounts[4].address) > 0



Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def isPolygon():

@pytest.fixture
def CCOW():
deployed1 = CashCow.deploy(DAI_ADDR, V3Factory, sushiV2Router, sweeper, polygon_superfluidHost, polygon_supertokenfactory, {'from': accounts[0]})
deployed1 = CashCow.deploy(DAI_ADDR, V3Factory, sushiV2Router, sweeper, {'from': accounts[0]})
return deployed1

@pytest.fixture
Expand Down

0 comments on commit aa2bcd2

Please sign in to comment.