totalSupplyOf(uint256) :
This function returns the total supply of a given project ID. It does this by first retrieving the staked total supply of the project ID from the stakedTotalSupplyOf mapping, and then adding the total supply of the ITickets contract associated with the project ID, if one exists. The total supply is then returned. (autogenerated documentation)
balanceOf(address,uint256) :
This function returns the total balance of a given address for a given project ID. It does this by first retrieving the staked balance of the address from the stakedBalanceOf mapping, and then adding the balance of the address from the ticketsOf mapping. The ticketsOf mapping stores an ITickets contract for each project ID, which contains the balanceOf function that is used to retrieve the balance of the address from the ITickets contract. (autogenerated documentation)
issue(uint256,string,string) :
This function allows a user to issue a new token for a given project. It requires that the user has the permission to issue the token, that the name and symbol of the token are not empty, and that the token has not already been issued. If all of these conditions are met, the function creates a new instance of the Tickets contract and stores it in the ticketsOf mapping. Finally, it emits an Issue event. (autogenerated documentation)
print(address,uint256,uint256,bool) :
This function is used to print tickets for a given project. It takes in the address of the ticket holder, the project ID, the amount of tickets to be printed, and a boolean value indicating whether the tickets should be unstaked. The function first checks that the amount of tickets to be printed is greater than 0. It then checks if the tickets should be unstaked, and if so, calls the print function from the ITickets contract. Otherwise, it adds the amount of tickets to the stakedBalanceOf mapping and updates the stakedTotalSupplyOf mapping. Finally, it emits an event with the relevant information. (autogenerated documentation)
redeem(address,uint256,uint256,bool) :
This function allows a user to redeem a certain amount of tickets for a given project. It first checks that the user has enough tickets to redeem, either in their staked or unstaked balance. It then calculates the amount of tickets to redeem from each balance, depending on whether the user prefers to redeem from their unstaked balance or not. Finally, it updates the user's staked and unstaked balances and emits an event to signal the redemption. (autogenerated documentation)
stake(address,uint256,uint256) :
This function allows a user to stake a certain amount of tokens for a specific project. It requires the user to have permission to stake tokens for the project, and checks that the user has enough tokens to stake. It then calls the redeem function on the ITickets contract to transfer the tokens from the user's balance to the staked balance. Finally, it updates the staked total supply of the project and emits an event to notify other contracts of the stake. (autogenerated documentation)
unstake(address,uint256,uint256) :
This function allows a user to unstake a certain amount of tickets from a project. It requires the user to have permission to unstake the tickets, and checks that the user has enough unlocked tickets to unstake. If these conditions are met, the function reduces the user's staked balance and the project's total staked supply by the amount of tickets being unstaked. Finally, it emits an Unstake event. (autogenerated documentation)
lock(address,uint256,uint256) :
This function allows a user to lock a certain amount of funds for a specific project. It requires the user to have permission to lock funds for the project, and that the user has enough funds to lock. If these conditions are met, the function will update the lockedBalanceOf and lockedBalanceBy mappings to reflect the new locked amount. Finally, it will emit an event to notify other contracts of the lock. (autogenerated documentation)
unlock(address,uint256,uint256) :
This function unlocks a specified amount of funds from a specified holder for a specified project. It requires that the amount to be unlocked is greater than 0, and that the sender has sufficient funds to unlock the specified amount. It then subtracts the amount from the lockedBalanceOf and lockedBalanceBy mappings, and emits an Unlock event. (autogenerated documentation)
transfer(address,uint256,uint256,address) :
This function allows a holder to transfer a certain amount of staked tickets from their account to another account. It requires that the holder has permission to transfer the tickets, that the recipient is not the same as the holder, that the amount is greater than 0, that the amount is less than or equal to the unlocked staked tickets, and that the recipient is not the zero address. If all of these conditions are met, the function will subtract the amount from the holder's staked balance and add it to the recipient's staked balance. Finally, it will emit a Transfer event. (autogenerated documentation)