Skip to content

Commit

Permalink
done
Browse files Browse the repository at this point in the history
  • Loading branch information
mejango committed Sep 11, 2023
1 parent 9883fda commit d3d80aa
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 20 deletions.
18 changes: 5 additions & 13 deletions contracts/JBController3_2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,13 @@ contract JBController3_2 is JBOperatable, ERC165, IJBController3_2, IJBMigratabl
/// @param _owner The address to set as the owner of the project. The project ERC-721 will be owned by this address.
/// @param _projectMetadata Metadata to associate with the project within a particular domain. This can be updated any time by the owner of the project.
/// @param _configurations The funding cycle configurations to schedule.
/// @param _mustStartAtOrAfter The time before which the configured funding cycle cannot start.
/// @param _terminals Payment terminals to add for the project.
/// @param _memo A memo to pass along to the emitted event.
/// @return projectId The ID of the project.
function launchProjectFor(
address _owner,
JBProjectMetadata calldata _projectMetadata,
JBFundingCycleConfiguration[] calldata _configurations,
uint256 _mustStartAtOrAfter,
IJBPaymentTerminal[] memory _terminals,
string memory _memo
) external virtual override returns (uint256 projectId) {
Expand All @@ -265,7 +263,7 @@ contract JBController3_2 is JBOperatable, ERC165, IJBController3_2, IJBMigratabl
_directory.setControllerOf(projectId, address(this));

// Configure the first funding cycle.
uint256 _configuration = _configure(projectId, _configurations, _mustStartAtOrAfter);
uint256 _configuration = _configure(projectId, _configurations);

// Add the provided terminals to the list of terminals.
if (_terminals.length > 0) _directory.setTerminalsOf(projectId, _terminals);
Expand All @@ -278,14 +276,12 @@ contract JBController3_2 is JBOperatable, ERC165, IJBController3_2, IJBMigratabl
/// @dev Only a project owner or operator can launch its funding cycles.
/// @param _projectId The ID of the project to launch funding cycles for.
/// @param _configurations The funding cycle configurations to schedule.
/// @param _mustStartAtOrAfter The time before which the configured funding cycle cannot start.
/// @param _terminals Payment terminals to add for the project.
/// @param _memo A memo to pass along to the emitted event.
/// @return configured The configuration timestamp of the funding cycle that was successfully reconfigured.
function launchFundingCyclesFor(
uint256 _projectId,
JBFundingCycleConfiguration[] calldata _configurations,
uint256 _mustStartAtOrAfter,
IJBPaymentTerminal[] memory _terminals,
string memory _memo
)
Expand All @@ -303,7 +299,7 @@ contract JBController3_2 is JBOperatable, ERC165, IJBController3_2, IJBMigratabl
directory.setControllerOf(_projectId, address(this));

// Configure the first funding cycle.
configured = _configure(_projectId, _configurations, _mustStartAtOrAfter);
configured = _configure(_projectId, _configurations);

// Add the provided terminals to the list of terminals.
if (_terminals.length > 0) directory.setTerminalsOf(_projectId, _terminals);
Expand All @@ -315,13 +311,11 @@ contract JBController3_2 is JBOperatable, ERC165, IJBController3_2, IJBMigratabl
/// @dev Only a project's owner or a designated operator can configure its funding cycles.
/// @param _projectId The ID of the project whose funding cycles are being reconfigured.
/// @param _configurations The funding cycle configurations to schedule.
/// @param _mustStartAtOrAfter The time before which the configured funding cycle cannot start.
/// @param _memo A memo to pass along to the emitted event.
/// @return configured The configuration timestamp of the funding cycle that was successfully reconfigured.
function reconfigureFundingCyclesOf(
uint256 _projectId,
JBFundingCycleConfiguration[] calldata _configurations,
uint256 _mustStartAtOrAfter,
string calldata _memo
)
external
Expand All @@ -331,7 +325,7 @@ contract JBController3_2 is JBOperatable, ERC165, IJBController3_2, IJBMigratabl
returns (uint256 configured)
{
// Configure the next funding cycle.
configured = _configure(_projectId, _configurations, _mustStartAtOrAfter);
configured = _configure(_projectId, _configurations);

emit ReconfigureFundingCycles(configured, _projectId, _memo, msg.sender);
}
Expand Down Expand Up @@ -655,12 +649,10 @@ contract JBController3_2 is JBOperatable, ERC165, IJBController3_2, IJBMigratabl
/// @notice Configures a funding cycle and stores information pertinent to the configuration.
/// @param _projectId The ID of the project whose funding cycles are being reconfigured.
/// @param _configurations The funding cycle configurations to schedule.
/// @param _mustStartAtOrAfter The time before which the configured funding cycle cannot start.
/// @return configured The configuration timestamp of the funding cycle that was successfully reconfigured.
function _configure(
uint256 _projectId,
JBFundingCycleConfiguration[] calldata _configurations,
uint256 _mustStartAtOrAfter
JBFundingCycleConfiguration[] calldata _configurations
) internal returns (uint256 configured) {
// Keep a reference to the configuration being iterated on.
JBFundingCycleConfiguration memory _configuration;
Expand Down Expand Up @@ -689,7 +681,7 @@ contract JBController3_2 is JBOperatable, ERC165, IJBController3_2, IJBMigratabl
_projectId,
_configuration.data,
JBFundingCycleMetadataResolver.packFundingCycleMetadata(_configuration.metadata),
_mustStartAtOrAfter
_configuration.mustStartAtOrAfter
);

// Set splits for the group.
Expand Down
3 changes: 0 additions & 3 deletions contracts/interfaces/IJBController3_2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -121,23 +121,20 @@ interface IJBController3_2 is IERC165 {
address owner,
JBProjectMetadata calldata projectMetadata,
JBFundingCycleConfiguration[] calldata configurations,
uint256 mustStartAtOrAfter,
IJBPaymentTerminal[] memory terminals,
string calldata memo
) external returns (uint256 projectId);

function launchFundingCyclesFor(
uint256 projectId,
JBFundingCycleConfiguration[] calldata configurations,
uint256 mustStartAtOrAfter,
IJBPaymentTerminal[] memory terminals,
string calldata memo
) external returns (uint256 configured);

function reconfigureFundingCyclesOf(
uint256 projectId,
JBFundingCycleConfiguration[] calldata configurations,
uint256 mustStartAtOrAfter,
string calldata memo
) external returns (uint256 configured);

Expand Down
10 changes: 6 additions & 4 deletions contracts/structs/JBFundingCycleConfiguration.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import {JBFundingCycleMetadata} from './JBFundingCycleMetadata.sol';
import {JBGroupedSplits} from './JBGroupedSplits.sol';
import {JBFundAccessConstraints} from './JBFundAccessConstraints.sol';

/// @custom:member _data Data that defines the project's funding cycle. These properties will remain fixed for the duration of the funding cycle.
/// @custom:member _metadata Metadata specifying the controller specific params that a funding cycle can have. These properties will remain fixed for the duration of the funding cycle.
/// @custom:member _groupedSplits An array of splits to set for any number of groups while the funding cycle configuration is active.
/// @custom:member _fundAccessConstraints An array containing amounts that a project can use from its treasury for each payment terminal while the funding cycle configuration is active. Amounts are fixed point numbers using the same number of decimals as the accompanying terminal. The `_distributionLimit` and `_overflowAllowance` parameters must fit in a `uint232`.
/// @custom:member mustStartAtOrAfter The time before which the configured funding cycle cannot start.
/// @custom:member data Data that defines the project's funding cycle. These properties will remain fixed for the duration of the funding cycle.
/// @custom:member metadata Metadata specifying the controller specific params that a funding cycle can have. These properties will remain fixed for the duration of the funding cycle.
/// @custom:member groupedSplits An array of splits to set for any number of groups while the funding cycle configuration is active.
/// @custom:member fundAccessConstraints An array containing amounts that a project can use from its treasury for each payment terminal while the funding cycle configuration is active. Amounts are fixed point numbers using the same number of decimals as the accompanying terminal. The `_distributionLimit` and `_overflowAllowance` parameters must fit in a `uint232`.
struct JBFundingCycleConfiguration {
uint256 mustStartAtOrAfter;
JBFundingCycleData data;
JBFundingCycleMetadata metadata;
JBGroupedSplits[] groupedSplits;
Expand Down

0 comments on commit d3d80aa

Please sign in to comment.