depositNew(uint256) :
This function is used to deposit a certain amount of funds into a contract. It takes in an amount as an argument and returns a tokenId. It works by first calling the mint() function of the OptimisticRewarder contract to create a new token and assign it to the sender of the transaction. It then calls the _depositFor() function to deposit the specified amount of funds into the contract. (autogenerated documentation)
deposit(uint256,uint256) :
This function allows the owner of a token to deposit a certain amount of tokens into a contract. It takes two parameters, the tokenId and the amount, and uses the onlyTokenOwner modifier to ensure that only the owner of the token can deposit it. The _depositFor() function is then called to deposit the tokens into the contract. (autogenerated documentation)
depositFor(uint256,uint256) :
This function allows a user to deposit a certain amount of funds for a specific token ID. It works by first checking that the amount is greater than 0, and then transferring the amount from the user's account to the contract's account. The token ID is then stored in a mapping, along with the amount deposited, and the total amount of funds deposited is updated. (autogenerated documentation)
withdraw(uint256,uint256) :
This function allows the owner of a token to withdraw a specified amount of tokens from their balance. It subtracts the amount from the token's balance, transfers the amount to the sender, updates the token's data, and emits an event to indicate that the withdrawal has taken place. (autogenerated documentation)
_depositFor(uint256,uint256) :
This function is used to deposit a certain amount of a specific token into a contract. It takes two parameters, tokenId and amount, and updates the balances mapping with the amount of the token deposited. It then transfers the amount of the token from the sender to the contract address. Finally, it updates the token information and emits a Deposit event. (autogenerated documentation)