0

https://learn.microsoft.com/en-us/nuget/quickstart/install-and-use-a-package-in-visual-studio

This says that nugets are codes other programmers have done for us.

I download a lot of nugets. Notably newtonsoft json and nethereum.

However, I can never see the code inside the objects I use.

For example,

Why I cannot send ftm with this simple code

The nethereum nugget thrown an exception. The most likely cause is I am using fantom blockchain that doesn't support some new ethereum feature.

However, I cannot step into nethereum codes and see that.

I wonder if I actually can do that.

Nethereum is open source.

Are all nugets open source?

In visual studio.

I can right click and go to definition. However I cannot see the implementation.

For example

Nethereum.RPC will look like this

#region Assembly Nethereum.RPC, Version=4.5.0.0, Culture=neutral, PublicKeyToken=8768a594786aba4e
// C:\Users\teguh\.nuget\packages\nethereum.rpc\4.5.0\lib\net5.0\Nethereum.RPC.dll
// Decompiled with ICSharpCode.Decompiler 7.1.0.6543
#endregion

using System.Collections.Generic;
using Nethereum.Hex.HexTypes;
using Newtonsoft.Json;

namespace Nethereum.RPC.Eth.DTOs
{
    public class TransactionInput : CallInput
    {
        [JsonProperty(PropertyName = "nonce")]
        public HexBigInteger Nonce { get; set; }

        [JsonProperty(PropertyName = "accessList")]
        public List<AccessList> AccessList { get; set; }

        public TransactionInput()
        {
        }

        public TransactionInput(string data, string addressTo)
            : base(data, addressTo)
        {
        }

        public TransactionInput(string data, string addressTo, HexBigInteger value)
            : base(data, addressTo, value)
        {
        }

        public TransactionInput(string data, string addressTo, string addressFrom, HexBigInteger gas, HexBigInteger value)
            : base(data, addressTo, addressFrom, gas, value)
        {
        }

        public TransactionInput(string data, string addressFrom, HexBigInteger gas, HexBigInteger value)
            : base(data, addressFrom, gas, value)
        {
        }

        public TransactionInput(string data, string addressTo, string addressFrom, HexBigInteger gas, HexBigInteger gasPrice, HexBigInteger value)
            : base(data, addressTo, addressFrom, gas, gasPrice, value)
        {
        }

        public TransactionInput(string data, HexBigInteger gas, string addressFrom)
            : base(data, gas, addressFrom)
        {
        }

        public TransactionInput(HexBigInteger type, string data, string addressTo, string addressFrom, HexBigInteger gas, HexBigInteger value, HexBigInteger maxFeePerGas, HexBigInteger maxPriorityFeePerGas)
            : base(data, addressTo, addressFrom, gas, value, type, maxFeePerGas, maxPriorityFeePerGas)
        {
        }
    }
}
#if false // Decompilation log

Just the interface. No implementation.

user4951
  • 32,206
  • 53
  • 172
  • 282

1 Answers1

1

You could use dnSpy to look inside the .dll which is located in the output directory after build.

https://github.com/dnSpy/dnSpy

Michael Santos
  • 466
  • 7
  • 15