diff --git a/Packages/io.chainsafe.web3-unity.lootboxes/Chainlink/Runtime/Libraries/ChainSafe.Gaming.Lootboxes.Chainlink.dll b/Packages/io.chainsafe.web3-unity.lootboxes/Chainlink/Runtime/Libraries/ChainSafe.Gaming.Lootboxes.Chainlink.dll index 1a0f8bf91..4cb063e24 100644 Binary files a/Packages/io.chainsafe.web3-unity.lootboxes/Chainlink/Runtime/Libraries/ChainSafe.Gaming.Lootboxes.Chainlink.dll and b/Packages/io.chainsafe.web3-unity.lootboxes/Chainlink/Runtime/Libraries/ChainSafe.Gaming.Lootboxes.Chainlink.dll differ diff --git a/Packages/io.chainsafe.web3-unity.lootboxes/Chainlink/Runtime/Libraries/Chainsafe.Gaming.Chainlink.dll b/Packages/io.chainsafe.web3-unity.lootboxes/Chainlink/Runtime/Libraries/Chainsafe.Gaming.Chainlink.dll index 5355ae4eb..5f144099c 100644 Binary files a/Packages/io.chainsafe.web3-unity.lootboxes/Chainlink/Runtime/Libraries/Chainsafe.Gaming.Chainlink.dll and b/Packages/io.chainsafe.web3-unity.lootboxes/Chainlink/Runtime/Libraries/Chainsafe.Gaming.Chainlink.dll differ diff --git a/Packages/io.chainsafe.web3-unity.lootboxes/Samples~/Chainlink Lootbox Samples/Scripts/Scene/Rewards/Erc1155NftRewardFactory.cs b/Packages/io.chainsafe.web3-unity.lootboxes/Samples~/Chainlink Lootbox Samples/Scripts/Scene/Rewards/Erc1155NftRewardFactory.cs index 237080841..03fe534f8 100644 --- a/Packages/io.chainsafe.web3-unity.lootboxes/Samples~/Chainlink Lootbox Samples/Scripts/Scene/Rewards/Erc1155NftRewardFactory.cs +++ b/Packages/io.chainsafe.web3-unity.lootboxes/Samples~/Chainlink Lootbox Samples/Scripts/Scene/Rewards/Erc1155NftRewardFactory.cs @@ -3,7 +3,7 @@ using LootBoxes.Chainlink.Scene.StageItems; using ChainSafe.Gaming.Evm.Contracts; using ChainSafe.Gaming.Lootboxes.Chainlink; -using ChainSafe.Gaming.UnityPackage; +using Scripts.EVM.Token; using UnityEngine; using UnityEngine.Networking; @@ -35,7 +35,7 @@ public async Task Create(Erc1155NftReward data) { var item = Instantiate(NftRewardItemPrefab); var reward = (NftReward)item.Reward; - var contract = contractBuilder.Build(ABI.ERC_1155, data.ContractAddress); + var contract = contractBuilder.Build(ABI.Erc1155, data.ContractAddress); var uri = (await contract.Call("uri", new object[] { data.TokenId }))[0].ToString(); Erc1155MetaData metadata; diff --git a/Packages/io.chainsafe.web3-unity.lootboxes/Samples~/Chainlink Lootbox Samples/Scripts/Scene/Rewards/Erc1155RewardFactory.cs b/Packages/io.chainsafe.web3-unity.lootboxes/Samples~/Chainlink Lootbox Samples/Scripts/Scene/Rewards/Erc1155RewardFactory.cs index 1d3a84ca2..a6bc70886 100644 --- a/Packages/io.chainsafe.web3-unity.lootboxes/Samples~/Chainlink Lootbox Samples/Scripts/Scene/Rewards/Erc1155RewardFactory.cs +++ b/Packages/io.chainsafe.web3-unity.lootboxes/Samples~/Chainlink Lootbox Samples/Scripts/Scene/Rewards/Erc1155RewardFactory.cs @@ -3,7 +3,7 @@ using LootBoxes.Chainlink.Scene.StageItems; using ChainSafe.Gaming.Evm.Contracts; using ChainSafe.Gaming.Lootboxes.Chainlink; -using ChainSafe.Gaming.UnityPackage; +using Scripts.EVM.Token; using UnityEngine; namespace LootBoxes.Chainlink.Scene @@ -34,7 +34,7 @@ public async Task Create(Erc1155Reward data) { var item = Instantiate(CoinRewardItemPrefab); var reward = (CoinReward)item.Reward; - var contract = contractBuilder.Build(ABI.ERC_1155, data.ContractAddress); + var contract = contractBuilder.Build(ABI.Erc1155, data.ContractAddress); var uri = (await contract.Call("uri", new object[] { data.TokenId }))[0].ToString(); Erc1155MetaData metadata; try diff --git a/Packages/io.chainsafe.web3-unity.lootboxes/Samples~/Chainlink Lootbox Samples/Scripts/Scene/Rewards/Erc20RewardFactory.cs b/Packages/io.chainsafe.web3-unity.lootboxes/Samples~/Chainlink Lootbox Samples/Scripts/Scene/Rewards/Erc20RewardFactory.cs index a56efd439..fccc533fa 100644 --- a/Packages/io.chainsafe.web3-unity.lootboxes/Samples~/Chainlink Lootbox Samples/Scripts/Scene/Rewards/Erc20RewardFactory.cs +++ b/Packages/io.chainsafe.web3-unity.lootboxes/Samples~/Chainlink Lootbox Samples/Scripts/Scene/Rewards/Erc20RewardFactory.cs @@ -5,7 +5,7 @@ using LootBoxes.Chainlink.Scene.StageItems; using ChainSafe.Gaming.Evm.Contracts; using ChainSafe.Gaming.Lootboxes.Chainlink; -using ChainSafe.Gaming.UnityPackage; +using Scripts.EVM.Token; using UnityEngine; namespace LootBoxes.Chainlink.Scene @@ -35,7 +35,7 @@ public async Task Create(Erc20Reward data) { var item = Instantiate(CoinRewardItemPrefab); var reward = (CoinReward)item.Reward; - var contract = contractBuilder.Build(ABI.ERC_20, data.ContractAddress); + var contract = contractBuilder.Build(ABI.Erc20, data.ContractAddress); var symbol = (await contract.Call("symbol"))[0].ToString(); var decimals = BigInteger.Parse((await contract.Call("decimals"))[0].ToString()); var humanizedAmount = HumanizeAmount(data.AmountRaw, decimals); diff --git a/Packages/io.chainsafe.web3-unity.lootboxes/Samples~/Chainlink Lootbox Samples/Scripts/Scene/Rewards/Erc721NftRewardFactory.cs b/Packages/io.chainsafe.web3-unity.lootboxes/Samples~/Chainlink Lootbox Samples/Scripts/Scene/Rewards/Erc721NftRewardFactory.cs index dac346508..39387aa77 100644 --- a/Packages/io.chainsafe.web3-unity.lootboxes/Samples~/Chainlink Lootbox Samples/Scripts/Scene/Rewards/Erc721NftRewardFactory.cs +++ b/Packages/io.chainsafe.web3-unity.lootboxes/Samples~/Chainlink Lootbox Samples/Scripts/Scene/Rewards/Erc721NftRewardFactory.cs @@ -4,6 +4,7 @@ using ChainSafe.Gaming.Evm.Contracts; using ChainSafe.Gaming.Lootboxes.Chainlink; using ChainSafe.Gaming.UnityPackage; +using Scripts.EVM.Token; using UnityEngine; namespace LootBoxes.Chainlink.Scene @@ -32,7 +33,7 @@ public async Task Create(Erc721Reward data) { var item = Instantiate(NftRewardItemPrefab); var reward = (NftReward)item.Reward; - var contract = contractBuilder.Build(ABI.ERC_721, data.ContractAddress); + var contract = contractBuilder.Build(ABI.Erc721, data.ContractAddress); var uri = (await contract.Call("tokenURI", new object[] { data.TokenId.ToString() }))[0].ToString(); Debug.Log(uri); diff --git a/Packages/io.chainsafe.web3-unity.web3auth/Samples~/Web3.Unity Web3Auth/Scenes/SampleLogin - Web3Auth.unity b/Packages/io.chainsafe.web3-unity.web3auth/Samples~/Web3.Unity Web3Auth/Scenes/SampleLogin - Web3Auth.unity index b7397b352..359b59511 100644 --- a/Packages/io.chainsafe.web3-unity.web3auth/Samples~/Web3.Unity Web3Auth/Scenes/SampleLogin - Web3Auth.unity +++ b/Packages/io.chainsafe.web3-unity.web3auth/Samples~/Web3.Unity Web3Auth/Scenes/SampleLogin - Web3Auth.unity @@ -995,7 +995,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7b6902e441950fa4bb5cefdd2263164a, type: 3} m_Name: m_EditorClassIdentifier: - gelatoApiKey: _UzPz_Yk_WTjWMfcl45fLvQNGQ9ISx5ZE8TnwnVKYrE_ + gelatoApiKey: 7MFQqyGS1Iui_e_MgmFW1BfbFeJ06g8nnL2oUTlIJug_ errorPopup: {fileID: 337558421} clientId: BCc0wTmuXureEzgawhUSZOWu4bgWo56sZPrxLiHQCpg5OHcNrfa44esdTS8Dm77VtmaIyjhbthdWfbLhSwf7jtU redirectUri: torusapp://io.chainsafe.gamingsdk.sdkdemoscene/auth @@ -1488,7 +1488,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMin.x @@ -1496,15 +1496,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 300 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 50 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_LocalPosition.x @@ -1536,11 +1536,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 150 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -190 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_LocalEulerAnglesHint.x @@ -1593,7 +1593,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMin.x @@ -1601,15 +1601,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 300 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 50 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_LocalPosition.x @@ -1641,11 +1641,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 150 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -80 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_LocalEulerAnglesHint.x @@ -1851,10 +1851,10 @@ RectTransform: m_Father: {fileID: 221640018348301908} m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 150, y: -337.825} + m_SizeDelta: {x: 300, y: 15.65} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &221640018720180777 GameObject: @@ -1996,7 +1996,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMin.x @@ -2004,15 +2004,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 300 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 50 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_LocalPosition.x @@ -2044,11 +2044,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 150 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -135 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_LocalEulerAnglesHint.x @@ -2121,7 +2121,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMin.x @@ -2129,15 +2129,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 300 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 50 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_LocalPosition.x @@ -2169,11 +2169,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 150 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -25 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_LocalEulerAnglesHint.x @@ -2274,7 +2274,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMin.x @@ -2282,15 +2282,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 300 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 50 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_LocalPosition.x @@ -2322,11 +2322,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 150 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -300 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_LocalEulerAnglesHint.x @@ -2399,7 +2399,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMin.x @@ -2407,15 +2407,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 300 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 50 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_LocalPosition.x @@ -2447,11 +2447,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 150 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -245 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_LocalEulerAnglesHint.x diff --git a/Packages/io.chainsafe.web3-unity/Editor/WebGLTemplates/Web3GL-2020x/network.js b/Packages/io.chainsafe.web3-unity/Editor/WebGLTemplates/Web3GL-2020x/network.js index 6a00e11ad..2282e6acb 100644 --- a/Packages/io.chainsafe.web3-unity/Editor/WebGLTemplates/Web3GL-2020x/network.js +++ b/Packages/io.chainsafe.web3-unity/Editor/WebGLTemplates/Web3GL-2020x/network.js @@ -16,9 +16,9 @@ window.networks = [ { - id: 5, - label: "Ethereum Goerli", - token: "goETH", - rpcUrl: `https://goerli.infura.io/v3/634371d724e34613bfc66e595b853cf0`, + id: 11155111, + label: "Ethereum Sepolia", + token: "Seth", + rpcUrl: `https://sepolia.infura.io/v3/287318045c6e455ab34b81d6bcd7a65f`, } ] \ No newline at end of file diff --git a/Packages/io.chainsafe.web3-unity/Editor/WebGLTemplates/Web3GL-MetaMask/network.js b/Packages/io.chainsafe.web3-unity/Editor/WebGLTemplates/Web3GL-MetaMask/network.js index 113c06eed..0681866ba 100644 --- a/Packages/io.chainsafe.web3-unity/Editor/WebGLTemplates/Web3GL-MetaMask/network.js +++ b/Packages/io.chainsafe.web3-unity/Editor/WebGLTemplates/Web3GL-MetaMask/network.js @@ -22,4 +22,4 @@ Used to set the network: https://chainlist.org/ 338 Cronos Testnet */ -window.web3ChainId = 5; +window.web3ChainId = 11155111; diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Debugging.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Debugging.dll index ec1c8c683..e5d1a54ec 100644 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Debugging.dll and b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Debugging.dll differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Gelato.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Gelato.dll index 666d41107..78c56d05c 100644 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Gelato.dll and b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Gelato.dll differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.InProcessSigner.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.InProcessSigner.dll index fd6b3d3fc..c61cab66c 100644 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.InProcessSigner.dll and b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.InProcessSigner.dll differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.InProcessTransactionExecutor.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.InProcessTransactionExecutor.dll index 6ad104af9..9cb8ecfca 100644 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.InProcessTransactionExecutor.dll and b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.InProcessTransactionExecutor.dll differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Unity.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Unity.dll index d7b5efef3..c38ccea8f 100644 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Unity.dll and b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Unity.dll differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.WalletConnect.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.WalletConnect.dll index 31c267fb8..f0aa4178c 100644 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.WalletConnect.dll and b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.WalletConnect.dll differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.dll index 4490e266e..518db0e8a 100644 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.dll and b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.dll differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/ABI.cs b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/ABI.cs deleted file mode 100644 index 117f754ea..000000000 --- a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/ABI.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace ChainSafe.Gaming.UnityPackage -{ - public class ABI - { - public const string ERC_20 = - "[ { \"inputs\": [ { \"internalType\": \"string\", \"name\": \"name_\", \"type\": \"string\" }, { \"internalType\": \"string\", \"name\": \"symbol_\", \"type\": \"string\" } ], \"stateMutability\": \"nonpayable\", \"type\": \"constructor\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": true, \"internalType\": \"address\", \"name\": \"owner\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"spender\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint256\", \"name\": \"value\", \"type\": \"uint256\" } ], \"name\": \"Approval\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": true, \"internalType\": \"address\", \"name\": \"from\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint256\", \"name\": \"value\", \"type\": \"uint256\" } ], \"name\": \"Transfer\", \"type\": \"event\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"owner\", \"type\": \"address\" }, { \"internalType\": \"address\", \"name\": \"spender\", \"type\": \"address\" } ], \"name\": \"allowance\", \"outputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"spender\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"amount\", \"type\": \"uint256\" } ], \"name\": \"approve\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"account\", \"type\": \"address\" } ], \"name\": \"balanceOf\", \"outputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [], \"name\": \"decimals\", \"outputs\": [ { \"internalType\": \"uint8\", \"name\": \"\", \"type\": \"uint8\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"spender\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"subtractedValue\", \"type\": \"uint256\" } ], \"name\": \"decreaseAllowance\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"spender\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"addedValue\", \"type\": \"uint256\" } ], \"name\": \"increaseAllowance\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [], \"name\": \"name\", \"outputs\": [ { \"internalType\": \"string\", \"name\": \"\", \"type\": \"string\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [], \"name\": \"symbol\", \"outputs\": [ { \"internalType\": \"string\", \"name\": \"\", \"type\": \"string\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [], \"name\": \"totalSupply\", \"outputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"recipient\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"amount\", \"type\": \"uint256\" } ], \"name\": \"transfer\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"sender\", \"type\": \"address\" }, { \"internalType\": \"address\", \"name\": \"recipient\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"amount\", \"type\": \"uint256\" } ], \"name\": \"transferFrom\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"stateMutability\": \"nonpayable\", \"type\": \"function\" } ]"; - - public const string ERC_1155 = - "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"mintBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeBatchTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"}],\"name\":\"TransferBatch\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"TransferSingle\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"value\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"URI\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"}],\"name\":\"balanceOfBatch\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"uri\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]"; - - public const string ERC_721 = - "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"safeMint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]"; - - public const string ADD_TOTAL_ABI = - "[ { \"inputs\": [ { \"internalType\": \"uint8\", \"name\": \"_myArg\", \"type\": \"uint8\" } ], \"name\": \"addTotal\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [], \"name\": \"myTotal\", \"outputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"stateMutability\": \"view\", \"type\": \"function\" } ]"; - } -} \ No newline at end of file diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/ABI.cs.meta b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/ABI.cs.meta deleted file mode 100644 index 66e16305e..000000000 --- a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/ABI.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 249f219a8a2002b46939c72b58456401 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Remote/CSServer.cs b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Remote/CSServer.cs index 768894eb6..93394f4d0 100644 --- a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Remote/CSServer.cs +++ b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Remote/CSServer.cs @@ -15,41 +15,7 @@ public class CSServer { public class Response { public T response; } private static readonly string host = "https://api.gaming.chainsafe.io/evm"; - private static readonly string hostVoucher = "https://lazy-minting-voucher-signer.herokuapp.com"; - - /// - /// Calls a contract method using the Multicall service. - /// - /// The Web3 instance used for the call. - /// The blockchain chain identifier (e.g., Ethereum). - /// The network identifier (e.g., Mainnet, Ropsten). - /// The address of the contract to call. - /// The JSON ABI (Application Binary Interface) of the contract. - /// The name of the contract method to call. - /// The arguments to pass to the contract method (in JSON format). - /// [Optional] The Multicall specific parameters, if any. - /// [Optional] The RPC (Remote Procedure Call) configuration, if needed. - /// String encoded response from the MultiCall contract. - public static async Task Multicall(Web3 web3, string _chain, string _network, string _contract, string _abi, string _method, string _args, string _multicall = "", string _rpc = "") - { - WWWForm form = new WWWForm(); - form.AddField("projectId", web3.ProjectConfig.ProjectId); - form.AddField("chain", _chain); - form.AddField("network", _network); - form.AddField("contract", _contract); - form.AddField("abi", _abi); - form.AddField("method", _method); - form.AddField("args", _args); - form.AddField("multicall", _multicall); - form.AddField("rpc", _rpc); - string url = host + "/multicall"; - using (UnityWebRequest webRequest = UnityWebRequest.Post(url, form)) - { - await webRequest.SendWebRequest(); - Response data = JsonUtility.FromJson>(Encoding.UTF8.GetString(webRequest.downloadHandler.data)); - return data.response; - } - } + private static readonly string nftHost = " https://api.gaming.chainsafe.io/v1/nft/networks/"; /// /// Creates a mint transaction for an NFT (Non-Fungible Token) on a specified blockchain network. @@ -278,40 +244,6 @@ public static async Task GetNft(Web3 web3, string _account, string _chai } } - /// - /// Retrieves a 721 voucher. - /// - /// The Web3 instance - /// A response object containing the voucher details. - public static async Task Get721Voucher(Web3 web3) - { - string url = hostVoucher + "/voucher721?receiver=" + await web3.Signer.GetAddress(); - - using (UnityWebRequest webRequest = UnityWebRequest.Get(url)) - { - await webRequest.SendWebRequest(); - GetVoucherModel.GetVoucher721Response root721 = JsonConvert.DeserializeObject(webRequest.downloadHandler.text); - return root721; - } - } - - /// - /// Retrieves a 1155 voucher. - /// - /// The Web3 instance - /// A response object containing the voucher details. - public static async Task Get1155Voucher(Web3 web3) - { - string url = hostVoucher + "/voucher1155?receiver=" + await web3.Signer.GetAddress(); - - using (UnityWebRequest webRequest = UnityWebRequest.Get(url)) - { - await webRequest.SendWebRequest(); - GetVoucherModel.GetVoucher1155Response root1155 = JsonConvert.DeserializeObject(webRequest.downloadHandler.text); - return root1155; - } - } - /// /// Creates an approval transaction for a specific token type. /// @@ -343,25 +275,15 @@ public static async Task GetNft(Web3 web3, string _account, string _chai /// Retrieves all ERC721 tokens owned by a given account on a specific blockchain and network. /// /// The Web3 instance used for the request. - /// The blockchain chain identifier (e.g., Ethereum). - /// The network identifier (e.g., Mainnet, Ropsten). /// The account address for which to retrieve ERC721 tokens. - /// [Optional] The address of the ERC721 contract (if filtering by contract is required). - /// [Optional] The maximum number of tokens to retrieve (default: 500). - /// [Optional] The number of tokens to skip in the query (default: 0). /// An array of response objects containing details of the ERC721 tokens. - public static async Task AllErc721(Web3 web3, string chain, string network, string account, string contract = "", int take = 500, int skip = 0) + public static async Task AllErc721(Web3 web3, string account) { WWWForm form = new WWWForm(); form.AddField("projectId", web3.ProjectConfig.ProjectId); - form.AddField("chain", chain); - form.AddField("network", network); form.AddField("account", account); - form.AddField("contract", contract); - form.AddField("first", take); - form.AddField("skip", skip); - string url = host + "/all721"; + string url = $"{nftHost}{web3.ChainConfig.ChainId}/{account}/tokens"; string rawNfts; using (UnityWebRequest webRequest = UnityWebRequest.Post(url, form)) { @@ -384,24 +306,14 @@ public static async Task AllErc721(Web3 web3, string chain, str /// Retrieves all ERC1155 tokens owned by a given account on a specific blockchain and network. /// /// The Web3 instance used for the request. - /// The blockchain chain identifier (e.g., Ethereum). - /// The network identifier (e.g., Mainnet, Ropsten). /// The account address for which to retrieve ERC1155 tokens. - /// [Optional] The address of the ERC1155 contract (if filtering by contract is required). - /// [Optional] The maximum number of tokens to retrieve (default: 500). - /// [Optional] The number of tokens to skip in the query (default: 0). /// An array of response objects containing details of the ERC1155 tokens. - public static async Task AllErc1155(Web3 web3, string chain, string network, string account, string contract = "", int take = 500, int skip = 0) + public static async Task AllErc1155(Web3 web3, string account) { WWWForm form = new WWWForm(); form.AddField("projectId", web3.ProjectConfig.ProjectId); - form.AddField("chain", chain); - form.AddField("network", network); form.AddField("account", account); - form.AddField("contract", contract); - form.AddField("first", take); - form.AddField("skip", skip); - string url = host + "/all1155"; + string url = $"{nftHost}{web3.ChainConfig.ChainId}/{account}/tokens"; string rawNfts; using (UnityWebRequest webRequest = UnityWebRequest.Post(url, form)) { @@ -419,36 +331,6 @@ public static async Task AllErc1155(Web3 web3, string chain, st throw new Web3Exception("NFTs deserialization failed.", e); } } - - /// - /// Creates a redeem transaction for a voucher, allowing the redemption of an NFT. - /// - /// The Web3 instance used for the transaction. - /// The blockchain chain identifier (e.g., Ethereum). - /// The network identifier (e.g., Mainnet, Ropsten). - /// The voucher to be redeemed. - /// The type or category of the voucher. - /// The address of the NFT contract associated with the voucher. - /// The account address initiating the redemption transaction. - /// A response object containing information about the redemption transaction. - public static async Task CreateRedeemTransaction(Web3 web3, string chain, string network, string voucher, string type, string nftAddress, string account) - { - WWWForm form = new WWWForm(); - form.AddField("projectId", web3.ProjectConfig.ProjectId); - form.AddField("chain", chain); - form.AddField("network", network); - form.AddField("voucher", voucher); - form.AddField("type", type); - form.AddField("nftAdrress", nftAddress); - form.AddField("account", account); - string url = host + "/createRedeemTransaction"; - using (UnityWebRequest webRequest = UnityWebRequest.Post(url, form)) - { - await webRequest.SendWebRequest(); - RedeemVoucherTxModel.Root data = JsonConvert.DeserializeObject(Encoding.UTF8.GetString(webRequest.downloadHandler.data)); - return data.response; - } - } } } diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/ABI.cs b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/ABI.cs index af77d41d5..8720130d6 100644 --- a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/ABI.cs +++ b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/ABI.cs @@ -2,13 +2,13 @@ namespace Scripts.EVM.Token { public static class ABI { - public const string Erc20 = "[ { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"spender\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"value\", \"type\": \"uint256\" } ], \"name\": \"approve\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"constructor\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"spender\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"allowance\", \"type\": \"uint256\" }, { \"internalType\": \"uint256\", \"name\": \"needed\", \"type\": \"uint256\" } ], \"name\": \"ERC20InsufficientAllowance\", \"type\": \"error\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"sender\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"balance\", \"type\": \"uint256\" }, { \"internalType\": \"uint256\", \"name\": \"needed\", \"type\": \"uint256\" } ], \"name\": \"ERC20InsufficientBalance\", \"type\": \"error\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"approver\", \"type\": \"address\" } ], \"name\": \"ERC20InvalidApprover\", \"type\": \"error\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"receiver\", \"type\": \"address\" } ], \"name\": \"ERC20InvalidReceiver\", \"type\": \"error\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"sender\", \"type\": \"address\" } ], \"name\": \"ERC20InvalidSender\", \"type\": \"error\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"spender\", \"type\": \"address\" } ], \"name\": \"ERC20InvalidSpender\", \"type\": \"error\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": true, \"internalType\": \"address\", \"name\": \"owner\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"spender\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint256\", \"name\": \"value\", \"type\": \"uint256\" } ], \"name\": \"Approval\", \"type\": \"event\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"amount\", \"type\": \"uint256\" } ], \"name\": \"mint\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"value\", \"type\": \"uint256\" } ], \"name\": \"transfer\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": true, \"internalType\": \"address\", \"name\": \"from\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint256\", \"name\": \"value\", \"type\": \"uint256\" } ], \"name\": \"Transfer\", \"type\": \"event\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"from\", \"type\": \"address\" }, { \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"value\", \"type\": \"uint256\" } ], \"name\": \"transferFrom\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"owner\", \"type\": \"address\" }, { \"internalType\": \"address\", \"name\": \"spender\", \"type\": \"address\" } ], \"name\": \"allowance\", \"outputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"account\", \"type\": \"address\" } ], \"name\": \"balanceOf\", \"outputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [], \"name\": \"decimals\", \"outputs\": [ { \"internalType\": \"uint8\", \"name\": \"\", \"type\": \"uint8\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [], \"name\": \"name\", \"outputs\": [ { \"internalType\": \"string\", \"name\": \"\", \"type\": \"string\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [], \"name\": \"symbol\", \"outputs\": [ { \"internalType\": \"string\", \"name\": \"\", \"type\": \"string\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [], \"name\": \"totalSupply\", \"outputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"stateMutability\": \"view\", \"type\": \"function\" } ]"; - public const string Erc1155 = "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"mintBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeBatchTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"}],\"name\":\"TransferBatch\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"TransferSingle\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"value\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"URI\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"}],\"name\":\"balanceOfBatch\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"uri\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]"; - public const string Erc721 = "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"safeMint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]"; - public const string AddTotal = "[ { \"inputs\": [ { \"internalType\": \"uint8\", \"name\": \"_myArg\", \"type\": \"uint8\" } ], \"name\": \"addTotal\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [], \"name\": \"myTotal\", \"outputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"stateMutability\": \"view\", \"type\": \"function\" } ]"; - public const string Array = "[{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_addresses\",\"type\":\"address[]\"}],\"name\":\"setStore\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"bought\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStore\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]"; - public const string CustomBalanceOf = "[ { \"inputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"constructor\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"spender\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"allowance\", \"type\": \"uint256\" }, { \"internalType\": \"uint256\", \"name\": \"needed\", \"type\": \"uint256\" } ], \"name\": \"ERC20InsufficientAllowance\", \"type\": \"error\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"sender\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"balance\", \"type\": \"uint256\" }, { \"internalType\": \"uint256\", \"name\": \"needed\", \"type\": \"uint256\" } ], \"name\": \"ERC20InsufficientBalance\", \"type\": \"error\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"approver\", \"type\": \"address\" } ], \"name\": \"ERC20InvalidApprover\", \"type\": \"error\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"receiver\", \"type\": \"address\" } ], \"name\": \"ERC20InvalidReceiver\", \"type\": \"error\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"sender\", \"type\": \"address\" } ], \"name\": \"ERC20InvalidSender\", \"type\": \"error\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"spender\", \"type\": \"address\" } ], \"name\": \"ERC20InvalidSpender\", \"type\": \"error\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": true, \"internalType\": \"address\", \"name\": \"owner\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"spender\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint256\", \"name\": \"value\", \"type\": \"uint256\" } ], \"name\": \"Approval\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": true, \"internalType\": \"address\", \"name\": \"from\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint256\", \"name\": \"value\", \"type\": \"uint256\" } ], \"name\": \"Transfer\", \"type\": \"event\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"owner\", \"type\": \"address\" }, { \"internalType\": \"address\", \"name\": \"spender\", \"type\": \"address\" } ], \"name\": \"allowance\", \"outputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"spender\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"value\", \"type\": \"uint256\" } ], \"name\": \"approve\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"account\", \"type\": \"address\" } ], \"name\": \"balanceOf\", \"outputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [], \"name\": \"decimals\", \"outputs\": [ { \"internalType\": \"uint8\", \"name\": \"\", \"type\": \"uint8\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"amount\", \"type\": \"uint256\" } ], \"name\": \"mint\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [], \"name\": \"name\", \"outputs\": [ { \"internalType\": \"string\", \"name\": \"\", \"type\": \"string\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [], \"name\": \"symbol\", \"outputs\": [ { \"internalType\": \"string\", \"name\": \"\", \"type\": \"string\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [], \"name\": \"totalSupply\", \"outputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"value\", \"type\": \"uint256\" } ], \"name\": \"transfer\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"from\", \"type\": \"address\" }, { \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"value\", \"type\": \"uint256\" } ], \"name\": \"transferFrom\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"stateMutability\": \"nonpayable\", \"type\": \"function\" } ]"; - public const string Mint721 = "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"renounceRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"revokeRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"previousAdminRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"newAdminRole\",\"type\":\"bytes32\"}],\"name\":\"RoleAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"}],\"name\":\"safeMint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasRole\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MINTER_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]"; - public const string Mint1155 = "[ { \"inputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"constructor\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": true, \"internalType\": \"address\", \"name\": \"account\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"operator\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"bool\", \"name\": \"approved\", \"type\": \"bool\" } ], \"name\": \"ApprovalForAll\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": true, \"internalType\": \"address\", \"name\": \"operator\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"from\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint256[]\", \"name\": \"ids\", \"type\": \"uint256[]\" }, { \"indexed\": false, \"internalType\": \"uint256[]\", \"name\": \"values\", \"type\": \"uint256[]\" } ], \"name\": \"TransferBatch\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": true, \"internalType\": \"address\", \"name\": \"operator\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"from\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint256\", \"name\": \"id\", \"type\": \"uint256\" }, { \"indexed\": false, \"internalType\": \"uint256\", \"name\": \"value\", \"type\": \"uint256\" } ], \"name\": \"TransferSingle\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": false, \"internalType\": \"string\", \"name\": \"value\", \"type\": \"string\" }, { \"indexed\": true, \"internalType\": \"uint256\", \"name\": \"id\", \"type\": \"uint256\" } ], \"name\": \"URI\", \"type\": \"event\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"account\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"id\", \"type\": \"uint256\" } ], \"name\": \"balanceOf\", \"outputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address[]\", \"name\": \"accounts\", \"type\": \"address[]\" }, { \"internalType\": \"uint256[]\", \"name\": \"ids\", \"type\": \"uint256[]\" } ], \"name\": \"balanceOfBatch\", \"outputs\": [ { \"internalType\": \"uint256[]\", \"name\": \"\", \"type\": \"uint256[]\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"account\", \"type\": \"address\" }, { \"internalType\": \"address\", \"name\": \"operator\", \"type\": \"address\" } ], \"name\": \"isApprovedForAll\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"account\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"id\", \"type\": \"uint256\" }, { \"internalType\": \"uint256\", \"name\": \"amount\", \"type\": \"uint256\" }, { \"internalType\": \"bytes\", \"name\": \"data\", \"type\": \"bytes\" } ], \"name\": \"mint\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"internalType\": \"uint256[]\", \"name\": \"ids\", \"type\": \"uint256[]\" }, { \"internalType\": \"uint256[]\", \"name\": \"amounts\", \"type\": \"uint256[]\" }, { \"internalType\": \"bytes\", \"name\": \"data\", \"type\": \"bytes\" } ], \"name\": \"mintBatch\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"from\", \"type\": \"address\" }, { \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"internalType\": \"uint256[]\", \"name\": \"ids\", \"type\": \"uint256[]\" }, { \"internalType\": \"uint256[]\", \"name\": \"amounts\", \"type\": \"uint256[]\" }, { \"internalType\": \"bytes\", \"name\": \"data\", \"type\": \"bytes\" } ], \"name\": \"safeBatchTransferFrom\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"from\", \"type\": \"address\" }, { \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"id\", \"type\": \"uint256\" }, { \"internalType\": \"uint256\", \"name\": \"amount\", \"type\": \"uint256\" }, { \"internalType\": \"bytes\", \"name\": \"data\", \"type\": \"bytes\" } ], \"name\": \"safeTransferFrom\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"operator\", \"type\": \"address\" }, { \"internalType\": \"bool\", \"name\": \"approved\", \"type\": \"bool\" } ], \"name\": \"setApprovalForAll\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"bytes4\", \"name\": \"interfaceId\", \"type\": \"bytes4\" } ], \"name\": \"supportsInterface\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"name\": \"uri\", \"outputs\": [ { \"internalType\": \"string\", \"name\": \"\", \"type\": \"string\" } ], \"stateMutability\": \"view\", \"type\": \"function\" } ]"; + public const string Erc20 = + "[ { \"inputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"constructor\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"spender\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"allowance\", \"type\": \"uint256\" }, { \"internalType\": \"uint256\", \"name\": \"needed\", \"type\": \"uint256\" } ], \"name\": \"ERC20InsufficientAllowance\", \"type\": \"error\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"sender\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"balance\", \"type\": \"uint256\" }, { \"internalType\": \"uint256\", \"name\": \"needed\", \"type\": \"uint256\" } ], \"name\": \"ERC20InsufficientBalance\", \"type\": \"error\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"approver\", \"type\": \"address\" } ], \"name\": \"ERC20InvalidApprover\", \"type\": \"error\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"receiver\", \"type\": \"address\" } ], \"name\": \"ERC20InvalidReceiver\", \"type\": \"error\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"sender\", \"type\": \"address\" } ], \"name\": \"ERC20InvalidSender\", \"type\": \"error\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"spender\", \"type\": \"address\" } ], \"name\": \"ERC20InvalidSpender\", \"type\": \"error\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": true, \"internalType\": \"address\", \"name\": \"owner\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"spender\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint256\", \"name\": \"value\", \"type\": \"uint256\" } ], \"name\": \"Approval\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": true, \"internalType\": \"address\", \"name\": \"from\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint256\", \"name\": \"value\", \"type\": \"uint256\" } ], \"name\": \"Transfer\", \"type\": \"event\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"owner\", \"type\": \"address\" }, { \"internalType\": \"address\", \"name\": \"spender\", \"type\": \"address\" } ], \"name\": \"allowance\", \"outputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"spender\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"value\", \"type\": \"uint256\" } ], \"name\": \"approve\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"account\", \"type\": \"address\" } ], \"name\": \"balanceOf\", \"outputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [], \"name\": \"decimals\", \"outputs\": [ { \"internalType\": \"uint8\", \"name\": \"\", \"type\": \"uint8\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"_to\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"_amount\", \"type\": \"uint256\" } ], \"name\": \"mint\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [], \"name\": \"name\", \"outputs\": [ { \"internalType\": \"string\", \"name\": \"\", \"type\": \"string\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [], \"name\": \"symbol\", \"outputs\": [ { \"internalType\": \"string\", \"name\": \"\", \"type\": \"string\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [], \"name\": \"totalSupply\", \"outputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"value\", \"type\": \"uint256\" } ], \"name\": \"transfer\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"from\", \"type\": \"address\" }, { \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"value\", \"type\": \"uint256\" } ], \"name\": \"transferFrom\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"stateMutability\": \"nonpayable\", \"type\": \"function\" } ]"; + public const string Erc721 = + "[ { \"inputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"constructor\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"sender\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"tokenId\", \"type\": \"uint256\" }, { \"internalType\": \"address\", \"name\": \"owner\", \"type\": \"address\" } ], \"name\": \"ERC721IncorrectOwner\", \"type\": \"error\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"operator\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"tokenId\", \"type\": \"uint256\" } ], \"name\": \"ERC721InsufficientApproval\", \"type\": \"error\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"approver\", \"type\": \"address\" } ], \"name\": \"ERC721InvalidApprover\", \"type\": \"error\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"operator\", \"type\": \"address\" } ], \"name\": \"ERC721InvalidOperator\", \"type\": \"error\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"owner\", \"type\": \"address\" } ], \"name\": \"ERC721InvalidOwner\", \"type\": \"error\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"receiver\", \"type\": \"address\" } ], \"name\": \"ERC721InvalidReceiver\", \"type\": \"error\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"sender\", \"type\": \"address\" } ], \"name\": \"ERC721InvalidSender\", \"type\": \"error\" }, { \"inputs\": [ { \"internalType\": \"uint256\", \"name\": \"tokenId\", \"type\": \"uint256\" } ], \"name\": \"ERC721NonexistentToken\", \"type\": \"error\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": true, \"internalType\": \"address\", \"name\": \"owner\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"approved\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"uint256\", \"name\": \"tokenId\", \"type\": \"uint256\" } ], \"name\": \"Approval\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": true, \"internalType\": \"address\", \"name\": \"owner\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"operator\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"bool\", \"name\": \"approved\", \"type\": \"bool\" } ], \"name\": \"ApprovalForAll\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": false, \"internalType\": \"uint256\", \"name\": \"_fromTokenId\", \"type\": \"uint256\" }, { \"indexed\": false, \"internalType\": \"uint256\", \"name\": \"_toTokenId\", \"type\": \"uint256\" } ], \"name\": \"BatchMetadataUpdate\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": false, \"internalType\": \"uint256\", \"name\": \"_tokenId\", \"type\": \"uint256\" } ], \"name\": \"MetadataUpdate\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": true, \"internalType\": \"address\", \"name\": \"from\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"uint256\", \"name\": \"tokenId\", \"type\": \"uint256\" } ], \"name\": \"Transfer\", \"type\": \"event\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"tokenId\", \"type\": \"uint256\" } ], \"name\": \"approve\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"owner\", \"type\": \"address\" } ], \"name\": \"balanceOf\", \"outputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"uint256\", \"name\": \"tokenId\", \"type\": \"uint256\" } ], \"name\": \"getApproved\", \"outputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"owner\", \"type\": \"address\" }, { \"internalType\": \"address\", \"name\": \"operator\", \"type\": \"address\" } ], \"name\": \"isApprovedForAll\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [], \"name\": \"name\", \"outputs\": [ { \"internalType\": \"string\", \"name\": \"\", \"type\": \"string\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"uint256\", \"name\": \"tokenId\", \"type\": \"uint256\" } ], \"name\": \"ownerOf\", \"outputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"_to\", \"type\": \"address\" }, { \"internalType\": \"string\", \"name\": \"_uri\", \"type\": \"string\" } ], \"name\": \"safeMint\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"from\", \"type\": \"address\" }, { \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"tokenId\", \"type\": \"uint256\" } ], \"name\": \"safeTransferFrom\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"from\", \"type\": \"address\" }, { \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"tokenId\", \"type\": \"uint256\" }, { \"internalType\": \"bytes\", \"name\": \"data\", \"type\": \"bytes\" } ], \"name\": \"safeTransferFrom\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"operator\", \"type\": \"address\" }, { \"internalType\": \"bool\", \"name\": \"approved\", \"type\": \"bool\" } ], \"name\": \"setApprovalForAll\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"bytes4\", \"name\": \"interfaceId\", \"type\": \"bytes4\" } ], \"name\": \"supportsInterface\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [], \"name\": \"symbol\", \"outputs\": [ { \"internalType\": \"string\", \"name\": \"\", \"type\": \"string\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"uint256\", \"name\": \"tokenId\", \"type\": \"uint256\" } ], \"name\": \"tokenURI\", \"outputs\": [ { \"internalType\": \"string\", \"name\": \"\", \"type\": \"string\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"from\", \"type\": \"address\" }, { \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"tokenId\", \"type\": \"uint256\" } ], \"name\": \"transferFrom\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" } ]"; + public const string Erc1155 = + "[ { \"inputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"constructor\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"sender\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"balance\", \"type\": \"uint256\" }, { \"internalType\": \"uint256\", \"name\": \"needed\", \"type\": \"uint256\" }, { \"internalType\": \"uint256\", \"name\": \"tokenId\", \"type\": \"uint256\" } ], \"name\": \"ERC1155InsufficientBalance\", \"type\": \"error\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"approver\", \"type\": \"address\" } ], \"name\": \"ERC1155InvalidApprover\", \"type\": \"error\" }, { \"inputs\": [ { \"internalType\": \"uint256\", \"name\": \"idsLength\", \"type\": \"uint256\" }, { \"internalType\": \"uint256\", \"name\": \"valuesLength\", \"type\": \"uint256\" } ], \"name\": \"ERC1155InvalidArrayLength\", \"type\": \"error\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"operator\", \"type\": \"address\" } ], \"name\": \"ERC1155InvalidOperator\", \"type\": \"error\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"receiver\", \"type\": \"address\" } ], \"name\": \"ERC1155InvalidReceiver\", \"type\": \"error\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"sender\", \"type\": \"address\" } ], \"name\": \"ERC1155InvalidSender\", \"type\": \"error\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"operator\", \"type\": \"address\" }, { \"internalType\": \"address\", \"name\": \"owner\", \"type\": \"address\" } ], \"name\": \"ERC1155MissingApprovalForAll\", \"type\": \"error\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": true, \"internalType\": \"address\", \"name\": \"account\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"operator\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"bool\", \"name\": \"approved\", \"type\": \"bool\" } ], \"name\": \"ApprovalForAll\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": true, \"internalType\": \"address\", \"name\": \"operator\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"from\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint256[]\", \"name\": \"ids\", \"type\": \"uint256[]\" }, { \"indexed\": false, \"internalType\": \"uint256[]\", \"name\": \"values\", \"type\": \"uint256[]\" } ], \"name\": \"TransferBatch\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": true, \"internalType\": \"address\", \"name\": \"operator\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"from\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint256\", \"name\": \"id\", \"type\": \"uint256\" }, { \"indexed\": false, \"internalType\": \"uint256\", \"name\": \"value\", \"type\": \"uint256\" } ], \"name\": \"TransferSingle\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": false, \"internalType\": \"string\", \"name\": \"value\", \"type\": \"string\" }, { \"indexed\": true, \"internalType\": \"uint256\", \"name\": \"id\", \"type\": \"uint256\" } ], \"name\": \"URI\", \"type\": \"event\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"account\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"id\", \"type\": \"uint256\" } ], \"name\": \"balanceOf\", \"outputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address[]\", \"name\": \"accounts\", \"type\": \"address[]\" }, { \"internalType\": \"uint256[]\", \"name\": \"ids\", \"type\": \"uint256[]\" } ], \"name\": \"balanceOfBatch\", \"outputs\": [ { \"internalType\": \"uint256[]\", \"name\": \"\", \"type\": \"uint256[]\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"account\", \"type\": \"address\" }, { \"internalType\": \"address\", \"name\": \"operator\", \"type\": \"address\" } ], \"name\": \"isApprovedForAll\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"_to\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"_id\", \"type\": \"uint256\" }, { \"internalType\": \"uint256\", \"name\": \"_amount\", \"type\": \"uint256\" }, { \"internalType\": \"bytes\", \"name\": \"_data\", \"type\": \"bytes\" } ], \"name\": \"mint\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"_to\", \"type\": \"address\" }, { \"internalType\": \"uint256[]\", \"name\": \"_ids\", \"type\": \"uint256[]\" }, { \"internalType\": \"uint256[]\", \"name\": \"_amounts\", \"type\": \"uint256[]\" }, { \"internalType\": \"bytes\", \"name\": \"_data\", \"type\": \"bytes\" } ], \"name\": \"mintBatch\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"from\", \"type\": \"address\" }, { \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"internalType\": \"uint256[]\", \"name\": \"ids\", \"type\": \"uint256[]\" }, { \"internalType\": \"uint256[]\", \"name\": \"values\", \"type\": \"uint256[]\" }, { \"internalType\": \"bytes\", \"name\": \"data\", \"type\": \"bytes\" } ], \"name\": \"safeBatchTransferFrom\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"from\", \"type\": \"address\" }, { \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"id\", \"type\": \"uint256\" }, { \"internalType\": \"uint256\", \"name\": \"value\", \"type\": \"uint256\" }, { \"internalType\": \"bytes\", \"name\": \"data\", \"type\": \"bytes\" } ], \"name\": \"safeTransferFrom\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"operator\", \"type\": \"address\" }, { \"internalType\": \"bool\", \"name\": \"approved\", \"type\": \"bool\" } ], \"name\": \"setApprovalForAll\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"bytes4\", \"name\": \"interfaceId\", \"type\": \"bytes4\" } ], \"name\": \"supportsInterface\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"name\": \"uri\", \"outputs\": [ { \"internalType\": \"string\", \"name\": \"\", \"type\": \"string\" } ], \"stateMutability\": \"view\", \"type\": \"function\" } ]"; + public const string ArrayTotal = + "[ { \"inputs\": [ { \"internalType\": \"uint256\", \"name\": \"_myArg\", \"type\": \"uint256\" } ], \"name\": \"addTotal\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [], \"name\": \"getStore\", \"outputs\": [ { \"internalType\": \"string[]\", \"name\": \"\", \"type\": \"string[]\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"name\": \"myTotal\", \"outputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"string[]\", \"name\": \"_addresses\", \"type\": \"string[]\" } ], \"name\": \"setStore\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" } ]"; } } \ No newline at end of file diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/Contracts.cs b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/Contracts.cs new file mode 100644 index 000000000..5762141cb --- /dev/null +++ b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/Contracts.cs @@ -0,0 +1,10 @@ +namespace Scripts.EVM.Token +{ + public class Contracts + { + public const string Erc20 = "0x358969310231363CBEcFEFe47323139569D8a88b"; + public const string Erc721 = "0x4f75BB7bdd6f7A0fD32f1b3A94dfF409F5a3F1CC"; + public const string Erc1155 = "0xAA2EbE78aa788d13AfFaaefD38C93333bbC4d51e"; + public const string ArrayTotal = "0x9839293240C535d8009920390b4D3DA256d31177"; + } +} \ No newline at end of file diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/Contracts.cs.meta b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/Contracts.cs.meta new file mode 100644 index 000000000..7d8b28f4f --- /dev/null +++ b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/Contracts.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 8bcba01b7d3d4593917935a2159b782c +timeCreated: 1699775716 \ No newline at end of file diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/Erc1155.cs b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/Erc1155.cs index c28b9c6c2..a291aceec 100644 --- a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/Erc1155.cs +++ b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/Erc1155.cs @@ -6,28 +6,20 @@ using Scripts.EVM.Remote; using UnityEngine; using UnityEngine.Networking; -using EthMethod = ChainSafe.Gaming.UnityPackage.EthMethod; namespace Scripts.EVM.Token { public static class Erc1155 { - private static readonly string Abi = ABI.Erc1155; - /// /// Fetches all 1155 Nfts from an account /// /// - /// - /// /// - /// - /// - /// /// - public static async Task AllErc1155(Web3 web3, string chain, string network, string account, string contract, int take, int skip) + public static async Task AllErc1155(Web3 web3, string account) { - return await CSServer.AllErc1155(web3, chain, network, account, contract, take, skip); + return await CSServer.AllErc1155(web3, account); } /// @@ -65,8 +57,8 @@ public static async Task BalanceOf(Web3 web3, string contractAddress } private static async Task BalanceOf(Web3 web3, string contractAddress, string account, object[] parameters) { - var contract = web3.ContractBuilder.Build(Abi, contractAddress); - var contractData = await contract.Call(CommonMethod.BalanceOf, parameters); + var contract = web3.ContractBuilder.Build(ABI.Erc1155, contractAddress); + var contractData = await contract.Call(EthMethod.BalanceOf, parameters); return BigInteger.Parse(contractData[0].ToString()); } @@ -80,8 +72,8 @@ private static async Task BalanceOf(Web3 web3, string contractAddres /// public static async Task> BalanceOfBatch(Web3 web3, string contractAddress, string[] accounts, string[] tokenIds) { - var contract = web3.ContractBuilder.Build(Abi, contractAddress); - var contractData = await contract.Call(CommonMethod.BalanceOfBatch, new object[] + var contract = web3.ContractBuilder.Build(ABI.Erc1155, contractAddress); + var contractData = await contract.Call(EthMethod.BalanceOfBatch, new object[] { accounts, tokenIds @@ -99,13 +91,13 @@ public static async Task> BalanceOfBatch(Web3 web3, string cont public static async Task Uri(Web3 web3, string contractAddress, string tokenId) { const string ipfsPath = "https://ipfs.io/ipfs/"; - var contract = web3.ContractBuilder.Build(Abi, contractAddress); + var contract = web3.ContractBuilder.Build(ABI.Erc1155, contractAddress); if (tokenId.StartsWith("0x")) { string convertUri = tokenId.Replace("0x", "f"); return ipfsPath + convertUri; } - var contractData = await contract.Call(CommonMethod.Uri, new object[] + var contractData = await contract.Call(EthMethod.Uri, new object[] { tokenId }); @@ -124,7 +116,7 @@ public static async Task Uri(Web3 web3, string contractAddress, string t public static async Task MintErc1155(Web3 web3, string abi, string contractAddress, BigInteger id, BigInteger amount) { byte[] dataObject = { }; - const string method = "mint"; + const string method = EthMethod.Mint; var destination = await web3.Signer.GetAddress(); var contract = web3.ContractBuilder.Build(abi, contractAddress); return await contract.Send(method, new object[] { destination, id, amount, dataObject }); diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/Erc20.cs b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/Erc20.cs index f5735ab96..91bf106f6 100644 --- a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/Erc20.cs +++ b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/Erc20.cs @@ -1,15 +1,12 @@ using System.Numerics; using System.Threading.Tasks; using ChainSafe.Gaming.Evm.Providers; -using ChainSafe.Gaming.UnityPackage; using ChainSafe.Gaming.Web3; namespace Scripts.EVM.Token { public static class Erc20 { - private static readonly string Abi = ABI.Erc20; - /// /// Balance Of ERC20 Address /// @@ -19,8 +16,8 @@ public static class Erc20 /// public static async Task BalanceOf(Web3 web3, string contractAddress, string account) { - var contract = web3.ContractBuilder.Build(Abi, contractAddress); - var contractData = await contract.Call(CommonMethod.BalanceOf, new object[] + var contract = web3.ContractBuilder.Build(ABI.Erc20, contractAddress); + var contractData = await contract.Call(EthMethod.BalanceOf, new object[] { account }); @@ -38,7 +35,7 @@ public static async Task CustomTokenBalance(Web3 web3, string contra { var contract = web3.ContractBuilder.Build(contractAbi, contractAddress); string address = await web3.Signer.GetAddress(); - var contractData = await contract.Call(CommonMethod.BalanceOf, new object[] { address }); + var contractData = await contract.Call(EthMethod.BalanceOf, new object[] { address }); return BigInteger.Parse(contractData[0].ToString()); } @@ -61,8 +58,8 @@ public static async Task NativeBalanceOf(Web3 web3, string account) /// public static async Task Name(Web3 web3, string contractAddress) { - var contract = web3.ContractBuilder.Build(Abi, contractAddress); - var name = await contract.Call(CommonMethod.Name); + var contract = web3.ContractBuilder.Build(ABI.Erc20, contractAddress); + var name = await contract.Call(EthMethod.Name); return name[0].ToString(); } @@ -74,8 +71,8 @@ public static async Task Name(Web3 web3, string contractAddress) /// public static async Task Symbol(Web3 web3, string contractAddress) { - var contract = web3.ContractBuilder.Build(Abi, contractAddress); - var symbol = await contract.Call(CommonMethod.Symbol); + var contract = web3.ContractBuilder.Build(ABI.Erc20, contractAddress); + var symbol = await contract.Call(EthMethod.Symbol); return symbol[0].ToString(); } @@ -87,8 +84,8 @@ public static async Task Symbol(Web3 web3, string contractAddress) /// public static async Task Decimals(Web3 web3, string contractAddress) { - var contract = web3.ContractBuilder.Build(Abi, contractAddress); - var decimals = await contract.Call(CommonMethod.Decimals); + var contract = web3.ContractBuilder.Build(ABI.Erc20, contractAddress); + var decimals = await contract.Call(EthMethod.Decimals); return BigInteger.Parse(decimals[0].ToString()); } @@ -100,8 +97,8 @@ public static async Task Decimals(Web3 web3, string contractAddress) /// public static async Task TotalSupply(Web3 web3, string contractAddress) { - var contract = web3.ContractBuilder.Build(Abi, contractAddress); - var totalSupply = await contract.Call(CommonMethod.TotalSupply); + var contract = web3.ContractBuilder.Build(ABI.Erc20, contractAddress); + var totalSupply = await contract.Call(EthMethod.TotalSupply); return BigInteger.Parse(totalSupply[0].ToString()); } @@ -114,9 +111,9 @@ public static async Task TotalSupply(Web3 web3, string contractAddre /// public static async Task MintErc20(Web3 web3, string contractAddress, string toAccount, BigInteger amount) { - const string method = "mint"; + const string method = EthMethod.Mint; var destination = await web3.Signer.GetAddress(); - var contract = web3.ContractBuilder.Build(Abi, contractAddress); + var contract = web3.ContractBuilder.Build(ABI.Erc20, contractAddress); return await contract.Send(method, new object[] { toAccount, amount }); } @@ -128,11 +125,11 @@ public static async Task MintErc20(Web3 web3, string contractAddress, /// /// /// + /// public static async Task TransferErc20(Web3 web3, string contractAddress, string toAccount, BigInteger amount) { - var abi = ABI.Erc20; var method = EthMethod.Transfer; - var contract = web3.ContractBuilder.Build(abi, contractAddress); + var contract = web3.ContractBuilder.Build(ABI.Erc20, contractAddress); var response = await contract.Send(method, new object[] { toAccount, diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/Erc721.cs b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/Erc721.cs index 267b33b1b..409627d4c 100644 --- a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/Erc721.cs +++ b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/Erc721.cs @@ -1,32 +1,25 @@ using System.Collections.Generic; using System.Numerics; using System.Threading.Tasks; -using ChainSafe.Gaming.UnityPackage; +using ChainSafe.Gaming.MultiCall; using ChainSafe.Gaming.Web3; -using Newtonsoft.Json; +using Nethereum.Contracts.QueryHandlers.MultiCall; +using Nethereum.Hex.HexConvertors.Extensions; using Scripts.EVM.Remote; -using UnityEngine; namespace Scripts.EVM.Token { public static class Erc721 { - private static string _abi = ABI.Erc721; - /// /// Fetches all 721 Nfts from an account /// /// - /// - /// /// - /// - /// - /// /// - public static async Task AllErc721(Web3 web3, string chain, string network, string account, string contract, int take, int skip) + public static async Task AllErc721(Web3 web3, string account) { - return await CSServer.AllErc721(web3, chain, network, account, contract, take, skip); + return await CSServer.AllErc721(web3, account); } /// @@ -38,8 +31,8 @@ public static async Task AllErc721(Web3 web3, string chain, str /// public static async Task BalanceOf(Web3 web3, string contractAddress, string account) { - var contract = web3.ContractBuilder.Build(_abi, contractAddress); - var contractData = await contract.Call(CommonMethod.BalanceOf, new object[] + var contract = web3.ContractBuilder.Build(ABI.Erc721, contractAddress); + var contractData = await contract.Call(EthMethod.BalanceOf, new object[] { account }); @@ -71,58 +64,48 @@ public static async Task OwnerOf(Web3 web3, string contractAddress, BigI } private static async Task OwnerOf(Web3 web3, string contractAddress, object[] parameters) { - var method = CommonMethod.OwnerOf; - var contract = web3.ContractBuilder.Build(_abi, contractAddress); + var method = EthMethod.OwnerOf; + var contract = web3.ContractBuilder.Build(ABI.Erc721, contractAddress); var contractData = await contract.Call(method, parameters); return contractData[0].ToString(); } - + /// - /// Owner Of Batch ERC721 Token + /// Returns owners of batch /// - /// - /// - /// - /// - /// public static async Task> OwnerOfBatch( Web3 web3, string contractAddress, - string[] tokenIds, - string multicall = "") + string[] tokenIds) { - var method = CommonMethod.OwnerOf; - // build array of args - var obj = new string[tokenIds.Length][]; - for (var i = 0; i < tokenIds.Length; i++) - { - obj[i] = new[] + var erc721Contract = web3.ContractBuilder.Build(ABI.Erc721, contractAddress); + List calls = new List(); + for (int i = 0; i < tokenIds.Length; i++) + { + var callData = erc721Contract.Calldata(EthMethod.OwnerOf, new object[] { tokenIds[i] + }); + var call3Value = new Call3Value() + { + Target = Contracts.Erc721, + AllowFailure = true, + CallData = callData.HexToByteArray() }; - } - var args = JsonConvert.SerializeObject(obj); - var response = await Remote.CSServer.Multicall(web3, web3.ChainConfig.ChainId, web3.ChainConfig.Network, - contractAddress, _abi, method, args, multicall, web3.ChainConfig.Rpc); - try + calls.Add(call3Value); + }; + + var multiCallResultResponse = await web3.MultiCall().MultiCallAsync(calls.ToArray()); + var owners = new List(); + for (int i = 0; i < multiCallResultResponse.Count; i++) { - var responses = JsonConvert.DeserializeObject(response); - var owners = new List(); - - foreach (var t in responses) + if (multiCallResultResponse[i] != null && multiCallResultResponse[i].Success) { - // clean up address - var address = "0x" + t.Substring(t.Length - 40); - owners.Add(address); + var owner = erc721Contract.Decode(EthMethod.OwnerOf, multiCallResultResponse[i].ReturnData.ToHex()); + owners.Add(owner[0].ToString()); } - - return owners; - } - catch - { - Debug.LogError(response); - throw; } + return owners; } /// @@ -135,14 +118,14 @@ public static async Task> OwnerOfBatch( public static async Task Uri(Web3 web3, string contractAddress, string tokenId) { const string ipfsPath = "https://ipfs.io/ipfs/"; - var contract = web3.ContractBuilder.Build(_abi, contractAddress); + var contract = web3.ContractBuilder.Build(ABI.Erc721, contractAddress); if (tokenId.StartsWith("0x")) { var convertUri = tokenId.Replace("0x", "f"); return ipfsPath + convertUri; } - var contractData = await contract.Call(CommonMethod.TokenUri, new object[] + var contractData = await contract.Call(EthMethod.TokenUri, new object[] { tokenId }); @@ -159,7 +142,7 @@ public static async Task Uri(Web3 web3, string contractAddress, string t /// public static async Task MintErc721(Web3 web3, string abi, string contractAddress, string uri) { - const string method = "safeMint"; + const string method = EthMethod.SafeMint; var destination = await web3.Signer.GetAddress(); var contract = web3.ContractBuilder.Build(abi, contractAddress); return await contract.Send(method, new object[] { destination, uri }); diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/Evm.cs b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/Evm.cs index 4d41a1be3..cbe6ddcc0 100644 --- a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/Evm.cs +++ b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/Evm.cs @@ -12,6 +12,7 @@ using Nethereum.Hex.HexTypes; using Nethereum.Signer; using Nethereum.Util; +using UnityEngine; using Web3Unity.Scripts.Library.IPFS; using Web3Unity.Scripts.Prefabs; @@ -43,10 +44,10 @@ public static async Task GetBlockNumber(Web3 web3) return await web3.RpcProvider.GetBlockNumber(); } - public static async Task GetGasLimit(Web3 web3, string contractAbi, string contractAddress, string method) + public static async Task GetGasLimit(Web3 web3, string contractAbi, string contractAddress, string method, object[] args) { var contract = web3.ContractBuilder.Build(contractAbi, contractAddress); - return await contract.EstimateGas(method, new object[] { }); + return await contract.EstimateGas(method, args); } public static async Task GetGasPrice(Web3 web3) @@ -124,16 +125,14 @@ public static async Task SignVerify(Web3 web3, string message) { var playerAccount = await web3.Signer.GetAddress(); var signatureString = await web3.Signer.SignMessage(message); - var msg = "\x19" + "Ethereum Signed Message:\n" + message.Length + message; var msgHash = new Sha3Keccack().CalculateHash(Encoding.UTF8.GetBytes(msg)); var signature = MessageSigner.ExtractEcdsaSignature(signatureString); var key = EthECKey.RecoverFromSignature(signature, msgHash); - return key.GetPublicAddress() == playerAccount; } - public static string PrivateKeySignTransaction(string _privateKey, string _transaction, string _chainId) + public static string EcdsaSignTransaction(string _privateKey, string _transaction, string _chainId) { int MATIC_MAIN = 137; int MATIC_MUMBAI = 80001; @@ -164,13 +163,13 @@ public static string PrivateKeySignTransaction(string _privateKey, string _trans return signature; } - public static string PrivateKeyGetAddress(string _privateKey) + public static string EcdsaGetAddress(string _privateKey) { EthECKey key = new EthECKey(_privateKey); return key.GetPublicAddress(); } - public static string PrivateKeySignMessage(string _privateKey, string _message) + public static string EcdsaSignMessage(string _privateKey, string _message) { var signer = new EthereumMessageSigner(); string signature = signer.HashAndSign(_message, _privateKey); diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/Methods.cs b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/Methods.cs index 50d3e8611..b203c64a1 100644 --- a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/Methods.cs +++ b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/Methods.cs @@ -1,6 +1,6 @@ namespace Scripts.EVM.Token { - public static class CommonMethod + public static class EthMethod { public const string BalanceOf = "balanceOf"; public const string Name = "name"; @@ -13,5 +13,7 @@ public static class CommonMethod public const string BalanceOfBatch = "balanceOfBatch"; public const string Transfer = "transfer"; public const string SafeTransferFrom = "safeTransferFrom"; + public const string Mint = "mint"; + public const string SafeMint = "safeMint"; } } \ No newline at end of file diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EthMethod.cs b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EthMethod.cs deleted file mode 100644 index 58e321df1..000000000 --- a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EthMethod.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace ChainSafe.Gaming.UnityPackage -{ - public static class EthMethod - { - public const string BalanceOf = "balanceOf"; - public const string Name = "name"; - public const string Symbol = "symbol"; - public const string Decimals = "decimals"; - public const string TotalSupply = "totalSupply"; - public const string OwnerOf = "ownerOf"; - public const string TokenUri = "tokenURI"; - public const string Uri = "uri"; - public const string BalanceOfBatch = "balanceOfBatch"; - public const string Transfer = "transfer"; - public const string SafeTransferFrom = "safeTransferFrom"; - } -} \ No newline at end of file diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EthMethod.cs.meta b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EthMethod.cs.meta deleted file mode 100644 index 74bdb6c39..000000000 --- a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/EthMethod.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: bb760047f12743142843ed9f14ff2205 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Samples/ABI.cs b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Samples/ABI.cs deleted file mode 100644 index 898cbc615..000000000 --- a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Samples/ABI.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace Web3Unity.Scripts.Prefabs -{ - public class ABI - { - public const string ERC_20 = - "[ { \"inputs\": [ { \"internalType\": \"string\", \"name\": \"name_\", \"type\": \"string\" }, { \"internalType\": \"string\", \"name\": \"symbol_\", \"type\": \"string\" } ], \"stateMutability\": \"nonpayable\", \"type\": \"constructor\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": true, \"internalType\": \"address\", \"name\": \"owner\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"spender\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint256\", \"name\": \"value\", \"type\": \"uint256\" } ], \"name\": \"Approval\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": true, \"internalType\": \"address\", \"name\": \"from\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint256\", \"name\": \"value\", \"type\": \"uint256\" } ], \"name\": \"Transfer\", \"type\": \"event\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"owner\", \"type\": \"address\" }, { \"internalType\": \"address\", \"name\": \"spender\", \"type\": \"address\" } ], \"name\": \"allowance\", \"outputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"spender\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"amount\", \"type\": \"uint256\" } ], \"name\": \"approve\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"account\", \"type\": \"address\" } ], \"name\": \"balanceOf\", \"outputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [], \"name\": \"decimals\", \"outputs\": [ { \"internalType\": \"uint8\", \"name\": \"\", \"type\": \"uint8\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"spender\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"subtractedValue\", \"type\": \"uint256\" } ], \"name\": \"decreaseAllowance\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"spender\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"addedValue\", \"type\": \"uint256\" } ], \"name\": \"increaseAllowance\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [], \"name\": \"name\", \"outputs\": [ { \"internalType\": \"string\", \"name\": \"\", \"type\": \"string\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [], \"name\": \"symbol\", \"outputs\": [ { \"internalType\": \"string\", \"name\": \"\", \"type\": \"string\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [], \"name\": \"totalSupply\", \"outputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"recipient\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"amount\", \"type\": \"uint256\" } ], \"name\": \"transfer\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"sender\", \"type\": \"address\" }, { \"internalType\": \"address\", \"name\": \"recipient\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"amount\", \"type\": \"uint256\" } ], \"name\": \"transferFrom\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"stateMutability\": \"nonpayable\", \"type\": \"function\" } ]"; - - public const string ERC_1155 = - "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"mintBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeBatchTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"}],\"name\":\"TransferBatch\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"TransferSingle\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"value\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"URI\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"}],\"name\":\"balanceOfBatch\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"uri\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]"; - - public const string ERC_721 = - "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"safeMint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]"; - - public const string ADD_TOTAL_ABI = - "[ { \"inputs\": [ { \"internalType\": \"uint8\", \"name\": \"_myArg\", \"type\": \"uint8\" } ], \"name\": \"addTotal\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [], \"name\": \"myTotal\", \"outputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"stateMutability\": \"view\", \"type\": \"function\" } ]"; - } -} \ No newline at end of file diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Samples/ABI.cs.meta b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Samples/ABI.cs.meta deleted file mode 100644 index a775d134c..000000000 --- a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Samples/ABI.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 018b9c26aeb87fd41ba97e9ba212bc79 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Samples/EthMethod.cs b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Samples/EthMethod.cs deleted file mode 100644 index 007c83f62..000000000 --- a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Samples/EthMethod.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace Web3Unity.Scripts.Prefabs -{ - public static class EthMethod - { - public const string BalanceOf = "balanceOf"; - public const string Name = "name"; - public const string Symbol = "symbol"; - public const string Decimals = "decimals"; - public const string TotalSupply = "totalSupply"; - public const string OwnerOf = "ownerOf"; - public const string TokenUri = "tokenURI"; - public const string Uri = "uri"; - public const string BalanceOfBatch = "balanceOfBatch"; - public const string Transfer = "transfer"; - public const string SafeTransferFrom = "safeTransferFrom"; - } -} \ No newline at end of file diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Samples/EthMethod.cs.meta b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Samples/EthMethod.cs.meta deleted file mode 100644 index 3b0c65aba..000000000 --- a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Samples/EthMethod.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 35af672b660def1488b2f4c01ab49ad2 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Samples/MultiCallSample.cs b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Samples/MultiCallSample.cs index 75d99d89e..a936a91c5 100644 --- a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Samples/MultiCallSample.cs +++ b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Samples/MultiCallSample.cs @@ -7,6 +7,7 @@ using Nethereum.ABI.FunctionEncoding; using Nethereum.Contracts.QueryHandlers.MultiCall; using Nethereum.Hex.HexConvertors.Extensions; +using Scripts.EVM.Token; using UnityEngine; public class MultiCallSample @@ -23,7 +24,7 @@ public MultiCallSample(Web3 web3) public async Task ErcSamples() { - var erc20Contract = web3.ContractBuilder.Build(ABI.ERC_20, Erc20ContractAddress); + var erc20Contract = web3.ContractBuilder.Build(ABI.Erc20, Erc20ContractAddress); var erc20BalanceOfCalldata = erc20Contract.Calldata(CommonMethod.BalanceOf, new object[] { Erc20Account diff --git a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Prefabs/Minter/VoucherMinter1155.prefab b/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Prefabs/Minter/VoucherMinter1155.prefab deleted file mode 100644 index 73532cb44..000000000 --- a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Prefabs/Minter/VoucherMinter1155.prefab +++ /dev/null @@ -1,395 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1 &2469385475120306930 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2469385475120306931} - - component: {fileID: 2469385475120306933} - - component: {fileID: 2469385475120306932} - m_Layer: 5 - m_Name: Text - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &2469385475120306931 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2469385475120306930} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 2469385475131455844} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &2469385475120306933 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2469385475120306930} - m_CullTransparentMesh: 1 ---- !u!114 &2469385475120306932 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2469385475120306930} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 14 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 4 - m_AlignByGeometry: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: Get Voucher Mint 1155 ---- !u!1 &2469385475131455843 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2469385475131455844} - - component: {fileID: 2469385475131455832} - - component: {fileID: 2469385475131455847} - - component: {fileID: 2469385475131455846} - m_Layer: 5 - m_Name: GetVoucher1155 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &2469385475131455844 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2469385475131455843} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 2469385475120306931} - m_Father: {fileID: 2469385476375445278} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 7.3307, y: 3} - m_SizeDelta: {x: 178.6985, y: 51.3155} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &2469385475131455832 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2469385475131455843} - m_CullTransparentMesh: 1 ---- !u!114 &2469385475131455847 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2469385475131455843} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!114 &2469385475131455846 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2469385475131455843} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_WrapAround: 0 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_SelectedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_SelectedTrigger: Selected - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 2469385475131455847} - m_OnClick: - m_PersistentCalls: - m_Calls: - - m_Target: {fileID: 8354423990863474395} - m_TargetAssemblyTypeName: MintWeb3Wallet1155, Assembly-CSharp - m_MethodName: VoucherMintNft1155 - m_Mode: 1 - m_Arguments: - m_ObjectArgument: {fileID: 0} - m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine - m_IntArgument: 0 - m_FloatArgument: 0 - m_StringArgument: - m_BoolArgument: 0 - m_CallState: 2 ---- !u!1 &2469385475538265602 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2469385475538265603} - m_Layer: 0 - m_Name: VoucherMinter1155 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &2469385475538265603 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2469385475538265602} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 550.5, y: 259.5, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 2469385476367201654} - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &2469385476367201653 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2469385476367201654} - - component: {fileID: 8354423990863474395} - m_Layer: 0 - m_Name: GetVoucher1155 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &2469385476367201654 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2469385476367201653} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -550.5, y: -259.5, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 2469385476375445278} - m_Father: {fileID: 2469385475538265603} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &8354423990863474395 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2469385476367201653} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: f530a2f3db5f5c7478b08921d42c5114, type: 3} - m_Name: - m_EditorClassIdentifier: - nftAddress: 0x2c1867bc3026178a47a677513746dcc6822a137a ---- !u!1 &2469385476375445277 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2469385476375445278} - - component: {fileID: 2469385476375445265} - - component: {fileID: 2469385476375445264} - - component: {fileID: 2469385476375445279} - m_Layer: 5 - m_Name: Canvas - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &2469385476375445278 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2469385476375445277} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0, y: 0, z: 0} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 2469385475131455844} - m_Father: {fileID: 2469385476367201654} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0, y: 0} ---- !u!223 &2469385476375445265 -Canvas: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2469385476375445277} - m_Enabled: 1 - serializedVersion: 3 - m_RenderMode: 0 - m_Camera: {fileID: 0} - m_PlaneDistance: 100 - m_PixelPerfect: 0 - m_ReceivesEvents: 1 - m_OverrideSorting: 0 - m_OverridePixelPerfect: 0 - m_SortingBucketNormalizedSize: 0 - m_AdditionalShaderChannelsFlag: 0 - m_SortingLayerID: 0 - m_SortingOrder: 0 - m_TargetDisplay: 0 ---- !u!114 &2469385476375445264 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2469385476375445277} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} - m_Name: - m_EditorClassIdentifier: - m_UiScaleMode: 0 - m_ReferencePixelsPerUnit: 100 - m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 - m_MatchWidthOrHeight: 0 - m_PhysicalUnit: 3 - m_FallbackScreenDPI: 96 - m_DefaultSpriteDPI: 96 - m_DynamicPixelsPerUnit: 1 - m_PresetInfoIsWorld: 0 ---- !u!114 &2469385476375445279 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2469385476375445277} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreReversedGraphics: 1 - m_BlockingObjects: 0 - m_BlockingMask: - serializedVersion: 2 - m_Bits: 4294967295 diff --git a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Prefabs/Minter/VoucherMinter1155.prefab.meta b/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Prefabs/Minter/VoucherMinter1155.prefab.meta deleted file mode 100644 index 97f0d0e46..000000000 --- a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Prefabs/Minter/VoucherMinter1155.prefab.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: adb4ed441865ece4195a1e5a5194795d -PrefabImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Prefabs/Minter/VoucherMinter721.prefab b/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Prefabs/Minter/VoucherMinter721.prefab deleted file mode 100644 index 6cfa7d719..000000000 --- a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Prefabs/Minter/VoucherMinter721.prefab +++ /dev/null @@ -1,395 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1 &2759602052112117140 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2759602052112117141} - m_Layer: 0 - m_Name: VoucherMinter721 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &2759602052112117141 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2759602052112117140} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 550.5, y: 259.5, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 2759602053411208928} - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &2759602052780609892 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2759602052780609893} - - component: {fileID: 2759602052780609891} - - component: {fileID: 2759602052780609890} - m_Layer: 5 - m_Name: Text - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &2759602052780609893 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2759602052780609892} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 2759602052787827442} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &2759602052780609891 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2759602052780609892} - m_CullTransparentMesh: 1 ---- !u!114 &2759602052780609890 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2759602052780609892} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 14 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 4 - m_AlignByGeometry: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: Get Voucher Mint 721 ---- !u!1 &2759602052787827445 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2759602052787827442} - - component: {fileID: 2759602052787827406} - - component: {fileID: 2759602052787827441} - - component: {fileID: 2759602052787827440} - m_Layer: 5 - m_Name: GetVoucher721 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &2759602052787827442 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2759602052787827445} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 2759602052780609893} - m_Father: {fileID: 2759602053423477896} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 7.3307, y: 5} - m_SizeDelta: {x: 178.6985, y: 51.3155} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &2759602052787827406 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2759602052787827445} - m_CullTransparentMesh: 1 ---- !u!114 &2759602052787827441 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2759602052787827445} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!114 &2759602052787827440 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2759602052787827445} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_WrapAround: 0 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_SelectedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_SelectedTrigger: Selected - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 2759602052787827441} - m_OnClick: - m_PersistentCalls: - m_Calls: - - m_Target: {fileID: 1370948658301429458} - m_TargetAssemblyTypeName: MintWeb3Wallet721, Assembly-CSharp - m_MethodName: VoucherMintNft721 - m_Mode: 1 - m_Arguments: - m_ObjectArgument: {fileID: 0} - m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine - m_IntArgument: 0 - m_FloatArgument: 0 - m_StringArgument: - m_BoolArgument: 0 - m_CallState: 2 ---- !u!1 &2759602053411208931 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2759602053411208928} - - component: {fileID: 1370948658301429458} - m_Layer: 0 - m_Name: GetVoucher721 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &2759602053411208928 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2759602053411208931} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -550.5, y: -259.5, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 2759602053423477896} - m_Father: {fileID: 2759602052112117141} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1370948658301429458 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2759602053411208931} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 785a5af054a848e4a93802898e155c97, type: 3} - m_Name: - m_EditorClassIdentifier: - nftAddress: f01559ae4021a47e26bc773587278f62a833f2a6117411afbc5a7855661936d1c ---- !u!1 &2759602053423477899 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2759602053423477896} - - component: {fileID: 2759602053423477895} - - component: {fileID: 2759602053423477894} - - component: {fileID: 2759602053423477897} - m_Layer: 5 - m_Name: Canvas - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &2759602053423477896 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2759602053423477899} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0, y: 0, z: 0} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 2759602052787827442} - m_Father: {fileID: 2759602053411208928} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0, y: 0} ---- !u!223 &2759602053423477895 -Canvas: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2759602053423477899} - m_Enabled: 1 - serializedVersion: 3 - m_RenderMode: 0 - m_Camera: {fileID: 0} - m_PlaneDistance: 100 - m_PixelPerfect: 0 - m_ReceivesEvents: 1 - m_OverrideSorting: 0 - m_OverridePixelPerfect: 0 - m_SortingBucketNormalizedSize: 0 - m_AdditionalShaderChannelsFlag: 0 - m_SortingLayerID: 0 - m_SortingOrder: 0 - m_TargetDisplay: 0 ---- !u!114 &2759602053423477894 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2759602053423477899} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} - m_Name: - m_EditorClassIdentifier: - m_UiScaleMode: 0 - m_ReferencePixelsPerUnit: 100 - m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 - m_MatchWidthOrHeight: 0 - m_PhysicalUnit: 3 - m_FallbackScreenDPI: 96 - m_DefaultSpriteDPI: 96 - m_DynamicPixelsPerUnit: 1 - m_PresetInfoIsWorld: 0 ---- !u!114 &2759602053423477897 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2759602053423477899} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreReversedGraphics: 1 - m_BlockingObjects: 0 - m_BlockingMask: - serializedVersion: 2 - m_Bits: 4294967295 diff --git a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Prefabs/Minter/VoucherMinter721.prefab.meta b/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Prefabs/Minter/VoucherMinter721.prefab.meta deleted file mode 100644 index b3025b80f..000000000 --- a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Prefabs/Minter/VoucherMinter721.prefab.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: cf8a2baf718a5584584015e1b2b23eb3 -PrefabImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scenes/SampleLogin.unity b/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scenes/SampleLogin.unity index 0f766adb4..086e5eb4e 100644 --- a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scenes/SampleLogin.unity +++ b/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scenes/SampleLogin.unity @@ -2675,7 +2675,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 96894e49d9863ec4db1d93a5e56f19cb, type: 3} m_Name: m_EditorClassIdentifier: - gelatoApiKey: _UzPz_Yk_WTjWMfcl45fLvQNGQ9ISx5ZE8TnwnVKYrE_ + gelatoApiKey: 7MFQqyGS1Iui_e_MgmFW1BfbFeJ06g8nnL2oUTlIJug_ errorPopup: {fileID: 1701305868} supportedWalletsDropdown: {fileID: 540464236} redirectToWalletToggle: {fileID: 981405684} diff --git a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scenes/SampleMain.unity b/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scenes/SampleMain.unity index 059bc2c4c..88c2ae9e0 100644 --- a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scenes/SampleMain.unity +++ b/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scenes/SampleMain.unity @@ -640,6 +640,10 @@ PrefabInstance: propertyPath: m_Name value: Button - OwnerOfBatch objectReference: {fileID: 0} + - target: {fileID: 8775736491206355084, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} - target: {fileID: 8781309615174179339, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_text value: OwnerOfBatch @@ -2329,7 +2333,7 @@ MonoBehaviour: m_HandleRect: {fileID: 37375165} m_Direction: 0 m_Value: 0 - m_Size: 0.20894393 + m_Size: 0.2672342 m_NumberOfSteps: 0 m_OnValueChanged: m_PersistentCalls: @@ -2505,7 +2509,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7324590823460843055, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName - value: RegisterContract + value: RegisteredContract objectReference: {fileID: 0} - target: {fileID: 7324590823460843055, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[1].m_MethodName @@ -6919,7 +6923,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7324590823460843055, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName - value: PrivateKeySignTransaction + value: EcdsaSignTransaction objectReference: {fileID: 0} - target: {fileID: 7324590823460843055, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[1].m_MethodName @@ -6943,11 +6947,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 8775736491206355084, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_Name - value: Button - SignTxPrivateKey + value: Button - SignTxECDSA objectReference: {fileID: 0} - target: {fileID: 8781309615174179339, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_text - value: PKSignTX + value: ECDSASignTX objectReference: {fileID: 0} - target: {fileID: 8781309615174179339, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_fontSize @@ -8415,7 +8419,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7324590823460843055, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName - value: PrivateKeyGetAddress + value: EcdsaGetAddress objectReference: {fileID: 0} - target: {fileID: 7324590823460843055, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[1].m_MethodName @@ -8439,11 +8443,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 8775736491206355084, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_Name - value: Button - GetAddressPrivateKey + value: Button - GetAddressECDSA objectReference: {fileID: 0} - target: {fileID: 8781309615174179339, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_text - value: PKGetAddress + value: ECDSAGetAddress objectReference: {fileID: 0} - target: {fileID: 8781309615174179339, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_fontSize @@ -9391,7 +9395,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7324590823460843055, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName - value: PrivateKeySignMessage + value: EcdsaSignMessage objectReference: {fileID: 0} - target: {fileID: 7324590823460843055, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[1].m_MethodName @@ -9415,11 +9419,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 8775736491206355084, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_Name - value: Button - SignMessagePrivateKey + value: Button - SignMessageECDSA objectReference: {fileID: 0} - target: {fileID: 8781309615174179339, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_text - value: PKSignMessage + value: ECDSASignMessage objectReference: {fileID: 0} - target: {fileID: 8781309615174179339, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_fontSize diff --git a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Prefabs/Minter/Mint1155.cs b/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Prefabs/Minter/Mint1155.cs deleted file mode 100644 index 4be2c33e7..000000000 --- a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Prefabs/Minter/Mint1155.cs +++ /dev/null @@ -1,42 +0,0 @@ -using ChainSafe.Gaming.Evm.Transactions; -using ChainSafe.Gaming.UnityPackage; -using ChainSafe.Gaming.UnityPackage.Model; -using UnityEngine; -using Scripts.EVM.Remote; -using Nethereum.Hex.HexTypes; -using Newtonsoft.Json; - -public class Mint1155 : MonoBehaviour -{ - // address of nft you want to mint - public string nftAddress = "0x2c1867bc3026178a47a677513746dcc6822a137a"; - - public async void VoucherMintNft1155() - { - var voucherResponse1155 = await CSServer.Get1155Voucher(Web3Accessor.Web3); - CreateRedeemVoucherModel.CreateVoucher1155 voucher1155 = new CreateRedeemVoucherModel.CreateVoucher1155(); - voucher1155.tokenId = voucherResponse1155.tokenId; - voucher1155.minPrice = voucherResponse1155.minPrice; - voucher1155.signer = voucherResponse1155.signer; - voucher1155.receiver = voucherResponse1155.receiver; - voucher1155.amount = voucherResponse1155.amount; - voucher1155.nonce = voucherResponse1155.nonce; - voucher1155.signature = voucherResponse1155.signature; - string voucherArgs = JsonUtility.ToJson(voucher1155); - - // connects to user's browser wallet to call a transaction - var chainConfig = Web3Accessor.Web3.ChainConfig; - RedeemVoucherTxModel.Response voucherResponse = await CSServer.CreateRedeemTransaction(Web3Accessor.Web3, chainConfig.Chain, chainConfig.Network, voucherArgs, "1155", nftAddress, voucherResponse1155.receiver); - var txRequest = new TransactionRequest - { - ChainId = HexBigIntUtil.ParseHexBigInt(chainConfig.ChainId), - To = voucherResponse.tx.to, - Value = new HexBigInteger(voucherResponse.tx.value), - Data = voucherResponse.tx.data, - GasLimit = HexBigIntUtil.ParseHexBigInt(voucherResponse.tx.gasLimit), - GasPrice = HexBigIntUtil.ParseHexBigInt(voucherResponse.tx.gasPrice), - }; - var response = await Web3Accessor.Web3.TransactionExecutor.SendTransaction(txRequest); - Debug.Log(JsonConvert.SerializeObject(response)); - } -} diff --git a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Prefabs/Minter/Mint1155.cs.meta b/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Prefabs/Minter/Mint1155.cs.meta deleted file mode 100644 index f3db421c6..000000000 --- a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Prefabs/Minter/Mint1155.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: f530a2f3db5f5c7478b08921d42c5114 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Prefabs/Minter/Mint721Voucher.cs b/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Prefabs/Minter/Mint721Voucher.cs deleted file mode 100644 index 16b4b6e41..000000000 --- a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Prefabs/Minter/Mint721Voucher.cs +++ /dev/null @@ -1,42 +0,0 @@ -using ChainSafe.Gaming.Evm.Transactions; -using ChainSafe.Gaming.UnityPackage; -using ChainSafe.Gaming.UnityPackage.Model; -using Nethereum.Hex.HexTypes; -using Newtonsoft.Json; -using UnityEngine; -using Scripts.EVM.Remote; - -public class Mint721Voucher : MonoBehaviour -{ - // address of nft you want to mint - public string nftAddress = "f01559ae4021a47e26bc773587278f62a833f2a6117411afbc5a7855661936d1c"; - - public async void VoucherMintNft721() - { - var voucherResponse721 = await CSServer.Get721Voucher(Web3Accessor.Web3); - CreateRedeemVoucherModel.CreateVoucher721 voucher721 = new CreateRedeemVoucherModel.CreateVoucher721 - { - tokenId = voucherResponse721.tokenId, - minPrice = voucherResponse721.minPrice, - signer = voucherResponse721.signer, - receiver = voucherResponse721.receiver, - signature = voucherResponse721.signature - }; - var voucherArgs = JsonUtility.ToJson(voucher721); - - // connects to user's browser wallet to call a transaction - var chainConfig = Web3Accessor.Web3.ChainConfig; - RedeemVoucherTxModel.Response voucherResponse = await CSServer.CreateRedeemTransaction(Web3Accessor.Web3, chainConfig.Chain, chainConfig.Network, voucherArgs, "721", nftAddress, voucherResponse721.receiver); - var txRequest = new TransactionRequest - { - ChainId = HexBigIntUtil.ParseHexBigInt(chainConfig.ChainId), - To = voucherResponse.tx.to, - Value = new HexBigInteger(voucherResponse.tx.value), - Data = voucherResponse.tx.data, - GasLimit = HexBigIntUtil.ParseHexBigInt(voucherResponse.tx.gasLimit), - GasPrice = HexBigIntUtil.ParseHexBigInt(voucherResponse.tx.gasPrice), - }; - var response = await Web3Accessor.Web3.TransactionExecutor.SendTransaction(txRequest); - Debug.Log(JsonConvert.SerializeObject(response)); - } -} diff --git a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Prefabs/Minter/Mint721Voucher.cs.meta b/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Prefabs/Minter/Mint721Voucher.cs.meta deleted file mode 100644 index cb534e18c..000000000 --- a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Prefabs/Minter/Mint721Voucher.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 785a5af054a848e4a93802898e155c97 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Scenes/Login.cs b/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Scenes/Login.cs index 0a8f958e6..3030d63a4 100644 --- a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Scenes/Login.cs +++ b/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Scenes/Login.cs @@ -9,6 +9,7 @@ using ChainSafe.Gaming.Web3.Build; using ChainSafe.Gaming.Web3.Unity; using ChainSafe.GamingSdk.Gelato; +using Scripts.EVM.Token; using UnityEngine; using UnityEngine.SceneManagement; @@ -77,10 +78,7 @@ private void ConfigureCommonServices(IWeb3ServiceCollection services) * to see how it's used later on. */ services.ConfigureRegisteredContracts(contracts => - contracts.RegisterContract( - "shiba", - "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isExcluded\",\"type\":\"bool\"}],\"name\":\"ExcludeFromFees\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isExcluded\",\"type\":\"bool\"}],\"name\":\"ExcludeMultipleAccountsFromFees\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"newValue\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"oldValue\",\"type\":\"uint256\"}],\"name\":\"GasForProcessingUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newLiquidityWallet\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldLiquidityWallet\",\"type\":\"address\"}],\"name\":\"LiquidityWalletUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"iterations\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"claims\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"lastProcessedIndex\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"automatic\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"gas\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"processor\",\"type\":\"address\"}],\"name\":\"ProcessedDividendTracker\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensSwapped\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"SendDividends\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"pair\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"value\",\"type\":\"bool\"}],\"name\":\"SetAutomatedMarketMakerPair\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensSwapped\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ethReceived\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensIntoLiqudity\",\"type\":\"uint256\"}],\"name\":\"SwapAndLiquify\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldAddress\",\"type\":\"address\"}],\"name\":\"UpdateDividendTracker\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldAddress\",\"type\":\"address\"}],\"name\":\"UpdateUniswapV2Router\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"SHIB\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"UNIRewardsFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_marketingWalletAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_maxTxAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"automatedMarketMakerPairs\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"blacklist\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blacklistblock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blockcount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"claim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"deadWallet\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"dividendTokenBalanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dividendTracker\",\"outputs\":[{\"internalType\":\"contract PSDividendTracker\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"excludeFromDividends\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"excluded\",\"type\":\"bool\"}],\"name\":\"excludeFromFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"bool\",\"name\":\"excluded\",\"type\":\"bool\"}],\"name\":\"excludeMultipleAccountsFromFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gasForProcessing\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"getAccountDividendsInfo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getAccountDividendsInfoAtIndex\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getClaimWait\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLastProcessedIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNumberOfDividendTokenHolders\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalDividendsDistributed\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"isExcludedFromFees\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"liquidityFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"marketingFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"gas\",\"type\":\"uint256\"}],\"name\":\"processDividendTracker\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"isBlack\",\"type\":\"bool\"}],\"name\":\"setAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pair\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"value\",\"type\":\"bool\"}],\"name\":\"setAutomatedMarketMakerPair\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"setLiquiditFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"setMarketingFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"wallet\",\"type\":\"address\"}],\"name\":\"setMarketingWallet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"setMaxTxAmount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"setSHIBRewardsFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"salestatus\",\"type\":\"bool\"}],\"name\":\"setSaleStart\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"swapTokensAtAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalFees\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"uniswapV2Pair\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"uniswapV2Router\",\"outputs\":[{\"internalType\":\"contract IUniswapV2Router02\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"claimWait\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"a\",\"type\":\"address\"}],\"name\":\"updateClaimWait\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"updateDividendTracker\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newValue\",\"type\":\"uint256\"}],\"name\":\"updateGasForProcessing\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"updateUniswapV2Router\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"withdrawableDividendOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", - "0x1d6f31b71e12a1a584ca20853495161c48ba491f")); + contracts.RegisterContract("CsTestErc20", ABI.Erc20, Contracts.Erc20)); } } diff --git a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Scenes/SampleMain/EVM/EvmCalls.cs b/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Scenes/SampleMain/EVM/EvmCalls.cs index 23f9fa380..6e4c8c6a3 100644 --- a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Scenes/SampleMain/EVM/EvmCalls.cs +++ b/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Scenes/SampleMain/EVM/EvmCalls.cs @@ -8,7 +8,6 @@ using Scripts.EVM.Token; using UnityEngine; using Web3Unity.Scripts.Prefabs; -using ABI = Scripts.EVM.Token.ABI; public class EvmCalls : MonoBehaviour { @@ -27,7 +26,6 @@ public class EvmCalls : MonoBehaviour # region Contract Send private string methodSend = "addTotal"; - private string contractAddressSend = "0x7286Cf0F6E80014ea75Dbc25F545A3be90F4904F"; private int increaseAmountSend = 1; #endregion @@ -35,13 +33,11 @@ public class EvmCalls : MonoBehaviour #region Contract Call private string methodCall = "myTotal"; - private string contractAddressCall = "0xC71d13c40B4fE7e2c557eBAa12A0400dd4Df76C9"; #endregion #region Get Send Array - - private string contractAddressArray = "0x5244d0453A727EDa96299384370359f4A2B5b20a"; + private string methodArrayGet = "getStore"; private string methodArraySend = "setStore"; private string[] stringArraySend = @@ -62,92 +58,125 @@ public class EvmCalls : MonoBehaviour #region Send Transaction - private string to = "0xdD4c825203f97984e7867F11eeCc813A036089D1"; + private string toAddress = "0xdD4c825203f97984e7867F11eeCc813A036089D1"; #endregion #region Registered Contract - private string registeredContractName = "shiba"; - private string registeredContractmethod = "balanceOf"; + private string registeredContractName = "CsTestErc20"; #endregion - #region Private Key + #region ECDSA - private string privateKey = "0x78dae1a22c7507a4ed30c06172e7614eb168d3546c13856340771e63ad3c0081"; - private string messagePrivateKey = "This is a test message"; + private string ecdsaKey = "0x78dae1a22c7507a4ed30c06172e7614eb168d3546c13856340771e63ad3c0081"; + private string ecdsaMessage = "This is a test message"; private string transactionHash = "0x123456789"; - private string chainId ="5"; + private string chainId ="11155111"; #endregion #region Multi Call - - private string Erc20ContractAddress = "0x3E0C0447e47d49195fbE329265E330643eB42e6f"; + private string Erc20Account = "0xd25b827D92b0fd656A1c829933e9b0b836d5C3e2"; #endregion #endregion + /// + /// Calls values from a contract + /// public async void ContractCall() { - object[] args = {}; - var response = await Evm.ContractCall(Web3Accessor.Web3, methodCall, ABI.AddTotal, contractAddressCall, args); + object[] args = + { + await Web3Accessor.Web3.Signer.GetAddress() + }; + var response = await Evm.ContractCall(Web3Accessor.Web3, methodCall, ABI.ArrayTotal, Contracts.ArrayTotal, args); + Debug.Log(response); var output = SampleOutputUtil.BuildOutputValue(response); SampleOutputUtil.PrintResult(output, nameof(Evm), nameof(Evm.ContractCall)); } - + + /// + /// Sends values to a contract + /// public async void ContractSend() { object[] args = { increaseAmountSend }; - var response = await Evm.ContractSend(Web3Accessor.Web3, methodSend, ABI.AddTotal, contractAddressSend, args); + var response = await Evm.ContractSend(Web3Accessor.Web3, methodSend, ABI.ArrayTotal, Contracts.ArrayTotal, args); var output = SampleOutputUtil.BuildOutputValue(response); SampleOutputUtil.PrintResult(output, nameof(Evm), nameof(Evm.ContractSend)); } - + + /// + /// Gets array values from a contract + /// public async void GetArray() { - var response = await Evm.GetArray(Web3Accessor.Web3, contractAddressArray, ABI.AddTotal, methodArrayGet); + var response = await Evm.GetArray(Web3Accessor.Web3, Contracts.ArrayTotal, ABI.ArrayTotal, methodArrayGet); var responseString = string.Join(",\n", response.Select((list, i) => $"#{i} {string.Join((string)", ", (IEnumerable)list)}")); SampleOutputUtil.PrintResult(responseString, nameof(Evm), nameof(Evm.GetArray)); } + /// + /// Sends array values to a contract + /// public async void SendArray() { - var response = await Evm.SendArray(Web3Accessor.Web3, methodArraySend, ABI.AddTotal, contractAddressArray, stringArraySend); + var response = await Evm.SendArray(Web3Accessor.Web3, methodArraySend, ABI.ArrayTotal, Contracts.ArrayTotal, stringArraySend); var output = SampleOutputUtil.BuildOutputValue(response); SampleOutputUtil.PrintResult(output, nameof(Evm), nameof(Evm.SendArray)); } + /// + /// Gets the current block number + /// public async void GetBlockNumber() { var blockNumber = await Evm.GetBlockNumber(Web3Accessor.Web3); SampleOutputUtil.PrintResult(blockNumber.ToString(), nameof(Evm), nameof(Evm.GetBlockNumber)); } + /// + /// Gets the gas limit for a specific function + /// public async void GetGasLimit() { - var gasLimit = await Evm.GetGasLimit(Web3Accessor.Web3, ABI.AddTotal, contractAddressSend, methodSend); + object[] args = + { + increaseAmountSend + }; + var gasLimit = await Evm.GetGasLimit(Web3Accessor.Web3, ABI.ArrayTotal, Contracts.ArrayTotal, methodSend, args); SampleOutputUtil.PrintResult(gasLimit.ToString(), nameof(Evm), nameof(Evm.GetGasLimit)); } + /// + /// Gets the current gas price + /// public async void GetGasPrice() { var gasPrice = await Evm.GetGasPrice(Web3Accessor.Web3); SampleOutputUtil.PrintResult(gasPrice.ToString(), nameof(Evm), nameof(Evm.GetGasPrice)); } + /// + /// Gets an accounts nonce + /// public async void GetNonce() { var nonce = await Evm.GetNonce(Web3Accessor.Web3); SampleOutputUtil.PrintResult(nonce.ToString(), nameof(Evm), nameof(Evm.GetNonce)); } + /// + /// Gets a specific transaction's status + /// public async void GetTransactionStatus() { var receipt = await Evm.GetTransactionStatus(Web3Accessor.Web3); @@ -158,30 +187,45 @@ public async void GetTransactionStatus() SampleOutputUtil.PrintResult(output, nameof(Evm), nameof(Evm.GetTransactionStatus)); } - public async void RegisterContract() + /// + /// Uses a registered contract + /// + public async void RegisteredContract() { - var balance = await Evm.UseRegisteredContract(Web3Accessor.Web3, registeredContractName, registeredContractmethod); + var balance = await Evm.UseRegisteredContract(Web3Accessor.Web3, registeredContractName, EthMethod.BalanceOf); SampleOutputUtil.PrintResult(balance.ToString(), nameof(Evm), nameof(Evm.UseRegisteredContract)); } + /// + /// Sends a transaction + /// public async void SendTransaction() { - var transactionHash = await Evm.SendTransaction(Web3Accessor.Web3, to); + var transactionHash = await Evm.SendTransaction(Web3Accessor.Web3, toAddress); SampleOutputUtil.PrintResult(transactionHash, nameof(Evm), nameof(Evm.SendTransaction)); } + /// + /// Encrypts a message with SHA3 + /// public void Sha3() { var hash = Evm.Sha3(messageSha); SampleOutputUtil.PrintResult(hash, nameof(Evm), nameof(Evm.Sha3)); } + /// + /// Signs a message, the result is specific to each user + /// public async void SignMessage() { var signedMessage = await Evm.SignMessage(Web3Accessor.Web3, messageSign); SampleOutputUtil.PrintResult(signedMessage, nameof(Evm), nameof(Evm.SignMessage)); } + /// + /// Signs a message and verifs account ownership + /// public async void SignVerify() { var signatureVerified = await Evm.SignVerify(Web3Accessor.Web3, messageSignVerify); @@ -189,24 +233,36 @@ public async void SignVerify() SampleOutputUtil.PrintResult(output, nameof(Evm), nameof(Evm.SignVerify)); } - public void PrivateKeySignTransaction() + /// + /// Signs a transaction via ECDSA + /// + public void EcdsaSignTransaction() { - var result = Evm.PrivateKeySignTransaction(privateKey, transactionHash, chainId); - SampleOutputUtil.PrintResult(result, nameof(Evm), nameof(Evm.PrivateKeySignTransaction)); + var result = Evm.EcdsaSignTransaction(ecdsaKey, transactionHash, chainId); + SampleOutputUtil.PrintResult(result, nameof(Evm), nameof(Evm.EcdsaSignTransaction)); } - public void PrivateKeySignMessage() + /// + /// Signs a message via ECDSA + /// + public void EcdsaSignMessage() { - var result = Evm.PrivateKeySignMessage(privateKey, messagePrivateKey); - SampleOutputUtil.PrintResult(result, nameof(Evm), nameof(Evm.PrivateKeySignMessage)); + var result = Evm.EcdsaSignMessage(ecdsaKey, ecdsaMessage); + SampleOutputUtil.PrintResult(result, nameof(Evm), nameof(Evm.EcdsaSignMessage)); } - public void PrivateKeyGetAddress() + /// + /// Gets an addres via ECDSA key + /// + public void EcdsaGetAddress() { - var result = Evm.PrivateKeyGetAddress(privateKey); - SampleOutputUtil.PrintResult(result, nameof(Evm), nameof(Evm.PrivateKeyGetAddress)); + var result = Evm.EcdsaGetAddress(ecdsaKey); + SampleOutputUtil.PrintResult(result, nameof(Evm), nameof(Evm.EcdsaGetAddress)); } + /// + /// Uploads to IPFS + /// public async void IPFSUpload() { var cid = await Evm.Upload(new IpfsUploadRequest @@ -220,15 +276,18 @@ public async void IPFSUpload() SampleOutputUtil.PrintResult(cid, nameof(IpfsSample), nameof(IpfsSample.Upload)); } + /// + /// Makes multiple calls + /// public async void MultiCall() { - var erc20Contract = Web3Accessor.Web3.ContractBuilder.Build(ABI.Erc20, Erc20ContractAddress); - var erc20BalanceOfCalldata = erc20Contract.Calldata(CommonMethod.BalanceOf, new object[] + var erc20Contract = Web3Accessor.Web3.ContractBuilder.Build(ABI.Erc20, Contracts.Erc20); + var erc20BalanceOfCalldata = erc20Contract.Calldata(EthMethod.BalanceOf, new object[] { Erc20Account }); - var erc20TotalSupplyCalldata = erc20Contract.Calldata(CommonMethod.TotalSupply, new object[] + var erc20TotalSupplyCalldata = erc20Contract.Calldata(EthMethod.TotalSupply, new object[] { }); @@ -236,13 +295,13 @@ public async void MultiCall() { new Call3Value() { - Target = Erc20ContractAddress, + Target = Contracts.Erc20, AllowFailure = true, CallData = erc20BalanceOfCalldata.HexToByteArray(), }, new Call3Value() { - Target = Erc20ContractAddress, + Target = Contracts.Erc20, AllowFailure = true, CallData = erc20TotalSupplyCalldata.HexToByteArray(), } @@ -254,16 +313,14 @@ public async void MultiCall() if (multicallResultResponse[0] != null && multicallResultResponse[0].Success) { - var decodedBalanceOf = erc20Contract.Decode(CommonMethod.BalanceOf, multicallResultResponse[0].ReturnData.ToHex()); + var decodedBalanceOf = erc20Contract.Decode(EthMethod.BalanceOf, multicallResultResponse[0].ReturnData.ToHex()); Debug.Log($"decodedBalanceOf {((BigInteger)decodedBalanceOf[0]).ToString()}"); } if (multicallResultResponse[1] != null && multicallResultResponse[1].Success) { - var decodedTotalSupply = erc20Contract.Decode(CommonMethod.TotalSupply, multicallResultResponse[1].ReturnData.ToHex()); + var decodedTotalSupply = erc20Contract.Decode(EthMethod.TotalSupply, multicallResultResponse[1].ReturnData.ToHex()); Debug.Log($"decodedTotalSupply {((BigInteger)decodedTotalSupply[0]).ToString()}"); } } - - } diff --git a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Scenes/SampleMain/Erc1155/Erc1155Calls.cs b/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Scenes/SampleMain/Erc1155/Erc1155Calls.cs index cfe580acd..a45bb180b 100644 --- a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Scenes/SampleMain/Erc1155/Erc1155Calls.cs +++ b/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Scenes/SampleMain/Erc1155/Erc1155Calls.cs @@ -4,7 +4,6 @@ using Scripts.EVM.Token; using UnityEngine; using UnityEngine.UI; -using ABI = Scripts.EVM.Token.ABI; /// /// ERC1155 calls used in the sample scene @@ -14,42 +13,33 @@ public class Erc1155Calls : MonoBehaviour #region Fields #region All Erc - - private string chainAllErc = "ethereum"; - private string networkAllErc = "goerli"; + private string accountAllErc = "0xfaecAE4464591F8f2025ba8ACF58087953E613b1"; - private string contractAllErc = ""; - private int takeAllErc = 1000; - private int skipAllErc = 0; #endregion #region Balance Of - - private string contractBalanceOf = "0x2c1867bc3026178a47a677513746dcc6822a137a"; + private string accountBalanceOf = "0xd25b827D92b0fd656A1c829933e9b0b836d5C3e2"; - private string tokenIdBalanceOf = "0x01559ae4021aee70424836ca173b6a4e647287d15cee8ac42d8c2d8d128927e5"; + private string tokenIdBalanceOf = "1"; #endregion #region Balance Of Batch - - private string contractBalanceOfBatch = "0xdc4aff511e1b94677142a43df90f948f9ae181dd"; + private string[] accountsBalanceOfBatch = { "0xd25b827D92b0fd656A1c829933e9b0b836d5C3e2", "0xE51995Cdb3b1c109E0e6E67ab5aB31CDdBB83E4a" }; private string[] tokenIdsBalanceOfBatch = { "1", "2" }; #endregion #region Uri - - private string contractUri = "0x2c1867BC3026178A47a677513746DCc6822A137A"; - private string tokenIdUri = "0x01559ae4021aee70424836ca173b6a4e647287d15cee8ac42d8c2d8d128927e5"; + + private string tokenIdUri = "1"; #endregion #region Mint - - private string contractMint = "0xA0a53f1Cabf7D723Ab2087400681039917D1B6D4"; + private int idMint = 1; private int amountMint = 1; @@ -58,15 +48,13 @@ public class Erc1155Calls : MonoBehaviour #region Transfer private string toAccountTransfer = "0xdD4c825203f97984e7867F11eeCc813A036089D1"; - private string contractTransfer = "0xA0a53f1Cabf7D723Ab2087400681039917D1B6D4"; private int tokenIdTransfer = 1; private int amountTransfer = 1; #endregion #region Texture - - private string contractTexture = "0x0288B4F1389ED7b3d3f9C7B73d4408235c0CBbc6"; + private string tokenIdTexture = "0"; #endregion @@ -80,7 +68,7 @@ public class Erc1155Calls : MonoBehaviour /// public async void AllErc1155() { - var allNfts = await Erc1155.AllErc1155(Web3Accessor.Web3, chainAllErc, networkAllErc, accountAllErc, contractAllErc, takeAllErc, skipAllErc); + var allNfts = await Erc1155.AllErc1155(Web3Accessor.Web3, accountAllErc); var output = string.Join(",\n", allNfts.Select(nft => $"{nft.TokenId} - {nft.Uri}")); SampleOutputUtil.PrintResult(output, nameof(Erc1155), nameof(Erc1155.AllErc1155)); } @@ -91,8 +79,8 @@ public async void AllErc1155() public async void BalanceOf() { var balance = tokenIdBalanceOf.StartsWith("0x") ? - await Erc1155.BalanceOf(Web3Accessor.Web3, contractBalanceOf, accountBalanceOf, tokenIdBalanceOf) - : await Erc1155.BalanceOf(Web3Accessor.Web3, contractBalanceOf, accountBalanceOf, BigInteger.Parse(tokenIdBalanceOf)); + await Erc1155.BalanceOf(Web3Accessor.Web3, Contracts.Erc1155, accountBalanceOf, tokenIdBalanceOf) + : await Erc1155.BalanceOf(Web3Accessor.Web3, Contracts.Erc1155, accountBalanceOf, BigInteger.Parse(tokenIdBalanceOf)); SampleOutputUtil.PrintResult(balance.ToString(), nameof(Erc1155), nameof(Erc1155.BalanceOf)); } @@ -101,7 +89,7 @@ await Erc1155.BalanceOf(Web3Accessor.Web3, contractBalanceOf, accountBalanceOf, /// public async void BalanceOfBatch() { - var balances = await Erc1155.BalanceOfBatch(Web3Accessor.Web3, contractBalanceOfBatch, accountsBalanceOfBatch, tokenIdsBalanceOfBatch); + var balances = await Erc1155.BalanceOfBatch(Web3Accessor.Web3, Contracts.Erc1155, accountsBalanceOfBatch, tokenIdsBalanceOfBatch); var balancesString = string.Join(", ", balances); SampleOutputUtil.PrintResult(balancesString, nameof(Erc1155), nameof(Erc1155.BalanceOfBatch)); } @@ -111,7 +99,7 @@ public async void BalanceOfBatch() /// public async void Uri() { - var uri = await Erc1155.Uri(Web3Accessor.Web3, contractUri, tokenIdUri); + var uri = await Erc1155.Uri(Web3Accessor.Web3, Contracts.Erc1155, tokenIdUri); SampleOutputUtil.PrintResult(uri, nameof(Erc1155), nameof(Erc1155.Uri)); } @@ -120,7 +108,7 @@ public async void Uri() /// public async void MintErc1155() { - var response = await Erc1155.MintErc1155(Web3Accessor.Web3, ABI.Mint1155, contractMint, idMint, amountMint); + var response = await Erc1155.MintErc1155(Web3Accessor.Web3, ABI.Erc1155, Contracts.Erc1155, idMint, amountMint); var output = SampleOutputUtil.BuildOutputValue(response); SampleOutputUtil.PrintResult(output, nameof(Erc1155), nameof(Erc1155.MintErc1155)); } @@ -130,7 +118,7 @@ public async void MintErc1155() /// public async void TransferErc1155() { - var response = await Erc1155.TransferErc1155(Web3Accessor.Web3, contractTransfer, tokenIdTransfer, amountTransfer, toAccountTransfer); + var response = await Erc1155.TransferErc1155(Web3Accessor.Web3, Contracts.Erc1155, tokenIdTransfer, amountTransfer, toAccountTransfer); var output = SampleOutputUtil.BuildOutputValue(response); SampleOutputUtil.PrintResult(output, nameof(Erc1155), nameof(Erc1155.TransferErc1155)); } @@ -140,7 +128,7 @@ public async void TransferErc1155() /// public async void ImportNftTexture1155() { - var textureRequest = await Erc1155.ImportNftTexture1155(Web3Accessor.Web3, contractTexture, tokenIdTexture); + var textureRequest = await Erc1155.ImportNftTexture1155(Web3Accessor.Web3, Contracts.Erc1155, tokenIdTexture); rawImage.texture = textureRequest; } } \ No newline at end of file diff --git a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Scenes/SampleMain/Erc20/Erc20Calls.cs b/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Scenes/SampleMain/Erc20/Erc20Calls.cs index c1c8b2f04..6eb11f377 100644 --- a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Scenes/SampleMain/Erc20/Erc20Calls.cs +++ b/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Scenes/SampleMain/Erc20/Erc20Calls.cs @@ -2,7 +2,6 @@ using ChainSafe.Gaming.UnityPackage; using Scripts.EVM.Token; using UnityEngine; -using ABI = Scripts.EVM.Token.ABI; /// /// ERC20 calls used in the sample scene @@ -12,20 +11,8 @@ public class Erc20Calls : MonoBehaviour #region Fields #region Balance Of - - private string contractBalanceOf = "0x3E0C0447e47d49195fbE329265E330643eB42e6f"; - private string accountBalanceOf = "0xd25b827D92b0fd656A1c829933e9b0b836d5C3e2"; - - #endregion - #region Custom Balance Of - - private string contractToken = "0x714d32fA722461A2c8F0b4EB98ff5cFF8F908Df2"; - #endregion - - #region Native Balance Of - - private string accountNativeBalanceOf = "0xaBed4239E4855E120fDA34aDBEABDd2911626BA1"; + private string accountBalanceOf = "0xd25b827D92b0fd656A1c829933e9b0b836d5C3e2"; #endregion @@ -38,7 +25,6 @@ public class Erc20Calls : MonoBehaviour #region Transfer private const string toAccount = "0xdD4c825203f97984e7867F11eeCc813A036089D1"; - private string contractTransfer = "0xc778417e063141139fce010982780140aa0cd5ab"; private BigInteger amountTransfer = 1000000000000000; #endregion @@ -51,7 +37,7 @@ public class Erc20Calls : MonoBehaviour public async void BalanceOf() { SampleFeedback.Instance?.Activate(); - var balance = await Erc20.BalanceOf(Web3Accessor.Web3, contractBalanceOf, accountBalanceOf); + var balance = await Erc20.BalanceOf(Web3Accessor.Web3, Contracts.Erc20, accountBalanceOf); SampleOutputUtil.PrintResult(balance.ToString(), nameof(Erc20), nameof(Erc20.BalanceOf)); SampleFeedback.Instance?.Deactivate(); } @@ -61,7 +47,7 @@ public async void BalanceOf() /// public async void CustomTokenBalanceOf() { - var result = await Erc20.CustomTokenBalance(Web3Accessor.Web3, ABI.CustomBalanceOf, contractToken); + var result = await Erc20.CustomTokenBalance(Web3Accessor.Web3, ABI.Erc20, Contracts.Erc20); SampleOutputUtil.PrintResult(result.ToString(), nameof(Erc20), nameof(Erc20.CustomTokenBalance)); } @@ -70,7 +56,7 @@ public async void CustomTokenBalanceOf() /// public async void NativeBalanceOf() { - var result = await Erc20.NativeBalanceOf(Web3Accessor.Web3, accountNativeBalanceOf); + var result = await Erc20.NativeBalanceOf(Web3Accessor.Web3, accountBalanceOf); SampleOutputUtil.PrintResult(result.ToString(), nameof(Erc20), nameof(Erc20.NativeBalanceOf)); } @@ -79,7 +65,7 @@ public async void NativeBalanceOf() /// public async void Name() { - var result = await Erc20.Name(Web3Accessor.Web3, contractToken); + var result = await Erc20.Name(Web3Accessor.Web3, Contracts.Erc20); SampleOutputUtil.PrintResult(result, nameof(Erc20), nameof(Erc20.Name)); } @@ -88,7 +74,7 @@ public async void Name() /// public async void Symbol() { - var result = await Erc20.Symbol(Web3Accessor.Web3, contractToken); + var result = await Erc20.Symbol(Web3Accessor.Web3, Contracts.Erc20); SampleOutputUtil.PrintResult(result, nameof(Erc20), nameof(Erc20.Symbol)); } @@ -97,7 +83,7 @@ public async void Symbol() /// public async void Decimals() { - var decimals = await Erc20.Decimals(Web3Accessor.Web3, contractToken); + var decimals = await Erc20.Decimals(Web3Accessor.Web3, Contracts.Erc20); SampleOutputUtil.PrintResult(decimals.ToString(), nameof(Erc20), nameof(Erc20.Decimals)); } @@ -106,7 +92,7 @@ public async void Decimals() /// public async void TotalSupply() { - var result = await Erc20.TotalSupply(Web3Accessor.Web3, contractToken); + var result = await Erc20.TotalSupply(Web3Accessor.Web3, Contracts.Erc20); SampleOutputUtil.PrintResult(result.ToString(), nameof(Erc20), nameof(Erc20.TotalSupply)); } @@ -116,7 +102,7 @@ public async void TotalSupply() public async void MintErc20() { string toAccount = await Web3Accessor.Web3.Signer.GetAddress(); - var response = await Erc20.MintErc20(Web3Accessor.Web3, contractToken, toAccount, amountMint); + var response = await Erc20.MintErc20(Web3Accessor.Web3, Contracts.Erc20, toAccount, amountMint); var output = SampleOutputUtil.BuildOutputValue(response); SampleOutputUtil.PrintResult(output, nameof(Erc20), nameof(Erc20.MintErc20)); } @@ -126,7 +112,7 @@ public async void MintErc20() /// public async void TransferErc20() { - var response = await Erc20.TransferErc20(Web3Accessor.Web3, contractTransfer, toAccount, amountTransfer); + var response = await Erc20.TransferErc20(Web3Accessor.Web3, Contracts.Erc20, toAccount, amountTransfer); var output = SampleOutputUtil.BuildOutputValue(response); SampleOutputUtil.PrintResult(output, nameof(Erc20), nameof(Erc20.TransferErc20)); } diff --git a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Scenes/SampleMain/Erc721/Erc721Calls.cs b/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Scenes/SampleMain/Erc721/Erc721Calls.cs index 570226147..48046abb4 100644 --- a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Scenes/SampleMain/Erc721/Erc721Calls.cs +++ b/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Scenes/SampleMain/Erc721/Erc721Calls.cs @@ -3,7 +3,6 @@ using ChainSafe.Gaming.UnityPackage; using Scripts.EVM.Token; using UnityEngine; -using ABI = Scripts.EVM.Token.ABI; /// /// ERC721 calls used in the sample scene @@ -13,50 +12,38 @@ public class Erc721Calls : MonoBehaviour #region Fields #region All Erc - - private string chainAllErc = "ethereum"; - private string networkAllErc = "goerli"; // mainnet goerli + private string accountAllErc = "0xfaecAE4464591F8f2025ba8ACF58087953E613b1"; - private string contractAllErc = "0x2c1867BC3026178A47a677513746DCc6822A137A"; - private int takeAllErc = 500; - private int skipAllErc = 0; #endregion #region Balance Of - - private string contractBalanceOf = "0x9123541E259125657F03D7AD2A7D1a8Ec79375BA"; + private string accountBalanceOf = "0xd25b827D92b0fd656A1c829933e9b0b836d5C3e2"; #endregion #region Owner Of - - private string contractOwnerOf = "0x06dc21f89f01409e7ed0e4c80eae1430962ae52c"; - private string tokenIdOwnerOf = "0x01559ae4021a565d5cc4740f1cefa95de8c1fb193949ecd32c337b03047da501"; + + private string tokenIdOwnerOf = "1"; #endregion #region Owner Of Batch - private string[] tokenIdsOwnerOfBatch = { "33", "29" }; - private string contractOwnerOfBatch = "0x47381c5c948254e6e0E324F1AA54b7B24104D92D"; - // optional: multicall contract https://github.com/makerdao/multicall - private string multicallOwnerOfBatch = "0x77dca2c955b15e9de4dbbcf1246b4b85b651e50e"; + private string[] tokenIdsOwnerOfBatch = { "4", "6" }; #endregion #region Uri - - private string contractUri = "0x06dc21f89f01409e7ed0e4c80eae1430962ae52c"; + private string tokenIdUri = "0x01559ae4021a565d5cc4740f1cefa95de8c1fb193949ecd32c337b03047da501"; #endregion #region Mint - - private string contractMint = "0x0B102638532be8A1b3d0ed1fcE6eC603Bec37848"; - private string uriMint = "ipfs://QmNn5EaGR26kU7aAMH7LhkNsAGcmcyJgun3Wia4MftVicW/1.json"; + + private string uriMint = "1"; #endregion @@ -75,7 +62,7 @@ public class Erc721Calls : MonoBehaviour /// public async void AllErc721() { - var allNfts = await Erc721.AllErc721(Web3Accessor.Web3, chainAllErc, networkAllErc, accountAllErc, contractAllErc, takeAllErc, skipAllErc); + var allNfts = await Erc721.AllErc721(Web3Accessor.Web3, accountAllErc); var output = string.Join(",\n", allNfts.Select(nft => $"{nft.TokenId} - {nft.Uri}")); SampleOutputUtil.PrintResult(output, nameof(Erc721), nameof(Erc721.AllErc721)); } @@ -85,7 +72,7 @@ public async void AllErc721() /// public async void BalanceOf() { - var balance = await Erc721.BalanceOf(Web3Accessor.Web3, contractBalanceOf, accountBalanceOf); + var balance = await Erc721.BalanceOf(Web3Accessor.Web3, Contracts.Erc721, accountBalanceOf); SampleOutputUtil.PrintResult(balance.ToString(), nameof(Erc721), nameof(Erc721.BalanceOf)); } @@ -95,8 +82,8 @@ public async void BalanceOf() public async void OwnerOf() { var owner = tokenIdOwnerOf.StartsWith("0x") ? - await Erc721.OwnerOf(Web3Accessor.Web3, contractOwnerOf, tokenIdOwnerOf) - : await Erc721.OwnerOf(Web3Accessor.Web3, contractOwnerOf, BigInteger.Parse(tokenIdOwnerOf)); + await Erc721.OwnerOf(Web3Accessor.Web3, Contracts.Erc721, tokenIdOwnerOf) + : await Erc721.OwnerOf(Web3Accessor.Web3, Contracts.Erc721, BigInteger.Parse(tokenIdOwnerOf)); SampleOutputUtil.PrintResult(owner, nameof(Erc721), nameof(Erc721.OwnerOf)); } @@ -105,7 +92,7 @@ await Erc721.OwnerOf(Web3Accessor.Web3, contractOwnerOf, tokenIdOwnerOf) /// public async void OwnerOfBatch() { - var owners = await Erc721.OwnerOfBatch(Web3Accessor.Web3, contractOwnerOfBatch, tokenIdsOwnerOfBatch, multicallOwnerOfBatch); + var owners = await Erc721.OwnerOfBatch(Web3Accessor.Web3, Contracts.Erc721, tokenIdsOwnerOfBatch); var ownersString = $"{owners.Count} owner(s):\n" + string.Join(",\n", owners); SampleOutputUtil.PrintResult(ownersString, nameof(Erc721), nameof(Erc721.OwnerOfBatch)); } @@ -115,7 +102,7 @@ public async void OwnerOfBatch() /// public async void Uri() { - var uri = await Erc721.Uri(Web3Accessor.Web3, contractUri, tokenIdUri); + var uri = await Erc721.Uri(Web3Accessor.Web3, Contracts.Erc721, tokenIdUri); SampleOutputUtil.PrintResult(uri, nameof(Erc721), nameof(Erc721.Uri)); } @@ -124,7 +111,7 @@ public async void Uri() /// public async void MintErc721() { - var response = await Erc721.MintErc721(Web3Accessor.Web3, ABI.Mint721, contractMint, uriMint); + var response = await Erc721.MintErc721(Web3Accessor.Web3, ABI.Erc721, Contracts.Erc721, uriMint); var output = SampleOutputUtil.BuildOutputValue(response); SampleOutputUtil.PrintResult(output, nameof(Erc721), nameof(Erc721.MintErc721)); } diff --git a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Scenes/SampleMain/SampleBehaviour.cs b/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Scenes/SampleMain/SampleBehaviour.cs index 5b2f461b7..5e79e2c6b 100644 --- a/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Scenes/SampleMain/SampleBehaviour.cs +++ b/Packages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts/Scenes/SampleMain/SampleBehaviour.cs @@ -7,17 +7,18 @@ namespace Samples.Behaviours [RequireComponent(typeof(Button))] public class SampleBehaviour : MonoBehaviour { - private const string DefaultChainId = "5"; + // This is what is used to check for gelato compatibility, if the chain doesn't match it will hide gelato functions in the test scene + private const string DefaultChainId = "11155111"; public async void Execute() { // Activates the loading pop up to stop duplicate calls SampleFeedback.Instance?.Activate(); - // check if we're on default sample chain + // Check if we're on default sample chain if (Web3Accessor.Web3.ChainConfig.ChainId != DefaultChainId) { - // log error not exception to not break flow + // Log error not exception to not break flow Debug.LogError($"Samples are configured for Chain Id {DefaultChainId}, Please Change Chain Id in Window > ChainSafe SDK > Server Settings to {DefaultChainId}"); } diff --git a/Packages/io.chainsafe.web3-unity/Tests/Runtime/Erc1155Tests.cs b/Packages/io.chainsafe.web3-unity/Tests/Runtime/Erc1155Tests.cs index 6c4c1a8a4..d0cd9806c 100644 --- a/Packages/io.chainsafe.web3-unity/Tests/Runtime/Erc1155Tests.cs +++ b/Packages/io.chainsafe.web3-unity/Tests/Runtime/Erc1155Tests.cs @@ -3,7 +3,6 @@ using System.Numerics; using ChainSafe.Gaming.Evm.JsonRpc; using ChainSafe.Gaming.UnityPackage; -using ChainSafe.Gaming.WalletConnect; using ChainSafe.Gaming.Web3; using ChainSafe.Gaming.Web3.Build; using ChainSafe.Gaming.Web3.Unity; @@ -14,19 +13,15 @@ public class Erc1155Tests { - // Fields + #region Fields + #region Balances - private readonly string[] _accounts = new[] { "0xd25b827D92b0fd656A1c829933e9b0b836d5C3e2", "0xE51995Cdb3b1c109E0e6E67ab5aB31CDdBB83E4a" }; - private const string ContractAddress = "0x2c1867bc3026178a47a677513746dcc6822a137a"; - private readonly string[] _tokenIds = { "0x01559ae4021aee70424836ca173b6a4e647287d15cee8ac42d8c2d8d128927e5", "0x01559ae4021aee70424836ca173b6a4e647287d15cee8ac42d8c2d8d128927e5" }; + private static string[] _accounts = { "0xd25b827D92b0fd656A1c829933e9b0b836d5C3e2", "0xE51995Cdb3b1c109E0e6E67ab5aB31CDdBB83E4a" }; + private static string[] _tokenIds = { "1", "2" }; #endregion - - #region Texture - - private const string NftTextureContractAddress = "0x0288B4F1389ED7b3d3f9C7B73d4408235c0CBbc6"; - + #endregion private Web3 web3; @@ -45,17 +40,18 @@ public class Erc1155Tests [UnitySetUp] public IEnumerator Setup() { - //wait for some time to initialize + // Wait for some time to initialize yield return new WaitForSeconds(5f); - //For whatever reason, in github this won't load + // Set project config, fallback is for github as it doesn't load var projectConfigScriptableObject = ProjectConfigUtilities.Load(); if (projectConfigScriptableObject == null) { - projectConfigScriptableObject = ProjectConfigUtilities.Load("3dc3e125-71c4-4511-a367-e981a6a94371", "5", - "Ethereum", "Goerli", "Geth", "https://goerli.infura.io/v3/287318045c6e455ab34b81d6bcd7a65f"); + projectConfigScriptableObject = ProjectConfigUtilities.Load("3dc3e125-71c4-4511-a367-e981a6a94371", "11155111", + "Ethereum", "Sepolia", "Seth", "https://sepolia.infura.io/v3/287318045c6e455ab34b81d6bcd7a65f"); } - + + // Create web3builder & assign services var web3Builder = new Web3Builder(projectConfigScriptableObject) .Configure(services => { @@ -65,36 +61,36 @@ public IEnumerator Setup() var buildWeb3 = web3Builder.LaunchAsync(); - //wait until for async task to finish + // Wait until for async task to finish yield return new WaitUntil(() => buildWeb3.IsCompleted); - + + // Assign result to web3 web3 = buildWeb3.Result; } [UnityTest] public IEnumerator TestBalanceOf() { - var getBalanceOf = Erc1155.BalanceOf(web3, ContractAddress, _accounts[0], _tokenIds[0]); + var getBalanceOf = Erc1155.BalanceOf(web3, Contracts.Erc1155, _accounts[0], _tokenIds[0]); yield return new WaitUntil(() => getBalanceOf.IsCompleted); - Assert.AreEqual(new BigInteger(2), getBalanceOf.Result); } [UnityTest] public IEnumerator TestBalanceOfBatch() { - var getBalanceOf = Erc1155.BalanceOfBatch(web3, ContractAddress, _accounts, _tokenIds); + var getBalanceOf = Erc1155.BalanceOfBatch(web3, Contracts.Erc1155, _accounts, _tokenIds); yield return new WaitUntil(() => getBalanceOf.IsCompleted); - CollectionAssert.AreEqual(new List { 2, 0 }, getBalanceOf.Result); + CollectionAssert.AreEqual(new List { 2, 3 }, getBalanceOf.Result); } private const string ExpectedUriResult = - "https://ipfs.io/ipfs/f01559ae4021aee70424836ca173b6a4e647287d15cee8ac42d8c2d8d128927e5"; + "https://ipfs.chainsafe.io/ipfs/QmfUHuFj3YL2JMZkyXNtGRV8e9aLJgQ6gcSrqbfjWFvbqQ"; [UnityTest] public IEnumerator TestUri() { - var uri = Erc1155.Uri(web3, ContractAddress, _tokenIds[0]); + var uri = Erc1155.Uri(web3, Contracts.Erc1155, _tokenIds[0]); yield return new WaitUntil(() => uri.IsCompleted); Assert.AreEqual(ExpectedUriResult, uri.Result); } @@ -174,7 +170,7 @@ public IEnumerator TestImportNFTTexture() }; #endregion - var texture = Erc1155.ImportNftTexture1155(web3, NftTextureContractAddress, "0"); + var texture = Erc1155.ImportNftTexture1155(web3, Contracts.Erc1155, "1"); yield return new WaitUntil(() => texture.IsCompleted); CollectionAssert.AreEqual(bytesOfTheTexture, texture.Result.EncodeToJPG(1)); } diff --git a/Packages/io.chainsafe.web3-unity/Tests/Runtime/Erc20Tests.cs b/Packages/io.chainsafe.web3-unity/Tests/Runtime/Erc20Tests.cs index 17eeaf23d..0997776c9 100644 --- a/Packages/io.chainsafe.web3-unity/Tests/Runtime/Erc20Tests.cs +++ b/Packages/io.chainsafe.web3-unity/Tests/Runtime/Erc20Tests.cs @@ -2,7 +2,6 @@ using System.Numerics; using ChainSafe.Gaming.Evm.JsonRpc; using ChainSafe.Gaming.UnityPackage; -using ChainSafe.Gaming.WalletConnect; using ChainSafe.Gaming.Web3; using ChainSafe.Gaming.Web3.Build; using ChainSafe.Gaming.Web3.Unity; @@ -13,32 +12,35 @@ public class Erc20Tests { - // Fields + #region Fields + #region Contract Calls private const string Account = "0xd25b827D92b0fd656A1c829933e9b0b836d5C3e2"; - private const string ContractAddress = "0x3E0C0447e47d49195fbE329265E330643eB42e6f"; + // Mint ERC20 function adjusts the total supply so we have a duplicate contract that doesn't change for the test to pass + private const string TotalSupplyAddress = "0xd1A103234d1D65E0E817A523d679B114cf86521A"; + #endregion + #endregion private Web3 web3; - private WalletConnectConfig config; [UnitySetUp] public IEnumerator Setup() { - //wait for some time to initialize + // Wait for some time to initialize yield return new WaitForSeconds(5f); - //For whatever reason, in github this won't load + // Set project config, fallback is for github as it doesn't load var projectConfigScriptableObject = ProjectConfigUtilities.Load(); if (projectConfigScriptableObject == null) { - projectConfigScriptableObject = ProjectConfigUtilities.Load("3dc3e125-71c4-4511-a367-e981a6a94371", "5", - "Ethereum", "Goerli", "Geth", "https://goerli.infura.io/v3/287318045c6e455ab34b81d6bcd7a65f"); + projectConfigScriptableObject = ProjectConfigUtilities.Load("3dc3e125-71c4-4511-a367-e981a6a94371", "11155111", + "Ethereum", "Sepolia", "Seth", "https://sepolia.infura.io/v3/287318045c6e455ab34b81d6bcd7a65f"); } - - + + // Create web3builder & assign services var web3Builder = new Web3Builder(projectConfigScriptableObject).Configure(services => { services.UseUnityEnvironment(); @@ -47,76 +49,58 @@ public IEnumerator Setup() var buildWeb3 = web3Builder.LaunchAsync(); - //wait until for async task to finish + // Wait until for async task to finish yield return new WaitUntil(() => buildWeb3.IsCompleted); - + + // Assign result to web3 web3 = buildWeb3.Result; } [UnityTest] public IEnumerator TestBalanceOf() { - var getBalanceOf = Erc20.BalanceOf(web3, ContractAddress, Account); + var getBalanceOf = Erc20.BalanceOf(web3, Contracts.Erc20, Account); yield return new WaitUntil(() => getBalanceOf.IsCompleted); - - Assert.AreEqual(new BigInteger(new byte[] - { - 0, 0, 0, 64, 234, 237, 116, 70, 208, 156, 44, 159, 12 - }), getBalanceOf.Result); + Assert.AreEqual(new BigInteger(1000000000000000000), getBalanceOf.Result); + } + + [UnityTest] + public IEnumerator TestNativeBalanceOf() + { + var getNativeBalanceOf = Erc20.NativeBalanceOf(web3, Account); + yield return new WaitUntil(() => getNativeBalanceOf.IsCompleted); + Assert.AreEqual(new BigInteger(500000000000000000), getNativeBalanceOf.Result); } [UnityTest] public IEnumerator TestDecimals() { - var getDecimals = Erc20.Decimals(web3, ContractAddress); + var getDecimals = Erc20.Decimals(web3, Contracts.Erc20); yield return new WaitUntil(() => getDecimals.IsCompleted); - Assert.AreEqual(new BigInteger(18), getDecimals.Result); } [UnityTest] public IEnumerator TestName() { - var getName = Erc20.Name(web3, ContractAddress); + var getName = Erc20.Name(web3, Contracts.Erc20); yield return new WaitUntil(() => getName.IsCompleted); - - Assert.AreEqual("ChainToken", getName.Result); - } - - [UnityTest] - public IEnumerator TestNativeBalanceOf() - { - var getNativeBalanceOf = Erc20.NativeBalanceOf(web3, Account); - - yield return new WaitUntil(() => getNativeBalanceOf.IsCompleted); - - - Assert.AreEqual(new BigInteger(new byte[] - { - 0, 144, 99, 20, 5, 161, 13, 3 - }), getNativeBalanceOf.Result); + Assert.AreEqual("CsTestErc20", getName.Result); } [UnityTest] public IEnumerator TestSymbol() { - var getSymbol = Erc20.Symbol(web3, ContractAddress); - + var getSymbol = Erc20.Symbol(web3, Contracts.Erc20); yield return new WaitUntil(() => getSymbol.IsCompleted); - - Assert.AreEqual("CT", getSymbol.Result); + Assert.AreEqual("CST", getSymbol.Result); } [UnityTest] public IEnumerator TestTotalSupply() { - var getTotalSupply = Erc20.TotalSupply(web3, ContractAddress); - + var getTotalSupply = Erc20.TotalSupply(web3, TotalSupplyAddress); yield return new WaitUntil(() => getTotalSupply.IsCompleted); - - Assert.AreEqual(new BigInteger(new byte[] - { - 0, 0, 0, 64, 234, 237, 116, 70, 208, 156, 44, 159, 12 - }), getTotalSupply.Result); + Assert.AreEqual(new BigInteger(1000000000000000000), getTotalSupply.Result); } } \ No newline at end of file diff --git a/Packages/io.chainsafe.web3-unity/Tests/Runtime/Erc721Tests.cs b/Packages/io.chainsafe.web3-unity/Tests/Runtime/Erc721Tests.cs index e0b3a4630..e4de525df 100644 --- a/Packages/io.chainsafe.web3-unity/Tests/Runtime/Erc721Tests.cs +++ b/Packages/io.chainsafe.web3-unity/Tests/Runtime/Erc721Tests.cs @@ -1,10 +1,7 @@ using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Numerics; using ChainSafe.Gaming.Evm.JsonRpc; +using ChainSafe.Gaming.MultiCall; using ChainSafe.Gaming.UnityPackage; -using ChainSafe.Gaming.WalletConnect; using ChainSafe.Gaming.Web3; using ChainSafe.Gaming.Web3.Build; using ChainSafe.Gaming.Web3.Unity; @@ -12,48 +9,40 @@ using Scripts.EVM.Token; using UnityEngine; using UnityEngine.TestTools; -using Web3Unity.Scripts.Prefabs; public class Erc721Tests { - // Fields + #region Fields + #region Balances - private const string balanceOfContractAddress = "0x9123541E259125657F03D7AD2A7D1a8Ec79375BA"; private const string balanceOfAccount = "0xd25b827D92b0fd656A1c829933e9b0b836d5C3e2"; + private static int balanceOfExpected = 3; #endregion #region OwnerOf - private const string ownerOfContractAddress = "0x06dc21f89f01409e7ed0e4c80eae1430962ae52c"; - private const string ownerOfTokenId = "0x01559ae4021a565d5cc4740f1cefa95de8c1fb193949ecd32c337b03047da501"; - private const string ownerOfExpected = "0x7Ea535884Ba8342bE7aDbef0Fa6822E629162375"; - private const string ownerOfBatchContractAddress = "0x47381c5c948254e6e0E324F1AA54b7B24104D92D"; - private string[] ownerOfBatchTokenIds = { "33", "29" }; - public string multicall = "0x77dca2c955b15e9de4dbbcf1246b4b85b651e50e"; - private string[] ownerOfBatchExpected = { "0x5e8caec3a556cbb8a3cb689560ea811bdddc8d90", "0x80cc9a67ead304bbb3b6cfca804773ef51da872c" }; + private const string ownerOfTokenId = "2"; + private const string ownerOfExpected = "0xd25b827D92b0fd656A1c829933e9b0b836d5C3e2"; + private static string[] ownerOfBatchTokenIds = { "4", "5" }; + private static string[] ownerOfBatchExpected = { "0xd25b827D92b0fd656A1c829933e9b0b836d5C3e2", "0xD5c8010ef6dff4c83B19C511221A7F8d1e5cFF44" }; - #endregion - - #region AllNfts - - private const string allContractAddress = "0x2c1867BC3026178A47a677513746DCc6822A137A"; - #endregion #region Uri - - private const string uriContractAddress = "0x06dc21f89f01409e7ed0e4c80eae1430962ae52c"; - private const string uriTokenId = "0x01559ae4021a565d5cc4740f1cefa95de8c1fb193949ecd32c337b03047da501"; + private const string uriTokenId = "1"; + private const string ExpectedUriResult = + "https://ipfs.chainsafe.io/ipfs/QmfUHuFj3YL2JMZkyXNtGRV8e9aLJgQ6gcSrqbfjWFvbqQ"; + private const string NftTextureContractAddress = "0x0288B4F1389ED7b3d3f9C7B73d4408235c0CBbc6"; + + #endregion + #endregion - private WalletConnectConfig config; private Web3 web3; - private const string NftTextureContractAddress = "0x0288B4F1389ED7b3d3f9C7B73d4408235c0CBbc6"; - #region Indexer Test Parameters private const string IndexerChain = "ethereum"; @@ -68,66 +57,63 @@ public class Erc721Tests [UnitySetUp] public IEnumerator Setup() { - //wait for some time to initialize + // Wait for some time to initialize yield return new WaitForSeconds(5f); - //For whatever reason, in github this won't load + // Set project config, fallback is for github as it doesn't load var projectConfigScriptableObject = ProjectConfigUtilities.Load(); if (projectConfigScriptableObject == null) { - projectConfigScriptableObject = ProjectConfigUtilities.Load("3dc3e125-71c4-4511-a367-e981a6a94371", "5", - "Ethereum", "Goerli", "Geth", "https://goerli.infura.io/v3/287318045c6e455ab34b81d6bcd7a65f"); + projectConfigScriptableObject = ProjectConfigUtilities.Load("3dc3e125-71c4-4511-a367-e981a6a94371", "11155111", + "Ethereum", "Sepolia", "Seth", "https://sepolia.infura.io/v3/287318045c6e455ab34b81d6bcd7a65f"); } - + + // Create web3builder & assign services var web3Builder = new Web3Builder(projectConfigScriptableObject) .Configure(services => { services.UseUnityEnvironment(); services.UseRpcProvider(); + services.UseMultiCall(); }); var buildWeb3 = web3Builder.LaunchAsync(); - //wait until for async task to finish + // Wait until for async task to finish yield return new WaitUntil(() => buildWeb3.IsCompleted); - + + // Assign result to web3 web3 = buildWeb3.Result; } [UnityTest] public IEnumerator TestBalanceOf() { - var getBalanceOf = Erc721.BalanceOf(web3, balanceOfContractAddress, balanceOfAccount); + var getBalanceOf = Erc721.BalanceOf(web3, Contracts.Erc721, balanceOfAccount); yield return new WaitUntil(() => getBalanceOf.IsCompleted); - - Assert.AreEqual(2, getBalanceOf.Result); + Assert.AreEqual(balanceOfExpected, getBalanceOf.Result); } [UnityTest] public IEnumerator TestOwnerOf() { - var getOwnerOf = Erc721.OwnerOf(web3, ownerOfContractAddress, ownerOfTokenId); + var getOwnerOf = Erc721.OwnerOf(web3, Contracts.Erc721, ownerOfTokenId); yield return new WaitUntil(() => getOwnerOf.IsCompleted); - Assert.AreEqual(ownerOfExpected, getOwnerOf.Result); } - + [UnityTest] public IEnumerator TestOwnerOfBatch() { - var getOwnerOfBatch = Erc721.OwnerOfBatch(web3, ownerOfBatchContractAddress, ownerOfBatchTokenIds, multicall); + var getOwnerOfBatch = Erc721.OwnerOfBatch(web3, Contracts.Erc721, ownerOfBatchTokenIds); yield return new WaitUntil(() => getOwnerOfBatch.IsCompleted); - CollectionAssert.AreEqual(ownerOfBatchExpected, getOwnerOfBatch.Result); } - private const string ExpectedUriResult = - "https://ipfs.io/ipfs/f01559ae4021a565d5cc4740f1cefa95de8c1fb193949ecd32c337b03047da501"; - [UnityTest] public IEnumerator TestUri() { - var uri = Erc721.Uri(web3, uriContractAddress, uriTokenId); + var uri = Erc721.Uri(web3, Contracts.Erc721, uriTokenId); yield return new WaitUntil(() => uri.IsCompleted); Assert.AreEqual(ExpectedUriResult, uri.Result); } diff --git a/Packages/io.chainsafe.web3-unity/Tests/Runtime/EvmTests.cs b/Packages/io.chainsafe.web3-unity/Tests/Runtime/EvmTests.cs index 53c0824e1..55b954dc8 100644 --- a/Packages/io.chainsafe.web3-unity/Tests/Runtime/EvmTests.cs +++ b/Packages/io.chainsafe.web3-unity/Tests/Runtime/EvmTests.cs @@ -9,27 +9,23 @@ public class EvmTests : SampleTestsBase { + #region Fields + #region ContractCalls - private const string ContractSendMethodName = "addTotal"; - - private const int IncreaseAmount = 1; - - private const string Abi = "[ { \"inputs\": [ { \"internalType\": \"uint8\", \"name\": \"_myArg\", \"type\": \"uint8\" } ], \"name\": \"addTotal\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [], \"name\": \"myTotal\", \"outputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"stateMutability\": \"view\", \"type\": \"function\" } ]"; - - private const string ContractAddress = "0x7286Cf0F6E80014ea75Dbc25F545A3be90F4904F"; + private const string ContractSendMethod = "addTotal"; + private const int IncreaseAmount = 2; + private const string ContractCallMethod = "myTotal"; + private const string CallAmount = "1"; #endregion #region Array - private const string SendArrayAbi = "[{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_addresses\",\"type\":\"address[]\"}],\"name\":\"setStore\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"bought\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStore\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]"; - - private const string SendArrayAddress = "0x5244d0453A727EDa96299384370359f4A2B5b20a"; + private const string GetArrayMethod = "getStore"; + private const string SendArrayMethod = "setStore"; - private const string SendArrayMethodName = "setStore"; - - private static readonly List ArrayToSend = new List() + private static List ArrayToSend = new List() { "0xFb3aECf08940785D4fB3Ad87cDC6e1Ceb20e9aac", "0x92d4040e4f3591e60644aaa483821d1bd87001e3" @@ -39,24 +35,18 @@ public class EvmTests : SampleTestsBase #region MintErc20 - private const string Mint20Contract = "0x714d32fA722461A2c8F0b4EB98ff5cFF8F908Df2"; - private const string Mint20ToAccount = "0xdD4c825203f97984e7867F11eeCc813A036089D1"; private const int Mint20Amount = 1; #endregion #region Mint721 - private const string Mint721Abi = "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"renounceRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"revokeRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"previousAdminRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"newAdminRole\",\"type\":\"bytes32\"}],\"name\":\"RoleAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"}],\"name\":\"safeMint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasRole\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MINTER_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]"; - private const string Mint721Contract = "0x0B102638532be8A1b3d0ed1fcE6eC603Bec37848"; - private const string Mint721Uri = "ipfs://QmNn5EaGR26kU7aAMH7LhkNsAGcmcyJgun3Wia4MftVicW/1.json"; + private const string Mint721Uri = "QmfUHuFj3YL2JMZkyXNtGRV8e9aLJgQ6gcSrqbfjWFvbqQ"; #endregion #region Mint1155 - private string Mint1155Abi = "[ { \"inputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"constructor\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": true, \"internalType\": \"address\", \"name\": \"account\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"operator\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"bool\", \"name\": \"approved\", \"type\": \"bool\" } ], \"name\": \"ApprovalForAll\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": true, \"internalType\": \"address\", \"name\": \"operator\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"from\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint256[]\", \"name\": \"ids\", \"type\": \"uint256[]\" }, { \"indexed\": false, \"internalType\": \"uint256[]\", \"name\": \"values\", \"type\": \"uint256[]\" } ], \"name\": \"TransferBatch\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": true, \"internalType\": \"address\", \"name\": \"operator\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"from\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint256\", \"name\": \"id\", \"type\": \"uint256\" }, { \"indexed\": false, \"internalType\": \"uint256\", \"name\": \"value\", \"type\": \"uint256\" } ], \"name\": \"TransferSingle\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": false, \"internalType\": \"string\", \"name\": \"value\", \"type\": \"string\" }, { \"indexed\": true, \"internalType\": \"uint256\", \"name\": \"id\", \"type\": \"uint256\" } ], \"name\": \"URI\", \"type\": \"event\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"account\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"id\", \"type\": \"uint256\" } ], \"name\": \"balanceOf\", \"outputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address[]\", \"name\": \"accounts\", \"type\": \"address[]\" }, { \"internalType\": \"uint256[]\", \"name\": \"ids\", \"type\": \"uint256[]\" } ], \"name\": \"balanceOfBatch\", \"outputs\": [ { \"internalType\": \"uint256[]\", \"name\": \"\", \"type\": \"uint256[]\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"account\", \"type\": \"address\" }, { \"internalType\": \"address\", \"name\": \"operator\", \"type\": \"address\" } ], \"name\": \"isApprovedForAll\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"account\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"id\", \"type\": \"uint256\" }, { \"internalType\": \"uint256\", \"name\": \"amount\", \"type\": \"uint256\" }, { \"internalType\": \"bytes\", \"name\": \"data\", \"type\": \"bytes\" } ], \"name\": \"mint\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"internalType\": \"uint256[]\", \"name\": \"ids\", \"type\": \"uint256[]\" }, { \"internalType\": \"uint256[]\", \"name\": \"amounts\", \"type\": \"uint256[]\" }, { \"internalType\": \"bytes\", \"name\": \"data\", \"type\": \"bytes\" } ], \"name\": \"mintBatch\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"from\", \"type\": \"address\" }, { \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"internalType\": \"uint256[]\", \"name\": \"ids\", \"type\": \"uint256[]\" }, { \"internalType\": \"uint256[]\", \"name\": \"amounts\", \"type\": \"uint256[]\" }, { \"internalType\": \"bytes\", \"name\": \"data\", \"type\": \"bytes\" } ], \"name\": \"safeBatchTransferFrom\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"from\", \"type\": \"address\" }, { \"internalType\": \"address\", \"name\": \"to\", \"type\": \"address\" }, { \"internalType\": \"uint256\", \"name\": \"id\", \"type\": \"uint256\" }, { \"internalType\": \"uint256\", \"name\": \"amount\", \"type\": \"uint256\" }, { \"internalType\": \"bytes\", \"name\": \"data\", \"type\": \"bytes\" } ], \"name\": \"safeTransferFrom\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"address\", \"name\": \"operator\", \"type\": \"address\" }, { \"internalType\": \"bool\", \"name\": \"approved\", \"type\": \"bool\" } ], \"name\": \"setApprovalForAll\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"bytes4\", \"name\": \"interfaceId\", \"type\": \"bytes4\" } ], \"name\": \"supportsInterface\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"name\": \"uri\", \"outputs\": [ { \"internalType\": \"string\", \"name\": \"\", \"type\": \"string\" } ], \"stateMutability\": \"view\", \"type\": \"function\" } ]"; - private string Mint1155Contract = "0xA0a53f1Cabf7D723Ab2087400681039917D1B6D4"; private const int Mint1155Id = 1; private const int Mint1155Amount = 1; @@ -64,86 +54,107 @@ public class EvmTests : SampleTestsBase #region Transfer - private const string TransferErc20ContractAddress = "0xc778417e063141139fce010982780140aa0cd5ab"; - private const string TransferErc721ContractAddress = "0x358AA13c52544ECCEF6B0ADD0f801012ADAD5eE3"; - private const string TransferErc1155ContractAddress = "0xe793e17Ec93bEc809C5Ac6dd0d8b383446E65B78"; + private BigInteger TransferErc20Amount = 1; + + private const int Transfer721Id = 5; + private const int Transfer1155Id = 1; + private const int Transfer1155Amount = 1; + private const string SendToAddress = "0xdD4c825203f97984e7867F11eeCc813A036089D1"; #endregion + + #region ECDSA + private string ecdsaKey = "0x78dae1a22c7507a4ed30c06172e7614eb168d3546c13856340771e63ad3c0081"; + private string ecdsaMessage = "This is a test message"; + private string transactionHash = "0x123456789"; + private string chainId ="11155111"; + + #endregion + + #endregion + private Web3 web3; [UnitySetUp] public override IEnumerator Setup() { yield return base.Setup(); - web3 = web3Result; } + + [UnityTest] + public IEnumerator TestContractCall() + { + object[] args = { config.TestWalletAddress }; + var callContract = Evm.ContractCall(web3, ContractCallMethod, ABI.ArrayTotal, Contracts.ArrayTotal, args); + yield return new WaitUntil(() => callContract.IsCompleted); + if (callContract.Exception != null) throw callContract.Exception; + Assert.IsTrue(callContract.IsCompletedSuccessfully); + Assert.AreEqual(CallAmount, callContract.Result[0].ToString()); + } [UnityTest] public IEnumerator TestContractSend() { - config.TestResponse = "0x9de3bb69db4bd93babef923f5da1f53cdb287d9ebab9b4177ba2fb25e6a09225"; - + config.TestResponse = "0x324080652dfe1463f0fcbde18961a6e7eee87f2231133523e96dc52ce8239d3f"; object[] args = { IncreaseAmount }; - - var sendContract = Evm.ContractSend(web3, ContractSendMethodName, Abi, ContractAddress, args); - + var sendContract = Evm.ContractSend(web3, ContractSendMethod, ABI.ArrayTotal, Contracts.ArrayTotal, args); yield return new WaitUntil(() => sendContract.IsCompleted); - if (sendContract.Exception != null) throw sendContract.Exception; - Assert.IsTrue(sendContract.IsCompletedSuccessfully); - - Assert.AreEqual(sendContract.Result, string.Empty); + Assert.AreEqual(string.Empty, sendContract.Result); } - [UnityTest] + [UnityTest] public IEnumerator TestGetArray() { - string contractAddress = "0x5244d0453A727EDa96299384370359f4A2B5b20a"; - string abi = "[{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_addresses\",\"type\":\"address[]\"}],\"name\":\"setStore\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"bought\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStore\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]"; - string method = "getStore"; - var getArray = Evm.GetArray(web3, contractAddress, abi, method); - + var getArray = Evm.GetArray(web3, Contracts.ArrayTotal, ABI.ArrayTotal, GetArrayMethod); yield return new WaitUntil(() => getArray.IsCompleted); - - //convert toLower to make comparing easier + // Convert toLower to make comparing easier var result = getArray.Result.ConvertAll(a => a.ConvertAll(b => b.ToLower())); - Assert.AreEqual(result, new List> { ArrayToSend.ConvertAll(a => a.ToLower()) }); } + + [UnityTest] + public IEnumerator TestSendArray() + { + config.TestResponse = "0x3446b949c3d214fba7e61c9cf127eac6cd0b2983564cf76be618099879b6f1e1"; + var sendArray = Evm.SendArray(web3, SendArrayMethod, ABI.ArrayTotal, Contracts.ArrayTotal, ArrayToSend.ToArray()); + yield return new WaitUntil(() => sendArray.IsCompleted); + if (sendArray.Exception != null) throw sendArray.Exception; + Assert.IsTrue(sendArray.IsCompletedSuccessfully); + Assert.AreEqual(string.Empty, sendArray.Result); + } [UnityTest] public IEnumerator TestGetBlockNumber() { var getBlockNumber = Evm.GetBlockNumber(web3); - yield return new WaitUntil(() => getBlockNumber.IsCompleted); - if (getBlockNumber.Exception != null) throw getBlockNumber.Exception; - - //just assert successful completion because result is always changing + // Just assert successful completion because result is always changing Assert.IsTrue(getBlockNumber.IsCompletedSuccessfully); } [UnityTest] public IEnumerator TestGetGasLimit() { - var getGasLimit = Evm.GetGasLimit(web3, Abi, ContractAddress, "addTotal"); - + object[] args = + { + IncreaseAmount + }; + var getGasLimit = Evm.GetGasLimit(web3, ABI.ArrayTotal, Contracts.ArrayTotal, ContractSendMethod, args); yield return new WaitUntil(() => getGasLimit.IsCompleted); - if (getGasLimit.Exception != null) throw getGasLimit.Exception; - - //just assert successful completion because result is always changing + // Just assert successful completion because result is always changing Assert.IsTrue(getGasLimit.IsCompletedSuccessfully); } @@ -151,98 +162,60 @@ public IEnumerator TestGetGasLimit() public IEnumerator TestGetGasPrice() { var getGasPrice = Evm.GetGasPrice(web3); - yield return new WaitUntil(() => getGasPrice.IsCompleted); - if (getGasPrice.Exception != null) throw getGasPrice.Exception; - - //just assert successful completion because result is always changing + // Just assert successful completion because result is always changing Assert.IsTrue(getGasPrice.IsCompletedSuccessfully); } [UnityTest] public IEnumerator TestGetGasNonce() { - config.TestResponse = "0x527fcd7356738389d29a96342b5fba92ab1348b744409d5bf4ce0ca2fbc2f25e"; - + config.TestResponse = "0xaba88d9a1977c8d78ddfb3d973798eb061bd495189d7cbfa832f895896417cd1"; var getGasNonce = Evm.GetNonce(web3); - yield return new WaitUntil(() => getGasNonce.IsCompleted); - if (getGasNonce.Exception != null) throw getGasNonce.Exception; - - //just assert successful completion because result is always changing + // Just assert successful completion because result is always changing Assert.IsTrue(getGasNonce.IsCompletedSuccessfully); } [UnityTest] public IEnumerator TestTransactionStatus() { - config.TestResponse = "0x1e989dbcc43e078b19ea8ea201af195e74397b494b7acd4afcca67e65e5c3339"; - + config.TestResponse = "0xaba88d9a1977c8d78ddfb3d973798eb061bd495189d7cbfa832f895896417cd1"; var getTransactionStatus = Evm.GetTransactionStatus(web3); - yield return new WaitUntil(() => getTransactionStatus.IsCompleted); - if (getTransactionStatus.Exception != null) throw getTransactionStatus.Exception; - - //just assert successful completion because result is always changing + // Just assert successful completion because result is always changing Assert.IsTrue(getTransactionStatus.IsCompletedSuccessfully); } [UnityTest] public IEnumerator TestUseRegisteredContract() { - var useRegisteredContract = Evm.UseRegisteredContract(web3, "shiba", "balanceOf"); - + var useRegisteredContract = Evm.UseRegisteredContract(web3, "CsTestErc20", EthMethod.BalanceOf); yield return new WaitUntil(() => useRegisteredContract.IsCompleted); - if (useRegisteredContract.Exception != null) throw useRegisteredContract.Exception; - Assert.IsTrue(useRegisteredContract.IsCompletedSuccessfully); - - Assert.AreEqual(useRegisteredContract.Result, new BigInteger(0)); - } - - [UnityTest] - public IEnumerator TestSendArray() - { - config.TestResponse = "0x6a33280f3b2b907da613b18b09f863cd835f1977a4131001ace5602899fc98c7"; - - var sendArray = Evm.SendArray(web3, SendArrayMethodName, SendArrayAbi, SendArrayAddress, ArrayToSend.ToArray()); - - yield return new WaitUntil(() => sendArray.IsCompleted); - - if (sendArray.Exception != null) throw sendArray.Exception; - - Assert.IsTrue(sendArray.IsCompletedSuccessfully); - - Assert.AreEqual(sendArray.Result, string.Empty); + Assert.AreEqual(new BigInteger(999999999999999), useRegisteredContract.Result); } [UnityTest] public IEnumerator TestSendTransaction() { - config.TestResponse = "0xa60bef1df91bedcd2f3f79e6609716ef245fd1202d66c6e35694b43529bf2e71"; - + config.TestResponse = "0x3446b949c3d214fba7e61c9cf127eac6cd0b2983564cf76be618099879b6f1e1"; var sendTransaction = Evm.SendTransaction(web3, SendToAddress); - yield return new WaitUntil(() => sendTransaction.IsCompleted); - if (sendTransaction.Exception != null) throw sendTransaction.Exception; - Assert.IsTrue(sendTransaction.IsCompletedSuccessfully); - - Assert.AreEqual(sendTransaction.Result, config.TestResponse); + Assert.AreEqual(config.TestResponse, sendTransaction.Result); } [UnityTest] public IEnumerator TestSha3() { var sha3 = Evm.Sha3("It’s dangerous to go alone, take this!"); - - Assert.AreEqual(sha3, "45760485edafabcbb28570e7da5ddda4639abb4794de9af6de1d6669cbf220fc"); - + Assert.AreEqual("45760485edafabcbb28570e7da5ddda4639abb4794de9af6de1d6669cbf220fc", sha3); yield return null; } @@ -250,129 +223,121 @@ public IEnumerator TestSha3() public IEnumerator TestSignMessage() { config.TestResponse = - "0x87dfaa646f476ca53ba8b6e8d122839571e52866be0984ec0497617ad3e988b7401c6b816858df27625166cb98a688f99ba92fa593da3c86c78b19c78c1f51cc1c"; - + "0xda2880dde86b7d870ac9ddfa690010bed8a679350415f8e9cce02d87bac91651081c40455538bce7a18792e3f2ea56457183e8dba8568f3a92785ab0d743ce0b1b"; var signMessage = Evm.SignMessage(web3,"The right man in the wrong place can make all the difference in the world."); - yield return new WaitUntil(() => signMessage.IsCompleted); - if (signMessage.Exception != null) throw signMessage.Exception; - Assert.IsTrue(signMessage.IsCompletedSuccessfully); - - Assert.AreEqual(signMessage.Result, config.TestResponse); + Assert.AreEqual(config.TestResponse, signMessage.Result); } [UnityTest] public IEnumerator TestSignVerify() { config.TestResponse = - "0x5c996d43c2e804a0d0de7f8b07cc660bbae638aa7ea137df6156621abe5e1fbb1727ebb06f7e0067537cb0f942825fa15ead9dea6d74e4d17fa6e69007cb59561c"; - + "0xda2880dde86b7d870ac9ddfa690010bed8a679350415f8e9cce02d87bac91651081c40455538bce7a18792e3f2ea56457183e8dba8568f3a92785ab0d743ce0b1b"; var signVerify = Evm.SignVerify(web3, "A man chooses, a slave obeys."); - yield return new WaitUntil(() => signVerify.IsCompleted); - if (signVerify.Exception != null) throw signVerify.Exception; - Assert.IsTrue(signVerify.IsCompletedSuccessfully); - - Assert.AreEqual(signVerify.Result, true); + Assert.AreEqual(true, signVerify.Result); + } + + [UnityTest] + public IEnumerator TestECDSASignTx() + { + var signTxECDSA = Evm.EcdsaSignTransaction(ecdsaKey, transactionHash, chainId); + Assert.AreEqual("0xf8cd1c5dfa0706767c7ec81b91bed9a05b65b9c5b47769206a594377c5969a9a47fe21f7328b5865815f97b7ddd09bd7b899879aac6ed7c01eda5380975a54dc01546d72", signTxECDSA); + return null; + } + + [UnityTest] + public IEnumerator TestECDSASign() + { + var signECDSA = Evm.EcdsaSignMessage(ecdsaKey, ecdsaMessage); + Assert.AreEqual("0x90bd386a185bdc5cbb13b9bba442e35036ac8e92792e74e385abbf7d9546be8720879c2075bf59124d9114b4d432173a4d6c4b118d278c3ffb51a140a625c66c1b", signECDSA); + return null; + } + + [UnityTest] + public IEnumerator TestECDSAAddress() + { + var address = Evm.EcdsaGetAddress(ecdsaKey); + Assert.AreEqual("0x428066dd8A212104Bc9240dCe3cdeA3D3A0f7979", address); + return null; + } + + [UnityTest] + public IEnumerator TestCustomBalanceOfErc20() + { + var getCustomBalanceOf = Erc20.CustomTokenBalance(web3, ABI.Erc20, Contracts.Erc20); + yield return new WaitUntil(() => getCustomBalanceOf.IsCompleted); + Assert.AreEqual(new BigInteger(999999999999999), getCustomBalanceOf.Result); } [UnityTest] public IEnumerator TestMintErc20() { - config.TestResponse = "0xd3027fbfd9d5ddb5ea0ef75f5b128581d9268ad67728d150657f915c8910f9f0"; - - var mint20 = Erc20.MintErc20(web3, Mint20Contract, Mint20ToAccount, Mint20Amount); - + config.TestResponse = "0xf6133ad76359ffaf67853a5eb138a94ed11f29d350b907420a92c685c6df5303"; + var mint20 = Erc20.MintErc20(web3, Contracts.Erc20, SendToAddress, Mint20Amount); yield return new WaitUntil(() => mint20.IsCompleted); - if (mint20.Exception != null) throw mint20.Exception; - Assert.IsTrue(mint20.IsCompletedSuccessfully); - - Assert.AreEqual(mint20.Result, string.Empty); + Assert.AreEqual(string.Empty, mint20.Result); } [UnityTest] public IEnumerator TestMintErc721() { - config.TestResponse = "0xd3027fbfd9d5ddb5ea0ef75f5b128581d9268ad67728d150657f915c8910f9f0"; - - var mint721 = Erc721.MintErc721(web3, Mint721Abi, Mint721Contract, Mint721Uri); - + config.TestResponse = "0x09f1c615d638ae0b3a8c4a5555b46170c42dba214f04412400f3ff639657a223"; + var mint721 = Erc721.MintErc721(web3, ABI.Erc721, Contracts.Erc721, Mint721Uri); yield return new WaitUntil(() => mint721.IsCompleted); - if (mint721.Exception != null) throw mint721.Exception; - Assert.IsTrue(mint721.IsCompletedSuccessfully); - - Assert.AreEqual(mint721.Result, string.Empty); + Assert.AreEqual(string.Empty, mint721.Result); } [UnityTest] public IEnumerator TestMintErc1155() { - config.TestResponse = "0xd3027fbfd9d5ddb5ea0ef75f5b128581d9268ad67728d150657f915c8910f9f0"; - - var mint1155 = Erc1155.MintErc1155(web3, Mint1155Abi, Mint1155Contract, Mint1155Id, Mint1155Amount); - + config.TestResponse = "0xa04294541b934b48ada4073b07ba01492d8ad676aa2db6f93249cec0820a1dca"; + var mint1155 = Erc1155.MintErc1155(web3, ABI.Erc1155, Contracts.Erc1155, Mint1155Id, Mint1155Amount); yield return new WaitUntil(() => mint1155.IsCompleted); - if (mint1155.Exception != null) throw mint1155.Exception; - Assert.IsTrue(mint1155.IsCompletedSuccessfully); - - Assert.AreEqual(mint1155.Result, string.Empty); + Assert.AreEqual(string.Empty, mint1155.Result); + } + + [UnityTest] + public IEnumerator TestTransferErc20() + { + config.TestResponse = "0x87d8826e895247b4106596040c5133a18ecbf76077c5433091a5f18c355a120b"; + var transferErc20 = Erc20.TransferErc20(web3, Contracts.Erc20, SendToAddress, TransferErc20Amount); + yield return new WaitUntil(() => transferErc20.IsCompleted); + if (transferErc20.Exception != null) throw transferErc20.Exception; + Assert.IsTrue(transferErc20.IsCompletedSuccessfully); + Assert.AreEqual(new object[] { false }, transferErc20.Result); } [UnityTest] public IEnumerator TestTransferErc721() { - config.TestResponse = "0x0e292ae8c5ab005d87581f32fd791e1b18b0cfa944d6877b41edbdb740ee8586"; - - var transferErc721 = Erc721.TransferErc721(web3, TransferErc721ContractAddress, SendToAddress, 0); - + config.TestResponse = "0x5c02df6b55bbc5f958d3a5e4b21f0db20cd2284fabe1f7278f7984d3e05de81d"; + var transferErc721 = Erc721.TransferErc721(web3, Contracts.Erc721, SendToAddress, Transfer721Id); yield return new WaitUntil(() => transferErc721.IsCompleted); - if (transferErc721.Exception != null) throw transferErc721.Exception; - Assert.IsTrue(transferErc721.IsCompletedSuccessfully); - - Assert.AreEqual(transferErc721.Result, string.Empty); + Assert.AreEqual(string.Empty, transferErc721.Result); } [UnityTest] public IEnumerator TestTransferErc1155() { - config.TestResponse = "0xb018a043ac0affe05159a53daa8656dbbad61c839eaf89622d7813226f222876"; - - var transferErc1155 = Erc1155.TransferErc1155(web3, TransferErc1155ContractAddress, 101, 1, SendToAddress); - + config.TestResponse = "0x5de8fb6c522d4ba85f09961f03bbdc1ee8d9c283ddd1dea0f3ccdfa27cc189af"; + var transferErc1155 = Erc1155.TransferErc1155(web3, Contracts.Erc1155, Transfer1155Id, Transfer1155Amount, SendToAddress); yield return new WaitUntil(() => transferErc1155.IsCompleted); - if (transferErc1155.Exception != null) throw transferErc1155.Exception; - yield return new WaitUntil(() => transferErc1155.IsCompletedSuccessfully); - - Assert.AreEqual(transferErc1155.Result, string.Empty); - } - - [UnityTest] - public IEnumerator TestTransferErc20() - { - config.TestResponse = "0xba90b6fb8cbee5fd0ad423cc74bb4a365bb88b260601933aac86b947945c5465"; - - var transferErc20 = Erc20.TransferErc20(web3, TransferErc20ContractAddress, SendToAddress, 1000000000000000); - - yield return new WaitUntil(() => transferErc20.IsCompleted); - - if (transferErc20.Exception != null) throw transferErc20.Exception; - - Assert.IsTrue(transferErc20.IsCompletedSuccessfully); - - Assert.AreEqual(transferErc20.Result, new object[] { false }); + Assert.AreEqual(string.Empty, transferErc1155.Result); } } diff --git a/Packages/io.chainsafe.web3-unity/Tests/Runtime/SampleTestsBase.cs b/Packages/io.chainsafe.web3-unity/Tests/Runtime/SampleTestsBase.cs index 329033b47..1197cf432 100644 --- a/Packages/io.chainsafe.web3-unity/Tests/Runtime/SampleTestsBase.cs +++ b/Packages/io.chainsafe.web3-unity/Tests/Runtime/SampleTestsBase.cs @@ -7,6 +7,7 @@ using ChainSafe.Gaming.Web3.Build; using ChainSafe.Gaming.Web3.Unity; using ChainSafe.GamingSdk.Gelato; +using Scripts.EVM.Token; using UnityEngine; using UnityEngine.TestTools; @@ -19,17 +20,18 @@ public class SampleTestsBase [UnitySetUp] public virtual IEnumerator Setup() { - // wait for some time to initialize + // Wait for some time to initialize yield return new WaitForSeconds(5f); - // For whatever reason, in github this won't load + // Set project config, fallback is for github as it doesn't load var projectConfigScriptableObject = ProjectConfigUtilities.Load(); if (projectConfigScriptableObject == null) { - projectConfigScriptableObject = ProjectConfigUtilities.Load("3dc3e125-71c4-4511-a367-e981a6a94371", "5", - "Ethereum", "Goerli", "Geth", "https://goerli.infura.io/v3/287318045c6e455ab34b81d6bcd7a65f"); + projectConfigScriptableObject = ProjectConfigUtilities.Load("3dc3e125-71c4-4511-a367-e981a6a94371", "11155111", + "Ethereum", "Sepolia", "Seth", "https://sepolia.infura.io/v3/287318045c6e455ab34b81d6bcd7a65f"); } - + + // Create web3builder & assign services var web3Builder = new Web3Builder(projectConfigScriptableObject).Configure(services => { services.UseUnityEnvironment(); @@ -38,28 +40,26 @@ public virtual IEnumerator Setup() config = new WalletConnectConfig { - // set wallet to testing + // Set wallet to testing Testing = true, - TestWalletAddress = "0x55ffe9E30347266f02b9BdAe20aD3a86493289ea", + TestWalletAddress = "0xD5c8010ef6dff4c83B19C511221A7F8d1e5cFF44", }; services.UseWalletConnect(config); services.UseWalletConnectSigner(); services.UseWalletConnectTransactionExecutor(); - //add any contracts we would want to use + // Add any contracts we would want to use services.ConfigureRegisteredContracts(contracts => - contracts.RegisterContract( - "shiba", - "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isExcluded\",\"type\":\"bool\"}],\"name\":\"ExcludeFromFees\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isExcluded\",\"type\":\"bool\"}],\"name\":\"ExcludeMultipleAccountsFromFees\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"newValue\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"oldValue\",\"type\":\"uint256\"}],\"name\":\"GasForProcessingUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newLiquidityWallet\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldLiquidityWallet\",\"type\":\"address\"}],\"name\":\"LiquidityWalletUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"iterations\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"claims\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"lastProcessedIndex\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"automatic\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"gas\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"processor\",\"type\":\"address\"}],\"name\":\"ProcessedDividendTracker\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensSwapped\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"SendDividends\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"pair\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"value\",\"type\":\"bool\"}],\"name\":\"SetAutomatedMarketMakerPair\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensSwapped\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ethReceived\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensIntoLiqudity\",\"type\":\"uint256\"}],\"name\":\"SwapAndLiquify\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldAddress\",\"type\":\"address\"}],\"name\":\"UpdateDividendTracker\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldAddress\",\"type\":\"address\"}],\"name\":\"UpdateUniswapV2Router\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"SHIB\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"UNIRewardsFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_marketingWalletAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_maxTxAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"automatedMarketMakerPairs\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"blacklist\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blacklistblock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blockcount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"claim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"deadWallet\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"dividendTokenBalanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dividendTracker\",\"outputs\":[{\"internalType\":\"contract PSDividendTracker\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"excludeFromDividends\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"excluded\",\"type\":\"bool\"}],\"name\":\"excludeFromFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"bool\",\"name\":\"excluded\",\"type\":\"bool\"}],\"name\":\"excludeMultipleAccountsFromFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gasForProcessing\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"getAccountDividendsInfo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getAccountDividendsInfoAtIndex\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getClaimWait\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLastProcessedIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNumberOfDividendTokenHolders\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalDividendsDistributed\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"isExcludedFromFees\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"liquidityFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"marketingFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"gas\",\"type\":\"uint256\"}],\"name\":\"processDividendTracker\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"isBlack\",\"type\":\"bool\"}],\"name\":\"setAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pair\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"value\",\"type\":\"bool\"}],\"name\":\"setAutomatedMarketMakerPair\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"setLiquiditFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"setMarketingFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"wallet\",\"type\":\"address\"}],\"name\":\"setMarketingWallet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"setMaxTxAmount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"setSHIBRewardsFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"salestatus\",\"type\":\"bool\"}],\"name\":\"setSaleStart\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"swapTokensAtAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalFees\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"uniswapV2Pair\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"uniswapV2Router\",\"outputs\":[{\"internalType\":\"contract IUniswapV2Router02\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"claimWait\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"a\",\"type\":\"address\"}],\"name\":\"updateClaimWait\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"updateDividendTracker\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newValue\",\"type\":\"uint256\"}],\"name\":\"updateGasForProcessing\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"updateUniswapV2Router\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"withdrawableDividendOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", - "0x1d6f31b71e12a1a584ca20853495161c48ba491f")); + contracts.RegisterContract("CsTestErc20", ABI.Erc20, Contracts.Erc20)); }); var buildWeb3 = web3Builder.LaunchAsync(); - //wait until for async task to finish + // Wait until for async task to finish yield return new WaitUntil(() => buildWeb3.IsCompleted); + // Assign result to web3 web3Result = buildWeb3.Result; } @@ -67,9 +67,7 @@ public virtual IEnumerator Setup() public virtual IEnumerator TearDown() { config.Testing = false; - web3Result.TerminateAsync(); - yield return null; } } diff --git a/src/ChainSafe.Gaming/Web3/Core/Evm/Dto/Chains.cs b/src/ChainSafe.Gaming/Web3/Core/Evm/Dto/Chains.cs index 47def408e..ccf619352 100644 --- a/src/ChainSafe.Gaming/Web3/Core/Evm/Dto/Chains.cs +++ b/src/ChainSafe.Gaming/Web3/Core/Evm/Dto/Chains.cs @@ -9,50 +9,6 @@ namespace ChainSafe.Gaming.Evm.Network { public class Chains { - private static Dictionary cached = new Dictionary(); - - // TODO: duplicates ChainProvider, remove, update usages - public static async Task> GetChains(Web3Environment environment) - { - if (cached.Count > 0) - { - return cached; - } - - var response = await environment.HttpClient.Get("https://chainid.network/chains.json"); - - if (!response.IsSuccess) - { - CaptureError(response.Error, environment); - throw new HttpRequestException(response.Error); - } - - var chains = response.Response; - - if (chains == null) - { - CaptureError("failed to deserialize chains", environment); - throw new Exception("failed to deserialize chains"); - } - - foreach (var chain in chains) - { - cached[chain.ChainId] = chain; - } - - return cached; - } - - private static void CaptureError(string error, Web3Environment environment) - { - var properties = new Dictionary - { - { "error", error }, - }; - - // TODO: log error using new event format - } - public class Chain { [JsonProperty(PropertyName = "name")] diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK Lootboxes/1.0.0/Chainlink Lootbox Sample/Scripts/Scene/Rewards/Erc1155NftRewardFactory.cs b/src/UnitySampleProject/Assets/Samples/web3.unity SDK Lootboxes/1.0.0/Chainlink Lootbox Sample/Scripts/Scene/Rewards/Erc1155NftRewardFactory.cs index 237080841..03fe534f8 100644 --- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK Lootboxes/1.0.0/Chainlink Lootbox Sample/Scripts/Scene/Rewards/Erc1155NftRewardFactory.cs +++ b/src/UnitySampleProject/Assets/Samples/web3.unity SDK Lootboxes/1.0.0/Chainlink Lootbox Sample/Scripts/Scene/Rewards/Erc1155NftRewardFactory.cs @@ -3,7 +3,7 @@ using LootBoxes.Chainlink.Scene.StageItems; using ChainSafe.Gaming.Evm.Contracts; using ChainSafe.Gaming.Lootboxes.Chainlink; -using ChainSafe.Gaming.UnityPackage; +using Scripts.EVM.Token; using UnityEngine; using UnityEngine.Networking; @@ -35,7 +35,7 @@ public async Task Create(Erc1155NftReward data) { var item = Instantiate(NftRewardItemPrefab); var reward = (NftReward)item.Reward; - var contract = contractBuilder.Build(ABI.ERC_1155, data.ContractAddress); + var contract = contractBuilder.Build(ABI.Erc1155, data.ContractAddress); var uri = (await contract.Call("uri", new object[] { data.TokenId }))[0].ToString(); Erc1155MetaData metadata; diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK Lootboxes/1.0.0/Chainlink Lootbox Sample/Scripts/Scene/Rewards/Erc1155RewardFactory.cs b/src/UnitySampleProject/Assets/Samples/web3.unity SDK Lootboxes/1.0.0/Chainlink Lootbox Sample/Scripts/Scene/Rewards/Erc1155RewardFactory.cs index 1d3a84ca2..a6bc70886 100644 --- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK Lootboxes/1.0.0/Chainlink Lootbox Sample/Scripts/Scene/Rewards/Erc1155RewardFactory.cs +++ b/src/UnitySampleProject/Assets/Samples/web3.unity SDK Lootboxes/1.0.0/Chainlink Lootbox Sample/Scripts/Scene/Rewards/Erc1155RewardFactory.cs @@ -3,7 +3,7 @@ using LootBoxes.Chainlink.Scene.StageItems; using ChainSafe.Gaming.Evm.Contracts; using ChainSafe.Gaming.Lootboxes.Chainlink; -using ChainSafe.Gaming.UnityPackage; +using Scripts.EVM.Token; using UnityEngine; namespace LootBoxes.Chainlink.Scene @@ -34,7 +34,7 @@ public async Task Create(Erc1155Reward data) { var item = Instantiate(CoinRewardItemPrefab); var reward = (CoinReward)item.Reward; - var contract = contractBuilder.Build(ABI.ERC_1155, data.ContractAddress); + var contract = contractBuilder.Build(ABI.Erc1155, data.ContractAddress); var uri = (await contract.Call("uri", new object[] { data.TokenId }))[0].ToString(); Erc1155MetaData metadata; try diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK Lootboxes/1.0.0/Chainlink Lootbox Sample/Scripts/Scene/Rewards/Erc20RewardFactory.cs b/src/UnitySampleProject/Assets/Samples/web3.unity SDK Lootboxes/1.0.0/Chainlink Lootbox Sample/Scripts/Scene/Rewards/Erc20RewardFactory.cs index a56efd439..fccc533fa 100644 --- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK Lootboxes/1.0.0/Chainlink Lootbox Sample/Scripts/Scene/Rewards/Erc20RewardFactory.cs +++ b/src/UnitySampleProject/Assets/Samples/web3.unity SDK Lootboxes/1.0.0/Chainlink Lootbox Sample/Scripts/Scene/Rewards/Erc20RewardFactory.cs @@ -5,7 +5,7 @@ using LootBoxes.Chainlink.Scene.StageItems; using ChainSafe.Gaming.Evm.Contracts; using ChainSafe.Gaming.Lootboxes.Chainlink; -using ChainSafe.Gaming.UnityPackage; +using Scripts.EVM.Token; using UnityEngine; namespace LootBoxes.Chainlink.Scene @@ -35,7 +35,7 @@ public async Task Create(Erc20Reward data) { var item = Instantiate(CoinRewardItemPrefab); var reward = (CoinReward)item.Reward; - var contract = contractBuilder.Build(ABI.ERC_20, data.ContractAddress); + var contract = contractBuilder.Build(ABI.Erc20, data.ContractAddress); var symbol = (await contract.Call("symbol"))[0].ToString(); var decimals = BigInteger.Parse((await contract.Call("decimals"))[0].ToString()); var humanizedAmount = HumanizeAmount(data.AmountRaw, decimals); diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK Lootboxes/1.0.0/Chainlink Lootbox Sample/Scripts/Scene/Rewards/Erc721NftRewardFactory.cs b/src/UnitySampleProject/Assets/Samples/web3.unity SDK Lootboxes/1.0.0/Chainlink Lootbox Sample/Scripts/Scene/Rewards/Erc721NftRewardFactory.cs index dac346508..39387aa77 100644 --- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK Lootboxes/1.0.0/Chainlink Lootbox Sample/Scripts/Scene/Rewards/Erc721NftRewardFactory.cs +++ b/src/UnitySampleProject/Assets/Samples/web3.unity SDK Lootboxes/1.0.0/Chainlink Lootbox Sample/Scripts/Scene/Rewards/Erc721NftRewardFactory.cs @@ -4,6 +4,7 @@ using ChainSafe.Gaming.Evm.Contracts; using ChainSafe.Gaming.Lootboxes.Chainlink; using ChainSafe.Gaming.UnityPackage; +using Scripts.EVM.Token; using UnityEngine; namespace LootBoxes.Chainlink.Scene @@ -32,7 +33,7 @@ public async Task Create(Erc721Reward data) { var item = Instantiate(NftRewardItemPrefab); var reward = (NftReward)item.Reward; - var contract = contractBuilder.Build(ABI.ERC_721, data.ContractAddress); + var contract = contractBuilder.Build(ABI.Erc721, data.ContractAddress); var uri = (await contract.Call("tokenURI", new object[] { data.TokenId.ToString() }))[0].ToString(); Debug.Log(uri); diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK Web3Auth/2.5.1/Web3.Unity Web3Auth Samples/Scenes/SampleLogin - Web3Auth.unity b/src/UnitySampleProject/Assets/Samples/web3.unity SDK Web3Auth/2.5.1/Web3.Unity Web3Auth Samples/Scenes/SampleLogin - Web3Auth.unity index b7397b352..359b59511 100644 --- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK Web3Auth/2.5.1/Web3.Unity Web3Auth Samples/Scenes/SampleLogin - Web3Auth.unity +++ b/src/UnitySampleProject/Assets/Samples/web3.unity SDK Web3Auth/2.5.1/Web3.Unity Web3Auth Samples/Scenes/SampleLogin - Web3Auth.unity @@ -995,7 +995,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7b6902e441950fa4bb5cefdd2263164a, type: 3} m_Name: m_EditorClassIdentifier: - gelatoApiKey: _UzPz_Yk_WTjWMfcl45fLvQNGQ9ISx5ZE8TnwnVKYrE_ + gelatoApiKey: 7MFQqyGS1Iui_e_MgmFW1BfbFeJ06g8nnL2oUTlIJug_ errorPopup: {fileID: 337558421} clientId: BCc0wTmuXureEzgawhUSZOWu4bgWo56sZPrxLiHQCpg5OHcNrfa44esdTS8Dm77VtmaIyjhbthdWfbLhSwf7jtU redirectUri: torusapp://io.chainsafe.gamingsdk.sdkdemoscene/auth @@ -1488,7 +1488,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMin.x @@ -1496,15 +1496,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 300 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 50 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_LocalPosition.x @@ -1536,11 +1536,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 150 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -190 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_LocalEulerAnglesHint.x @@ -1593,7 +1593,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMin.x @@ -1601,15 +1601,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 300 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 50 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_LocalPosition.x @@ -1641,11 +1641,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 150 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -80 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_LocalEulerAnglesHint.x @@ -1851,10 +1851,10 @@ RectTransform: m_Father: {fileID: 221640018348301908} m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 150, y: -337.825} + m_SizeDelta: {x: 300, y: 15.65} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &221640018720180777 GameObject: @@ -1996,7 +1996,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMin.x @@ -2004,15 +2004,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 300 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 50 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_LocalPosition.x @@ -2044,11 +2044,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 150 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -135 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_LocalEulerAnglesHint.x @@ -2121,7 +2121,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMin.x @@ -2129,15 +2129,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 300 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 50 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_LocalPosition.x @@ -2169,11 +2169,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 150 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -25 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_LocalEulerAnglesHint.x @@ -2274,7 +2274,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMin.x @@ -2282,15 +2282,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 300 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 50 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_LocalPosition.x @@ -2322,11 +2322,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 150 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -300 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_LocalEulerAnglesHint.x @@ -2399,7 +2399,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMin.x @@ -2407,15 +2407,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 300 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 50 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_LocalPosition.x @@ -2447,11 +2447,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 150 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -245 objectReference: {fileID: 0} - target: {fileID: 4764608378852082086, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_LocalEulerAnglesHint.x diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Prefabs/Minter/VoucherMinter1155.prefab b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Prefabs/Minter/VoucherMinter1155.prefab deleted file mode 100644 index 73532cb44..000000000 --- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Prefabs/Minter/VoucherMinter1155.prefab +++ /dev/null @@ -1,395 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1 &2469385475120306930 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2469385475120306931} - - component: {fileID: 2469385475120306933} - - component: {fileID: 2469385475120306932} - m_Layer: 5 - m_Name: Text - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &2469385475120306931 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2469385475120306930} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 2469385475131455844} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &2469385475120306933 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2469385475120306930} - m_CullTransparentMesh: 1 ---- !u!114 &2469385475120306932 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2469385475120306930} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 14 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 4 - m_AlignByGeometry: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: Get Voucher Mint 1155 ---- !u!1 &2469385475131455843 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2469385475131455844} - - component: {fileID: 2469385475131455832} - - component: {fileID: 2469385475131455847} - - component: {fileID: 2469385475131455846} - m_Layer: 5 - m_Name: GetVoucher1155 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &2469385475131455844 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2469385475131455843} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 2469385475120306931} - m_Father: {fileID: 2469385476375445278} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 7.3307, y: 3} - m_SizeDelta: {x: 178.6985, y: 51.3155} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &2469385475131455832 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2469385475131455843} - m_CullTransparentMesh: 1 ---- !u!114 &2469385475131455847 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2469385475131455843} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!114 &2469385475131455846 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2469385475131455843} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_WrapAround: 0 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_SelectedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_SelectedTrigger: Selected - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 2469385475131455847} - m_OnClick: - m_PersistentCalls: - m_Calls: - - m_Target: {fileID: 8354423990863474395} - m_TargetAssemblyTypeName: MintWeb3Wallet1155, Assembly-CSharp - m_MethodName: VoucherMintNft1155 - m_Mode: 1 - m_Arguments: - m_ObjectArgument: {fileID: 0} - m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine - m_IntArgument: 0 - m_FloatArgument: 0 - m_StringArgument: - m_BoolArgument: 0 - m_CallState: 2 ---- !u!1 &2469385475538265602 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2469385475538265603} - m_Layer: 0 - m_Name: VoucherMinter1155 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &2469385475538265603 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2469385475538265602} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 550.5, y: 259.5, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 2469385476367201654} - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &2469385476367201653 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2469385476367201654} - - component: {fileID: 8354423990863474395} - m_Layer: 0 - m_Name: GetVoucher1155 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &2469385476367201654 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2469385476367201653} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -550.5, y: -259.5, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 2469385476375445278} - m_Father: {fileID: 2469385475538265603} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &8354423990863474395 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2469385476367201653} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: f530a2f3db5f5c7478b08921d42c5114, type: 3} - m_Name: - m_EditorClassIdentifier: - nftAddress: 0x2c1867bc3026178a47a677513746dcc6822a137a ---- !u!1 &2469385476375445277 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2469385476375445278} - - component: {fileID: 2469385476375445265} - - component: {fileID: 2469385476375445264} - - component: {fileID: 2469385476375445279} - m_Layer: 5 - m_Name: Canvas - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &2469385476375445278 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2469385476375445277} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0, y: 0, z: 0} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 2469385475131455844} - m_Father: {fileID: 2469385476367201654} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0, y: 0} ---- !u!223 &2469385476375445265 -Canvas: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2469385476375445277} - m_Enabled: 1 - serializedVersion: 3 - m_RenderMode: 0 - m_Camera: {fileID: 0} - m_PlaneDistance: 100 - m_PixelPerfect: 0 - m_ReceivesEvents: 1 - m_OverrideSorting: 0 - m_OverridePixelPerfect: 0 - m_SortingBucketNormalizedSize: 0 - m_AdditionalShaderChannelsFlag: 0 - m_SortingLayerID: 0 - m_SortingOrder: 0 - m_TargetDisplay: 0 ---- !u!114 &2469385476375445264 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2469385476375445277} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} - m_Name: - m_EditorClassIdentifier: - m_UiScaleMode: 0 - m_ReferencePixelsPerUnit: 100 - m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 - m_MatchWidthOrHeight: 0 - m_PhysicalUnit: 3 - m_FallbackScreenDPI: 96 - m_DefaultSpriteDPI: 96 - m_DynamicPixelsPerUnit: 1 - m_PresetInfoIsWorld: 0 ---- !u!114 &2469385476375445279 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2469385476375445277} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreReversedGraphics: 1 - m_BlockingObjects: 0 - m_BlockingMask: - serializedVersion: 2 - m_Bits: 4294967295 diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Prefabs/Minter/VoucherMinter1155.prefab.meta b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Prefabs/Minter/VoucherMinter1155.prefab.meta deleted file mode 100644 index 97f0d0e46..000000000 --- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Prefabs/Minter/VoucherMinter1155.prefab.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: adb4ed441865ece4195a1e5a5194795d -PrefabImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Prefabs/Minter/VoucherMinter721.prefab b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Prefabs/Minter/VoucherMinter721.prefab deleted file mode 100644 index 6cfa7d719..000000000 --- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Prefabs/Minter/VoucherMinter721.prefab +++ /dev/null @@ -1,395 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1 &2759602052112117140 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2759602052112117141} - m_Layer: 0 - m_Name: VoucherMinter721 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &2759602052112117141 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2759602052112117140} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 550.5, y: 259.5, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 2759602053411208928} - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &2759602052780609892 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2759602052780609893} - - component: {fileID: 2759602052780609891} - - component: {fileID: 2759602052780609890} - m_Layer: 5 - m_Name: Text - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &2759602052780609893 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2759602052780609892} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 2759602052787827442} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &2759602052780609891 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2759602052780609892} - m_CullTransparentMesh: 1 ---- !u!114 &2759602052780609890 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2759602052780609892} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 14 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 4 - m_AlignByGeometry: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: Get Voucher Mint 721 ---- !u!1 &2759602052787827445 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2759602052787827442} - - component: {fileID: 2759602052787827406} - - component: {fileID: 2759602052787827441} - - component: {fileID: 2759602052787827440} - m_Layer: 5 - m_Name: GetVoucher721 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &2759602052787827442 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2759602052787827445} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 2759602052780609893} - m_Father: {fileID: 2759602053423477896} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 7.3307, y: 5} - m_SizeDelta: {x: 178.6985, y: 51.3155} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &2759602052787827406 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2759602052787827445} - m_CullTransparentMesh: 1 ---- !u!114 &2759602052787827441 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2759602052787827445} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!114 &2759602052787827440 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2759602052787827445} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_WrapAround: 0 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_SelectedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_SelectedTrigger: Selected - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 2759602052787827441} - m_OnClick: - m_PersistentCalls: - m_Calls: - - m_Target: {fileID: 1370948658301429458} - m_TargetAssemblyTypeName: MintWeb3Wallet721, Assembly-CSharp - m_MethodName: VoucherMintNft721 - m_Mode: 1 - m_Arguments: - m_ObjectArgument: {fileID: 0} - m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine - m_IntArgument: 0 - m_FloatArgument: 0 - m_StringArgument: - m_BoolArgument: 0 - m_CallState: 2 ---- !u!1 &2759602053411208931 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2759602053411208928} - - component: {fileID: 1370948658301429458} - m_Layer: 0 - m_Name: GetVoucher721 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &2759602053411208928 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2759602053411208931} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -550.5, y: -259.5, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 2759602053423477896} - m_Father: {fileID: 2759602052112117141} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1370948658301429458 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2759602053411208931} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 785a5af054a848e4a93802898e155c97, type: 3} - m_Name: - m_EditorClassIdentifier: - nftAddress: f01559ae4021a47e26bc773587278f62a833f2a6117411afbc5a7855661936d1c ---- !u!1 &2759602053423477899 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2759602053423477896} - - component: {fileID: 2759602053423477895} - - component: {fileID: 2759602053423477894} - - component: {fileID: 2759602053423477897} - m_Layer: 5 - m_Name: Canvas - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &2759602053423477896 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2759602053423477899} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0, y: 0, z: 0} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 2759602052787827442} - m_Father: {fileID: 2759602053411208928} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0, y: 0} ---- !u!223 &2759602053423477895 -Canvas: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2759602053423477899} - m_Enabled: 1 - serializedVersion: 3 - m_RenderMode: 0 - m_Camera: {fileID: 0} - m_PlaneDistance: 100 - m_PixelPerfect: 0 - m_ReceivesEvents: 1 - m_OverrideSorting: 0 - m_OverridePixelPerfect: 0 - m_SortingBucketNormalizedSize: 0 - m_AdditionalShaderChannelsFlag: 0 - m_SortingLayerID: 0 - m_SortingOrder: 0 - m_TargetDisplay: 0 ---- !u!114 &2759602053423477894 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2759602053423477899} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} - m_Name: - m_EditorClassIdentifier: - m_UiScaleMode: 0 - m_ReferencePixelsPerUnit: 100 - m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 - m_MatchWidthOrHeight: 0 - m_PhysicalUnit: 3 - m_FallbackScreenDPI: 96 - m_DefaultSpriteDPI: 96 - m_DynamicPixelsPerUnit: 1 - m_PresetInfoIsWorld: 0 ---- !u!114 &2759602053423477897 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2759602053423477899} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreReversedGraphics: 1 - m_BlockingObjects: 0 - m_BlockingMask: - serializedVersion: 2 - m_Bits: 4294967295 diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Prefabs/Minter/VoucherMinter721.prefab.meta b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Prefabs/Minter/VoucherMinter721.prefab.meta deleted file mode 100644 index b3025b80f..000000000 --- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Prefabs/Minter/VoucherMinter721.prefab.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: cf8a2baf718a5584584015e1b2b23eb3 -PrefabImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scenes/SampleLogin.unity b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scenes/SampleLogin.unity index 0f766adb4..086e5eb4e 100644 --- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scenes/SampleLogin.unity +++ b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scenes/SampleLogin.unity @@ -2675,7 +2675,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 96894e49d9863ec4db1d93a5e56f19cb, type: 3} m_Name: m_EditorClassIdentifier: - gelatoApiKey: _UzPz_Yk_WTjWMfcl45fLvQNGQ9ISx5ZE8TnwnVKYrE_ + gelatoApiKey: 7MFQqyGS1Iui_e_MgmFW1BfbFeJ06g8nnL2oUTlIJug_ errorPopup: {fileID: 1701305868} supportedWalletsDropdown: {fileID: 540464236} redirectToWalletToggle: {fileID: 981405684} diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scenes/SampleMain.unity b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scenes/SampleMain.unity index 059bc2c4c..88c2ae9e0 100644 --- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scenes/SampleMain.unity +++ b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scenes/SampleMain.unity @@ -640,6 +640,10 @@ PrefabInstance: propertyPath: m_Name value: Button - OwnerOfBatch objectReference: {fileID: 0} + - target: {fileID: 8775736491206355084, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} - target: {fileID: 8781309615174179339, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_text value: OwnerOfBatch @@ -2329,7 +2333,7 @@ MonoBehaviour: m_HandleRect: {fileID: 37375165} m_Direction: 0 m_Value: 0 - m_Size: 0.20894393 + m_Size: 0.2672342 m_NumberOfSteps: 0 m_OnValueChanged: m_PersistentCalls: @@ -2505,7 +2509,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7324590823460843055, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName - value: RegisterContract + value: RegisteredContract objectReference: {fileID: 0} - target: {fileID: 7324590823460843055, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[1].m_MethodName @@ -6919,7 +6923,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7324590823460843055, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName - value: PrivateKeySignTransaction + value: EcdsaSignTransaction objectReference: {fileID: 0} - target: {fileID: 7324590823460843055, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[1].m_MethodName @@ -6943,11 +6947,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 8775736491206355084, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_Name - value: Button - SignTxPrivateKey + value: Button - SignTxECDSA objectReference: {fileID: 0} - target: {fileID: 8781309615174179339, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_text - value: PKSignTX + value: ECDSASignTX objectReference: {fileID: 0} - target: {fileID: 8781309615174179339, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_fontSize @@ -8415,7 +8419,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7324590823460843055, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName - value: PrivateKeyGetAddress + value: EcdsaGetAddress objectReference: {fileID: 0} - target: {fileID: 7324590823460843055, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[1].m_MethodName @@ -8439,11 +8443,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 8775736491206355084, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_Name - value: Button - GetAddressPrivateKey + value: Button - GetAddressECDSA objectReference: {fileID: 0} - target: {fileID: 8781309615174179339, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_text - value: PKGetAddress + value: ECDSAGetAddress objectReference: {fileID: 0} - target: {fileID: 8781309615174179339, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_fontSize @@ -9391,7 +9395,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7324590823460843055, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName - value: PrivateKeySignMessage + value: EcdsaSignMessage objectReference: {fileID: 0} - target: {fileID: 7324590823460843055, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[1].m_MethodName @@ -9415,11 +9419,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 8775736491206355084, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_Name - value: Button - SignMessagePrivateKey + value: Button - SignMessageECDSA objectReference: {fileID: 0} - target: {fileID: 8781309615174179339, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_text - value: PKSignMessage + value: ECDSASignMessage objectReference: {fileID: 0} - target: {fileID: 8781309615174179339, guid: 50ad8ea555027414b8ddfc03fc7d41ab, type: 3} propertyPath: m_fontSize diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Prefabs/Minter/Mint1155.cs b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Prefabs/Minter/Mint1155.cs deleted file mode 100644 index 4be2c33e7..000000000 --- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Prefabs/Minter/Mint1155.cs +++ /dev/null @@ -1,42 +0,0 @@ -using ChainSafe.Gaming.Evm.Transactions; -using ChainSafe.Gaming.UnityPackage; -using ChainSafe.Gaming.UnityPackage.Model; -using UnityEngine; -using Scripts.EVM.Remote; -using Nethereum.Hex.HexTypes; -using Newtonsoft.Json; - -public class Mint1155 : MonoBehaviour -{ - // address of nft you want to mint - public string nftAddress = "0x2c1867bc3026178a47a677513746dcc6822a137a"; - - public async void VoucherMintNft1155() - { - var voucherResponse1155 = await CSServer.Get1155Voucher(Web3Accessor.Web3); - CreateRedeemVoucherModel.CreateVoucher1155 voucher1155 = new CreateRedeemVoucherModel.CreateVoucher1155(); - voucher1155.tokenId = voucherResponse1155.tokenId; - voucher1155.minPrice = voucherResponse1155.minPrice; - voucher1155.signer = voucherResponse1155.signer; - voucher1155.receiver = voucherResponse1155.receiver; - voucher1155.amount = voucherResponse1155.amount; - voucher1155.nonce = voucherResponse1155.nonce; - voucher1155.signature = voucherResponse1155.signature; - string voucherArgs = JsonUtility.ToJson(voucher1155); - - // connects to user's browser wallet to call a transaction - var chainConfig = Web3Accessor.Web3.ChainConfig; - RedeemVoucherTxModel.Response voucherResponse = await CSServer.CreateRedeemTransaction(Web3Accessor.Web3, chainConfig.Chain, chainConfig.Network, voucherArgs, "1155", nftAddress, voucherResponse1155.receiver); - var txRequest = new TransactionRequest - { - ChainId = HexBigIntUtil.ParseHexBigInt(chainConfig.ChainId), - To = voucherResponse.tx.to, - Value = new HexBigInteger(voucherResponse.tx.value), - Data = voucherResponse.tx.data, - GasLimit = HexBigIntUtil.ParseHexBigInt(voucherResponse.tx.gasLimit), - GasPrice = HexBigIntUtil.ParseHexBigInt(voucherResponse.tx.gasPrice), - }; - var response = await Web3Accessor.Web3.TransactionExecutor.SendTransaction(txRequest); - Debug.Log(JsonConvert.SerializeObject(response)); - } -} diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Prefabs/Minter/Mint1155.cs.meta b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Prefabs/Minter/Mint1155.cs.meta deleted file mode 100644 index f3db421c6..000000000 --- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Prefabs/Minter/Mint1155.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: f530a2f3db5f5c7478b08921d42c5114 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Prefabs/Minter/Mint721Voucher.cs b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Prefabs/Minter/Mint721Voucher.cs deleted file mode 100644 index 16b4b6e41..000000000 --- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Prefabs/Minter/Mint721Voucher.cs +++ /dev/null @@ -1,42 +0,0 @@ -using ChainSafe.Gaming.Evm.Transactions; -using ChainSafe.Gaming.UnityPackage; -using ChainSafe.Gaming.UnityPackage.Model; -using Nethereum.Hex.HexTypes; -using Newtonsoft.Json; -using UnityEngine; -using Scripts.EVM.Remote; - -public class Mint721Voucher : MonoBehaviour -{ - // address of nft you want to mint - public string nftAddress = "f01559ae4021a47e26bc773587278f62a833f2a6117411afbc5a7855661936d1c"; - - public async void VoucherMintNft721() - { - var voucherResponse721 = await CSServer.Get721Voucher(Web3Accessor.Web3); - CreateRedeemVoucherModel.CreateVoucher721 voucher721 = new CreateRedeemVoucherModel.CreateVoucher721 - { - tokenId = voucherResponse721.tokenId, - minPrice = voucherResponse721.minPrice, - signer = voucherResponse721.signer, - receiver = voucherResponse721.receiver, - signature = voucherResponse721.signature - }; - var voucherArgs = JsonUtility.ToJson(voucher721); - - // connects to user's browser wallet to call a transaction - var chainConfig = Web3Accessor.Web3.ChainConfig; - RedeemVoucherTxModel.Response voucherResponse = await CSServer.CreateRedeemTransaction(Web3Accessor.Web3, chainConfig.Chain, chainConfig.Network, voucherArgs, "721", nftAddress, voucherResponse721.receiver); - var txRequest = new TransactionRequest - { - ChainId = HexBigIntUtil.ParseHexBigInt(chainConfig.ChainId), - To = voucherResponse.tx.to, - Value = new HexBigInteger(voucherResponse.tx.value), - Data = voucherResponse.tx.data, - GasLimit = HexBigIntUtil.ParseHexBigInt(voucherResponse.tx.gasLimit), - GasPrice = HexBigIntUtil.ParseHexBigInt(voucherResponse.tx.gasPrice), - }; - var response = await Web3Accessor.Web3.TransactionExecutor.SendTransaction(txRequest); - Debug.Log(JsonConvert.SerializeObject(response)); - } -} diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Prefabs/Minter/Mint721Voucher.cs.meta b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Prefabs/Minter/Mint721Voucher.cs.meta deleted file mode 100644 index cb534e18c..000000000 --- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Prefabs/Minter/Mint721Voucher.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 785a5af054a848e4a93802898e155c97 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Scenes/Login.cs b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Scenes/Login.cs index 0a8f958e6..3030d63a4 100644 --- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Scenes/Login.cs +++ b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Scenes/Login.cs @@ -9,6 +9,7 @@ using ChainSafe.Gaming.Web3.Build; using ChainSafe.Gaming.Web3.Unity; using ChainSafe.GamingSdk.Gelato; +using Scripts.EVM.Token; using UnityEngine; using UnityEngine.SceneManagement; @@ -77,10 +78,7 @@ private void ConfigureCommonServices(IWeb3ServiceCollection services) * to see how it's used later on. */ services.ConfigureRegisteredContracts(contracts => - contracts.RegisterContract( - "shiba", - "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isExcluded\",\"type\":\"bool\"}],\"name\":\"ExcludeFromFees\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isExcluded\",\"type\":\"bool\"}],\"name\":\"ExcludeMultipleAccountsFromFees\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"newValue\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"oldValue\",\"type\":\"uint256\"}],\"name\":\"GasForProcessingUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newLiquidityWallet\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldLiquidityWallet\",\"type\":\"address\"}],\"name\":\"LiquidityWalletUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"iterations\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"claims\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"lastProcessedIndex\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"automatic\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"gas\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"processor\",\"type\":\"address\"}],\"name\":\"ProcessedDividendTracker\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensSwapped\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"SendDividends\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"pair\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"value\",\"type\":\"bool\"}],\"name\":\"SetAutomatedMarketMakerPair\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensSwapped\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ethReceived\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensIntoLiqudity\",\"type\":\"uint256\"}],\"name\":\"SwapAndLiquify\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldAddress\",\"type\":\"address\"}],\"name\":\"UpdateDividendTracker\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldAddress\",\"type\":\"address\"}],\"name\":\"UpdateUniswapV2Router\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"SHIB\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"UNIRewardsFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_marketingWalletAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_maxTxAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"automatedMarketMakerPairs\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"blacklist\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blacklistblock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blockcount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"claim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"deadWallet\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"dividendTokenBalanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dividendTracker\",\"outputs\":[{\"internalType\":\"contract PSDividendTracker\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"excludeFromDividends\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"excluded\",\"type\":\"bool\"}],\"name\":\"excludeFromFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"bool\",\"name\":\"excluded\",\"type\":\"bool\"}],\"name\":\"excludeMultipleAccountsFromFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gasForProcessing\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"getAccountDividendsInfo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getAccountDividendsInfoAtIndex\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getClaimWait\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLastProcessedIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNumberOfDividendTokenHolders\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalDividendsDistributed\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"isExcludedFromFees\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"liquidityFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"marketingFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"gas\",\"type\":\"uint256\"}],\"name\":\"processDividendTracker\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"isBlack\",\"type\":\"bool\"}],\"name\":\"setAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pair\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"value\",\"type\":\"bool\"}],\"name\":\"setAutomatedMarketMakerPair\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"setLiquiditFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"setMarketingFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"wallet\",\"type\":\"address\"}],\"name\":\"setMarketingWallet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"setMaxTxAmount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"setSHIBRewardsFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"salestatus\",\"type\":\"bool\"}],\"name\":\"setSaleStart\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"swapTokensAtAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalFees\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"uniswapV2Pair\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"uniswapV2Router\",\"outputs\":[{\"internalType\":\"contract IUniswapV2Router02\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"claimWait\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"a\",\"type\":\"address\"}],\"name\":\"updateClaimWait\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"updateDividendTracker\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newValue\",\"type\":\"uint256\"}],\"name\":\"updateGasForProcessing\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"updateUniswapV2Router\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"withdrawableDividendOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", - "0x1d6f31b71e12a1a584ca20853495161c48ba491f")); + contracts.RegisterContract("CsTestErc20", ABI.Erc20, Contracts.Erc20)); } } diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/EVM/EvmCalls.cs b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/EVM/EvmCalls.cs index 23f9fa380..6e4c8c6a3 100644 --- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/EVM/EvmCalls.cs +++ b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/EVM/EvmCalls.cs @@ -8,7 +8,6 @@ using Scripts.EVM.Token; using UnityEngine; using Web3Unity.Scripts.Prefabs; -using ABI = Scripts.EVM.Token.ABI; public class EvmCalls : MonoBehaviour { @@ -27,7 +26,6 @@ public class EvmCalls : MonoBehaviour # region Contract Send private string methodSend = "addTotal"; - private string contractAddressSend = "0x7286Cf0F6E80014ea75Dbc25F545A3be90F4904F"; private int increaseAmountSend = 1; #endregion @@ -35,13 +33,11 @@ public class EvmCalls : MonoBehaviour #region Contract Call private string methodCall = "myTotal"; - private string contractAddressCall = "0xC71d13c40B4fE7e2c557eBAa12A0400dd4Df76C9"; #endregion #region Get Send Array - - private string contractAddressArray = "0x5244d0453A727EDa96299384370359f4A2B5b20a"; + private string methodArrayGet = "getStore"; private string methodArraySend = "setStore"; private string[] stringArraySend = @@ -62,92 +58,125 @@ public class EvmCalls : MonoBehaviour #region Send Transaction - private string to = "0xdD4c825203f97984e7867F11eeCc813A036089D1"; + private string toAddress = "0xdD4c825203f97984e7867F11eeCc813A036089D1"; #endregion #region Registered Contract - private string registeredContractName = "shiba"; - private string registeredContractmethod = "balanceOf"; + private string registeredContractName = "CsTestErc20"; #endregion - #region Private Key + #region ECDSA - private string privateKey = "0x78dae1a22c7507a4ed30c06172e7614eb168d3546c13856340771e63ad3c0081"; - private string messagePrivateKey = "This is a test message"; + private string ecdsaKey = "0x78dae1a22c7507a4ed30c06172e7614eb168d3546c13856340771e63ad3c0081"; + private string ecdsaMessage = "This is a test message"; private string transactionHash = "0x123456789"; - private string chainId ="5"; + private string chainId ="11155111"; #endregion #region Multi Call - - private string Erc20ContractAddress = "0x3E0C0447e47d49195fbE329265E330643eB42e6f"; + private string Erc20Account = "0xd25b827D92b0fd656A1c829933e9b0b836d5C3e2"; #endregion #endregion + /// + /// Calls values from a contract + /// public async void ContractCall() { - object[] args = {}; - var response = await Evm.ContractCall(Web3Accessor.Web3, methodCall, ABI.AddTotal, contractAddressCall, args); + object[] args = + { + await Web3Accessor.Web3.Signer.GetAddress() + }; + var response = await Evm.ContractCall(Web3Accessor.Web3, methodCall, ABI.ArrayTotal, Contracts.ArrayTotal, args); + Debug.Log(response); var output = SampleOutputUtil.BuildOutputValue(response); SampleOutputUtil.PrintResult(output, nameof(Evm), nameof(Evm.ContractCall)); } - + + /// + /// Sends values to a contract + /// public async void ContractSend() { object[] args = { increaseAmountSend }; - var response = await Evm.ContractSend(Web3Accessor.Web3, methodSend, ABI.AddTotal, contractAddressSend, args); + var response = await Evm.ContractSend(Web3Accessor.Web3, methodSend, ABI.ArrayTotal, Contracts.ArrayTotal, args); var output = SampleOutputUtil.BuildOutputValue(response); SampleOutputUtil.PrintResult(output, nameof(Evm), nameof(Evm.ContractSend)); } - + + /// + /// Gets array values from a contract + /// public async void GetArray() { - var response = await Evm.GetArray(Web3Accessor.Web3, contractAddressArray, ABI.AddTotal, methodArrayGet); + var response = await Evm.GetArray(Web3Accessor.Web3, Contracts.ArrayTotal, ABI.ArrayTotal, methodArrayGet); var responseString = string.Join(",\n", response.Select((list, i) => $"#{i} {string.Join((string)", ", (IEnumerable)list)}")); SampleOutputUtil.PrintResult(responseString, nameof(Evm), nameof(Evm.GetArray)); } + /// + /// Sends array values to a contract + /// public async void SendArray() { - var response = await Evm.SendArray(Web3Accessor.Web3, methodArraySend, ABI.AddTotal, contractAddressArray, stringArraySend); + var response = await Evm.SendArray(Web3Accessor.Web3, methodArraySend, ABI.ArrayTotal, Contracts.ArrayTotal, stringArraySend); var output = SampleOutputUtil.BuildOutputValue(response); SampleOutputUtil.PrintResult(output, nameof(Evm), nameof(Evm.SendArray)); } + /// + /// Gets the current block number + /// public async void GetBlockNumber() { var blockNumber = await Evm.GetBlockNumber(Web3Accessor.Web3); SampleOutputUtil.PrintResult(blockNumber.ToString(), nameof(Evm), nameof(Evm.GetBlockNumber)); } + /// + /// Gets the gas limit for a specific function + /// public async void GetGasLimit() { - var gasLimit = await Evm.GetGasLimit(Web3Accessor.Web3, ABI.AddTotal, contractAddressSend, methodSend); + object[] args = + { + increaseAmountSend + }; + var gasLimit = await Evm.GetGasLimit(Web3Accessor.Web3, ABI.ArrayTotal, Contracts.ArrayTotal, methodSend, args); SampleOutputUtil.PrintResult(gasLimit.ToString(), nameof(Evm), nameof(Evm.GetGasLimit)); } + /// + /// Gets the current gas price + /// public async void GetGasPrice() { var gasPrice = await Evm.GetGasPrice(Web3Accessor.Web3); SampleOutputUtil.PrintResult(gasPrice.ToString(), nameof(Evm), nameof(Evm.GetGasPrice)); } + /// + /// Gets an accounts nonce + /// public async void GetNonce() { var nonce = await Evm.GetNonce(Web3Accessor.Web3); SampleOutputUtil.PrintResult(nonce.ToString(), nameof(Evm), nameof(Evm.GetNonce)); } + /// + /// Gets a specific transaction's status + /// public async void GetTransactionStatus() { var receipt = await Evm.GetTransactionStatus(Web3Accessor.Web3); @@ -158,30 +187,45 @@ public async void GetTransactionStatus() SampleOutputUtil.PrintResult(output, nameof(Evm), nameof(Evm.GetTransactionStatus)); } - public async void RegisterContract() + /// + /// Uses a registered contract + /// + public async void RegisteredContract() { - var balance = await Evm.UseRegisteredContract(Web3Accessor.Web3, registeredContractName, registeredContractmethod); + var balance = await Evm.UseRegisteredContract(Web3Accessor.Web3, registeredContractName, EthMethod.BalanceOf); SampleOutputUtil.PrintResult(balance.ToString(), nameof(Evm), nameof(Evm.UseRegisteredContract)); } + /// + /// Sends a transaction + /// public async void SendTransaction() { - var transactionHash = await Evm.SendTransaction(Web3Accessor.Web3, to); + var transactionHash = await Evm.SendTransaction(Web3Accessor.Web3, toAddress); SampleOutputUtil.PrintResult(transactionHash, nameof(Evm), nameof(Evm.SendTransaction)); } + /// + /// Encrypts a message with SHA3 + /// public void Sha3() { var hash = Evm.Sha3(messageSha); SampleOutputUtil.PrintResult(hash, nameof(Evm), nameof(Evm.Sha3)); } + /// + /// Signs a message, the result is specific to each user + /// public async void SignMessage() { var signedMessage = await Evm.SignMessage(Web3Accessor.Web3, messageSign); SampleOutputUtil.PrintResult(signedMessage, nameof(Evm), nameof(Evm.SignMessage)); } + /// + /// Signs a message and verifs account ownership + /// public async void SignVerify() { var signatureVerified = await Evm.SignVerify(Web3Accessor.Web3, messageSignVerify); @@ -189,24 +233,36 @@ public async void SignVerify() SampleOutputUtil.PrintResult(output, nameof(Evm), nameof(Evm.SignVerify)); } - public void PrivateKeySignTransaction() + /// + /// Signs a transaction via ECDSA + /// + public void EcdsaSignTransaction() { - var result = Evm.PrivateKeySignTransaction(privateKey, transactionHash, chainId); - SampleOutputUtil.PrintResult(result, nameof(Evm), nameof(Evm.PrivateKeySignTransaction)); + var result = Evm.EcdsaSignTransaction(ecdsaKey, transactionHash, chainId); + SampleOutputUtil.PrintResult(result, nameof(Evm), nameof(Evm.EcdsaSignTransaction)); } - public void PrivateKeySignMessage() + /// + /// Signs a message via ECDSA + /// + public void EcdsaSignMessage() { - var result = Evm.PrivateKeySignMessage(privateKey, messagePrivateKey); - SampleOutputUtil.PrintResult(result, nameof(Evm), nameof(Evm.PrivateKeySignMessage)); + var result = Evm.EcdsaSignMessage(ecdsaKey, ecdsaMessage); + SampleOutputUtil.PrintResult(result, nameof(Evm), nameof(Evm.EcdsaSignMessage)); } - public void PrivateKeyGetAddress() + /// + /// Gets an addres via ECDSA key + /// + public void EcdsaGetAddress() { - var result = Evm.PrivateKeyGetAddress(privateKey); - SampleOutputUtil.PrintResult(result, nameof(Evm), nameof(Evm.PrivateKeyGetAddress)); + var result = Evm.EcdsaGetAddress(ecdsaKey); + SampleOutputUtil.PrintResult(result, nameof(Evm), nameof(Evm.EcdsaGetAddress)); } + /// + /// Uploads to IPFS + /// public async void IPFSUpload() { var cid = await Evm.Upload(new IpfsUploadRequest @@ -220,15 +276,18 @@ public async void IPFSUpload() SampleOutputUtil.PrintResult(cid, nameof(IpfsSample), nameof(IpfsSample.Upload)); } + /// + /// Makes multiple calls + /// public async void MultiCall() { - var erc20Contract = Web3Accessor.Web3.ContractBuilder.Build(ABI.Erc20, Erc20ContractAddress); - var erc20BalanceOfCalldata = erc20Contract.Calldata(CommonMethod.BalanceOf, new object[] + var erc20Contract = Web3Accessor.Web3.ContractBuilder.Build(ABI.Erc20, Contracts.Erc20); + var erc20BalanceOfCalldata = erc20Contract.Calldata(EthMethod.BalanceOf, new object[] { Erc20Account }); - var erc20TotalSupplyCalldata = erc20Contract.Calldata(CommonMethod.TotalSupply, new object[] + var erc20TotalSupplyCalldata = erc20Contract.Calldata(EthMethod.TotalSupply, new object[] { }); @@ -236,13 +295,13 @@ public async void MultiCall() { new Call3Value() { - Target = Erc20ContractAddress, + Target = Contracts.Erc20, AllowFailure = true, CallData = erc20BalanceOfCalldata.HexToByteArray(), }, new Call3Value() { - Target = Erc20ContractAddress, + Target = Contracts.Erc20, AllowFailure = true, CallData = erc20TotalSupplyCalldata.HexToByteArray(), } @@ -254,16 +313,14 @@ public async void MultiCall() if (multicallResultResponse[0] != null && multicallResultResponse[0].Success) { - var decodedBalanceOf = erc20Contract.Decode(CommonMethod.BalanceOf, multicallResultResponse[0].ReturnData.ToHex()); + var decodedBalanceOf = erc20Contract.Decode(EthMethod.BalanceOf, multicallResultResponse[0].ReturnData.ToHex()); Debug.Log($"decodedBalanceOf {((BigInteger)decodedBalanceOf[0]).ToString()}"); } if (multicallResultResponse[1] != null && multicallResultResponse[1].Success) { - var decodedTotalSupply = erc20Contract.Decode(CommonMethod.TotalSupply, multicallResultResponse[1].ReturnData.ToHex()); + var decodedTotalSupply = erc20Contract.Decode(EthMethod.TotalSupply, multicallResultResponse[1].ReturnData.ToHex()); Debug.Log($"decodedTotalSupply {((BigInteger)decodedTotalSupply[0]).ToString()}"); } } - - } diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/Erc1155/Erc1155Calls.cs b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/Erc1155/Erc1155Calls.cs index cfe580acd..a45bb180b 100644 --- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/Erc1155/Erc1155Calls.cs +++ b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/Erc1155/Erc1155Calls.cs @@ -4,7 +4,6 @@ using Scripts.EVM.Token; using UnityEngine; using UnityEngine.UI; -using ABI = Scripts.EVM.Token.ABI; /// /// ERC1155 calls used in the sample scene @@ -14,42 +13,33 @@ public class Erc1155Calls : MonoBehaviour #region Fields #region All Erc - - private string chainAllErc = "ethereum"; - private string networkAllErc = "goerli"; + private string accountAllErc = "0xfaecAE4464591F8f2025ba8ACF58087953E613b1"; - private string contractAllErc = ""; - private int takeAllErc = 1000; - private int skipAllErc = 0; #endregion #region Balance Of - - private string contractBalanceOf = "0x2c1867bc3026178a47a677513746dcc6822a137a"; + private string accountBalanceOf = "0xd25b827D92b0fd656A1c829933e9b0b836d5C3e2"; - private string tokenIdBalanceOf = "0x01559ae4021aee70424836ca173b6a4e647287d15cee8ac42d8c2d8d128927e5"; + private string tokenIdBalanceOf = "1"; #endregion #region Balance Of Batch - - private string contractBalanceOfBatch = "0xdc4aff511e1b94677142a43df90f948f9ae181dd"; + private string[] accountsBalanceOfBatch = { "0xd25b827D92b0fd656A1c829933e9b0b836d5C3e2", "0xE51995Cdb3b1c109E0e6E67ab5aB31CDdBB83E4a" }; private string[] tokenIdsBalanceOfBatch = { "1", "2" }; #endregion #region Uri - - private string contractUri = "0x2c1867BC3026178A47a677513746DCc6822A137A"; - private string tokenIdUri = "0x01559ae4021aee70424836ca173b6a4e647287d15cee8ac42d8c2d8d128927e5"; + + private string tokenIdUri = "1"; #endregion #region Mint - - private string contractMint = "0xA0a53f1Cabf7D723Ab2087400681039917D1B6D4"; + private int idMint = 1; private int amountMint = 1; @@ -58,15 +48,13 @@ public class Erc1155Calls : MonoBehaviour #region Transfer private string toAccountTransfer = "0xdD4c825203f97984e7867F11eeCc813A036089D1"; - private string contractTransfer = "0xA0a53f1Cabf7D723Ab2087400681039917D1B6D4"; private int tokenIdTransfer = 1; private int amountTransfer = 1; #endregion #region Texture - - private string contractTexture = "0x0288B4F1389ED7b3d3f9C7B73d4408235c0CBbc6"; + private string tokenIdTexture = "0"; #endregion @@ -80,7 +68,7 @@ public class Erc1155Calls : MonoBehaviour /// public async void AllErc1155() { - var allNfts = await Erc1155.AllErc1155(Web3Accessor.Web3, chainAllErc, networkAllErc, accountAllErc, contractAllErc, takeAllErc, skipAllErc); + var allNfts = await Erc1155.AllErc1155(Web3Accessor.Web3, accountAllErc); var output = string.Join(",\n", allNfts.Select(nft => $"{nft.TokenId} - {nft.Uri}")); SampleOutputUtil.PrintResult(output, nameof(Erc1155), nameof(Erc1155.AllErc1155)); } @@ -91,8 +79,8 @@ public async void AllErc1155() public async void BalanceOf() { var balance = tokenIdBalanceOf.StartsWith("0x") ? - await Erc1155.BalanceOf(Web3Accessor.Web3, contractBalanceOf, accountBalanceOf, tokenIdBalanceOf) - : await Erc1155.BalanceOf(Web3Accessor.Web3, contractBalanceOf, accountBalanceOf, BigInteger.Parse(tokenIdBalanceOf)); + await Erc1155.BalanceOf(Web3Accessor.Web3, Contracts.Erc1155, accountBalanceOf, tokenIdBalanceOf) + : await Erc1155.BalanceOf(Web3Accessor.Web3, Contracts.Erc1155, accountBalanceOf, BigInteger.Parse(tokenIdBalanceOf)); SampleOutputUtil.PrintResult(balance.ToString(), nameof(Erc1155), nameof(Erc1155.BalanceOf)); } @@ -101,7 +89,7 @@ await Erc1155.BalanceOf(Web3Accessor.Web3, contractBalanceOf, accountBalanceOf, /// public async void BalanceOfBatch() { - var balances = await Erc1155.BalanceOfBatch(Web3Accessor.Web3, contractBalanceOfBatch, accountsBalanceOfBatch, tokenIdsBalanceOfBatch); + var balances = await Erc1155.BalanceOfBatch(Web3Accessor.Web3, Contracts.Erc1155, accountsBalanceOfBatch, tokenIdsBalanceOfBatch); var balancesString = string.Join(", ", balances); SampleOutputUtil.PrintResult(balancesString, nameof(Erc1155), nameof(Erc1155.BalanceOfBatch)); } @@ -111,7 +99,7 @@ public async void BalanceOfBatch() /// public async void Uri() { - var uri = await Erc1155.Uri(Web3Accessor.Web3, contractUri, tokenIdUri); + var uri = await Erc1155.Uri(Web3Accessor.Web3, Contracts.Erc1155, tokenIdUri); SampleOutputUtil.PrintResult(uri, nameof(Erc1155), nameof(Erc1155.Uri)); } @@ -120,7 +108,7 @@ public async void Uri() /// public async void MintErc1155() { - var response = await Erc1155.MintErc1155(Web3Accessor.Web3, ABI.Mint1155, contractMint, idMint, amountMint); + var response = await Erc1155.MintErc1155(Web3Accessor.Web3, ABI.Erc1155, Contracts.Erc1155, idMint, amountMint); var output = SampleOutputUtil.BuildOutputValue(response); SampleOutputUtil.PrintResult(output, nameof(Erc1155), nameof(Erc1155.MintErc1155)); } @@ -130,7 +118,7 @@ public async void MintErc1155() /// public async void TransferErc1155() { - var response = await Erc1155.TransferErc1155(Web3Accessor.Web3, contractTransfer, tokenIdTransfer, amountTransfer, toAccountTransfer); + var response = await Erc1155.TransferErc1155(Web3Accessor.Web3, Contracts.Erc1155, tokenIdTransfer, amountTransfer, toAccountTransfer); var output = SampleOutputUtil.BuildOutputValue(response); SampleOutputUtil.PrintResult(output, nameof(Erc1155), nameof(Erc1155.TransferErc1155)); } @@ -140,7 +128,7 @@ public async void TransferErc1155() /// public async void ImportNftTexture1155() { - var textureRequest = await Erc1155.ImportNftTexture1155(Web3Accessor.Web3, contractTexture, tokenIdTexture); + var textureRequest = await Erc1155.ImportNftTexture1155(Web3Accessor.Web3, Contracts.Erc1155, tokenIdTexture); rawImage.texture = textureRequest; } } \ No newline at end of file diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/Erc20/Erc20Calls.cs b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/Erc20/Erc20Calls.cs index c1c8b2f04..6eb11f377 100644 --- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/Erc20/Erc20Calls.cs +++ b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/Erc20/Erc20Calls.cs @@ -2,7 +2,6 @@ using ChainSafe.Gaming.UnityPackage; using Scripts.EVM.Token; using UnityEngine; -using ABI = Scripts.EVM.Token.ABI; /// /// ERC20 calls used in the sample scene @@ -12,20 +11,8 @@ public class Erc20Calls : MonoBehaviour #region Fields #region Balance Of - - private string contractBalanceOf = "0x3E0C0447e47d49195fbE329265E330643eB42e6f"; - private string accountBalanceOf = "0xd25b827D92b0fd656A1c829933e9b0b836d5C3e2"; - - #endregion - #region Custom Balance Of - - private string contractToken = "0x714d32fA722461A2c8F0b4EB98ff5cFF8F908Df2"; - #endregion - - #region Native Balance Of - - private string accountNativeBalanceOf = "0xaBed4239E4855E120fDA34aDBEABDd2911626BA1"; + private string accountBalanceOf = "0xd25b827D92b0fd656A1c829933e9b0b836d5C3e2"; #endregion @@ -38,7 +25,6 @@ public class Erc20Calls : MonoBehaviour #region Transfer private const string toAccount = "0xdD4c825203f97984e7867F11eeCc813A036089D1"; - private string contractTransfer = "0xc778417e063141139fce010982780140aa0cd5ab"; private BigInteger amountTransfer = 1000000000000000; #endregion @@ -51,7 +37,7 @@ public class Erc20Calls : MonoBehaviour public async void BalanceOf() { SampleFeedback.Instance?.Activate(); - var balance = await Erc20.BalanceOf(Web3Accessor.Web3, contractBalanceOf, accountBalanceOf); + var balance = await Erc20.BalanceOf(Web3Accessor.Web3, Contracts.Erc20, accountBalanceOf); SampleOutputUtil.PrintResult(balance.ToString(), nameof(Erc20), nameof(Erc20.BalanceOf)); SampleFeedback.Instance?.Deactivate(); } @@ -61,7 +47,7 @@ public async void BalanceOf() /// public async void CustomTokenBalanceOf() { - var result = await Erc20.CustomTokenBalance(Web3Accessor.Web3, ABI.CustomBalanceOf, contractToken); + var result = await Erc20.CustomTokenBalance(Web3Accessor.Web3, ABI.Erc20, Contracts.Erc20); SampleOutputUtil.PrintResult(result.ToString(), nameof(Erc20), nameof(Erc20.CustomTokenBalance)); } @@ -70,7 +56,7 @@ public async void CustomTokenBalanceOf() /// public async void NativeBalanceOf() { - var result = await Erc20.NativeBalanceOf(Web3Accessor.Web3, accountNativeBalanceOf); + var result = await Erc20.NativeBalanceOf(Web3Accessor.Web3, accountBalanceOf); SampleOutputUtil.PrintResult(result.ToString(), nameof(Erc20), nameof(Erc20.NativeBalanceOf)); } @@ -79,7 +65,7 @@ public async void NativeBalanceOf() /// public async void Name() { - var result = await Erc20.Name(Web3Accessor.Web3, contractToken); + var result = await Erc20.Name(Web3Accessor.Web3, Contracts.Erc20); SampleOutputUtil.PrintResult(result, nameof(Erc20), nameof(Erc20.Name)); } @@ -88,7 +74,7 @@ public async void Name() /// public async void Symbol() { - var result = await Erc20.Symbol(Web3Accessor.Web3, contractToken); + var result = await Erc20.Symbol(Web3Accessor.Web3, Contracts.Erc20); SampleOutputUtil.PrintResult(result, nameof(Erc20), nameof(Erc20.Symbol)); } @@ -97,7 +83,7 @@ public async void Symbol() /// public async void Decimals() { - var decimals = await Erc20.Decimals(Web3Accessor.Web3, contractToken); + var decimals = await Erc20.Decimals(Web3Accessor.Web3, Contracts.Erc20); SampleOutputUtil.PrintResult(decimals.ToString(), nameof(Erc20), nameof(Erc20.Decimals)); } @@ -106,7 +92,7 @@ public async void Decimals() /// public async void TotalSupply() { - var result = await Erc20.TotalSupply(Web3Accessor.Web3, contractToken); + var result = await Erc20.TotalSupply(Web3Accessor.Web3, Contracts.Erc20); SampleOutputUtil.PrintResult(result.ToString(), nameof(Erc20), nameof(Erc20.TotalSupply)); } @@ -116,7 +102,7 @@ public async void TotalSupply() public async void MintErc20() { string toAccount = await Web3Accessor.Web3.Signer.GetAddress(); - var response = await Erc20.MintErc20(Web3Accessor.Web3, contractToken, toAccount, amountMint); + var response = await Erc20.MintErc20(Web3Accessor.Web3, Contracts.Erc20, toAccount, amountMint); var output = SampleOutputUtil.BuildOutputValue(response); SampleOutputUtil.PrintResult(output, nameof(Erc20), nameof(Erc20.MintErc20)); } @@ -126,7 +112,7 @@ public async void MintErc20() /// public async void TransferErc20() { - var response = await Erc20.TransferErc20(Web3Accessor.Web3, contractTransfer, toAccount, amountTransfer); + var response = await Erc20.TransferErc20(Web3Accessor.Web3, Contracts.Erc20, toAccount, amountTransfer); var output = SampleOutputUtil.BuildOutputValue(response); SampleOutputUtil.PrintResult(output, nameof(Erc20), nameof(Erc20.TransferErc20)); } diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/Erc721/Erc721Calls.cs b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/Erc721/Erc721Calls.cs index 570226147..48046abb4 100644 --- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/Erc721/Erc721Calls.cs +++ b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/Erc721/Erc721Calls.cs @@ -3,7 +3,6 @@ using ChainSafe.Gaming.UnityPackage; using Scripts.EVM.Token; using UnityEngine; -using ABI = Scripts.EVM.Token.ABI; /// /// ERC721 calls used in the sample scene @@ -13,50 +12,38 @@ public class Erc721Calls : MonoBehaviour #region Fields #region All Erc - - private string chainAllErc = "ethereum"; - private string networkAllErc = "goerli"; // mainnet goerli + private string accountAllErc = "0xfaecAE4464591F8f2025ba8ACF58087953E613b1"; - private string contractAllErc = "0x2c1867BC3026178A47a677513746DCc6822A137A"; - private int takeAllErc = 500; - private int skipAllErc = 0; #endregion #region Balance Of - - private string contractBalanceOf = "0x9123541E259125657F03D7AD2A7D1a8Ec79375BA"; + private string accountBalanceOf = "0xd25b827D92b0fd656A1c829933e9b0b836d5C3e2"; #endregion #region Owner Of - - private string contractOwnerOf = "0x06dc21f89f01409e7ed0e4c80eae1430962ae52c"; - private string tokenIdOwnerOf = "0x01559ae4021a565d5cc4740f1cefa95de8c1fb193949ecd32c337b03047da501"; + + private string tokenIdOwnerOf = "1"; #endregion #region Owner Of Batch - private string[] tokenIdsOwnerOfBatch = { "33", "29" }; - private string contractOwnerOfBatch = "0x47381c5c948254e6e0E324F1AA54b7B24104D92D"; - // optional: multicall contract https://github.com/makerdao/multicall - private string multicallOwnerOfBatch = "0x77dca2c955b15e9de4dbbcf1246b4b85b651e50e"; + private string[] tokenIdsOwnerOfBatch = { "4", "6" }; #endregion #region Uri - - private string contractUri = "0x06dc21f89f01409e7ed0e4c80eae1430962ae52c"; + private string tokenIdUri = "0x01559ae4021a565d5cc4740f1cefa95de8c1fb193949ecd32c337b03047da501"; #endregion #region Mint - - private string contractMint = "0x0B102638532be8A1b3d0ed1fcE6eC603Bec37848"; - private string uriMint = "ipfs://QmNn5EaGR26kU7aAMH7LhkNsAGcmcyJgun3Wia4MftVicW/1.json"; + + private string uriMint = "1"; #endregion @@ -75,7 +62,7 @@ public class Erc721Calls : MonoBehaviour /// public async void AllErc721() { - var allNfts = await Erc721.AllErc721(Web3Accessor.Web3, chainAllErc, networkAllErc, accountAllErc, contractAllErc, takeAllErc, skipAllErc); + var allNfts = await Erc721.AllErc721(Web3Accessor.Web3, accountAllErc); var output = string.Join(",\n", allNfts.Select(nft => $"{nft.TokenId} - {nft.Uri}")); SampleOutputUtil.PrintResult(output, nameof(Erc721), nameof(Erc721.AllErc721)); } @@ -85,7 +72,7 @@ public async void AllErc721() /// public async void BalanceOf() { - var balance = await Erc721.BalanceOf(Web3Accessor.Web3, contractBalanceOf, accountBalanceOf); + var balance = await Erc721.BalanceOf(Web3Accessor.Web3, Contracts.Erc721, accountBalanceOf); SampleOutputUtil.PrintResult(balance.ToString(), nameof(Erc721), nameof(Erc721.BalanceOf)); } @@ -95,8 +82,8 @@ public async void BalanceOf() public async void OwnerOf() { var owner = tokenIdOwnerOf.StartsWith("0x") ? - await Erc721.OwnerOf(Web3Accessor.Web3, contractOwnerOf, tokenIdOwnerOf) - : await Erc721.OwnerOf(Web3Accessor.Web3, contractOwnerOf, BigInteger.Parse(tokenIdOwnerOf)); + await Erc721.OwnerOf(Web3Accessor.Web3, Contracts.Erc721, tokenIdOwnerOf) + : await Erc721.OwnerOf(Web3Accessor.Web3, Contracts.Erc721, BigInteger.Parse(tokenIdOwnerOf)); SampleOutputUtil.PrintResult(owner, nameof(Erc721), nameof(Erc721.OwnerOf)); } @@ -105,7 +92,7 @@ await Erc721.OwnerOf(Web3Accessor.Web3, contractOwnerOf, tokenIdOwnerOf) /// public async void OwnerOfBatch() { - var owners = await Erc721.OwnerOfBatch(Web3Accessor.Web3, contractOwnerOfBatch, tokenIdsOwnerOfBatch, multicallOwnerOfBatch); + var owners = await Erc721.OwnerOfBatch(Web3Accessor.Web3, Contracts.Erc721, tokenIdsOwnerOfBatch); var ownersString = $"{owners.Count} owner(s):\n" + string.Join(",\n", owners); SampleOutputUtil.PrintResult(ownersString, nameof(Erc721), nameof(Erc721.OwnerOfBatch)); } @@ -115,7 +102,7 @@ public async void OwnerOfBatch() /// public async void Uri() { - var uri = await Erc721.Uri(Web3Accessor.Web3, contractUri, tokenIdUri); + var uri = await Erc721.Uri(Web3Accessor.Web3, Contracts.Erc721, tokenIdUri); SampleOutputUtil.PrintResult(uri, nameof(Erc721), nameof(Erc721.Uri)); } @@ -124,7 +111,7 @@ public async void Uri() /// public async void MintErc721() { - var response = await Erc721.MintErc721(Web3Accessor.Web3, ABI.Mint721, contractMint, uriMint); + var response = await Erc721.MintErc721(Web3Accessor.Web3, ABI.Erc721, Contracts.Erc721, uriMint); var output = SampleOutputUtil.BuildOutputValue(response); SampleOutputUtil.PrintResult(output, nameof(Erc721), nameof(Erc721.MintErc721)); } diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/SampleBehaviour.cs b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/SampleBehaviour.cs index 5b2f461b7..5e79e2c6b 100644 --- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/SampleBehaviour.cs +++ b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/SampleBehaviour.cs @@ -7,17 +7,18 @@ namespace Samples.Behaviours [RequireComponent(typeof(Button))] public class SampleBehaviour : MonoBehaviour { - private const string DefaultChainId = "5"; + // This is what is used to check for gelato compatibility, if the chain doesn't match it will hide gelato functions in the test scene + private const string DefaultChainId = "11155111"; public async void Execute() { // Activates the loading pop up to stop duplicate calls SampleFeedback.Instance?.Activate(); - // check if we're on default sample chain + // Check if we're on default sample chain if (Web3Accessor.Web3.ChainConfig.ChainId != DefaultChainId) { - // log error not exception to not break flow + // Log error not exception to not break flow Debug.LogError($"Samples are configured for Chain Id {DefaultChainId}, Please Change Chain Id in Window > ChainSafe SDK > Server Settings to {DefaultChainId}"); }