//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "./SoulSBT.sol"; contract SoulshipFactory { struct DeployedContracts { address contractAddress; address organizationAddress; string utility; string uri; string name; } struct Organizations { address organizationAddress; string organizationName; string organizationLogo; } address[] contractAddresses; mapping (uint256 => DeployedContracts) public getContractData; mapping (address => uint256) public numberOfCollections; mapping(address => Organizations) public getOrgData; function registration(string memory orgName, string memory logoUri) public returns (bool) { require(getOrgData[msg.sender].organizationAddress != msg.sender , "Soul: This organization is already registered."); getOrgData[msg.sender] = Organizations({ organizationAddress: msg.sender, organizationName: orgName, organizationLogo: logoUri }); return true; } function CreateNewChild(string memory name, string memory symbol, string memory utility, string memory uri) public returns (bool) { SoulSBT soul = new SoulSBT(name, symbol); uint256 collections = numberOfCollections[msg.sender]; numberOfCollections[msg.sender] = collections + 1; contractAddresses.push(payable(soul)); getContractData[numberOfCollections[msg.sender]] = DeployedContracts({ contractAddress: soul, organizationAddress: msg.sender, utility: utility, uri: uri, name: name }); return true; } function getOrgDetails(address orgAddress) public view { return getOrgData[orgAddress]; } }
0.4.18