// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.20; import {Ajo} from "./Ajo.sol"; // TODO make ownable, pauseable (by owner), upgradeable /// @title Ajo Factory /// @author Charlie Andrews-Jubelt /// @custom:security-contact security@valora.xyz contract AjoFactory { mapping(address => Ajo[]) public deployedAjosByDeployer; event AjoDeployed(address indexed deployer, address ajoAddress); function createAjo( address[] memory _participants, uint256 _contributionPerRound, uint256 _startTime, address _tokenAddress, uint256 _roundDurationSeconds ) public returns (address) { Ajo newAjo = new Ajo( _participants, _contributionPerRound, _startTime, _tokenAddress, _roundDurationSeconds ); deployedAjosByDeployer[msg.sender].push(newAjo); emit AjoDeployed(msg.sender, address(newAjo)); return address(newAjo); } function getAjosByDeployer(address deployer) public view returns (Ajo[] memory) { return deployedAjosByDeployer[deployer]; } }