diff --git a/C#/UnitySamples/PhantasmaGame/Assets/Phantasma/Samples/NFT/Scripts/Market.cs b/C#/UnitySamples/PhantasmaGame/Assets/Phantasma/Samples/NFT/Scripts/Market.cs index a1b9c53..3c75548 100644 --- a/C#/UnitySamples/PhantasmaGame/Assets/Phantasma/Samples/NFT/Scripts/Market.cs +++ b/C#/UnitySamples/PhantasmaGame/Assets/Phantasma/Samples/NFT/Scripts/Market.cs @@ -146,7 +146,7 @@ public void BuyAsset(Car car) var script = ScriptUtils.BeginScript() .AllowGas(car.OwnerAddress, Address.Null, 1, 9999) - .CallContract("market", "BuyToken", PhantasmaDemo.Instance.Key.Address, PhantasmaDemo.TOKEN_SYMBOL, car.TokenID) + .CallContract("market", "BuyToken", PhantasmaDemo.Instance.Key.Address, PhantasmaDemo.TOKEN_SYMBOL, BigInteger.Parse(car.TokenID)) .SpendGas(car.OwnerAddress) .EndScript(); @@ -233,7 +233,7 @@ public void SellAsset(Car car, Address from, BigInteger price, Timestamp endDate var script = ScriptUtils.BeginScript() .AllowGas(car.OwnerAddress, Address.Null, 1, 9999) - .CallContract("market", "SellToken", from, PhantasmaDemo.TOKEN_SYMBOL, "SOUL", car.TokenID, price, endDate) + .CallContract("market", "SellToken", from, PhantasmaDemo.TOKEN_SYMBOL, PhantasmaDemo.SOUL_TOKEN_SYMBOL, BigInteger.Parse(car.TokenID), price, endDate) .SpendGas(from) .EndScript(); @@ -325,7 +325,7 @@ public void RemoveAsset(Car car) var script = ScriptUtils.BeginScript() .AllowGas(car.OwnerAddress, Address.Null, 1, 9999) - .CallContract("market", "BuyToken", PhantasmaDemo.Instance.Key.Address, PhantasmaDemo.TOKEN_SYMBOL, car.TokenID) + .CallContract("market", "BuyToken", PhantasmaDemo.Instance.Key.Address, PhantasmaDemo.TOKEN_SYMBOL, BigInteger.Parse(car.TokenID)) .SpendGas(car.OwnerAddress) .EndScript(); diff --git a/C#/UnitySamples/PhantasmaGame/Assets/Phantasma/Samples/NFT/Scripts/PhantasmaDemo.cs b/C#/UnitySamples/PhantasmaGame/Assets/Phantasma/Samples/NFT/Scripts/PhantasmaDemo.cs index 42af70b..6436d43 100644 --- a/C#/UnitySamples/PhantasmaGame/Assets/Phantasma/Samples/NFT/Scripts/PhantasmaDemo.cs +++ b/C#/UnitySamples/PhantasmaGame/Assets/Phantasma/Samples/NFT/Scripts/PhantasmaDemo.cs @@ -1,7 +1,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Globalization; using UnityEngine; @@ -13,6 +12,7 @@ using Phantasma.Numerics; using Phantasma.SDK; using Phantasma.VM.Utils; + using Random = UnityEngine.Random; using Token = Phantasma.SDK.Token; @@ -47,10 +47,12 @@ public enum EBLOCKCHAIN_OPERATION public const string TOKEN_SYMBOL = "CAR"; public const string TOKEN_NAME = "Car Demo Token"; + public const string SOUL_TOKEN_SYMBOL = "SOUL"; + private const string _SERVER_ADDRESS = "http://localhost:7077/rpc"; private const float _TRANSACTION_CONFIRMATION_DELAY = 10f; - + public Market market; public List carImages; @@ -492,7 +494,7 @@ public void MintToken(string tokenName) var script = ScriptUtils.BeginScript() .AllowGas(Key.Address, Address.Null, 1, 9999) - .CallContract("token", "MintToken", Key.Address, TOKEN_SYMBOL, txData, txMutableData) + .CallContract("token", "MintToken", Key.Address, TOKEN_SYMBOL, txData, txMutableData, 0) .SpendGas(Key.Address) .EndScript();