Openzeppelin-contracts: Fix code sample in Access Control guide

Created on 1 Aug 2019  路  4Comments  路  Source: OpenZeppelin/openzeppelin-contracts

On the Access Control guide for 2.x, the code snippet does not compile.

  • [x] DetailedERC20 in the constructor should be ERC20Detailed. (Fixed in #1792)
  • [x] minters and namers should be _minters and _namers. (Fixed in #1792)
  • [ ] The rename function attempts to change name and symbol, but these are private in ERC20Detailed and cannot actually be changed. A different example should be used instead.

(reported via Intercom)

bug documentation

Most helpful comment

Hello @ristosaar! Indeed, for a change that only affects documentation, just editing the .adoc files is enough. Once the PR is open, you'll see a preview of the generated documentation site, and check that way if your changes are correct.

All 4 comments

Hello,

I see this issue is still open. I'm new to Solidity and would like to contribute.
I propose replacing the rename function with the default burn function in ERC20 and rename _namers with _burners.
Let me know if this is an acceptable solution.

Hi @ristosaar,

Welcome to Solidity. Great that you want to contribute.

Your solution to the code example sounds fine.

Thank you,

I'm not entirely sure how I should incorporate the change though.
docs/modules/ROOT/pages/access-control.adoc seems to be the right file but do I also have to create tests for the new example contract and commit them somewhere? The guidelines are a bit vague on documentation files.

Hello @ristosaar! Indeed, for a change that only affects documentation, just editing the .adoc files is enough. Once the PR is open, you'll see a preview of the generated documentation site, and check that way if your changes are correct.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LogvinovLeon picture LogvinovLeon  路  4Comments

sanchaymittal picture sanchaymittal  路  4Comments

ryana picture ryana  路  4Comments

mswezey23 picture mswezey23  路  3Comments

xiaoyao1991 picture xiaoyao1991  路  3Comments