Go implementation of the Ethereum protocol
Find a file
Daniel Liu 05a9e91898
cmd/abigen, accounts/abi/bind: implement abigen version 2 #31379 (#1416)
This PR implements a new version of the abigen utility (v2) which exists
along with the pre-existing v1 version.

Abigen is a utility command provided by go-ethereum that, given a
solidity contract ABI definition, will generate Go code to transact/call
the contract methods, converting the method parameters/results and
structures defined in the contract into corresponding Go types. This is
useful for preventing the need to write custom boilerplate code for
contract interactions.

Methods in the generated bindings perform encoding between Go types and
Solidity ABI-encoded packed bytecode, as well as some action (e.g.
`eth_call` or creating and submitting a transaction). This limits the
flexibility of how the generated bindings can be used, and prevents
easily adding new functionality, as it will make the generated bindings
larger for each feature added.

Abigen v2 was conceived of by the observation that the only
functionality that generated Go bindings ought to perform is conversion
between Go types and ABI-encoded packed data. Go-ethereum already
provides various APIs which in conjunction with conversion methods
generated in v2 bindings can cover all functionality currently provided
by v1, and facilitate all other previously-desired use-cases.

To generate contract bindings using abigen v2, invoke the `abigen`
command with the `--v2` flag. The functionality of all other flags is
preserved between the v2 and v1 versions.

The execution of `abigen --v2` generates Go code containing methods
which convert between Go types and corresponding ABI-encoded data
expected by the contract. For each input-accepting contract method and
the constructor, a "packing" method is generated in the binding which
converts from Go types to the corresponding packed solidity expected by
the contract. If a method returns output, an "unpacking" method is
generated to convert this output from ABI-encoded data to the
corresponding Go types.

For contracts which emit events, an unpacking method is defined for each
event to unpack the corresponding raw log to the Go type that it
represents.

Likewise, where custom errors are defined by contracts, an unpack method
is generated to unpack raw error data into a Go type.

For a smooth user-experience, abigen v2 comes with a number of utility
functions to be used in conjunction with the generated bindings for
performing common contract interaction use-cases. These include:

* filtering for historical logs of a given topic
* watching the chain for emission of logs with a given topic
* contract deployment methods
* Call/Transact methods

https://geth.ethereum.org will be updated to include a new tutorial page
for abigen v2 with full code examples. The page currently exists in a
PR: https://github.com/ethereum/go-ethereum/pull/31390 .

There are also extensive examples of interactions with contract bindings
in [test
cases](cc855c7ede/accounts/abi/bind/v2/lib_test.go)
provided with this PR.

---------

Co-authored-by: jwasinger <j-wasinger@hotmail.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-09-03 15:47:12 +08:00
.github devnet cicd selective deployment 2025-08-20 14:22:07 +04:00
accounts cmd/abigen, accounts/abi/bind: implement abigen version 2 #31379 (#1416) 2025-09-03 15:47:12 +08:00
assets/images update README and include a logo photo 2022-07-24 21:44:58 +10:00
beacon beacon/types: add beacon chain data types (#27292) 2024-12-28 09:06:31 +08:00
bmt crypto: switch over to upstream sha3 package (#18390) 2024-12-09 17:48:59 +08:00
build all: use common.FileExist for checking file existence #24748 (#1212) 2025-07-11 10:42:51 +08:00
cicd turn off personal, debug, shh apis by default 2025-06-26 11:36:53 +04:00
cmd cmd/abigen, accounts/abi/bind: implement abigen version 2 #31379 (#1416) 2025-09-03 15:47:12 +08:00
common revert reward v2 block number for testing backward compatitble (#1361) 2025-08-20 01:25:37 -07:00
consensus all: remove ethash pow 27178 (#1378) 2025-08-26 11:54:01 +08:00
console all: remove ethash pow 27178 (#1378) 2025-08-26 11:54:01 +08:00
containers/docker containers: drop vagrant support, noone's maintaining it 2018-03-14 13:23:40 +02:00
contracts all: use big.Sign to compare with zero #29490 (#1387) 2025-08-28 18:56:39 +08:00
core cmd/abigen, accounts/abi/bind: implement abigen version 2 #31379 (#1416) 2025-09-03 15:47:12 +08:00
crypto all: create global hasher pool #31769 (#1233) 2025-08-20 15:11:09 +08:00
docker all: normalize flag's name 2024-11-25 16:39:29 +08:00
docs internal/web3ext: remove deprecated method debug_seedHash (#1380) 2025-08-26 15:10:26 +08:00
eth all: mv loggers to eth/tracers #23892 (#1269) 2025-09-03 15:35:28 +08:00
ethclient ethclient/gethclient: use common.Hash to debug_traceTransaction #32404 (#1401) 2025-08-31 15:55:06 +08:00
ethdb core, ethdb, tests, trie: implement NewBatchWithSize API for batcher #24392 (#1085) 2025-06-17 13:26:50 +08:00
ethstats all: simplify timestamps to uint64 #19372 (#1318) 2025-08-08 10:33:37 +08:00
event all: fix staticcheck warning ST1006: don't use generic name self 2024-10-25 21:30:54 +08:00
genesis all: update parameters for rollback 2025-04-12 11:38:27 +08:00
internal internal: remove eth_{compile,getWork,submitWork} from console #31856 (#1408) 2025-09-03 15:41:09 +08:00
log log: fix issues with benchmarks (#30667) 2024-11-15 10:02:43 +08:00
metrics all: add build tags for wasip1 (#31090) 2025-03-19 18:02:46 +08:00
miner all: remove ethash pow 27178 (#1378) 2025-08-26 11:54:01 +08:00
node cmd, node, p2p: implement whitelist and blacklist for peers (#1331) 2025-08-20 15:14:56 +08:00
p2p cmd, node, p2p: implement whitelist and blacklist for peers (#1331) 2025-08-20 15:14:56 +08:00
params add syncinfo pool (#1236) 2025-07-28 01:43:41 -07:00
rlp rlp: refactor to use maths.ReadBits #32432 (#1405) 2025-09-03 15:38:55 +08:00
rpc rpc: refactor read limit test #32494 (#1412) 2025-09-03 15:44:04 +08:00
swarm all: use errrors.New instead of empty fmt.Errorf 2024-06-14 19:19:21 +08:00
tests all: update dead wiki links #32215 (#1409) 2025-09-03 15:41:48 +08:00
trie core, eth, trie: use TryGetAccount to read what TryUpdateAccount has written #25458 (#1106) 2025-09-03 15:34:11 +08:00
XDCx core, eth, trie: use TryGetAccount to read what TryUpdateAccount has written #25458 (#1106) 2025-09-03 15:34:11 +08:00
XDCxDAO core, ethdb, tests, trie: implement NewBatchWithSize API for batcher #24392 (#1085) 2025-06-17 13:26:50 +08:00
XDCxlending core, eth, trie: use TryGetAccount to read what TryUpdateAccount has written #25458 (#1106) 2025-09-03 15:34:11 +08:00
.dockerignore dockerignore, internal/build: forward correct git folder 2017-11-12 22:52:41 +02:00
.gitattributes FIx Bad block error. 2021-09-17 17:59:06 +05:30
.gitignore build: support golangci-lint v1.63.4 2025-01-11 23:56:59 +08:00
.golangci.yml build: support golangci-lint v1.63.4 2025-01-11 23:56:59 +08:00
COPYING all: update license information 2015-07-07 14:12:44 +02:00
COPYING.LESSER all: update license information 2015-07-07 14:12:44 +02:00
Dockerfile fix docker build warning 2025-03-31 06:03:42 +04:00
Dockerfile.bootnode fix docker build warning 2025-03-31 06:03:42 +04:00
Dockerfile.node fix docker build warning 2025-03-31 06:03:42 +04:00
go.mod cmd/abigen, accounts/abi/bind: implement abigen version 2 #31379 (#1416) 2025-09-03 15:47:12 +08:00
go.sum cmd/abigen, accounts/abi/bind: implement abigen version 2 #31379 (#1416) 2025-09-03 15:47:12 +08:00
interfaces.go ethclient: fix unmarshaling of ethereum.SyncProgress #24199 (#1367) 2025-08-22 16:41:28 +08:00
Makefile Makefile: add devtools and help targets, remove gc target 2025-04-07 16:38:00 +08:00
README.md docs: add document for JSONRPC API (#1027) 2025-05-19 15:30:52 +08:00

XDPoSChain

XinFin XDPoSchain
Enterprise ready hybrid blockchain for global trade and finance


XinFin Hybrid Blockchain

XinFin Hybrid Blockchain is an Enterprise ready Blockchain for global trade and finance

Visit: XinFin.org Contribute: Developer Docs

XinFin Network XDPoS is community driven project to achieve the following

  • XinFin DPOS (XDPoS) consensus that selects 108 set of Masternodes to achieve a high throughput Energy efficient consensus with instant block finality

  • KYC Enforcement on Masternodes for Enterprise Adoption and compliance

  • Ability to port/relay limited set of data and transactions from privacy channels to public channel

  • Interoperability between applications hosted on Private Blockchains like Corda, Hyperledger, Quorum(JP Morgan) using relayers to XinFin Network

  • Customer Centric and consortium driven Governance to equally benefit the validators as well as providing comfort for large scale enterprise applications to be hosted on the Network. This achieves

    • Rapid Upgradability

    • DApps Standardisation for rapid commercialisation

    • Compliance with major global jurisdictions.

KYC for masternodes

OVERVIEW

To add a layer of KYC for masternodes in the current system and a sense of ownership amongst the masternodes hence tying such a cluster of masternodes to physical entity which can held accountable for its actions.

Design

We established a bidirectional connection between a candidate and its owner inorder to retrieve a candidate belonging to a specific owner & vice versa.

All the masternodes are recognized by the KYC of their owners and hence are considered as a single verified entity ( for eg. while voting for invalid KYC, only one vote is considered per such cluster )

The contract is very strict in handing out penalty for invalid KYC, it results loss of all funds invested in all of its candidates.

For eg. say A proposes condidates B,C,D by paying for its proposal cost. If at a later stage if some predecided amount of owners ( investors ) vote that a KYC for a A is invalid then A & all of its candidates (B,C,D) will lose their position & all their funds will be lost ( will remain with contract wallet ).

Documents

Document

For developers

Continues integration & delivery

See https://github.com/XinFinOrg/XDPoSChain/tree/dev-upgrade/cicd

To contribute

Simple create a pull request along with proper reasoning, we'll get back to you.

Our Channels : Telegram Developer Group or XDC.Dev