I am designing a simple contract that doles out staking rewards. The claimant need only call a claim function specifying the amount to be claimed. However, the amount is calculated off-chain on a website, and depends on other inputs, such as time staked, token id staked. The rules are too complex to fit in the staking contract. How can I force the user to call the claim function with a pre-specified amount of tokens?
You can't force people to call your function with specific parameters. You can force failures to occur if some specific parameters are incorrect. The problem is how do we let the smart contract know if a paremeter is incorrect. The only legitimate solution is to have these values exist on chain. So either you need to post the amount on chain and have your function use that OR you can have hardcoded values(this option is not that great).