Skip to content

Organizing calls#712

Merged
kantagara merged 59 commits into
mainfrom
sneakz/sample-organization
Nov 9, 2023
Merged

Organizing calls#712
kantagara merged 59 commits into
mainfrom
sneakz/sample-organization

Conversation

@sneakzttv
Copy link
Copy Markdown
Contributor

@sneakzttv sneakzttv commented Nov 7, 2023

Removed the many example scripts we have and combined them into 1 centralized script for each protocol ERC20/1155 etc etc.

Users may find this easier to locate and subsequently the methods are a lot cleaner which you can see from the file changes.

This also makes alterations easier as we only need to update our changes in 1 place.

If we like this approach I will continue on and create a script for each protocol.

Update:

After long discussions between myself nikola and rob, we decided on the above approach, i've added a few changes below:

Removed texture scene and merged it into the main scene so we're 1 step closer to a single scene.
image

Grouped all of the protocol scripts in the root of the scene under SDK Calls for easy access rather than diving through buttons.
image

Updated Unsorted to EVM as it displays nicer.
image

Removed the many behavior scripts, now we just have a centralized script for each protocol, yay.
image

Updated tests to work with the changes.

Added ecdsa sign, get address, send tx functions and mint and transfer functions for 20/721 & 1155. Created buttons for each function in the main scene.

This merge will make calling the SDK functions simple and easy.
image

-----------------To Test---------------------
Boot up the login scene to enter into the main scene and check the calls to make sure that everything is functioning as intended.

Comment thread Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/Erc20.cs Outdated
Comment thread Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/Erc20.cs Outdated
@sneakzttv sneakzttv self-assigned this Nov 7, 2023
@sneakzttv sneakzttv added the Status: In Progress Added to issues to signal that its actively being worked on. label Nov 7, 2023
@sneakzttv sneakzttv added ready-to-merge Ready to Merge PR - this'll trigger required checks and removed ready-to-merge Ready to Merge PR - this'll trigger required checks labels Nov 9, 2023
Comment thread Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/Erc1155.cs Outdated
Comment thread Packages/io.chainsafe.web3-unity/Runtime/Scripts/EVM/Token/Erc721.cs Outdated
Copy link
Copy Markdown
Contributor

@juans-chainsafe juans-chainsafe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok! I finish the testing, here is the status:

  • WebGL build with Web3Auth ✅ except #714
  • Web3Auth in Unity editor ✅
  • Wallet connect in Unity editor ✅

❌ Failing:

  • All721Nft (we should remove this, the endpoint is no longer supported in game-api)
  • All1155Nft (we should remove this, the endpoint is no longer supported in game-api)
  • Multicall
InvalidOperationException: No service for type 'ChainSafe.Gaming.MultiCall.IMultiCall' has been registered.
Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService (System.IServiceProvider provider, System.Type serviceType) (at <1ba52dc0b103422eba91ad87a1aa9fe3>:0)
Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T] (System.IServiceProvider provider) (at <1ba52dc0b103422eba91ad87a1aa9fe3>:0)
ChainSafe.Gaming.MultiCall.MultiCallExtensions.MultiCall (ChainSafe.Gaming.Web3.Web3 web3) (at <c5a8911fc36e44c88a494f120980ea1f>:0)
EvmCalls.MultiCall () (at Assets/Samples/web3.unity SDK/2.5.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/EVM/EvmCalls.cs:257)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) (at <130809ae6f984869a6663c878f16e3f3>:0)
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/UnitySynchronizationContext.cs:153)
UnityEngine.UnitySynchronizationContext.Exec () (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/UnitySynchronizationContext.cs:83)
UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/UnitySynchronizationContext.cs:107)

@sneakzttv
Copy link
Copy Markdown
Contributor Author

fixed

Copy link
Copy Markdown
Contributor

@juans-chainsafe juans-chainsafe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multicall working now! ✅
All721Nft and All1155Nft are failing ❌ but they will be fixed in a different PR

Copy link
Copy Markdown
Contributor

@RyRy79261 RyRy79261 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, Sneakz ran test to confirm the BigInteger works in the calls

@sneakzttv sneakzttv added ready-to-merge Ready to Merge PR - this'll trigger required checks and removed ready-to-merge Ready to Merge PR - this'll trigger required checks labels Nov 9, 2023
@kantagara kantagara merged commit 78eb1f1 into main Nov 9, 2023
@kantagara kantagara deleted the sneakz/sample-organization branch November 9, 2023 18:39
rob1997 pushed a commit that referenced this pull request Jan 16, 2025
* Organizing calls

* Auto-duplicate Packages Samples

* Changes

* Auto-duplicate Packages Samples

* Update Erc20.cs

* Erc721

* Auto-duplicate Packages Samples

* 1155 calls

1155 calls

* Auto-duplicate Packages Samples

* Test fixes

Test fixes

* Evm & gelato scripts

* Scene

Scene

* Fix tests

* Cleanup

Cleanup

* fix

* ECDSA calls

ECDSA calls

* multicall

multicall

* multicall

multicall

* Auto-duplicate Packages Samples

* Update SampleMain.unity

* Auto-duplicate Packages Samples

* Texture request

Texture request

* Auto-duplicate Packages Samples

* Update EvmCalls.cs

* Auto-duplicate Packages Samples

* Cleanup

* Auto-duplicate Packages Samples

* Fix tests

Fix tests

* Auto-duplicate Packages Samples

* Fitting the typecast overload fix from Rob in

Fitting the typecast overload fix from Rob in

* Auto-duplicate Packages Samples

* static classes

static classes

* Auto-duplicate Packages Samples

* Fix image

Fix image

* Auto-duplicate Packages Samples

* Gelato disable fix

Gelato disable fix

* Auto-duplicate Packages Samples

* Update GelatoDisableContent.cs

* custom token fix

custom token fix

* Auto-duplicate Packages Samples

* evm fix

evm fix

* Auto-duplicate Packages Samples

* Fix for multicall not working.

* Auto-duplicate Packages Samples

* Fixes

Fixes

* Auto-duplicate Packages Samples

---------

Co-authored-by: sneakzttv <sneakzttv@users.noreply.github.com>
Co-authored-by: Nikola Garabandic <kantagara@gmail.com>
Co-authored-by: kantagara <kantagara@users.noreply.github.com>
sergeypanin1994 pushed a commit to sergeypanin1994/web3.unity that referenced this pull request Mar 16, 2025
* Organizing calls

* Auto-duplicate Packages Samples

* Changes

* Auto-duplicate Packages Samples

* Update Erc20.cs

* Erc721

* Auto-duplicate Packages Samples

* 1155 calls

1155 calls

* Auto-duplicate Packages Samples

* Test fixes

Test fixes

* Evm & gelato scripts

* Scene

Scene

* Fix tests

* Cleanup

Cleanup

* fix

* ECDSA calls

ECDSA calls

* multicall

multicall

* multicall

multicall

* Auto-duplicate Packages Samples

* Update SampleMain.unity

* Auto-duplicate Packages Samples

* Texture request

Texture request

* Auto-duplicate Packages Samples

* Update EvmCalls.cs

* Auto-duplicate Packages Samples

* Cleanup

* Auto-duplicate Packages Samples

* Fix tests

Fix tests

* Auto-duplicate Packages Samples

* Fitting the typecast overload fix from Rob in

Fitting the typecast overload fix from Rob in

* Auto-duplicate Packages Samples

* static classes

static classes

* Auto-duplicate Packages Samples

* Fix image

Fix image

* Auto-duplicate Packages Samples

* Gelato disable fix

Gelato disable fix

* Auto-duplicate Packages Samples

* Update GelatoDisableContent.cs

* custom token fix

custom token fix

* Auto-duplicate Packages Samples

* evm fix

evm fix

* Auto-duplicate Packages Samples

* Fix for multicall not working.

* Auto-duplicate Packages Samples

* Fixes

Fixes

* Auto-duplicate Packages Samples

---------

Co-authored-by: sneakzttv <sneakzttv@users.noreply.github.com>
Co-authored-by: Nikola Garabandic <kantagara@gmail.com>
Co-authored-by: kantagara <kantagara@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Ready to Merge PR - this'll trigger required checks

Projects

None yet

5 participants