Target
The Target contract is designed for on-chain creation and management of projects. It facilitates functions such as enabling financiers to create projects, registering administrators, and managing proj
Contract Function
The Target contract is designed to create and manage projects (Targets), allowing users to become administrators (Contractors) of these projects. Project creators can mint NFTs to represent their projects and manage project status and funding flows through the contract's logic.
Contract Structure:
BaseConfig: Contains basic configurations of the contract, such as token addresses, fee addresses, treasury contract addresses, etc.
TargetData: Includes data structures related to the Target project.
ChequeData: Contains data structures related to cheques (Cheques).
DistributionData: Includes data structures related to distributions (Distributions).
PublicFun: Contains public functions that are inherited and used by the Target contract.
important variables:
TargetNFT
:
Address of the NFT contract used for minting NFTs representing projects.TOKEN
:
Address of the token contract used for handling token transactions.feeTo
:
Address used for receiving transaction fees.Vault
:
Address of the vault contract used for managing fund flows.Router
:
Address of the router contract used for obtaining token prices.Farm
:
Address of the mining contract used for fee distribution.Expert
:
Address of the expert contract used for associated query subscriptions.
The Functions :
Create Project
createTarget: Users can create a project, requiring them to meet the minimum hashrate requirement and mint an NFT to represent the project.
Register Administrator
registerContractor: Users can apply to become administrators of a project, needing to pay a fee and meet the minimum hashrate requirement.
Status Management
getTargetStatus: Retrieves the status of a project, where the status value defines the current phase of the project (not started, project created, cheque created, etc.).
Events
NewTargetCreated: Triggered when a new project is created.
NewTargetStatus: Triggered when the status of a project changes.
NewContractor: Triggered when a new administrator is registered.
Contract Logic
Users create projects using the createTarget
function, which requires meeting specific hashrate requirements and minting an NFT.
Users can become administrators of projects by using the registerContractor
function, which involves paying a fee.
The status of a project is obtained using the getTargetStatus
function, where the status value reflects the current phase of the project.
Interface
Last updated