Skip to content

Instantly share code, notes, and snippets.

View anegg0's full-sized avatar

Gaël Blanchemain anegg0

View GitHub Profile
@anegg0
anegg0 / index.html
Created July 21, 2023 22:15
Terminal Output
<pre><output>webpack: Compiled successfully.
webpack: Compiling...
Hash: 33d8c38093d5e8261eac
Version: webpack 3.11.0
Time: 1337ms
Asset Size Chunks Chunk Names
project.js 12.3 MB 0 [emitted] [big] project
dashboard.js 6.36 MB 1 [emitted] [big] dashboard
organize.js 5.29 MB 2 [emitted] [big] organize
proPens.js 4.92 MB 3 [emitted] [big] proPens

Using Receipt Status

Since the Byzantium fork, Ethereum provides with a way to know if a transaction succeeded by checking its receipt status. A receipt status can have a value of 0 or 1 which translate into:

  • 0 transaction has failed (for whatever reason)

  • 1 transaction was succesful.

How to retrieve a transaction status with Nethereum

Estimating the cost of a transaction with Nethereum

Documentation about Nethereum can be found at: https://docs.nethereum.com

The purpose of this sample is to estimate the gas cost of a simple transaction and modify the assigned values of gas and gasprice.

Ethereum and Gas: a primer

Gas is the pricing system used for running a transaction or contract in Ethereum. The gas system is not very different from the use of kW-h for measuring electricity home use. One difference from actual energy market is that the originator of the transaction sets the price of gas, which the miner can accept or not, this causes an emergence of a market around gas. You can see the evolution of the price of gas at: .

@anegg0
anegg0 / multiple.cs
Last active November 25, 2019 16:06
multiple balance outputs
using Nethereum.Web3;
using Nethereum.ABI.FunctionEncoding.Attributes;
using Nethereum.Contracts.CQS;
using Nethereum.Util;
using Nethereum.Web3.Accounts;
using Nethereum.Hex.HexConvertors.Extensions;
using Nethereum.Contracts;
using Nethereum.Contracts.Extensions;
using Nethereum.RPC.Eth.DTOs;
using System;
uusing Nethereum.Web3;
using System;
using Nethereum;
using Nethereum.Web3;
using System.Threading;
using System.Threading.Tasks;
using Nethereum.Web3.Accounts;
using Nethereum.Web3.Accounts.Managed;
public class LogProcessing_WithInDepthConfiguration
@anegg0
anegg0 / coin
Created October 24, 2019 21:55
Bytecode representation of a subcurrency smart contract
608060405234801561001057600080fd5b50600080546001600160a01b03191633179055610288806100326000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c8063075461721461005157806327e235e31461007557806340c10f19146100ad578063d0679d34146100db575b600080fd5b610059610107565b604080516001600160a01b039092168252519081900360200190f35b61009b6004803603602081101561008b57600080fd5b50356001600160a01b0316610116565b60408051918252519081900360200190f35b6100d9600480360360408110156100c357600080fd5b506001600160a01b038135169060200135610128565b005b6100d9600480360360408110156100f157600080fd5b506001600160a01b038135169060200135610186565b6000546001600160a01b031681565b60016020526000908152604090205481565b6000546001600160a01b0316331461013f57600080fd5b789f4f2726179a224501d762422c946590d91000000000000000811061016457600080fd5b6001600160a01b03909116600090815260016020526040902080549091019055565b336000908152600160205260409020548111156101e2576040805162461bcd60e51b815260206004820152601560248201527424b739bab33334b1b4b2b73a103130b630b731b2
@anegg0
anegg0 / coin.json
Last active October 24, 2019 21:48
Json representation of a subcurrency smart contract
{
"contractName": "Coin",
"abi": [
{
"constant": true,
"inputs": [],
"name": "minter",
"outputs": [
{
"internalType": "address",

Keybase proof

I hereby claim:

  • I am anegg0 on github.
  • I am anegg0 (https://keybase.io/anegg0) on keybase.
  • I have a public key ASAR5ULncP63K6rkKv60Yg8qGoHcfSIQYq6kLJ610JS11Ao

To claim this, I am signing this object:

3Box is a social profiles network for web3. This post links my 3Box profile to my Github account!
✅ did:muport:QmNwij7C1QG9jiRoWsCS696hrXvFbQjRJp7Zf6KpyHtwPa ✅
Create your profile today to start building social connection and trust online. https://3box.io/
@anegg0
anegg0 / smartContractData.csx
Created February 26, 2019 16:59
Nethereum Workbooks Boilerplate Code
#r "Nethereum.Web3"
#r "Nethereum.Accounts"
using Nethereum.Web3;
using Nethereum.ABI.FunctionEncoding.Attributes;
using Nethereum.Contracts.CQS;
using Nethereum.Util;
using Nethereum.Web3.Accounts;
using Nethereum.Hex.HexConvertors.Extensions;