CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 730
Releases: Nethereum/Nethereum
5.0.0
Compare
EIP7022
Model:
- New Transaction7702
- New Transaction7702Encoder (RLP encoding / decoding)
- TransactionFactory update to create 7702 transactions directly, from a generic input or rlp
- New transaction Type (0x04)
- Authorisation7702 and Authorisation7702Signed both supported by Encoders, First one used to sign authorisations
RPC: - New Authorisation RPC object and Model mappers
- Changes to TransactionInput and Transaction to include Authorisations
- Changes to TransactionManagerBase to include identification of EIP7022 transaction types if included the authorisation list, also include common methods to Add authorisations or remove authorisations to the next request, default gas calculation optimised to add extra 2500 per authorisation if either present on the transaction input or in the next requests to be appended to the transaction
Signer:
New: Transaction7702Signer similar generic same as 1059
- Authorisation7702Signer signer to authorise items requests before including them into the 7022 transaction.
- EthECKeyBuilderFromSignedAuthorisation to recover the the signer from Authorisation7702Signed authorisation
- DecodeRLPToAuthorisation7702 to validate the rlp that is being signed by the user... (what am I authorising)
Updates:
- EthECKeyBuilderFromSignedTransaction update to recover from Transaction7702 transaction
- EthExternalSignerBase generic external signer support of 7702.
- Aws, Azure enable generic signing of 7702
- Ledger, Trezor, marked as unsupported
Accounts:
- AccountSignerTransactionManager at the time of nonce allocation, does the signing of all the authorisations to ensure correct nonces in sequencing order based on the nonce manager, authorisations are merged from the request queue onto the transaction input.
- OfflineTransactionSigner update.
- ExternalAccount signing partial support whilst it can sign the 7702 this needs to be implemented to SignAuthorisationAsync and nonce flow
Contracts
- Added AuthorisationList to the common contract object and encoding services
Tests
- Signing Integration tests, included smart contracts examples BatchCall as a contract to be used as 7702 (enabling multiple calls) and delegation.
Services
- 7022SponsorAuthorisationService (Sign authorisations for multiple external accounts),
- AuthorisationGasCalculator (core gas calculator),
- AuthorisationSigner batch key signing support
- Tests to batch creation / authorisation
Commits: 906f165, e88fb13, 8a20bce,
2343277
Muticall RPC batch support improvements
-
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
Utils Random
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
- The EVM simulator includes a Gas counter.
- New Op codes supported: BASEFEE- BLOBHASH - BLOBBASEFE- TLOAD - TSTORE
Commits: ee6b4d7
Nethereum.Merkles LeanIncrementalMerkleTree
- New tree / trie LeanIncrementalMerkleTree to support zk proofs
Commit: adb2872
Nethereum.Geth update
- New DTOs for debug and tracer options/responses added and changes to the Debug api services.
Thanks to @SolidityNinja pull: #1068 - Nethereum.Geth use StateChange from the core RPC project
Commit: ec4c916
Bouncy Castle update
- Change of package and version to BouncyCastle.Cryptography 2.5.1, but open to any version up to 3.0.0, targeting frameworks net90, net80, net60 and net472, leaving portable to other versions (previous) due to compatibility issues.
- fix issue in ToDER() method, thanks to the pull request by @tmm360 in #1071
Commits: 62affe5, a184667
.NET AOT Native support, Nethereum.JsonRpc.SystemTextJsonRpcClient and Example.
.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.
- Nethereum.JsonRpc.SystemTextJsonRpcClient is a brand new project and AOT-friendly JSON-RPC client for Ethereum, using System.Text.Json.
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
- Update all the Nethereum.RPC DTOs, Nethereum.JsonRpc.RpcClient Messages and Nethereum.Hex HexTypes to dual support Newtonsoft.Json and System.Text.Json
[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
- Nethereum.ABI.SourceGenerators, (WIP) to avoid ABI decoding using the attributes and reflection when using typed FunctionMessages, Events etc. Nethereum.ABI.SourceGenerators experimental project generates the code to convert set and get the values directly when encoding and decoding at compilation time. This works very well native mode as the code is normally stripped from this scenarios. The current early implementation works on Functions and Structs, but further refining is required to allow for anonymous methods, implementation of other types and most importantly integrate it an option within the deserialising workflow.
Commits: 48a2302
- .NET Native example and test project
The dotnet native example, provides many common scenarios and tests to validate the native support of Nethereum.
Source: https://github.com/Nethereum/Nethereum/blob/master/consoletests/Nethereum.AOTSigningTest/Program.cs
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("https://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...
Assets 2
4.29.0
Compare
Nethereum.Blazor
- New project, to be used as the basis for integrating with Blazor.
- EIP6963 support, enabling multi wallet browser extension support, like Metamask, Coinbase, Brave, Rabby etc Example of Blazor Project
- EthereumAuthenticationProvider, common class to provide authentication support, this should work if you use EIP963, Metamask standalone or Reown
- SiweAuthenticationServerStateProvider, common class to provide further authentications support if using SIWE, so whilst a user might be connected, it can be authenticated in certain areas of the application.
- LocalStorageAccessTokenService and LocalStorageHelper, generic helpers to manage the SIWE access tokens on generic LocalStorage.
Commits: b534f8f
Screenshot of Blazor application
Nethereum.Unity.EIP6963
- Unity support for EIP6963, including custom WeglHostProvider, Interop, etc.
- Full example in the Unity Template https://github.com/Nethereum/Unity3dSampleTemplate/
Commits: b534f8f, Nethereum/Unity3dSampleTemplate@a321511
Screenshot of Unity application
Account Abstraction RPC Bundler
Rpc Service and requests to integrate with 4337 Account Abstraction
Commits: 7116733
Other Additions
- Add TryParse method to BigDecimal struct by @AnzeS in #1066
- Support NUGET_PACKAGES environment variable in Nethereum.Autogen.ContractApi by @zakhard90 in #1067
Full Changelog: 4.28.0...4.29.0
Assets 2
4.28.0
Compare
Code generator (.net, typescript, vscode solidity)
- Services now inherit from a base class with the core implementation, all methods are virtual, allowing to be overriden on the main class to add custom logic like validation.
- Mud Table Service is extended to include Set and Get methods using parameters, so now Keys Values are needed.
- Mud Table, includes accessors for both Keys and Value properties at top level, this way it can be easily accessed the data, but also in future
use these properties as entities to get the data from a different storage or Api.
Commits: 1beb31c
Example of code generated file for both Mud table service and table
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.
Example of ".nethereum-gen.multisettings"
[
{
"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
- Safe smart contract upgrade, signing and new contract handler extension.
The new contract handler extension allows you to convert any smart contract service into a safe request signer using your private key (or keys).
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
- Mud Call From and Batching removing the namespace prefixes from the generated function messages, and other general improvements Commits: 7019a21, 0b73515, 3fcd9ae, 69d4fa1,
69345dc
Unity Release
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
Assets 2
4.27.1
Compare
Patch to rollback the Bouncy Castle upgrade (Reported Issues)
Full Changelog: 4.27.0...4.27.1
Assets 2
4.27.0
Compare
Reown Appkit Blazor support
- Add Reown AppKit library and Blazor example by @Magehernan (Many Thanks!!!) in #1056
This works the same as Metamask Blazor / Wallet Connect Blazor here is the example https://github.com/Nethereum/Nethereum/blob/master/consoletests/NethereumReownAppKitBlazor/Pages/Index.razor
Updates
- .Net 9 Target, removal of dotnetcore 2 and dotnetcore 3 (this should use netstandard if needed)
- Support for Microsoft.Extensions.Logging.Abstractions in .net 9 by @andresgutierrez in #1054
- Use BouncyCastle.Cryptography for net6.0 and later by @raymens in #1057
General changes / Fixes
- Custom Error exceptions typed changes / handling and factories to enable casting and straight decoding
- BigInteger explicit cast and FloorToBigInteger for BigDecimal by @ethanrushh in #1055
- Mud Normaliser Postgres dbnull fix / support
Unity release
The unity release can be found here, follow the instructions for installation.
https://github.com/Nethereum/Nethereum.Unity/
Full Changelog: 4.26.0...4.27.0
Assets 2
4.26.0
Compare
Mud Postgres Normaliser
The 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 General
- EF Stored records can be retrieved all by BlockNumber and RowId Commits 6e2ae82
- Stored records Key is now a combination of all the keys padded to 32 bytes (for byte or hex storage), this allows to decode the key without knowing the schema before hand. Commits f860291
- TableSchema Generic table schema object that can be built from TableTableRecord (by retrieving the schema from the chain Commit 5b0ab1c
- Value Decoder defaults to default values for remaining schema fields when there are no more bytes to decode. Commit 5b0ab1c
Blockchain Log Processor
- Adding extra logging on the Log Processor to track progress of each internal block range processed. Commit a5eb2ea
Full Changelog: 4.25.0...4.26.0
Unity release in openupm.com https://github.com/Nethereum/Nethereum.Unity
Assets 2
4.25.0
Compare
4.25.0
IRestHttpHelper / RestHttpHelper and UnityTaskRestHttpHelper
This 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:
- Cross-Platform Support: The utility works in both .NET and Unity, ensuring flexibility across different platforms.
- Dynamic JSON Deserialization:
- Utilizes System.Text.Json (STJ) for .NET 8 and newer versions.
- Falls back to Newtonsoft.Json for Unity and older .NET versions.
- New Dependency: A new project, Nethereum.Util.Rest, has been added to handle REST client operations for DataServices and Contracts
Commits 0b4d51b
Upgrade of Nethereum.DataServices and Nethereum.Contracts
Nethereum.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
TablePredicateBuilder
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.
Key Features:
-
Fluent API for Predicate Construction:
- Easily create complex queries using chainable
.AndEqual()
,.OrEqual()
,.AndNotEqual()
, and other methods. - Supports flexible predicate building that can target specific table fields or conditions.
- Easily create complex queries using chainable
-
Reusable across Storage Types:
- Predicates are built on a custom set of objects, enabling them to be reused for different storage backends (e.g., PostgreSQL, SQLite).
-
REST API Integration:
- Predicates can be serialized into JSON for making REST API calls. The server can then deserialize the predicate and query the internal database storage using the same predicate structure.
Example Usage:
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.EntityFramework
The 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:
- Provides a predicate builder that creates SQL queries using key hex values. The queries are compiled into a
SqlPredicateResult
, which includes the SQL statement and arguments to safely prevent SQL injection.
- Provides a predicate builder that creates SQL queries using key hex values. The queries are compiled into a
-
MudEFTableRepository:
- A MudTableRepository using keys as hex and EF supporting any context that implements IMudStoreRecordsDbSets, which includes the StoreRecords and BlockProgress entities.
-
BlockProgressRepository:
- Custom implementation of the BlockProgresRepository for EF Mud
Commits dc4be4c
Mud Repository Postgres
Provides an extended Entity Framework (EF) repository implementation for PostgreSQL.
Key features include:
- Log Processing Service: Synchronizes and processes blockchain logs into a PostgreSQL database.
- Custom DbContext and TableRepository: A custom
DbContext
andTableRepository
are included to manage all fields stored asbytea
(PostgreSQL binary format). - PredicateBuilder: Enables dynamic querying by constructing predicates that can be used to efficiently filter data within the repository.
Commits: 13edbfa
NethereumMudLogProcessing, NethereumMudStoredRecordsRestApi, and NethereumMudStoreRestApiClient Examples
Source:
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:
- Mud Log processing creation of Log processor: 13edbfa
Fixes
- 712 ToJson - Prefix bytes for 1271 AA Type Messages by @0xFirekeeper in #1041
- Exceptions when validating v indicate that TransactionChainId should be used by @psavva in #1043
Full Changelog: 4.21.4...4.25.0
Assets 2
4.21.4
Compare
Contract Handler
The 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 changes
Code 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
Assets 2
4.21.3
Compare
Mud
Multiple Table registration (not using bulk)
Contract Standards
Supports interface standard
Full Changelog: 4.21.2...4.21.3
Unity release in openupm.com https://github.com/Nethereum/Nethereum.Unity
Assets 2
4.21.2
Compare
ERC6492 support
Example 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
- Fix to make AWSKeyManagementExternalSigner signed messages compatible with EIP-2 by @hasandogu in #1036
- Request batching for EthSendRawTransaction by @teledu in #1032
- Mud adding multiquery rpc support to retrieve multiple records of a table, other extra functionality on table services to simplify querying, set and delete records.
Full Changelog: 4.21.0...4.21.2
Unity package can be found in Nethereum.Unity