Model:
Signer:
New: Transaction7702Signer similar generic same as 1059
Updates:
Accounts:
Contracts
Tests
Services
Commits: 906f165, e88fb13, 8a20bce,
2343277
MulticallInputOuputRpcBatchItem and CreateMulticallInputOutputRpcBatchItems
To be able to send batches of rpc calls and decode them the MultiQueryBatchRpcHandler includes CreateMulticallInputOutputRpcBatchItems. This method using the multicalls creates a set of MulticallInputOutputRpcBatchItems that contains both the multicallinputouput for decoding the call data and the newly created based on the multicallinputoutput rpcRequestResponseBatchItem.
MulticallInputOuputRpcBatchItem implements the interface of IRpcRequestResponseBatchItem by wrapping the rpcRequestResponseBatchItem so it can be used as any other normal batch request
Allowing partial success in batch requests. by @dlebee in #1070
New shuffler and bytes shuffler specialised to help when creating random sets of bytes / numbers (or anything), based on the card shuffling strategy, so no consecutive values can be guessed based on a generic set or rng if guessed.
Commits: cfe1ff4
EVM Simulator update.NET Native (now part of Native AOT in .NET) compiles .NET applications ahead-of-time into platform-specific machine code, eliminating the need for a JIT compiler and reducing startup time, memory usage, and deployment size. To enable this and continue to be backwards compatible requires many changes (at core), mostly caused by JSON encoding and decoding.
This provides new RPC Client component and Simple RPC Client component, including also Nethereum RPC Context for generated serialisation of RPC types to provide the RPC transport with System.Text.Json instead of Newtonsoft making it suitable for AOT Native builds using .net9.
Commits: e99d174
[JsonProperty(PropertyName = "decimals")] #if NET6_0_OR_GREATER [System.Text.Json.Serialization.JsonPropertyName("decimals")] #endif public uint Decimals { get; set; }
Transaction Receipt does not use JArray that couples it to Newtonsoft, it uses now the typed version, FilterLog, and to avoid migration issues all the extensions from receipt has been upgraded, and in scenarios the type conversion remains the same, but just returns the same object.
All Clients now include a DecodeMethod, so any response message can be combined with the client deserialiser and settings (ie System.Text.Json specific).
New ContractABI deserialiser ABIJsonDeserialiserSTJ to support System.Text.Json, this is an optin deserialiser, enabling to interact with smart contracts using abi strings in Native mode. Note: To workaround the fact that newtonsoft is more flexible and allows for single quotes when using Json and backwards compatibility, the deserialiser if it finds single quotes it replaces them with double quotes.
To enable it use:
AbiDeserializationSettings.UseSystemTextJson = true;
Commits: 8466e44, 5eccd83, 2b0407d
Commits: 48a2302
A simple example of usage:
Include the namespace for the SystemTextJsonRpcClient.
using Nethereum.JsonRpc.SystemTextJsonRpcClient;
Using the RpcClient from SystemTextJsonRpcClient, and work as usual.
var localClient = new RpcClient("http://localhost:8545"); var account = new Nethereum.Web3.Accounts.Account("0xb5b1870957d373ef0eeffecc6e4812c0fd08f554b37b233526acc331bf1544f7"); var web3Local = new Web3.Web3(account, localClient); var localBalance = await web3Local .Eth .GetBalance.SendRequestAsync("0x12890d2cce102216644c59daE5baed380d84830c"); var ethSenderService = web3Local.Eth.GetEtherTransferService(); var transactionHash = await ethSenderService.TransferEtherAsync("0x12890d2cce102216644c59daE5baed380d84830c", 0.01m);
Note...
Read more 4.29.0 Nethereum.BlazorCommits: b534f8f
Screenshot of Blazor application Nethereum.Unity.EIP6963Commits: b534f8f, Nethereum/Unity3dSampleTemplate@a321511
Screenshot of Unity application Account Abstraction RPC BundlerRpc Service and requests to integrate with 4337 Account Abstraction
Commits: 7116733
Other AdditionsFull Changelog: 4.28.0...4.29.0
4.28.0 Code generator (.net, typescript, vscode solidity)public partial class ItemTableService : TableService<ItemTableRecord, ItemTableRecord.ItemKey, ItemTableRecord.ItemValue> { public ItemTableService(IWeb3 web3, string contractAddress) : base(web3, contractAddress) {} public virtual Task<ItemTableRecord> GetTableRecordAsync(uint id, BlockParameter blockParameter = null) { var _key = new ItemTableRecord.ItemKey(); _key.Id = id; return GetTableRecordAsync(_key, blockParameter); } public virtual Task<string> SetRecordRequestAsync(uint id, uint price, string name, string description, string owner) { var _key = new ItemTableRecord.ItemKey(); _key.Id = id; var _values = new ItemTableRecord.ItemValue(); _values.Price = price; _values.Name = name; _values.Description = description; _values.Owner = owner; return SetRecordRequestAsync(_key, _values); } public virtual Task<TransactionReceipt> SetRecordRequestAndWaitForReceiptAsync(uint id, uint price, string name, string description, string owner) { var _key = new ItemTableRecord.ItemKey(); _key.Id = id; var _values = new ItemTableRecord.ItemValue(); _values.Price = price; _values.Name = name; _values.Description = description; _values.Owner = owner; return SetRecordRequestAndWaitForReceiptAsync(_key, _values); } } public partial class ItemTableRecord : TableRecord<ItemTableRecord.ItemKey, ItemTableRecord.ItemValue> { public ItemTableRecord() : base("MyWorld", "Item") { } /// <summary> /// Direct access to the key property 'Id'. /// </summary> public virtual uint Id => Keys.Id; /// <summary> /// Direct access to the value property 'Price'. /// </summary> public virtual uint Price => Values.Price; /// <summary> /// Direct access to the value property 'Name'. /// </summary> public virtual string Name => Values.Name; /// <summary> /// Direct access to the value property 'Description'. /// </summary> public virtual string Description => Values.Description; /// <summary> /// Direct access to the value property 'Owner'. /// </summary> public virtual string Owner => Values.Owner; public partial class ItemKey { [Parameter("uint32", "id", 1)] public virtual uint Id { get; set; } } public partial class ItemValue { [Parameter("uint32", "price", 1)] public virtual uint Price { get; set; } [Parameter("string", "name", 2)] public virtual string Name { get; set; } [Parameter("string", "description", 3)] public virtual string Description { get; set; } [Parameter("string", "owner", 4)] public virtual string Owner { get; set; } } }Code generator .NET
Now supports GeneratorSets or ".nethereum-gen.multisettings" as a library and console, the same as the typescript and vscode-solidity version.
Commit: a211387
Console usage Nethereum.Generator.Console generate from-config
defaults to ".nethereum-gen.multisettings" and current folder.
See --help for more info.
[ { "paths": ["out/ERC20.sol/Standard_Token.json"], "generatorConfigs": [ { "baseNamespace": "MyProject.Contracts", "basePath": "codeGenNodeTest/GeneratorSets/Example2/MyProject.Contracts", "codeGenLang": 0, "generatorType": "ContractDefinition" }, { "baseNamespace": "MyProject.Contracts", "basePath": "codeGenNodeTest/GeneratorSets/Example2/MyProject.Contracts", "codeGenLang": 0, "generatorType": "UnityRequest" } ] }, { "paths": ["out/IncrementSystem.sol/IncrementSystem.json"], "generatorConfigs": [ { "baseNamespace": "MyProject.Contracts.MyWorld1.Systems", "basePath": "codeGenNodeTest/GeneratorSets/Example2/MyProject.Contracts/MyWorld1/Systems", "codeGenLang": 0, "generatorType": "ContractDefinition", "mudNamespace": "myworld1" }, { "baseNamespace": "MyProject.Contracts.MyWorld1.Systems", "basePath": "codeGenNodeTest/GeneratorSets/Example2/MyProject.Contracts/MyWorld1/Systems", "codeGenLang": 0, "generatorType": "MudExtendedService", "mudNamespace": "myworld1" } ] }, { "paths": ["mudMultipleNamespace/mud.config.ts"], "generatorConfigs": [ { "baseNamespace": "MyProject.Contracts.MyWorld1.Tables", "basePath": "codeGenNodeTest/GeneratorSets/Example2/MyProject.Contracts/MyWorld1/Tables", "generatorType": "MudTables", "mudNamespace": "myworld1" } ] }, { "paths": ["mudMultipleNamespace/mud.config.ts"], "generatorConfigs": [ { "baseNamespace": "MyProject.Contracts.MyWorld2.Tables", "basePath": "codeGenNodeTest/GeneratorSets/Example2/MyProject.Contracts/MyWorld2/Tables", "generatorType": "MudTables", "mudNamespace": "myworld2" } ] } ](Gnosis) Safe
Commits:: 255b574, 66da017, dddba5f,
var privateKeySigner = ""; var privatekeySender = ""; var web3 = new Web3(new Nethereum.Web3.Accounts.Account(privateKey), "https://rpc.aboutcircles.com/"); var hubService = new HubService(web3, v2HubAddress); hubService.ChangeContractHandlerToSafeExecTransaction(humanAddress1, privateKeySigner);Other fixes
The unity release can be found here, follow the instructions for installation.
https://github.com/Nethereum/Nethereum.Unity/
Full Changelog: 4.27.1...4.28.0
4.27.1Patch to rollback the Bouncy Castle upgrade (Reported Issues)
Full Changelog: 4.27.0...4.27.1
4.27.0 4.26.0 Mud Postgres NormaliserThe Mud Postgres Normaliser is a service that processes data from the StoredRecords table, which is populated by Store event logs, and normalizes it in PostgreSQL.
Key Features:
Table Creation:
For each record, the service ensures that the corresponding table based on the tableId is created. If the table doesn’t exist, it is created using schema information retrieved from the blockchain, including appropriate column types.
Data Decoding and Persistence:
The service decodes and inserts or updates the blockchain event data into the PostgreSQL database.
Singleton Tables:
Singleton tables are created with a single key of 1, simplifying their structure.
Progress Tracking:
A Progress table tracks the last processed blockNumber and rowId, allowing the service to pick up from where it left off and process data in batches.
Configurable Pagination:
The service supports configurable batch sizes, making it flexible for different use cases.
Example
public class Program { public static async Task Main(string[] args) { // Set up the necessary services var connection = new NpgsqlConnection("Host=myserver;Username=mylogin;Password=mypass;Database=mydatabase"); var loggerFactory = LoggerFactory.Create(builder => builder.AddConsole()); var logger = loggerFactory.CreateLogger<MudPostgresNormaliserProcessingService>(); // Create the repository (assuming it's already implemented and registered) var storeRecordsTableRepository = new MudPostgresStoreRecordsTableRepository(connection, logger); // Create an instance of the processing service var processingService = new MudPostgresNormaliserProcessingService( storeRecordsTableRepository, connection, logger ) { RpcUrl = "https://localhost:8545", Address = "0xYourContractAddress", PageSize = 1000 // Optional: configure the number of records processed per batch }; // Execute the normalisation process var cancellationToken = new CancellationTokenSource().Token; await processingService.ExecuteAsync(cancellationToken); } }
Commits: 99f16f7
Mud GeneralFull Changelog: 4.25.0...4.26.0
Unity release in openupm.com https://github.com/Nethereum/Nethereum.Unity
4.25.0 4.25.0 IRestHttpHelper / RestHttpHelper and UnityTaskRestHttpHelperThis release introduces a IRestHttpHelper interface and a simple implementation of a REST API client for use across both .NET and Unity Nethereum projects. Key features include:
Commits 0b4d51b
Upgrade of Nethereum.DataServices and Nethereum.ContractsNethereum.DataServices and Nethereum.Contracts are upgraded to use the new RestHttpHelper by default or any other implementation that implements the interface.
Fixes to Etherscan are also included.
Commits aeaa446
The TablePredicateBuilder
introduces a fluent API to build predicates for querying Mud
storage tables that have been synchronized to an external repository (such as a PostgreSQL database). It allows developers to construct complex queries with minimal effort using chainable methods.
Fluent API for Predicate Construction:
.AndEqual()
, .OrEqual()
, .AndNotEqual()
, and other methods.Reusable across Storage Types:
REST API Integration:
var predicateBuilder = new TablePredicateBuilder<ItemTableRecord, ItemTableRecord.ItemKey, ItemTableRecord.ItemValue>("0xABC123"); var predicate = predicateBuilder .AndEqual(x => x.Id, 1) // AND key0 = '0x1' .AndEqual(x => x.Id, 2) // AND key0 = '0x2' .OrEqual(x => x.Id, 3) // OR key0 = '0x3' .AndNotEqual(x => x.Id, 4) // AND key0 != '0x4' .Expand(); // Finalize the predicate
The TablePredicateBuilder
simplifies querying complex storage structures and provides flexibility for different storage systems, allowing predicates to be reused and transported as needed for various scenarios such as querying a database or sending queries via REST APIs.
Commits ad9ac4c 4ddb6d4 af16f6b
Mud.Repositories.EntityFrameworkThe Mud.Repositories.EntityFramework project offers a foundational framework to integrate with a Mud repository using Entity Framework (EF). It includes various utilities and features to support efficient querying and storage of blockchain data.
Key Features:Custom Predicate Builder:
SqlPredicateResult
, which includes the SQL statement and arguments to safely prevent SQL injection.MudEFTableRepository:
BlockProgressRepository:
Commits dc4be4c
Mud Repository PostgresProvides an extended Entity Framework (EF) repository implementation for PostgreSQL.
Key features include:
DbContext
and TableRepository
are included to manage all fields stored as bytea
(PostgreSQL binary format).Commits: 13edbfa
NethereumMudLogProcessing, NethereumMudStoredRecordsRestApi, and NethereumMudStoreRestApiClient ExamplesSource:
https://github.com/Nethereum/Nethereum/tree/master/consoletests/NethereumMudLogProcessing
https://github.com/Nethereum/Nethereum/tree/master/consoletests/NethereumMudStoreRestApiClient
https://github.com/Nethereum/Nethereum/tree/master/consoletests/NethereumMudStoredRecordsRestApi
End-to-end examples for processing and querying data from blockchain store records using a PostgreSQL database. The solution includes:
Log Processing: Blockchain store records are processed and stored in a PostgreSQL database using the LogProcessor. The solution leverages Entity Framework (EF) migrations for database schema management.
REST API Integration: A flexible REST API is provided to query the stored records. The API receives requests containing predicates (in JSON format), which are converted into queries for PostgreSQL using the table repository.
Data Transformation: The queried results are transformed into Data Transfer Objects (DTOs) and further converted into table format, which is then outputted to the console.
Commits: 73fbd59
Extra fetures:Full Changelog: 4.21.4...4.25.0
4.21.4 Contract HandlerThe Contract Handler can now be overridden and changed on ContractServices, this allows for specialisation of ContractHandlers as the one used in Mud to to create a CallFrom Message when delegating a call from the given signer.
This means that Nethereum now can have 2 levels of interception, one at the rpc level, for example when using Metamask, WalletConnect etc to redirect messages to another provider, and this one at ContractHandler level when we want to sign as usual but embed the contract call into another function message.
Code generator changesCode generator updated (JavaScript) to support multiple configurations, this allow you to define multiple code generation settings for your smart contracts, enabling the generation of client-side code for various platforms (e.g., C#, Unity) based on Solidity ABI files.
Example of usage in vscode solidity https://github.com/juanfranblanco/vscode-solidity?tab=readme-ov-file#code-generation-with-nethereum-genmultisettings
An example of the file is:
[ { "paths": ["out/ERC20.sol/Standard_Token.json"], "generatorConfigs": [ { "baseNamespace": "MyProject.Contracts", "basePath": "codeGenNodeTest/GeneratorSets/Example2/MyProject.Contracts", "codeGenLang": 0, // Code generation for C# "generatorType": "ContractDefinition" // Generates contract definitions in C# }, { "baseNamespace": "MyProject.Contracts", "basePath": "codeGenNodeTest/GeneratorSets/Example2/MyProject.Contracts", "codeGenLang": 0, // Code generation for C# "generatorType": "UnityRequest" // Generates Unity client request code } ] }, { "paths": ["out/IncrementSystem.sol/IncrementSystem.json"], "generatorConfigs": [ { "baseNamespace": "MyProject.Contracts.MyWorld1.Systems", "basePath": "codeGenNodeTest/GeneratorSets/Example2/MyProject.Contracts.MyWorld1.Systems", "codeGenLang": 0, // Code generation for C# "generatorType": "ContractDefinition" }, { "baseNamespace": "MyProject.Contracts.MyWorld1.Systems", "basePath": "codeGenNodeTest/GeneratorSets/Example2/MyProject.Contracts.MyWorld1.Systems", "codeGenLang": 0, "generatorType": "MudExtendedService", // Generates Mud services "mudNamespace": "myworld1" } ] }, { "paths": ["mudMultipleNamespace/mud.config.ts"], "generatorConfigs": [ { "baseNamespace": "MyProject.Contracts.MyWorld1.Tables", "basePath": "codeGenNodeTest/GeneratorSets/Example2/MyProject.Contracts.MyWorld1.Tables", "generatorType": "MudTables", // Generates Mud tables "mudNamespace": "myworld1" } ] }, { "paths": ["mudMultipleNamespace/mud.config.ts"], "generatorConfigs": [ { "baseNamespace": "MyProject.Contracts.MyWorld2.Tables", "basePath": "codeGenNodeTest/GeneratorSets/Example2/MyProject.Contracts.MyWorld2.Tables", "generatorType": "MudTables", "mudNamespace": "myworld2" } ] } ]
Commits: 3b9dabf
Full Changelog: 4.21.3...4.21.4
4.21.3 4.21.2 ERC6492 supportExample and more info: https://eips.ethereum.org/EIPS/eip-6492
[Fact] public async Task ShouldValidateOfflineAsync() { var create2FactoryAddress = "0xBf07a0Df119Ca234634588fbDb5625594E2a5BCA"; var factoryCallData = "0x49c81579000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000010000000000000000000000004836a472ab1dd406ecb8d0f933a985541ee3921f0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000007a7f00000000000000000000000000000000000000000000000000000000000000017f7f0f292b79d9ce101861526459da50f62368077ae24affe97b792bf4bdd2e171553d602d80604d3d3981f3363d3d373d3d3d363d732a2b85eb1054d6f0c6c2e37da05ed3e5fea684ef5af43d82803e903d91602b57fd5bf300000000000000000000000000000000000000000000000000000000000000000000000002246171d1c9000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000004836a472ab1dd406ecb8d0f933a985541ee3921f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000942f9ce5d9a33a82f88d233aeb3292e6802303480000000000000000000000000000000000000000000000000014c3c6ef1cdc01000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000042f2eaaebf45fc0340eb55f11c52a30e2ca7f48539d0a1f1cdc240482210326494545def903e8ed4441bd5438109abe950f1f79baf032f184728ba2d4161dea32e1b0100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; var originalSignature = "0xc0f8db6019888d87a0afc1299e81ef45d3abce64f63072c8d7a6ef00f5f82c1522958ff110afa98b8c0d23b558376db1d2fbab4944e708f8bf6dc7b977ee07201b00"; var web3 = new Web3.Web3("https://polygon-mainnet.public.blastapi.io"); var signatureValidationERC6492 = web3.Eth.SignatureValidationPredeployContractERC6492; var signatureERC6492 = signatureValidationERC6492.BuildSignature(create2FactoryAddress, factoryCallData.HexToByteArray(), originalSignature.HexToByteArray()); Assert.True(signatureValidationERC6492.IsERC6492Signature(signatureERC6492)); var message = "0x787177"; var address = "0x4836a472ab1dd406ecb8d0f933a985541ee3921f"; var isValid = await signatureValidationERC6492.IsValidSignatureMessageAsync(address, message.HexToByteArray(), signatureERC6492); Assert.True(isValid); }Fixes and extras
Full Changelog: 4.21.0...4.21.2
Unity package can be found in Nethereum.Unity
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4