Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes during GDA mainnet rollout #1780

Merged
merged 51 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
1944426
make superfluidPoolBeacon part of GeneralDistributionAgreementV1 logic
hellwolf Jan 16, 2024
f229b9c
fix up nft constructor
0xdavinchee Jan 16, 2024
317bad7
update deploy script to latest changes
d10r Jan 16, 2024
301805d
fix gov script
d10r Jan 16, 2024
9f3200e
2-phase GDA bootstrapping
d10r Jan 17, 2024
6c1f47c
pool placeholder contract
d10r Jan 17, 2024
9fec9c8
2-step GDA bootstrapping, fix verification script
d10r Jan 18, 2024
d6779f5
more consistent naming
d10r Jan 18, 2024
fbe9cd8
token update: skip tokens we don't own (not pointing to a previous ca…
d10r Jan 19, 2024
77c6d0f
updated bsc metadata
d10r Jan 19, 2024
53b6242
Merge branch 'dev' into gda-deployment-fixes
d10r Jan 22, 2024
1b3de2c
Merge branch 'dev' into gda-deployment-fixes
d10r Jan 23, 2024
a0055f1
piggyback: added aux contracts to scroll-mainnet metadata
d10r Jan 23, 2024
d687d85
please the linter
d10r Jan 23, 2024
a2eeaaa
metadata changelog
d10r Jan 23, 2024
7231c13
improved verification script
d10r Jan 23, 2024
c9ce6f4
refine deploy script
d10r Jan 23, 2024
56253e8
Merge branch 'dev' into gda-deployment-fixes
d10r Jan 25, 2024
a83ad3a
patch gas settings into truffle contract object, various small ops-sc…
d10r Jan 27, 2024
ba64895
patch gas settings into truffle contract object, various small ops-sc…
d10r Jan 27, 2024
eaed537
fix for local testing
d10r Jan 27, 2024
f2dd1f1
fix gas price for other ops scripts too
d10r Jan 29, 2024
922319f
polygon-mainnet gda and new loader in metadata
d10r Jan 29, 2024
7468d47
smol fix
d10r Jan 29, 2024
87c939d
fix tests
d10r Jan 29, 2024
0fe4da6
smol fixes
d10r Jan 30, 2024
955589d
inlike function for getting gas settings in Framework.js to fix faili…
d10r Jan 30, 2024
f7ede8f
consider new admin override when upgrading SuperTokens
d10r Jan 30, 2024
ec9ea01
Merge branch 'dev' into gda-deployment-fixes
d10r Jan 31, 2024
2c1eb89
fix test failure
d10r Feb 1, 2024
ecd39d2
Merge branch 'dev' into gda-deployment-fixes
d10r Feb 1, 2024
127acec
add forwarders to verification
d10r Feb 1, 2024
91631e5
Merge remote-tracking branch 'origin/dev' into gda-deployment-fixes
hellwolf Feb 5, 2024
e46cd19
refactor SuperfluidFrameworkDeploymentSteps to reduce sizes
hellwolf Feb 6, 2024
699ae0d
[WORKFLOWS] make sure linting happens in more places
hellwolf Feb 6, 2024
bbf188f
[WORKFLOWS] fix the shell script
hellwolf Feb 6, 2024
7fcaaa4
Merge branch 'fix-strict-lint-in-ci' into gda-deployment-fixes
hellwolf Feb 6, 2024
a13ab58
fix typo: SuperfluidGDAv1DeployerLibrary
hellwolf Feb 6, 2024
d541155
fix typo: SuperfluidGDAv1DeployerLibrary
hellwolf Feb 6, 2024
3c8586e
fix build warning SuperfluidPoolPlaceholder.sol
hellwolf Feb 6, 2024
b4c0b80
fixes
hellwolf Feb 6, 2024
4e6c60b
fixes
hellwolf Feb 6, 2024
00fc206
Merge branch 'fix-strict-lint-in-ci' into gda-deployment-fixes
hellwolf Feb 6, 2024
670ec8c
Merge remote-tracking branch 'origin/dev' into gda-deployment-fixes
hellwolf Feb 6, 2024
59963c2
some fixes to
hellwolf Feb 6, 2024
15ce2ca
fix gov.updateContracts
hellwolf Feb 6, 2024
eeab842
already remove the deprecated overloaded method, too much fallout
d10r Feb 6, 2024
82e0787
revert ugly workaround for overloaded (nomore) method
d10r Feb 6, 2024
3acba5e
[WORKFLOW] cleanups to root package.json
hellwolf Feb 7, 2024
b931a6a
audit changelog
0xdavinchee Feb 7, 2024
3690477
Merge branch 'dev' into gda-deployment-fixes
0xdavinchee Feb 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
pragma solidity 0.8.19;

import { SafeCast } from "@openzeppelin/contracts/utils/math/SafeCast.sol";
import { IBeacon } from "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol";

import { ISuperfluid, ISuperfluidGovernance } from "../../interfaces/superfluid/ISuperfluid.sol";
import {
Expand All @@ -21,6 +20,7 @@ import {
IGeneralDistributionAgreementV1,
PoolConfig
} from "../../interfaces/agreements/gdav1/IGeneralDistributionAgreementV1.sol";
import { SuperfluidUpgradeableBeacon } from "../../upgradability/SuperfluidUpgradeableBeacon.sol";
import { ISuperfluidToken } from "../../interfaces/superfluid/ISuperfluidToken.sol";
import { IConstantOutflowNFT } from "../../interfaces/superfluid/IConstantOutflowNFT.sol";
import { ISuperToken } from "../../interfaces/superfluid/ISuperToken.sol";
Expand Down Expand Up @@ -94,11 +94,9 @@ contract GeneralDistributionAgreementV1 is AgreementBase, TokenMonad, IGeneralDi
bytes32 private constant SUPERTOKEN_MINIMUM_DEPOSIT_KEY =
keccak256("org.superfluid-finance.superfluid.superTokenMinimumDeposit");

IBeacon public superfluidPoolBeacon;
SuperfluidUpgradeableBeacon public immutable superfluidPoolBeacon;

constructor(ISuperfluid host) AgreementBase(address(host)) { }

function initialize(IBeacon superfluidPoolBeacon_) external initializer {
constructor(ISuperfluid host, SuperfluidUpgradeableBeacon superfluidPoolBeacon_) AgreementBase(address(host)) {
superfluidPoolBeacon = superfluidPoolBeacon_;
}

Expand Down Expand Up @@ -335,7 +333,7 @@ contract GeneralDistributionAgreementV1 is AgreementBase, TokenMonad, IGeneralDi

_clearPoolConnectionsBitmap(token, msgSender, poolMemberData.poolID);
}

emit PoolConnectionUpdated(token, pool, msgSender, doConnect, currentContext.userData);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity 0.8.19;
import { IERC721Metadata } from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import { IPoolAdminNFT } from "../../interfaces/agreements/gdav1/IPoolAdminNFT.sol";
import { PoolNFTBase } from "./PoolNFTBase.sol";
import { ISuperfluid } from "../../interfaces/superfluid/ISuperfluid.sol";
import { IGeneralDistributionAgreementV1, ISuperfluid } from "../../interfaces/superfluid/ISuperfluid.sol";
import { ISuperfluidPool } from "../../interfaces/agreements/gdav1/ISuperfluidPool.sol";
import { ISuperfluidToken } from "../../interfaces/superfluid/ISuperfluidToken.sol";

Expand All @@ -22,7 +22,7 @@ contract PoolAdminNFT is PoolNFTBase, IPoolAdminNFT {
/// @dev The token id is uint256(keccak256(abi.encode(pool, admin)))
mapping(uint256 => PoolAdminNFTData) internal _poolAdminDataByTokenId;

constructor(ISuperfluid host) PoolNFTBase(host) { }
constructor(ISuperfluid host, IGeneralDistributionAgreementV1 gdaV1) PoolNFTBase(host, gdaV1) { }

// note that this is used so we don't upgrade to wrong logic contract
function proxiableUUID() public pure override returns (bytes32) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity 0.8.19;
import { IERC721Metadata } from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import { IPoolMemberNFT } from "../../interfaces/agreements/gdav1/IPoolMemberNFT.sol";
import { PoolNFTBase } from "./PoolNFTBase.sol";
import { ISuperfluid } from "../../interfaces/superfluid/ISuperfluid.sol";
import { IGeneralDistributionAgreementV1, ISuperfluid } from "../../interfaces/superfluid/ISuperfluid.sol";
import { ISuperfluidPool } from "../../interfaces/agreements/gdav1/ISuperfluidPool.sol";
import { ISuperfluidToken } from "../../interfaces/superfluid/ISuperfluidToken.sol";

Expand All @@ -22,7 +22,7 @@ contract PoolMemberNFT is PoolNFTBase, IPoolMemberNFT {
/// @dev The token id is uint256(keccak256(abi.encode(pool, member)))
mapping(uint256 => PoolMemberNFTData) internal _poolMemberDataByTokenId;

constructor(ISuperfluid host) PoolNFTBase(host) { }
constructor(ISuperfluid host, IGeneralDistributionAgreementV1 gdaV1) PoolNFTBase(host, gdaV1) { }

// note that this is used so we don't upgrade to wrong logic contract
function proxiableUUID() public pure override returns (bytes32) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ pragma solidity 0.8.19;
// solhint-disable-next-line no-unused-import
import { IERC165, IERC721, IERC721Metadata } from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import { UUPSProxiable } from "../../upgradability/UUPSProxiable.sol";
import { ISuperfluid } from "../../interfaces/superfluid/ISuperfluid.sol";
import { IGeneralDistributionAgreementV1, ISuperfluid } from "../../interfaces/superfluid/ISuperfluid.sol";
import { ISuperTokenFactory } from "../../interfaces/superfluid/ISuperTokenFactory.sol";
import { IPoolNFTBase } from "../../interfaces/agreements/gdav1/IPoolNFTBase.sol";
import { IGeneralDistributionAgreementV1 } from "../../interfaces/agreements/gdav1/IGeneralDistributionAgreementV1.sol";

abstract contract PoolNFTBase is UUPSProxiable, IPoolNFTBase {
string public constant DEFAULT_BASE_URI = "https://nft.superfluid.finance/pool/v2/getmeta";
Expand Down Expand Up @@ -68,15 +67,9 @@ abstract contract PoolNFTBase is UUPSProxiable, IPoolNFTBase {
uint256 private _reserve20;
uint256 internal _reserve21;

constructor(ISuperfluid host) {
constructor(ISuperfluid host, IGeneralDistributionAgreementV1 gdaV1) {
HOST = host;
GENERAL_DISTRIBUTION_AGREEMENT_V1 = IGeneralDistributionAgreementV1(
address(
ISuperfluid(host).getAgreementClass(
keccak256("org.superfluid-finance.agreements.GeneralDistributionAgreement.v1")
)
)
);
GENERAL_DISTRIBUTION_AGREEMENT_V1 = gdaV1;
}

function initialize(string memory nftName, string memory nftSymbol)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// SPDX-License-Identifier: AGPLv3
// solhint-disable not-rely-on-time
pragma solidity 0.8.19;

import { BeaconProxiable } from "../../upgradability/BeaconProxiable.sol";

/**
* @title used on first deployment (upgrade case) of GDA
* in order to solve the circular dependency between GDA and SuperfluidPool
*/
contract SuperfluidPoolPlaceholder is BeaconProxiable {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You sure we have to use it instead of just using ZERO_ADDRESS?

nix-shell$ git grep SuperfluidPoolPlaceholder
packages/ethereum-contracts/contracts/agreements/gdav1/SuperfluidPoolPlaceholder.sol:contract SuperfluidPoolPlaceholder is BeaconProxiable {
packages/ethereum-contracts/ops-scripts/deploy-framework.js:        "SuperfluidPoolPlaceholder",
packages/ethereum-contracts/ops-scripts/deploy-framework.js:        SuperfluidPoolPlaceholder,
packages/ethereum-contracts/ops-scripts/deploy-framework.js:            SuperfluidPoolPlaceholder.new,
packages/ethereum-contracts/ops-scripts/deploy-framework.js:            "SuperfluidPoolPlaceholder.new"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need it in order to have a compatible logic:

contract SuperfluidUpgradeableBeacon is UpgradeableBeacon {
...
    function upgradeTo(address newImplementation) public override onlyOwner {
...
        if (BeaconProxiable(newImplementation).proxiableUUID() != BeaconProxiable(implementation()).proxiableUUID()) {
            revert INCOMPATIBLE_LOGIC();
        }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting, checkout the SuperfluidDeployer code, it uses zero address, what's the difference?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there were 2 reasons:

  • don't waste gas for deploying a logic which is then immediately replaced

and more importantly:

  • have all code paths blocked during the intermediate phase with the new agreement registered, but not yet properly set up (if SuperfluidPool.initialize() reverts, then GeneralDistributionAgreementV1.createPool() reverts too, thus we know for sure there's no way to use the agreement to manipulate SuperToken state as long as we're not done with the setup).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can remove this after upgrading all mainnets, not needed for new deployments

// don't allow to create instances of the placeholder
function initialize(address, address, bool ,bool) external pure {
// solhint-disable-next-line reason-string
revert();
}

function proxiableUUID() public pure override returns (bytes32) {
return keccak256("org.superfluid-finance.contracts.SuperfluidPool.implementation");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ abstract contract SuperfluidGovernanceBase is ISuperfluidGovernance
}
}

// @note deprecated: to be removed in the next release
// only exists in order to facilitate the update process
function updateContracts(ISuperfluid, address, address[] calldata, address) external pure {
// solhint-disable-next-line reason-string
revert();
}

function batchUpdateSuperTokenLogic(
ISuperfluid host,
ISuperToken[] calldata tokens
Expand Down
25 changes: 20 additions & 5 deletions packages/ethereum-contracts/contracts/mocks/CFAv1NFTMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
pragma solidity 0.8.19;

import { Strings } from "@openzeppelin/contracts/utils/Strings.sol";
import { ISuperfluid, IConstantInflowNFT, IConstantOutflowNFT } from "../interfaces/superfluid/ISuperfluid.sol";
import {
IConstantFlowAgreementV1,
IGeneralDistributionAgreementV1,
ISuperfluid,
IConstantInflowNFT,
IConstantOutflowNFT
} from "../interfaces/superfluid/ISuperfluid.sol";
import { ConstantOutflowNFT } from "../superfluid/ConstantOutflowNFT.sol";
import { ConstantInflowNFT } from "../superfluid/ConstantInflowNFT.sol";
import { FlowNFTBase } from "../superfluid/FlowNFTBase.sol";
Expand All @@ -17,7 +23,9 @@ contract FlowNFTBaseMock is FlowNFTBase {

mapping(uint256 => FlowNFTData) internal _flowDataByTokenId;

constructor(ISuperfluid host) FlowNFTBase(host) { }
constructor(ISuperfluid host, IConstantFlowAgreementV1 cfaV1, IGeneralDistributionAgreementV1 gdaV1)
FlowNFTBase(host, cfaV1, gdaV1)
{ }

function proxiableUUID() public pure override returns (bytes32) {
return keccak256("org.superfluid-finance.contracts.FlowNFTBaseMock.implementation");
Expand Down Expand Up @@ -57,7 +65,12 @@ contract FlowNFTBaseMock is FlowNFTBase {
}

contract ConstantOutflowNFTMock is ConstantOutflowNFT {
constructor(ISuperfluid host, IConstantInflowNFT constantInflowNFT) ConstantOutflowNFT(host, constantInflowNFT) { }
constructor(
ISuperfluid host,
IConstantFlowAgreementV1 cfaV1,
IGeneralDistributionAgreementV1 gdaV1,
IConstantInflowNFT constantInflowNFT
) ConstantOutflowNFT(host, cfaV1, gdaV1, constantInflowNFT) { }

/// @dev a mock mint function that exposes the internal _mint function
function mockMint(address _superToken, address _to, address _flowReceiver, uint256 _newTokenId) public {
Expand All @@ -83,8 +96,10 @@ contract ConstantOutflowNFTMock is ConstantOutflowNFT {
contract ConstantInflowNFTMock is ConstantInflowNFT {
constructor(
ISuperfluid host,
IConstantFlowAgreementV1 cfaV1,
IGeneralDistributionAgreementV1 gdaV1,
IConstantOutflowNFT constantOutflowNFT
) ConstantInflowNFT(host, constantOutflowNFT) { }
) ConstantInflowNFT(host, cfaV1, gdaV1, constantOutflowNFT) { }

/// @dev a mock mint function to emit the mint Transfer event
function mockMint(address _to, uint256 _newTokenId) public {
Expand All @@ -105,4 +120,4 @@ contract ConstantInflowNFTMock is ConstantInflowNFT {
function mockGetApproved(uint256 _tokenId) public view returns (address) {
return _tokenApprovals[_tokenId];
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// SPDX-License-Identifier: AGPLv3
pragma solidity 0.8.19;

import { ISuperfluid } from "../interfaces/superfluid/ISuperfluid.sol";
import { IConstantFlowAgreementV1, IGeneralDistributionAgreementV1, ISuperfluid }
from "../interfaces/superfluid/ISuperfluid.sol";
import { ConstantInflowNFT, IConstantInflowNFT } from "../superfluid/ConstantInflowNFT.sol";
import { ConstantOutflowNFT, IConstantOutflowNFT } from "../superfluid/ConstantOutflowNFT.sol";
import { FlowNFTBase } from "../superfluid/FlowNFTBase.sol";
Expand All @@ -16,9 +17,10 @@ import { IStorageLayoutBase } from "./IStorageLayoutBase.sol";
/// @notice A mock FlowNFTBase contract for testing storage layout.
/// @dev This contract *MUST* have the same storage layout as FlowNFTBase.sol
contract FlowNFTBaseStorageLayoutMock is FlowNFTBase, IStorageLayoutBase {
constructor(
ISuperfluid host
) FlowNFTBase(host) {}

constructor(ISuperfluid host, IConstantFlowAgreementV1 cfaV1, IGeneralDistributionAgreementV1 gdaV1)
FlowNFTBase(host, cfaV1, gdaV1)
{ }

/// @notice Validates storage layout
/// @dev This function is used by all the FlowNFTBase mock contracts to validate the layout
Expand Down Expand Up @@ -94,8 +96,10 @@ contract ConstantInflowNFTStorageLayoutMock is ConstantInflowNFT, IStorageLayout

constructor(
ISuperfluid host,
IConstantFlowAgreementV1 cfaV1,
IGeneralDistributionAgreementV1 gdaV1,
IConstantOutflowNFT constantOutflowNFT
) ConstantInflowNFT(host, constantOutflowNFT) {}
) ConstantInflowNFT(host, cfaV1, gdaV1, constantOutflowNFT) { }

/// @notice Validates storage layout
/// @dev This function is used to validate storage layout of ConstantInflowNFT
Expand Down Expand Up @@ -145,8 +149,10 @@ contract ConstantOutflowNFTStorageLayoutMock is ConstantOutflowNFT, IStorageLayo

constructor(
ISuperfluid host,
IConstantFlowAgreementV1 cfaV1,
IGeneralDistributionAgreementV1 gdaV1,
IConstantInflowNFT constantInflowNFT
) ConstantOutflowNFT(host, constantInflowNFT) {}
) ConstantOutflowNFT(host, cfaV1, gdaV1, constantInflowNFT) { }

/// @notice Validates storage layout
/// @dev This function is used to validate storage layout of ConstantOutflowNFT
Expand Down
8 changes: 4 additions & 4 deletions packages/ethereum-contracts/contracts/mocks/PoolNFTMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
pragma solidity 0.8.19;

import { Strings } from "@openzeppelin/contracts/utils/Strings.sol";
import { ISuperfluid } from "../interfaces/superfluid/ISuperfluid.sol";
import { IGeneralDistributionAgreementV1, ISuperfluid } from "../interfaces/superfluid/ISuperfluid.sol";
import { PoolAdminNFT } from "../agreements/gdav1/PoolAdminNFT.sol";
import { PoolMemberNFT } from "../agreements/gdav1/PoolMemberNFT.sol";
import { PoolNFTBase } from "../agreements/gdav1/PoolNFTBase.sol";
Expand All @@ -13,7 +13,7 @@ contract PoolNFTBaseMock is PoolNFTBase {

mapping(uint256 => address) private _owners;

constructor(ISuperfluid host) PoolNFTBase(host) { }
constructor(ISuperfluid host, IGeneralDistributionAgreementV1 gdaV1) PoolNFTBase(host, gdaV1) { }

function proxiableUUID() public pure override returns (bytes32) {
return keccak256("org.superfluid-finance.contracts.PoolNFTBaseMock.implementation");
Expand Down Expand Up @@ -52,7 +52,7 @@ contract PoolNFTBaseMock is PoolNFTBase {
}

contract PoolAdminNFTMock is PoolAdminNFT {
constructor(ISuperfluid host) PoolAdminNFT(host) { }
constructor(ISuperfluid host, IGeneralDistributionAgreementV1 gdaV1) PoolAdminNFT(host, gdaV1) { }

/// @dev a mock mint function that exposes the internal _mint function
function mockMint(address _pool) public {
Expand All @@ -71,7 +71,7 @@ contract PoolAdminNFTMock is PoolAdminNFT {
}

contract PoolMemberNFTMock is PoolMemberNFT {
constructor(ISuperfluid host) PoolMemberNFT(host) { }
constructor(ISuperfluid host, IGeneralDistributionAgreementV1 gdaV1) PoolMemberNFT(host, gdaV1) { }

/// @dev a mock mint function that exposes the internal _mint function
function mockMint(address _pool, address _member) public {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
pragma solidity 0.8.19;

import { PoolNFTBase } from "../agreements/gdav1/PoolNFTBase.sol";
import { ISuperfluid } from "../interfaces/superfluid/ISuperfluid.sol";
import { IGeneralDistributionAgreementV1, ISuperfluid } from "../interfaces/superfluid/ISuperfluid.sol";
import { PoolMemberNFT } from "../agreements/gdav1/PoolMemberNFT.sol";
import { PoolAdminNFT } from "../agreements/gdav1/PoolAdminNFT.sol";
import { IStorageLayoutBase } from "./IStorageLayoutBase.sol";

contract PoolNFTBaseStorageLayoutMock is PoolNFTBase, IStorageLayoutBase {
constructor(ISuperfluid host) PoolNFTBase(host) { }
constructor(ISuperfluid host, IGeneralDistributionAgreementV1 gdaV1) PoolNFTBase(host, gdaV1) { }

function validateStorageLayout() public virtual {
uint256 slot;
Expand Down Expand Up @@ -72,7 +72,7 @@ contract PoolNFTBaseStorageLayoutMock is PoolNFTBase, IStorageLayoutBase {
}

contract PoolAdminNFTStorageLayoutMock is PoolAdminNFT, IStorageLayoutBase {
constructor(ISuperfluid host) PoolAdminNFT(host) { }
constructor(ISuperfluid host, IGeneralDistributionAgreementV1 gdaV1) PoolAdminNFT(host, gdaV1) { }

function validateStorageLayout() public virtual {
uint256 slot;
Expand Down Expand Up @@ -112,7 +112,7 @@ contract PoolAdminNFTStorageLayoutMock is PoolAdminNFT, IStorageLayoutBase {
}

contract PoolMemberNFTStorageLayoutMock is PoolMemberNFT, IStorageLayoutBase {
constructor(ISuperfluid host) PoolMemberNFT(host) { }
constructor(ISuperfluid host, IGeneralDistributionAgreementV1 gdaV1) PoolMemberNFT(host, gdaV1) { }

function validateStorageLayout() public virtual {
uint256 slot;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
pragma solidity 0.8.19;

import { IERC721Metadata } from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import { IGeneralDistributionAgreementV1 } from "../interfaces/agreements/gdav1/IGeneralDistributionAgreementV1.sol";
import { IConstantFlowAgreementV1 } from "../interfaces/agreements/IConstantFlowAgreementV1.sol";
import { IConstantOutflowNFT } from "../interfaces/superfluid/IConstantOutflowNFT.sol";
import { IConstantInflowNFT } from "../interfaces/superfluid/IConstantInflowNFT.sol";
import { ISuperfluid } from "../interfaces/superfluid/ISuperfluid.sol";
Expand All @@ -15,7 +17,12 @@ contract ConstantInflowNFT is FlowNFTBase, IConstantInflowNFT {
IConstantOutflowNFT public immutable CONSTANT_OUTFLOW_NFT;

// solhint-disable-next-line no-empty-blocks
constructor(ISuperfluid host, IConstantOutflowNFT constantOutflowNFT) FlowNFTBase(host) {
constructor(
ISuperfluid host,
IConstantFlowAgreementV1 cfaV1,
IGeneralDistributionAgreementV1 gdaV1,
IConstantOutflowNFT constantOutflowNFT
) FlowNFTBase(host, cfaV1, gdaV1) {
CONSTANT_OUTFLOW_NFT = constantOutflowNFT;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ pragma solidity 0.8.19;

import { IERC721Metadata } from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import { ISuperfluidToken } from "../interfaces/superfluid/ISuperfluidToken.sol";
import { IGeneralDistributionAgreementV1 } from "../interfaces/agreements/gdav1/IGeneralDistributionAgreementV1.sol";
import { IConstantFlowAgreementV1 } from "../interfaces/agreements/IConstantFlowAgreementV1.sol";
import { IConstantInflowNFT } from "../interfaces/superfluid/IConstantInflowNFT.sol";
import { IConstantOutflowNFT } from "../interfaces/superfluid/IConstantOutflowNFT.sol";
import { ISuperfluid } from "../interfaces/superfluid/ISuperfluid.sol";
Expand All @@ -22,7 +24,12 @@ contract ConstantOutflowNFT is FlowNFTBase, IConstantOutflowNFT {
mapping(uint256 => FlowNFTData) internal _flowDataByTokenId;

// solhint-disable-next-line no-empty-blocks
constructor(ISuperfluid host, IConstantInflowNFT constantInflowNFT) FlowNFTBase(host) {
constructor(
ISuperfluid host,
IConstantFlowAgreementV1 cfaV1,
IGeneralDistributionAgreementV1 gdaV1,
IConstantInflowNFT constantInflowNFT
) FlowNFTBase(host, cfaV1, gdaV1) {
CONSTANT_INFLOW_NFT = constantInflowNFT;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,22 +95,10 @@ abstract contract FlowNFTBase is UUPSProxiable, IFlowNFTBase {
uint256 private _reserve20;
uint256 internal _reserve21;

constructor(ISuperfluid host) {
constructor(ISuperfluid host, IConstantFlowAgreementV1 cfaV1, IGeneralDistributionAgreementV1 gdaV1) {
HOST = host;
CONSTANT_FLOW_AGREEMENT_V1 = IConstantFlowAgreementV1(
address(
ISuperfluid(host).getAgreementClass(
keccak256("org.superfluid-finance.agreements.ConstantFlowAgreement.v1")
)
)
);
GENERAL_DISTRIBUTION_AGREEMENT_V1 = IGeneralDistributionAgreementV1(
address(
ISuperfluid(host).getAgreementClass(
keccak256("org.superfluid-finance.agreements.GeneralDistributionAgreement.v1")
)
)
);
CONSTANT_FLOW_AGREEMENT_V1 = cfaV1;
GENERAL_DISTRIBUTION_AGREEMENT_V1 = gdaV1;
}

function initialize(string memory nftName, string memory nftSymbol)
Expand Down
Loading
Loading