nibbstack / erc721-validator Goto Github PK
View Code? Open in Web Editor NEWERC721 smart contract validator
Home Page: https://erc721validator.org/
ERC721 smart contract validator
Home Page: https://erc721validator.org/
Move validator to validate.tools or some other general-purpose domain. Redirect existing site to there.
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
Use an input box to have the user paste in solidity code. Provide a few example snippets.
Sample web page:
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 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!
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.
DO IT NOW.
THEN POST HERE https://twitter.com/VitalikButerin/status/1075181710730506240
Would it be possible to make this available for testnet contracts?
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.
0x7a70Aae32509fd8004F7f3d2Ec24F35c396fC62C
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.
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.
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!
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:
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:
[ BUTTON: VALIDATE ]
AFTER CLICKING VALIDATE...
Same output as current
🚨 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.
When I try to validate any address I get this error: "Unable to connect with a server. Check your internet connection."
My internet connection is fine.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.