Git Product home page Git Product logo

erc721-validator's People

Contributors

leonpanjtar avatar momannn avatar xpepermint avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

erc721-validator's Issues

the check for balanceOf(0) does not seem to detect revert

I have an ERC721 contract on the mainnet at : 0x266003AfA9976D72565cac0bd840C276b01aE34f

and when I test it against the validator at https://erc721validator.org/?address=0x266003AfA9976D72565cac0bd840C276b01aE34f
It shows that balanceOf(address(0)) does not throw/

But when I execute the eth_call myself to an infura node with

{
	"jsonrpc": "2.0",
	"id": 1,
	"method": "eth_call",
	"params": [{
		"to": "0x266003AfA9976D72565cac0bd840C276b01aE34f",
		"data": "0x70a082310000000000000000000000000000000000000000000000000000000000000000"
	}, "latest"]
}

It gives me

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000156f776e6572206973207a65726f20616464726573730000000000000000000000"
}

which is a revert-reason string so the call indeed revert

In comparison the 0xcert implementation when called with the same request,

{
	"jsonrpc": "2.0",
	"id": 1,
	"method": "eth_call",
	"params": [{
		"to": "0xf176d7bcdD07f8e474877095870685Ef0CCcCb2D",
		"data": "0x70a082310000000000000000000000000000000000000000000000000000000000000000"
	}, "latest"]
}

I get

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x"
}

which is also the response (albeit different) corresponding to a revert/throw

Maybe it is the web3 estimateGas call that does not error out here :
https://github.com/0xcert/erc721-validator/blob/master/src/validator.ts#L47

because it does not consider the error-reason string as an error
See also ethereum/go-ethereum#19027

Make your own test case

Use an input box to have the user paste in solidity code. Provide a few example snippets.

Sample web page:


Custom test case (advanced)

Input your own Solidity code to create a custom test case which can be run against any smart contract. Read about how we run Solidity code against blockchain networks without committing transactions to the network here (LINK TO WILL+TADEJ PAPER).

[ BUTTON: Load example erc165 test case ]
[ BUTTON: Load hello world test case ]
[ BUTTON: Load erc20 symbol name test case ]

[ LARGE TEXT BOX WITH LAST TEST CASE PREFILLED ]

[ RUN TEST CASE ]


Note: the test cases are going to have an `import "http:... /oxcertvalidator/testcase.sol" at the top.

After clicking submit: use soljs to compile and run the code like f-- magic. Then send the byte code to REST backend to run the test case.


Test case results:

Test case ran with a gas limit of XXXX. Total gas consumed XXX. Test did NOT revert.

If your test case is awesome, open an issue HERE and we can add it into the validator!

Link to paper

Tadej and I will write a paper on this technique (announced at NIFTY).

Add a link to the README.md so people can be notified when this paper drops.

Testnet contracts

Would it be possible to make this available for testnet contracts?

Support URL query

We would like a specific URL, including a query string, to correspond to a specific scan.

This project is really great and we should expect that people are going to want to directly link to test results.

Work plan

Follow on work

  • Generate a list of tests we have performed and give the links to #marketing

Validor

0x7a70Aae32509fd8004F7f3d2Ec24F35c396fC62C

Select network

Currently the deployed validator only works for main net. Please add options to run on other networks and add a dropdown / radio box selector for at least ROPSTEN and RINKSBY.

Priority: medium


If this cannot be complete before presentation then at a minimum we must update the website to note this is working for ethereum main net.

Review popular contracts

Here are some projects, please find ALL deployed 721 or notable 721 contracts and validate them. Paste in here the list of all issues that are found.

Due date Tue July 24th.

Follow on work

  • Send to 0xcert #marketing

web3.eth.Contract is not a constructor

I'm getting

web3.eth.Contract is not a constructor

at line 40 of validator.ts

I've read that you don't need "new" in front the constructor, but this is only with web3 versions <1

I tried to fork the package but then I get this error during my build 😅 :

This dependency was not found:

  • @0xcert/erc721-validator in ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./pages/settings.vue?vue&type=script&lang=js&

Any help is greatly appreciated!

Reorder front end to collect smart contract address first

Currently, the tool only validates ERC-721 contracts. We will expand the scope of the project, so the UI should also be compatible with doing multiple test suites.

New web page format follows:


Smart Contract Validator

This validator tests blockchain smart contracts for known vulnerabilities and conformance to published standards, including ERC-721 Non-Fungible token standards.

INPUT A VALID CONTRACT ADDRESS:

[ INPUT: ADDRESS ]

SELECT A NETWORK:

[ DROP DOWN:
🔳 Ethereum MAINNET 🔲 Ethereum ROPSTEN 🔲 Ethereum RINKEBY 🔲 Wanchain MAINNET (coming soon)
]

[ BUTTON: START VALIDATOR ]


AFTER CLICKING START VALIDATOR...


A smart contract exists at address, it is XXXX bytes.

The contract supports the following known interfaces (testing with ERC-165):

[ A bunch of labels. Supported interfaces are lit up and show first. Other interfaces are dim and shown after ]

Choose test suites to perform:

  • ERC-721 Non-fungible token
  • ERC-20 Token (COMING SOON)
  • ERC-777 Token (COMING SOON)
  • Known Solidity bugs (COMING SOON)
  • Make your own test case (COMING SOON)

[ BUTTON: VALIDATE ]


AFTER CLICKING VALIDATE...


Same output as current

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.