remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
remix-project/apps/contract-verification
Manuel Wedler 1f19d74613 New icon for verification plugin 3 weeks ago
..
src New icon for verification plugin 3 weeks ago
.babelrc Modify .prettierrc and prettify `contract-verification-plugin` folder 4 months ago
.browserslistrc
.eslintrc Modify .prettierrc and prettify `contract-verification-plugin` folder 4 months ago
.eslintrc.json
README.md Verification plugin: Add simple documentation on how to add a new verifier 4 weeks ago
project.json
tsconfig.app.json
tsconfig.json Move default api urls to a json structure 4 months ago
webpack.config.js Update webpack.config.js 3 weeks ago

README.md

Contract Verification Plugin

With this plugin, contracts written and compiled in Remix can be verified at Sourcify, Etherscan, Blockscout and Routescan at the same time. Besides that, the source code of any address can be fetched from the verifiers and added to the file editor.

Adding a new verification service

Currently, the plugin supports Sourcify, Etherscan, Blockscout and Routescan. To add a new verifier, you need to make the following changes:

In ./src/app/types/VerificationTypes.ts, add the new verifier to the VerifierIdentifier type and theVERIFIERS array.

In order to interact with the API of the verification service, you need to create a new class that extends the AbstractVerifier class. If your API is based on the Etherscan API, you can simply extend the EtherscanVerifier class. In this case, see the RoutescanVerifier and the BlockscoutVerifier for reference. All related classes are located in the ./src/app/Verifiers directory.

In ./src/app/Verifiers/index.ts, add your new verifier to the getVerifier function. Validate any settings properties that are required by your verifier.

In ./src/app/utils/default-apis.json, you need to add default settings for your new verifier. If you can, simply add your defaults in the form of { [VerifierIdentifier]: { [chainId]: { apiUrl: [value], explorerUrl: [value] } } }. If you need more flexibility, you might also want to change the src/app/utils/default-settings.ts file. See Routescan there for reference.

Your new verifier will automatically be shown in the VerifyView and the LookupView since we added it to the VERIFIERS array. You only need to make a change to the SettingsView because the required settings depend on the verifier. There, add a new div block in the same format as the other verifiers. Only add the ConfigInput elements for the settings that your verifier needs to the div block.

That's it! Your verification service should be able to verify contracts through Remix now.