Skip to content

Releases: Nethereum/Nethereum

4.20.0

28 Mar 17:33
a3d2dab
Compare
Choose a tag to compare

WIP

  • Diamonds support as a Standard contract, including factory extensions to create Facets from service contracts.

  • New ServiceContractBase and ServiceContractWeb3Base these should be complemented normally by the new code generation changes, this include helpers to get all the contract signatures, abis or types.

  • Service code generation changes, to support the new ServiceContractWeb3Base and implement supporting functions to get all abi FunctionTypes, EventTypes and ErrorTypes these can be complimented with the Diamonds to create the Facet cuts, or handle errors specific to the that contract, etc.

  • WalletConnect host provider, adding switchchain, addchain to the interceptor, support the current account and changes to selected chain and selected account. Examples upgraded for Avalonia and Blazor.

  • Use IWeb3 instead of Web3 to deploy contracts by @Magehernan in #1000

  • Fixes to signing in the NethereumWalletConnectInterceptor by @skibitsky in #1017

  • CI workflow to call the nuget.bat and build the "development" nuget packages by @webwarrior-ws in #1018

Unity releases WIP

Full Changelog: 4.19.0...4.20.0

4.19.0

16 Feb 18:46
Compare
Choose a tag to compare

Full Changelog: 4.18.0...4.19.0

4.18.0

21 Nov 11:54
f0e48bd
Compare
Choose a tag to compare

.Net 8 Target

All projects target .net8 where possible/

Other changes

  • OpenZeppelinMerkleTree using a new AbiStructSha3KeccackMerkleTree to match implementation that hashes the data struct Item when encoding by @dejx in #975
  • Updated text records enum according to ENS docs by @ridicoulous in #980
  • Enhancement: Adding new constructor that accepts aws kms client interface parameter. by @kjmoraji #979
  • Error handling when building .NET Standard projects by @aarani in #983
  • Support Logging Abstractions 8.0 as reference by @raymens in #986

4.17.1 ☀️☀️🍞🍞

28 Sep 10:54
Compare
Choose a tag to compare

2930 Transaction Support

Legacy2930 Transaction support to Sign, Recover and reconstruct RLP (As it is legacy this is not part of the normal TransactionManager flow)

Commits: 7c7d86b. a812ef2

Batch rpc Items (Create Batch Item for common methods)

This simplifies the creation of batches as per:

            var web3 = _ethereumClientIntegrationFixture.GetWeb3();

            var batchRequest = new RpcRequestResponseBatch();
            var batchItem1 = web3.Eth.GetBalance.CreateBatchItem(EthereumClientIntegrationFixture.AccountAddress, BlockParameter.CreateLatest(), 1);
            var batchItem2 = web3.Eth.GetBalance.CreateBatchItem(EthereumClientIntegrationFixture.AccountAddress, BlockParameter.CreateLatest(), 2);
            batchRequest.BatchItems.Add(batchItem1);
            batchRequest.BatchItems.Add(batchItem2);
            var response = await web3.Client.SendBatchRequestAsync(batchRequest);
            Assert.Equal(batchItem1.Response.Value, batchItem2.Response.Value);

Commit: 3332901

Wallet Connect Integration

Integration of Wallet connect libraries with Nethereum

Usage:

  1. Add the package Nethereum.WalletConnect
  2. Check one of these examples:

Commits: 27e5c93, 7153532, b3e617d, 8fa81e1, 6324189

nethereum-walletconnect-avalonia
nethereum-walletconnect-blazor-wasm

712 Encoding

Enhancements and fix on tuples (New methods HashStruct, GetEncodedType, GetEncodedTypeDomainSeparator, HashDomainSeparator)
See unit test for example: https://github.com/Nethereum/Nethereum/blob/894aaf6421106465a56ea6dbc12a030c155f8e25/tests/Nethereum.Signer.IntegrationTests/EIP712IntegrationTestRaribleExample.cs
Commits: 894aaf6, 0d35d8c

Event decoding

Added support to indexed values, when decoding default values to json, object dictionary, string dynamic dictionary support for indexed values that are hashed

Commit: 3ea051a

Full Changelog: 4.16.0...4.17.1

4.17.0 ☀️☀️🍞🍞

27 Sep 17:51
Compare
Choose a tag to compare

See 4.17.1

Full Changelog: 4.16.0...4.17.0

4.16.0 ☀️☀️🍞🍞

14 Aug 08:38
Compare
Choose a tag to compare

Nethereum.DataServices

New DataServices package, adding support to external (or local) data services starting with Etherscan, 4ByteDirectory and Sourcify.

Usage:

  1. Add the package Nethereum.DataServices
  2. Add the namespaces from Nethereum.DataServices

Etherscan example

var etherscanService = new EtherscanApiService();
var result = await etherscanService.Contracts.GetSourceCodeAsync("0xC36442b4a4522E871399CD717aBDD847Ab11FE88");
Assert.Equal("1", result.Status);
var contract = result.Result.First();
Assert.True(contract.ContainsSourceCodeCompilationMetadata());
var compilationMetadata = contract.DeserialiseCompilationMetadata();
var contractSource = compilationMetadata.GetLocalSourceCode(contract.ContractName);

Sourcify example

 var sourcifyApiService = new Sourcify.SourcifyApiService();
            var compilationMetadata = await sourcifyApiService.GetCompilationMetadataAsync(1, "0xC36442b4a4522E871399CD717aBDD847Ab11FE88");

4Bytes Example

 var fourByteDirectoryService = new FourByteDirectoryService();
var signature = await fourByteDirectoryService.GetFunctionSignatureByHexSignatureAsync("0x722713f7");

Commits:
226371c, 96290cf, 0fbcfa0, 4868317,

Nethereum.ABI

  • Fix Decoding, multidimentional array of structs of non dynamic structs will only decode first element as it needed to be initialise by iterating all the types. 929c336
  • Compilation metadata parsing and objects
  • Extensions to ABI Model (FunctionABI, EventABI, ErrorABI) to simplify decoding, selection and finding
  • AbiInfo, AbiInfoStorage and AbiInfoInMemoryStorage to maintain in memory or externally abi information.
  • Extensions to Transactions, Logs, RpcException to find FunctionAbis, EventAbis and ErrorAbis and facilitate decoding
    Commits:
  • 6847eb7, 657390b, 04e9494, 8464988, b5a82f4, 4a92caf

Nethereum.EVM

Adding revert message to Evm simulator
Commit: 9d3ce60

 var transactionHash = "0xf3d2a323110370a4dc72c04c738bf9b45d14b03603ed70372128a3966c54fca6";

            var web3 = _ethereumClientIntegrationFixture.GetInfuraWeb3(InfuraNetwork.Mainnet);
            var txn = await web3.Eth.Transactions.GetTransactionByHash.SendRequestAsync(transactionHash);
            var txnReceipt = await web3.Eth.Transactions.GetTransactionReceipt.SendRequestAsync(transactionHash);
            var block = await web3.Eth.Blocks.GetBlockWithTransactionsHashesByNumber.SendRequestAsync(txn.BlockNumber);
            var code = await web3.Eth.GetCode.SendRequestAsync(txn.To); // runtime code;
            Program program = await ExecuteProgramAsync(web3, txn, block, code, null);
            Assert.NotNull(program.ProgramResult.GetRevertMessage());

Nethereum.RPC

Bath requests added to common rpc methods
EthGetBlockWithTransactionsHashesByHash, EthGetBlockWithTransactionsByNumber, EthGetBlockWithTransactionsHashesByNumber, EthGetBalance, EthCall, EthGetTransactionByHash, EthGetTransactionReceipt, have now SendBatchRequestAsync included with an array of parameters

Commit: b031a3b

Nethereum.Contracts

MultiQueryBatchRpcHandler creates a multi query handler, to enable execute a single request combining multiple queries to multiple contracts using rpc batches

This uses the same IMulticallInputOutput as per the contract multiquery enabling to easily switch between them (although the contract version can handle errors in the calls)

//Connecting to Ethereum mainnet using Infura
            var web3 = _ethereumClientIntegrationFixture.GetInfuraWeb3(InfuraNetwork.Mainnet);

            //Setting the owner https://etherscan.io/tokenholdings?a=0x8ee7d9235e01e6b42345120b5d270bdb763624c7
            var balanceOfMessage1 = new BalanceOfFunction()
            { Owner = "0x5d3a536e4d6dbd6114cc1ead35777bab948e3643" }; //compound
            var call1 = new MulticallInputOutput<BalanceOfFunction, BalanceOfOutputDTO>(balanceOfMessage1,
                "0x6b175474e89094c44da98b954eedeac495271d0f"); //dai

            var balanceOfMessage2 = new BalanceOfFunction()
            { Owner = "0x6c6bc977e13df9b0de53b251522280bb72383700" }; //uni
            var call2 = new MulticallInputOutput<BalanceOfFunction, BalanceOfOutputDTO>(balanceOfMessage2,
                "0x6b175474e89094c44da98b954eedeac495271d0f"); //dai

            await web3.Eth.GetMultiQueryBatchRpcHandler().MultiCallAsync(call1, call2);
            Assert.True(call1.Output.Balance > 0);
            Assert.True(call2.Output.Balance > 0);

Full Changelog: 4.15.0...4.16.0

Unity Package (.net472 AOT)

You can now use the latest release directly from a package in this repository: https://github.com/Nethereum/Nethereum.Unity

Unity DLLs (attached)

net472UnityCommonAOT Includes all the Common used net472 AOT dlls, if you need extra libraries just copy them from net472dllsAOT.
net472dllsAOT: Includes all the net472 AOT dlls, this includes libraries like Nethereum.Geth, Nethereum.Besu etc that are not Common

netStandardMinimalWebglUnityAOT Includes a minimal set of netStandard dlls to work with webgl, it excludes libraries like Nethereum.Web3 and Nethereum.JsonRpc.RpcClient which cannot be used in webgl but instead is required to use Nethereum.Unity with coroutines.
netStandardCommonUnityAOT Includes all the Common dlls / libraries used in netstandard AOT, if you need extra libraries just copy them from netStandardUnityCommonAOT.
netStandardUnityCommonAOT Includes all the netstandard AOT dlls, this includes libraries like Nethereum.Geth, Nethereum.Besu etc that are not Common, this may include duplicated libraries like UnityEngine or Newtonsoft.Json.dll

net461dllsAOT Includes all the net461 AOT dlls, this includes libraries like Nethereum.Geth, Nethereum.Besu etc that are not Common, this may include duplicated libraries like UnityEngine or Newtonsoft.Json.dll

4.15.2 ☀️☀️🍞🍞

11 Jul 11:14
Compare
Choose a tag to compare

Nethereum.RPC.Extensions

New RPC Extensions package, adding support initially to development nodes like Ganache, Hardhat and Anvil custom RPC methods.

Usage:

  1. Add the package Nethereum.RPC.Extensions
  2. Add the using statement csharp using Nethereum.RPC.Extensions;
  3. In web3.Eth you can access the extensions as follow:
var incresedBlockNumber = await web3.Eth.Hardhat().IncreaseTimeAsync(1); //hardhat
await web3.Eth.Anvil().ImpersonateAccount.SendRequestAsync("xxxx"); //anvil same as hardhat
await web3.Eth.DevToolsEvm().SetNextBlockTimestamp.SendRequestAsync(); //Ganache Evm included in DevToolsEvm.

Commits:
5bf06fc, cfd9eb3, d9f7404, 62ac612, a6050df

Nethereum.EVM.Contracts

New Package to enable the simulation of specific contracts currently for ERC20 using the Nethereum EVM https://www.nuget.org/packages/Nethereum.EVM.Contracts

Example usage:

 [Fact]
        public async void ShouldCalculateBalanceSlot()
        {
            var web3 = _ethereumClientIntegrationFixture.GetInfuraWeb3(InfuraNetwork.Mainnet);
            var contractAddress = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
            var senderAddress = "0x0000000000000000000000000000000000000001";
            var simulator = new Nethereum.EVM.Contracts.ERC20.ERC20Simulator(web3, 1, contractAddress);
            var slot = await simulator.CalculateMappingBalanceSlotAsync(senderAddress, 100);
            Assert.Equal(9, slot);
        }

        [Fact]
        public async void ShouldSimulateTransferAndBalanceState()
        {
            var web3 = _ethereumClientIntegrationFixture.GetInfuraWeb3(InfuraNetwork.Mainnet);
            var contractAddress = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
            var senderAddress = "0x0000000000000000000000000000000000000001";
            var receiverAddress = "0x0000000000000000000000000000000000000025";
            var simulator = new Nethereum.EVM.Contracts.ERC20.ERC20Simulator(web3, 1, contractAddress);
            var simulationResult = await simulator.SimulateTransferAndBalanceStateAsync(senderAddress, receiverAddress, 100);
            Assert.Equal(simulationResult.BalanceSenderAfter, simulationResult.BalanceSenderBefore - 100);
            Assert.Equal(simulationResult.BalanceSenderStorageAfter, simulationResult.BalanceSenderBefore - 100);
            Assert.Equal(simulationResult.BalanceReceiverAfter, simulationResult.BalanceReceiverBefore + 100);
            Assert.Equal(simulationResult.BalanceReceiverStorageAfter, simulationResult.BalanceReceiverBefore + 100);

        }

Commits: 15c4b22, a3dc528,
3843f7d

ENS Normalisation changes ENSIP-15

Full support of ENSIP-15 by replacing implementation used with IdnMapping in System.Globalization with the new package created by @adraffy AdRaffy.EnsNormalise, which also enables ENS normalisation support for older frameworks like netstandard1.1 and net35.

Commits: 2ebbd8a, 14f75dc

Other changes:

  • AbiEncode helper methods to decode data
    Commit: db90655
  • Decimal usage instead of doubles when doing calculations, this fixes possible issues with TimePreferenceCalculation:
    Commit: 8cbd94a
  • Code generation updates (Javascript)
    Commit: 709130e
  • ENS Reverse resolve and contenthash use the common method ResolveAsync>
    Commit: ab5a3d5
  • Push0 EVM Similator
    Commit: fcb65d3
  • Add recover from signature with non standard json by @JuanuMusic in #952
  • Unity double to decimal Commit: f7f729d
  • Unity Contract UnityRequests exposing IUnityRpcRequestClientFactory Commit: 0a5c08f

Full Changelog: 4.14.0...4.15.0

4.14.0 ☀️☀️🍞🍞

20 Mar 14:35
Compare
Choose a tag to compare

ENS Wilcard CCIP Read

Commits: 0c87c34, a375d5a

Rpc updates

  • SwitchEthereumChain thanks to @youtpout
  • Block DTO changes to include (validator) Withdrawal merkle root and Withdrawal objects
    Commits: 9edea65, 77856f4

Nethereum UI, Metamask and Metamask Unity changes

  • Metamask Unity rename objects to include Webgl Coroutine or Task to avoid confusion. (breaking change)
  • Metamask Interceptor adding support to intercept only Signing / Wallet and Transaction methods, as an example this will enable the Metamask Unity Sdk to be used only to sign and transactions or if wanted in webgl / blazor
  • Metamask Host Provider adding to support to instantiate with a Rpc client, previously it will create a default client as other methods will not use any existing client.
  • Decoupling of the interceptor to the host provider, so the interceptor can live on its own without the top abstraction. There will be scenarios a user is only interested on MM as an interceptor as opposed to have a top abstraction to switch between providers.

Commits: 82e9bce, 2a033e8, 82d86a8,
b353706,
f34937f

Template samples changes and upgrades:

Nethereum.Templates.Pack: 2.0 Includes all the new updates for SmartContract, OpenZeppelin, Blazor and Siwe https://github.com/Nethereum/Nethereum.Templates.Pack and nuget: https://www.nuget.org/packages/Nethereum.Templates.Pack/
SmartContract Template: (Included in the pack) Upgrade to the latest version
https://github.com/Nethereum/Nethereum.Templates.SmartContractDefault
Erc721, 1555 Open Zeppelin Template: (Included in the pack) Upgrade to the latest version
https://github.com/Nethereum/Nethereum.Templates.SmartContracts.OZ-Erc721-Erc1155
Blazor Metamask: (Included in the pack) Changes on dependency injection, package upgrade and small fix https://github.com/Nethereum/Nethereum.Templates.Metamask.Blazor
Blazor Siwe: (Included in the pack) Changes on dependency injection, package upgrade https://github.com/Nethereum/Nethereum.Templates.Siwe

Unity3d Sample Template: Includes now Web3 / Task samples, ERC20 samples as these can work now in WebGL and all the changes for Nethereum UI / Unity https://github.com/Nethereum/Unity3dSampleTemplate
Unity3d WebGl Template: Upgrade to new version

Full Changelog: 4.13.0...4.14.0

Unity DLLs (attached)

net472UnityCommonAOT Includes all the Common used net472 AOT dlls, if you need extra libraries just copy them from net472dllsAOT.
net472dllsAOT: Includes all the net472 AOT dlls, this includes libraries like Nethereum.Geth, Nethereum.Besu etc that are not Common

netStandardMinimalWebglUnityAOT Includes a minimal set of netStandard dlls to work with webgl, it excludes libraries like Nethereum.Web3 and Nethereum.JsonRpc.RpcClient which cannot be used in webgl but instead is required to use Nethereum.Unity with coroutines.
netStandardCommonUnityAOT Includes all the Common dlls / libraries used in netstandard AOT, if you need extra libraries just copy them from netStandardUnityCommonAOT.
netStandardUnityCommonAOT Includes all the netstandard AOT dlls, this includes libraries like Nethereum.Geth, Nethereum.Besu etc that are not Common, this may include duplicated libraries like UnityEngine or Newtonsoft.Json.dll

net461dllsAOT Includes all the net461 AOT dlls, this includes libraries like Nethereum.Geth, Nethereum.Besu etc that are not Common, this may include duplicated libraries like UnityEngine or Newtonsoft.Json.dll

4.13.0 ☀️☀️🍞🍞

18 Feb 08:58
Compare
Choose a tag to compare

Nethereum.Merkle

  • Generic Merkle trie
  • Includes strategy to concatenate pairs (sorted or normal)
  • HashProvider using Keccack sha3
  • ByteConvertors for char, string, byte array and Abi encoded either normal or packed
  • AbiStructMerkleTree uses Sha3 AbiEncodedPacked and sorted pair strategy
  • MerkleDropTree same as AbiStructMerkleTree but using MerkleDropItem which includes the receiver and the amount
  • Integration tests (contract using OZ merkle utils that demonstrates using a merkle drop and AbiStructMerkleTree one to verify and claim a drop and the latter to verify that a payment is included in the root provided)

Commits: 0796f97 0d07bb4

Nethereum.Merkle.PatriciaTrie

  • Patricia Trie for chain proof verification to enable to validate the state and root using data from different rpc nodes or root sources (ie etherscan)
  • EthChainProofValidationService New rpc service to retrieve AccountProofs / State validate the data using the root
  • Also provide transaction root validation and retrieval using a specific block
  • New mappers from RPC to Model to enable rlp building, recovery or merkle validation.

Commits: 485986e c521c3d f282972

Signed Transactions (Legacy, 1559, ChainId) moved to Nethereum.Model

Breaking change:

  • All the signed transaction objects moved to the Nethereum.Model to enable the RLP encoding and decoding to be decoupled of the Nethereum.Signers
  • Added new TypedTransctionSigner and Transaction1559Signer
  • Reconstruction of EthEcKey via recovery can be done now using the extensions EthECKeyBuilderFromSignedTransaction, this is an extension to avoid major disruption
  • V calculations are now part the model with VRecoveryAndChainCalculations
  • A new generic Signature class is used in the Model instead of EthECDSASignature
    Commit: 852cbc4

Metamask Unity Webgl Web3 / interceptor / host provider support

  • Added support for Metamask to work in Unity using Web3 with an interceptor the same as in Blazor.
  • MetamaskWebGlHostProvider.CreateOrGetCurrentInstance() will create a new instance.
  • MetamaskTaskRequestInterop provides the IMetamaskInterop implementation to be used with the Host / Web3 for interception, including callbacks for SelectedNetworkChanged and SelectedAccountChanged which will use the webgl host to raise events synchronously

Commits:
937f1da

UnityWebRequestRpcTaskClient

  • UnityWebRequestRpcTaskClient to use together with Web3 and UnityWebRequest instead of System Http. This enables to use all the functionality of Nethereum without using coroutines, if working on webgl you will require the WebGLThreadingPatcher

This requires to use the extension WebGLThreadingPatcher https://github.com/VolodymyrBS/WebGLThreadingPatcher Thanks to the great job of @VVolodymyrBS. There is a new updated preview template on https://github.com/Nethereum/Unity3dSampleTemplate

Commits:
3bca871

Other changes

  • added interval parameter with 0 as default for wait a interval of ms between blocks. by @Magehernan in #913
  • Fix typo in mnemonic var names and references by @kPatch in #912

Other Fixes Additions.. TBC

Full Changelog: 4.12.0...4.13.0

4.12.0 ☀️☀️🍞🍞

09 Dec 16:39
Compare
Choose a tag to compare

EVM Simulator RC2

  • Refactored evm execution instructions and fixes (operations back to twos complements, encoding / decoding unsigned, bitwise bytes when needed, precompiled contracts)
    Tests using full stack trace matching for some common contracts uniswap v2, v3, curve and opensea (These stack traces are matched to the ones of Remix ❤️)
    Commit: d71aaa8
  • More tests: Matched to the extended evm-dafny tests Commit: 74bfba3
  • DebugStorageRangeAt support to enable simulation of an existing transactions (needs an archive node that supports it) Commit: b1d0d3b
  • SourceMap initial support, Commits: 0b288ab 1ce92ee
  • Inner program instructions to enable tracing source across different calls. Commit: d01edb4

Hardware Wallets

  • Update to the latest version of Ledger.Net and Trezor.Net, allowing to target more platforms thanks to the great work of @MelbourneDeveloper with his other project Device.Net https://github.com/MelbourneDeveloper/Device.Net
  • Added support to 1559 to Ledger and Trezor
  • Also added support for big payloads to both
  • Support for chains with larger number for Ledger
  • Created Nethereum Brokers and Factories.

Commits: 64b70c8 d17378b 6cac70c fa08c26
2c4f1e8

Other changes

  • Accounts Basic Account, an Account that not requires a private key (and is not managed) to interact with Rpc simulators or already unlocked chains. Commit: 7aa2b5e
  • 712 Signing Enable the signing of streamlined (non standard) EIP712 Json message that includes only one type (not the domain), not a primary type and a different message selector
    Commit: 330bab3
  • ABI Json Encoding
    When generating json, or using it as an input if the Abi does not include a parameter name it will use the format "param_" + parameter.Order + "_" + parameter.Type
    6b915ad
  • SIWE Recap Functionality by @jaerith in #899
  • Code generator Include Errors that don't have parameters. Commit: 1a355ee
  • Metamask Serialization of json to not include null values (used the json one)
  • IPFS Adding "cat" to the minimal IPFS http service.

Full Changelog: 4.11.0...4.12.0
Nuget Web3: https://www.nuget.org/packages/Nethereum.Web3
All Nugets: https://www.nuget.org/profiles/nethereum

Unity DLLs (attached)

net472UnityCommonAOT Includes all the Common used net472 AOT dlls, if you need extra libraries just copy them from net472dllsAOT.
net472dllsAOT: Includes all the net472 AOT dlls, this includes libraries like Nethereum.Geth, Nethereum.Besu etc that are not Common

netStandardMinimalWebglUnityAOT Includes a minimal set of netStandard dlls to work with webgl, it excludes libraries like Nethereum.Web3 and Nethereum.JsonRpc.RpcClient which cannot be used in webgl but instead is required to use Nethereum.Unity with coroutines.
netStandardCommonUnityAOT Includes all the Common dlls / libraries used in netstandard AOT, if you need extra libraries just copy them from netStandardUnityCommonAOT.
netStandardUnityCommonAOT Includes all the netstandard AOT dlls, this includes libraries like Nethereum.Geth, Nethereum.Besu etc that are not Common, this may include duplicated libraries like UnityEngine or Newtonsoft.Json.dll

net461dllsAOT Includes all the net461 AOT dlls, this includes libraries like Nethereum.Geth, Nethereum.Besu etc that are not Common, this may include duplicated libraries like UnityEngine or Newtonsoft.Json.dll

Note: If you need the net351 dlls for older versions of unity, please let us know in discord.