Collabberry Docs
  • Welcome Berries!
  • How do we do it?
  • Getting Started
    • Admin
      • Start an Organization
      • Team Agreements
        • Add Team Agreements
      • Organization Settings
    • Contributor
      • Join an Organization
  • Technical
    • Architecture
    • Berry Algorithm
    • Smart Contracts
      • Team Points
        • Implementation
      • Team Points Factory
Powered by GitBook
On this page
  1. Technical
  2. Smart Contracts

Team Points Factory

TeamPointsFactory

Factory Logic

TeamPointsFactory helps you deploy new TeamPoints contracts quickly:

  • Deploys a new TeamPoints instance with desired initial settings.

  • Grants the deployer ADMIN_ROLE on the new contract.

  • Keeps an on-chain record of all deployed contracts.

Factory Functions

createTeamPoints(...) -> address

function createTeamPoints(
    bool isTransferable,
    bool isOutsideTransferAllowed,
    uint256 materialWeight,
    string memory name,
    string memory symbol
) external returns (address contractAddress)
  • Parameters:

    • isTransferable: Whether tokens in the new contract can be transferred.

    • isOutsideTransferAllowed: Whether transfers to addresses that haven’t previously held tokens are allowed.

    • materialWeight: Initial multiplier for material contributions.

    • name: ERC20 name for the new tokens.

    • symbol: ERC20 symbol for the new tokens.

  • Effects:

    • Deploys a new TeamPoints instance.

    • Sets msg.sender as the initial admin of the new contract.

    • Emits a TeamPointsCreated event.

getTeamPointsCount() -> uint256

Returns the total number of TeamPoints contracts deployed.

getAllTeamPoints() -> address[]

Returns an array of all deployed TeamPoints contract addresses.

PreviousImplementation

Last updated 4 months ago