Uint256 (solidity contract) to int (c# code Unity)

We have seen all the Moralis for Unity videos and we know how to call functions through C#.
What I would like to know is how to cast an integer in unity to uint256 and if there is a page to see all the types of casts available, since we have a function in the contract that requests the uint256 parameter and when we try to assign the integer value in C# we get throws error β€˜The type or namespace name β€œβ€˜uint256’” could not be found (are you missing a using directive or an assembly reference?)’.
Is there any way to cast it?

Thank you very much for all the videos and the Moralis platform.


Are you following a particular tutorial? You can post what you’ve done in code.

Why do you have to cast the integer? E.g. with Moralis.ExecuteContractFunction and a function that requires _tokenId of uint256, you can just pass in a number (as a string).

In the end I found the way and it was passing it as a string.

Thank you very much for your answer. Cheers

Can you share me your code how are you sending the data @cryptokid

did you try with the number as a string?

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.