question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adding a header to OpenZeppelin contracts

See original GitHub issue

🧐 Motivation

The contracts produced by the OpenZeppelin team are of high quality. So when I go Etherscan and check the source code of a verified contract, I tend to trust it more when I can see that it’s reusing OpenZeppelin implementations instead of reinventing the wheel. However, this is far from trivial to do. A lot of times I simply don’t know if a subcontract from a verified contract is coming from OpenZeppelin or not.

📝 Details

So my suggestion is very simple. I wonder if you could do two simple things:

  1. Adding a (comment) header to all OpenZeppelin contracts, which would include an explicit mention to the OpenZeppelin project and the corresponding version of the contract. Something like this:
/**
* @origin This subcontract was developed by the OpenZeppelin team.
* Location: contracts/token/ERC20/ERC20.sol. Version: v1-12-0
*/
  1. Since a verified contract is like a flattened version of the original source code, you guys could add delimiters at the beginning and end of your contracts. Something like this:
///////
[The header described above]
[The source code of the OpenZeppelin contract]
///////

With these two measures in place (header and delimiters), end-users would know exactly which subcontracts of a verified contract were reused from OpenZeppelin and their corresponding versions.

This feature request is related to #336 , but it is not the same thing. Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
Skygecommented, Apr 16, 2019

@frangio I have got to say please think about it seriously, I do not think this is a good idea, as a matter of fact, no matter who want to write a safe, effective and vulnerable-less contract, he/she will come here for some idea, but I think they will not use the contract directly, he/she will make some changes to satisfy their own requirements. yeah, he/she really uses most of the contract of OpenZeppelin, but it is precisely the changes he/she made that have led to fatal errors, so if you use most of contracts of OpenZeppelin, it does not mean it is safe. So the contract writer can make a comment: This subcontract was developed by the OpenZeppelin team. but the OpenZeppelin team can not. Please consider it seriously!

0reactions
frangiocommented, Apr 13, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

Contracts - OpenZeppelin Docs
A library for secure smart contract development. Build on a solid foundation of community-vetted code. Implementations of standards like ERC20 and ERC721.
Read more >
Header Sections - LEAP - #1 Sales Platform for Contractors
Adding headers to a document allow you to populate information on your documents including company information, customer information, company logos and ...
Read more >
OpenZeppelin Contracts Reviews & Ratings 2022 - TrustRadius
OpenZeppelin offers an Open Source library for smart contract development. OpenZeppelin Contracts powers over 3,000 public projects, with over 7,000 stars ...
Read more >
Web3 Tutorial: build DApp with Hardhat, React and Ethers.js
STEP 1: add a header component ... In Task 3, we will build ERC20 smart contract using OpenZeppelin ... yarn add @openzeppelin/contracts.
Read more >
solidity - Verifying a Contract on BSCScan.com - Stack Overflow
... should set a License header to your contract, so you need to add ... here: https://forum.openzeppelin.com/t/solidity-0-6-8-introduces- ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found