Blockchain Interactions Unity
Smart contracts interactions in Unity with the Moralis Unity SDK.
smart contracts
what are smart contracts ?
Simple definition : Smart contracts are simply programs stored on a blockchain that run when predetermined conditions are met. Learn more about smart contracts
User details
After logging in, you can get the user details in the MoralisUser
object
Execute smart contract function
ExecuteContractFunction calls smart contract functions
options
contractAddress
: The address of the deployed smart contractabi
: The abi of the contract or just of that specific function. You can convert the ABI to a string here to pass it as a string in code or it can be passed through the inspectorfunctionName
: The name of the smart contract function to be calledargs
: The arguments passed into the functionvalue
: msg.value of a contract functiongas
: Transaction fee for the transactiongasPrice
: This is the amount in wei the sender is willing to pay for the transaction
Example result:
Returns the hash of the transaction
ExecuteContractFunction
is currently the only accepted way to call smart contract functions, there are other methods like SendEvmTransactionAsync, SendTransactionAndWaitForReceiptAsync but they only work for platform and are deprecated
Last updated