| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Compile a Solidity contract, get a typed F# API for it — no codegen step, no hand-written DTOs.
SolidityProvider turns a contract's ABI into a typed F# API — deploy it, call its methods, decode its results and events — using an F# type provider that expands the members at compile time. No codegen step to rerun, no DTOs to hand-write; the moment the ABI changes, so does the type. Encoding, decoding and remote calls all go through Nethereum.
| Area | Technology |
|---|---|
| Language | F# (netstandard2.0 + net8.0) |
| Type provider host | FSharp.TypeProviders.SDK |
| Ethereum client | Nethereum 6.x |
| ABI parsing | System.Text.Json for artifact discovery, Newtonsoft.Json for Nethereum's ABI deserializer |
| Package management | Paket |
| Tests | xUnit |
| Compatible build tools | Hardhat, or anything producing Hardhat/Truffle-shaped artifact json |
flowchart LR
A[Solidity contract] -->|hardhat compile| B[ABI + bytecode json]
B --> C{SolidityProvider}
C -->|design time| D[Generated FooContract type]
D -->|ContractPlug| E[Nethereum]
E --> F[Ethereum JSON-RPC node]
type Contracts = AbiTypeProvider.AbiTypes<"./build/contracts">
let storageContract = Contracts.SimpleStorageContract(web3)
let getResult = storageContract.getQuery()
storageContract.set(newValue, weiValue 0UL, gasLlimit 8500000UL)Swap in AbiTypeProvider.AbiTypesFromHardhat<"./hardhat.config.js"> and it runs npx hardhat compile for you before generating types. An example project is in example/.
| Member | Behavior |
|---|---|
| fooQuery / fooQueryAsync | Read-only call, decoded to a .NET value |
| foo / fooAsync | State-changing call, returns a TransactionReceipt |
| fooData / fooTransactionInput | Raw calldata / an unsent TransactionInput |
| FooEventDTO.DecodeAllEvents | Decodes a receipt's logs into typed events |
Prerequisites: .NET 8 SDK (plus Node.js + npx for AbiTypesFromHardhat).
dotnet tool restore # installs the Paket bootstrapper
dotnet paket install # resolves NuGet dependencies
dotnet build -c Release
dotnet test tests/SolidityProviderTest/SolidityProviderTest.fsproj| Back | FazBrowse Home | New Git URL |