I need all Ethereum smart contracts

0 votes

The problem

I would like to get all ERC20 token smart contract bytecodes in Ethereum network.

The question

Is there a way to scan the blockchain for ERC20 smart contracts and/or scan an address for a [ERC20] smart contract?

Jun 16, 2018 in Blockchain by ariaholic
• 7,320 points
30 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Have a look at EIP165. It allows you some form of introspection wether an address offers a certain interface. Obviously this only works for contracts that at least implement ERC20 and EIP165.

How to detect if a contract implements ERC-165:

  1. The source contact makes a STATICCALL to the destination address with input data: 0x01ffc9a701ffc9a700000000000000000000000000000000000000000000000000000000 and gas 30,000. This corresponds to contract.supportsInterface(0x01ffc9a7).
  2. If the call fails or return false, the destination contract does not implement ERC-165.
  3. If the call returns true, a second call is made with input data 0x01ffc9a7ffffffff00000000000000000000000000000000000000000000000000000000.

  4. If the second call fails or returns true, the destination contract does not implement ERC-165. Otherwise it implements ERC-165.

How to detect if a contract implements any given interface:

  1. If you are not sure if the contract implements ERC-165, use the above procedure to confirm.
  2. If it does not implement ERC-165, then you will have to see what methods it uses the old-fashioned way.
  3. If it implements ERC-165 then just call supportsInterface(interfaceID) to determine if it implements an interface you can use.

answered Jun 16, 2018 by charlie_brown
• 7,710 points

Related Questions In Blockchain

+1 vote
1 answer

How to deploy ethereum smart contracts on a website?

There are many ways to do this: 1 ...READ MORE

answered Mar 26, 2018 in Blockchain by Johnathon
• 9,050 points
58 views
+15 votes
2 answers

What are the various blockchain smart contracts platforms?

While Ethereum is the most popular platform ...READ MORE

answered Mar 26, 2018 in Blockchain by Johnathon
• 9,050 points
97 views
+1 vote
2 answers

Can I include real world data in a smart contract? If so, how?

You cant access/embed real world data using ...READ MORE

answered Jul 17, 2018 in Blockchain by sapan
33 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
65 views
0 votes
1 answer
+1 vote
3 answers

Is it possible to store data about arbitrary objects on the blockchain using smart contracts?

Consider following tutorial from Hyperledger Fabric "Getting Started" pages. Basically ...READ MORE

answered Aug 30, 2018 in Blockchain by Artem
65 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.