Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove underscore from events' arguments #1175

Closed
come-maiz opened this issue Aug 8, 2018 · 11 comments · Fixed by #1258
Closed

Remove underscore from events' arguments #1175

come-maiz opened this issue Aug 8, 2018 · 11 comments · Fixed by #1258
Assignees
Labels
breaking change Changes that break backwards compatibility of the public API. contracts Smart contract code.
Milestone

Comments

@come-maiz
Copy link
Contributor

Some of our events have arguments with a leading underscore on their name. This underscore is unnecessary because there is not chance of ambiguity with these arguments, so it should be removed.

@come-maiz come-maiz added good first issue Low hanging fruit for new contributors to get involved! kind:improvement contracts Smart contract code. labels Aug 8, 2018
@come-maiz come-maiz added this to the v2.0 milestone Aug 8, 2018
@come-maiz
Copy link
Contributor Author

ERC721 defines the leading underscore on the events' arguments. If we change that, are we still following the standard?

@come-maiz come-maiz added kind:discussion and removed good first issue Low hanging fruit for new contributors to get involved! labels Aug 8, 2018
@frangio
Copy link
Contributor

frangio commented Aug 16, 2018

Event argument names do not affect the ABI, so ERC721 contracts implemented without underscores will be perfectly compliant. Someone who uses the OpenZeppelin artifacts may expect underscores in the event arguments and will find that it won't work, but can easily adjust to the OpenZeppelin convention. I don't see a problem with it.

@frangio frangio added the breaking change Changes that break backwards compatibility of the public API. label Aug 16, 2018
@frangio frangio modified the milestones: v2.0, v2.1 Aug 29, 2018
@come-maiz come-maiz self-assigned this Aug 30, 2018
come-maiz added a commit to come-maiz/openzeppelin-solidity that referenced this issue Aug 30, 2018
frangio pushed a commit that referenced this issue Sep 3, 2018
* Remove underscores from event parameters.

Fixes #1175

* Add comment about ERC
nventuro added a commit that referenced this issue Sep 4, 2018
* Minor test style improvements (#1219)

* Changed .eq to .equal

* Changed equal(bool) to .to.be.bool

* Changed be.bool to equal(bool), disallowed unused expressions.

* Add ERC165Query library (#1086)

* Add ERC165Query library

* Address PR Comments

* Add tests and mocks from #1024 and refactor code slightly

* Fix javascript and solidity linting errors

* Split supportsInterface into three methods as discussed in #1086

* Change InterfaceId_ERC165 comment to match style in the rest of the repo

* Fix max-len lint issue on ERC165Checker.sol

* Conditionally ignore the asserts during solidity-coverage test

* Switch to abi.encodeWithSelector and add test for account addresses

* Switch to supportsInterfaces API as suggested by @frangio

* Adding ERC165InterfacesSupported.sol

* Fix style issues

* Add test for supportsInterfaces returning false

* Add ERC165Checker.sol newline

* feat: fix coverage implementation

* fix: solidity linting error

* fix: revert to using boolean tests instead of require statements

* fix: make supportsERC165Interface private again

* rename SupportsInterfaceWithLookupMock to avoid name clashing

* Added mint and burn tests for zero amounts. (#1230)

* Changed .eq to .equal. (#1231)

* ERC721 pausable token (#1154)

* ERC721 pausable token

* Reuse of ERC721 Basic behavior for Pausable, split view checks in paused state & style fixes

* [~] paused token behavior

* Add some detail to releasing steps (#1190)

* add note about pulling upstream changes to release branch

* add comment about upstream changes in merging section

* Increase test coverage (#1237)

* Fixed a SplitPayment test

* Deleted unnecessary function.

* Improved PostDeliveryCrowdsale tests.

* Improved RefundableCrowdsale tests.

* Improved MintedCrowdsale tests.

* Improved IncreasingPriceCrowdsale tests.

* Fixed a CappedCrowdsale test.

* Improved TimedCrowdsale tests.

* Improved descriptions of added tests.

*  ci: trigger docs update on tag  (#1186)

* MintableToken now uses Roles.

* Fixed FinalizableCrowdsale test.

* Roles can now be transfered.

* Fixed tests related to MintableToken.

* Removed Roles.check.

* Renamed transferMintPermission.

* Moved MinterRole

* Fixed RBAC.

* Adressed review comments.

* Addressed review comments

* Fixed linter errors.

* Added Events tests of Pausable contract (#1207)

* Fixed roles tests.

* Rename events to past-tense (#1181)

* fix: refactor sign.js and related tests (#1243)

* fix: refactor sign.js and related tests

* fix: remove unused dep

* fix: update package.json correctly

* Added "_" sufix to internal variables (#1171)

* Added PublicRole test.

* Fixed crowdsale tests.

* Rename ERC interfaces to I prefix (#1252)

* rename ERC20 to IERC20

* move ERC20.sol to IERC20.sol

* rename StandardToken to ERC20

* rename StandardTokenMock to ERC20Mock

* move StandardToken.sol to ERC20.sol, likewise test and mock files

* rename MintableToken to ERC20Mintable

* move MintableToken.sol to ERC20Mintable.sol, likewise test and mock files

* rename BurnableToken to ERC20Burnable

* move BurnableToken.sol to ERC20Burnable.sol, likewise for related files

* rename CappedToken to ERC20Capped

* move CappedToken.sol to ERC20Capped.sol, likewise for related files

* rename PausableToken to ERC20Pausable

* move PausableToken.sol to ERC20Pausable.sol, likewise for related files

* rename DetailedERC20 to ERC20Detailed

* move DetailedERC20.sol to ERC20Detailed.sol, likewise for related files

* rename ERC721 to IERC721, and likewise for other related interfaces

* move ERC721.sol to IERC721.sol, likewise for other 721 interfaces

* rename ERC721Token to ERC721

* move ERC721Token.sol to ERC721.sol, likewise for related files

* rename ERC721BasicToken to ERC721Basic

* move ERC721BasicToken.sol to ERC721Basic.sol, likewise for related files

* rename ERC721PausableToken to ERC721Pausable

* move ERC721PausableToken.sol to ERC721Pausable.sol

* rename ERC165 to IERC165

* move ERC165.sol to IERC165.sol

* amend comment that ERC20 is based on FirstBlood

* fix comments mentioning IERC721Receiver

* added explicit visibility (#1261)

* Remove underscores from event parameters. (#1258)

* Remove underscores from event parameters.

Fixes #1175

* Add comment about ERC

* Move contracts to subdirectories (#1253)

* Move contracts to subdirectories

Fixes #1177.

This Change also removes the LimitBalance contract.

* fix import

* move MerkleProof to cryptography

* Fix import

* Remove HasNoEther, HasNoTokens, HasNoContracts, and NoOwner (#1254)

* remove HasNoEther, HasNoTokens, HasNoContracts, and NoOwner

* remove unused ERC223TokenMock

* remove Contactable

* remove TokenDestructible

* remove DeprecatedERC721

* inline Destructible#destroy in Bounty

* remove Destructible

* Functions in interfaces changed to "external" (#1263)

* Add a leading underscore to internal and private functions. (#1257)

* Add a leading underscore to internal and private functions.

Fixes #1176

* Remove super

* update the ERC721 changes

* add missing underscore after merge

* Fix mock

* Improve encapsulation on SignatureBouncer, Whitelist and RBAC example (#1265)

* Improve encapsulation on Whitelist

* remove only

* update whitelisted crowdsale test

* Improve encapsulation on SignatureBouncer

* fix missing test

* Improve encapsulation on RBAC example

* Improve encapsulation on RBAC example

* Remove extra visibility

* Improve encapsulation on ERC20 Mintable

* Improve encapsulation on Superuser

* fix lint

* add missing constant

* Addressed review comments.

* Fixed build error.
nventuro added a commit that referenced this issue Sep 7, 2018
* Role tests (#1228)

* Moved RBAC tests to access.

* Added Roles.addMany and tests.

* Fixed linter error.

* Now using uint256 indexes.

* Removed RBAC tokens (#1229)

* Deleted RBACCappedTokenMock.

* Removed RBACMintableToken.

* Removed RBACMintableToken from the MintedCrowdsale tests.

* Roles can now be transfered. (#1235)

* Roles can now be transfered.

* Now explicitly checking support for the null address.

* Now rejecting transfer to a role-haver.

* Added renounce, roles can no longer be transfered to 0.

* Fixed linter errors.

* Fixed a Roles test.

* True Ownership (#1247)

* Added barebones Secondary.

* Added transferPrimary

* Escrow is now Secondary instead of Ownable.

* Now reverting on transfers to 0.

* The Secondary's primary is now private.

* MintableToken using Roles (#1236)

* Minor test style improvements (#1219)

* Changed .eq to .equal

* Changed equal(bool) to .to.be.bool

* Changed be.bool to equal(bool), disallowed unused expressions.

* Add ERC165Query library (#1086)

* Add ERC165Query library

* Address PR Comments

* Add tests and mocks from #1024 and refactor code slightly

* Fix javascript and solidity linting errors

* Split supportsInterface into three methods as discussed in #1086

* Change InterfaceId_ERC165 comment to match style in the rest of the repo

* Fix max-len lint issue on ERC165Checker.sol

* Conditionally ignore the asserts during solidity-coverage test

* Switch to abi.encodeWithSelector and add test for account addresses

* Switch to supportsInterfaces API as suggested by @frangio

* Adding ERC165InterfacesSupported.sol

* Fix style issues

* Add test for supportsInterfaces returning false

* Add ERC165Checker.sol newline

* feat: fix coverage implementation

* fix: solidity linting error

* fix: revert to using boolean tests instead of require statements

* fix: make supportsERC165Interface private again

* rename SupportsInterfaceWithLookupMock to avoid name clashing

* Added mint and burn tests for zero amounts. (#1230)

* Changed .eq to .equal. (#1231)

* ERC721 pausable token (#1154)

* ERC721 pausable token

* Reuse of ERC721 Basic behavior for Pausable, split view checks in paused state & style fixes

* [~] paused token behavior

* Add some detail to releasing steps (#1190)

* add note about pulling upstream changes to release branch

* add comment about upstream changes in merging section

* Increase test coverage (#1237)

* Fixed a SplitPayment test

* Deleted unnecessary function.

* Improved PostDeliveryCrowdsale tests.

* Improved RefundableCrowdsale tests.

* Improved MintedCrowdsale tests.

* Improved IncreasingPriceCrowdsale tests.

* Fixed a CappedCrowdsale test.

* Improved TimedCrowdsale tests.

* Improved descriptions of added tests.

*  ci: trigger docs update on tag  (#1186)

* MintableToken now uses Roles.

* Fixed FinalizableCrowdsale test.

* Roles can now be transfered.

* Fixed tests related to MintableToken.

* Removed Roles.check.

* Renamed transferMintPermission.

* Moved MinterRole

* Fixed RBAC.

* Adressed review comments.

* Addressed review comments

* Fixed linter errors.

* Added Events tests of Pausable contract (#1207)

* Fixed roles tests.

* Rename events to past-tense (#1181)

* fix: refactor sign.js and related tests (#1243)

* fix: refactor sign.js and related tests

* fix: remove unused dep

* fix: update package.json correctly

* Added "_" sufix to internal variables (#1171)

* Added PublicRole test.

* Fixed crowdsale tests.

* Rename ERC interfaces to I prefix (#1252)

* rename ERC20 to IERC20

* move ERC20.sol to IERC20.sol

* rename StandardToken to ERC20

* rename StandardTokenMock to ERC20Mock

* move StandardToken.sol to ERC20.sol, likewise test and mock files

* rename MintableToken to ERC20Mintable

* move MintableToken.sol to ERC20Mintable.sol, likewise test and mock files

* rename BurnableToken to ERC20Burnable

* move BurnableToken.sol to ERC20Burnable.sol, likewise for related files

* rename CappedToken to ERC20Capped

* move CappedToken.sol to ERC20Capped.sol, likewise for related files

* rename PausableToken to ERC20Pausable

* move PausableToken.sol to ERC20Pausable.sol, likewise for related files

* rename DetailedERC20 to ERC20Detailed

* move DetailedERC20.sol to ERC20Detailed.sol, likewise for related files

* rename ERC721 to IERC721, and likewise for other related interfaces

* move ERC721.sol to IERC721.sol, likewise for other 721 interfaces

* rename ERC721Token to ERC721

* move ERC721Token.sol to ERC721.sol, likewise for related files

* rename ERC721BasicToken to ERC721Basic

* move ERC721BasicToken.sol to ERC721Basic.sol, likewise for related files

* rename ERC721PausableToken to ERC721Pausable

* move ERC721PausableToken.sol to ERC721Pausable.sol

* rename ERC165 to IERC165

* move ERC165.sol to IERC165.sol

* amend comment that ERC20 is based on FirstBlood

* fix comments mentioning IERC721Receiver

* added explicit visibility (#1261)

* Remove underscores from event parameters. (#1258)

* Remove underscores from event parameters.

Fixes #1175

* Add comment about ERC

* Move contracts to subdirectories (#1253)

* Move contracts to subdirectories

Fixes #1177.

This Change also removes the LimitBalance contract.

* fix import

* move MerkleProof to cryptography

* Fix import

* Remove HasNoEther, HasNoTokens, HasNoContracts, and NoOwner (#1254)

* remove HasNoEther, HasNoTokens, HasNoContracts, and NoOwner

* remove unused ERC223TokenMock

* remove Contactable

* remove TokenDestructible

* remove DeprecatedERC721

* inline Destructible#destroy in Bounty

* remove Destructible

* Functions in interfaces changed to "external" (#1263)

* Add a leading underscore to internal and private functions. (#1257)

* Add a leading underscore to internal and private functions.

Fixes #1176

* Remove super

* update the ERC721 changes

* add missing underscore after merge

* Fix mock

* Improve encapsulation on SignatureBouncer, Whitelist and RBAC example (#1265)

* Improve encapsulation on Whitelist

* remove only

* update whitelisted crowdsale test

* Improve encapsulation on SignatureBouncer

* fix missing test

* Improve encapsulation on RBAC example

* Improve encapsulation on RBAC example

* Remove extra visibility

* Improve encapsulation on ERC20 Mintable

* Improve encapsulation on Superuser

* fix lint

* add missing constant

* Addressed review comments.

* Fixed build error.

* Improved Roles API. (#1280)

* Improved Roles API.

* fix linter error

* Added PauserRole. (#1283)

* Remove Claimable, DelayedClaimable, Heritable (#1274)

* remove Claimable, DelayedClaimable, Heritable

* remove SimpleSavingsWallet example which used Heritable

(cherry picked from commit 0dc7117)

* Role behavior tests (#1285)

* Added role tests.

* Added PauserRole tests to contracts that have that role.

* Added MinterRole tests to contracts that have that role.

* Fixed linter errors.

* Migrate Ownable to Roles (#1287)

* Added CapperRole.

* RefundEscrow is now Secondary.

* FinalizableCrowdsale is no longer Ownable.

* Removed Whitelist and WhitelistedCrowdsale, redesign needed.

* Fixed linter errors, disabled lbrace due to it being buggy.

* Remove RBAC, SignatureBouncer refactor (#1289)

* Added CapperRole.

* RefundEscrow is now Secondary.

* FinalizableCrowdsale is no longer Ownable.

* Removed Whitelist and WhitelistedCrowdsale, redesign needed.

* Fixed linter errors, disabled lbrace due to it being buggy.

* Moved SignatureBouncer tests.

* Deleted RBAC and Superuser.

* Deleted rbac directory.

* Updated readme.

* SignatureBouncer now uses SignerRole, renamed bouncer to signer.

* feat: implement ERC721Mintable and ERC721Burnable (#1276)

* feat: implement ERC721Mintable and ERC721Burnable

* fix: linting errors

* fix: remove unused mintable mock for ERC721BasicMock

* fix: add finishMinting tests

* fix: catch MintFinished typo

* inline ERC721Full behavior

* undo pretty formatting

* fix lint errors

* rename canMint to onlyBeforeMintingFinished for consistency with ERC20Mintable

* Fix the merge with the privatization branch

* remove duplicate CapperRole test
frangio pushed a commit that referenced this issue Sep 7, 2018
…meters (#1282)

* Role tests (#1228)

* Moved RBAC tests to access.

* Added Roles.addMany and tests.

* Fixed linter error.

* Now using uint256 indexes.

* Removed RBAC tokens (#1229)

* Deleted RBACCappedTokenMock.

* Removed RBACMintableToken.

* Removed RBACMintableToken from the MintedCrowdsale tests.

* Roles can now be transfered. (#1235)

* Roles can now be transfered.

* Now explicitly checking support for the null address.

* Now rejecting transfer to a role-haver.

* Added renounce, roles can no longer be transfered to 0.

* Fixed linter errors.

* Fixed a Roles test.

* True Ownership (#1247)

* Added barebones Secondary.

* Added transferPrimary

* Escrow is now Secondary instead of Ownable.

* Now reverting on transfers to 0.

* The Secondary's primary is now private.

* Improve encapsulation on ERC165

* Improve encapsulation on ERC20

* Improve encapsulation on ERC721

* Add tests, use standard getters

* fix tests

* Fix lint

* MintableToken using Roles (#1236)

* Minor test style improvements (#1219)

* Changed .eq to .equal

* Changed equal(bool) to .to.be.bool

* Changed be.bool to equal(bool), disallowed unused expressions.

* Add ERC165Query library (#1086)

* Add ERC165Query library

* Address PR Comments

* Add tests and mocks from #1024 and refactor code slightly

* Fix javascript and solidity linting errors

* Split supportsInterface into three methods as discussed in #1086

* Change InterfaceId_ERC165 comment to match style in the rest of the repo

* Fix max-len lint issue on ERC165Checker.sol

* Conditionally ignore the asserts during solidity-coverage test

* Switch to abi.encodeWithSelector and add test for account addresses

* Switch to supportsInterfaces API as suggested by @frangio

* Adding ERC165InterfacesSupported.sol

* Fix style issues

* Add test for supportsInterfaces returning false

* Add ERC165Checker.sol newline

* feat: fix coverage implementation

* fix: solidity linting error

* fix: revert to using boolean tests instead of require statements

* fix: make supportsERC165Interface private again

* rename SupportsInterfaceWithLookupMock to avoid name clashing

* Added mint and burn tests for zero amounts. (#1230)

* Changed .eq to .equal. (#1231)

* ERC721 pausable token (#1154)

* ERC721 pausable token

* Reuse of ERC721 Basic behavior for Pausable, split view checks in paused state & style fixes

* [~] paused token behavior

* Add some detail to releasing steps (#1190)

* add note about pulling upstream changes to release branch

* add comment about upstream changes in merging section

* Increase test coverage (#1237)

* Fixed a SplitPayment test

* Deleted unnecessary function.

* Improved PostDeliveryCrowdsale tests.

* Improved RefundableCrowdsale tests.

* Improved MintedCrowdsale tests.

* Improved IncreasingPriceCrowdsale tests.

* Fixed a CappedCrowdsale test.

* Improved TimedCrowdsale tests.

* Improved descriptions of added tests.

*  ci: trigger docs update on tag  (#1186)

* MintableToken now uses Roles.

* Fixed FinalizableCrowdsale test.

* Roles can now be transfered.

* Fixed tests related to MintableToken.

* Removed Roles.check.

* Renamed transferMintPermission.

* Moved MinterRole

* Fixed RBAC.

* Adressed review comments.

* Addressed review comments

* Fixed linter errors.

* Added Events tests of Pausable contract (#1207)

* Fixed roles tests.

* Rename events to past-tense (#1181)

* fix: refactor sign.js and related tests (#1243)

* fix: refactor sign.js and related tests

* fix: remove unused dep

* fix: update package.json correctly

* Added "_" sufix to internal variables (#1171)

* Added PublicRole test.

* Fixed crowdsale tests.

* Rename ERC interfaces to I prefix (#1252)

* rename ERC20 to IERC20

* move ERC20.sol to IERC20.sol

* rename StandardToken to ERC20

* rename StandardTokenMock to ERC20Mock

* move StandardToken.sol to ERC20.sol, likewise test and mock files

* rename MintableToken to ERC20Mintable

* move MintableToken.sol to ERC20Mintable.sol, likewise test and mock files

* rename BurnableToken to ERC20Burnable

* move BurnableToken.sol to ERC20Burnable.sol, likewise for related files

* rename CappedToken to ERC20Capped

* move CappedToken.sol to ERC20Capped.sol, likewise for related files

* rename PausableToken to ERC20Pausable

* move PausableToken.sol to ERC20Pausable.sol, likewise for related files

* rename DetailedERC20 to ERC20Detailed

* move DetailedERC20.sol to ERC20Detailed.sol, likewise for related files

* rename ERC721 to IERC721, and likewise for other related interfaces

* move ERC721.sol to IERC721.sol, likewise for other 721 interfaces

* rename ERC721Token to ERC721

* move ERC721Token.sol to ERC721.sol, likewise for related files

* rename ERC721BasicToken to ERC721Basic

* move ERC721BasicToken.sol to ERC721Basic.sol, likewise for related files

* rename ERC721PausableToken to ERC721Pausable

* move ERC721PausableToken.sol to ERC721Pausable.sol

* rename ERC165 to IERC165

* move ERC165.sol to IERC165.sol

* amend comment that ERC20 is based on FirstBlood

* fix comments mentioning IERC721Receiver

* added explicit visibility (#1261)

* Remove underscores from event parameters. (#1258)

* Remove underscores from event parameters.

Fixes #1175

* Add comment about ERC

* Move contracts to subdirectories (#1253)

* Move contracts to subdirectories

Fixes #1177.

This Change also removes the LimitBalance contract.

* fix import

* move MerkleProof to cryptography

* Fix import

* Remove HasNoEther, HasNoTokens, HasNoContracts, and NoOwner (#1254)

* remove HasNoEther, HasNoTokens, HasNoContracts, and NoOwner

* remove unused ERC223TokenMock

* remove Contactable

* remove TokenDestructible

* remove DeprecatedERC721

* inline Destructible#destroy in Bounty

* remove Destructible

* Functions in interfaces changed to "external" (#1263)

* Add a leading underscore to internal and private functions. (#1257)

* Add a leading underscore to internal and private functions.

Fixes #1176

* Remove super

* update the ERC721 changes

* add missing underscore after merge

* Fix mock

* Improve encapsulation on SignatureBouncer, Whitelist and RBAC example (#1265)

* Improve encapsulation on Whitelist

* remove only

* update whitelisted crowdsale test

* Improve encapsulation on SignatureBouncer

* fix missing test

* Improve encapsulation on RBAC example

* Improve encapsulation on RBAC example

* Remove extra visibility

* Improve encapsulation on ERC20 Mintable

* Improve encapsulation on Superuser

* fix lint

* add missing constant

* Addressed review comments.

* Fixed build error.

* move interface ids to implementation contracts

* Do not prefix getters

* Improve encapsulation on Crowdsales

* add missing tests

* remove only

* Improve encapsulation on Pausable

* add the underscore

* Improve encapsulation on ownership

* fix rebase

* fix ownership

* Improve encapsulation on payments

* Add missing tests

* add missing test

* Do not prefix getters

* Do not prefix getters

* Fix tests.

* Update modifiers to call public view functions.

Fixes #1179.

* Improve encapsulation on BreakInvariantBounty

* Make researchers private

* Improve encapsulation on Crowdsales

* add missing tests

* remove only

* Improve encapsulation on Pausable

* add the underscore

* Improve encapsulation on ownership

* fix rebase

* fix ownership

* Improve encapsulation on payments

* Add missing tests

* add missing test

* Do not prefix getters

* Do not prefix getters

* Do not prefix getters

* Fix tests.

* tmp

* remove isMinter

* fix is owner call

* fix isOpen

* Fix merge

* tmp

* Improve encapsulation on TimedCrowdsale

* Add missing parentheses

* Use prefix underscore for state variables and no underscore for parameters

* Improved Roles API. (#1280)

* Improved Roles API.

* fix linter error

* Added PauserRole. (#1283)

* remove duplicate function definition

* Remove Claimable, DelayedClaimable, Heritable (#1274)

* remove Claimable, DelayedClaimable, Heritable

* remove SimpleSavingsWallet example which used Heritable

(cherry picked from commit 0dc7117)

* Role behavior tests (#1285)

* Added role tests.

* Added PauserRole tests to contracts that have that role.

* Added MinterRole tests to contracts that have that role.

* Fixed linter errors.

* Migrate Ownable to Roles (#1287)

* Added CapperRole.

* RefundEscrow is now Secondary.

* FinalizableCrowdsale is no longer Ownable.

* Removed Whitelist and WhitelistedCrowdsale, redesign needed.

* Fixed linter errors, disabled lbrace due to it being buggy.

* Remove RBAC, SignatureBouncer refactor (#1289)

* Added CapperRole.

* RefundEscrow is now Secondary.

* FinalizableCrowdsale is no longer Ownable.

* Removed Whitelist and WhitelistedCrowdsale, redesign needed.

* Fixed linter errors, disabled lbrace due to it being buggy.

* Moved SignatureBouncer tests.

* Deleted RBAC and Superuser.

* Deleted rbac directory.

* Updated readme.

* SignatureBouncer now uses SignerRole, renamed bouncer to signer.

* feat: implement ERC721Mintable and ERC721Burnable (#1276)

* feat: implement ERC721Mintable and ERC721Burnable

* fix: linting errors

* fix: remove unused mintable mock for ERC721BasicMock

* fix: add finishMinting tests

* fix: catch MintFinished typo

* inline ERC721Full behavior

* undo pretty formatting

* fix lint errors

* rename canMint to onlyBeforeMintingFinished for consistency with ERC20Mintable

* Fix the merge with the privatization branch

* fix lint

* Remove underscore

* Delete CapperRole.test.js

* fix increaseApproval
@maxsam4
Copy link

maxsam4 commented Nov 14, 2018

@frangio @ElOpio Sorry for bringing this back up but as far as I remember, Event names are included in the ABI (probably not in ByteCode though). IMO This change makes the tokens in openzeppelin non-compliant to ERC20 and ERC721.

Even if you think that it is still compliant, I hope you can still see the problems it will make for dApps trying to read ERC20 events. dApps won't know if the token is OZ or ERC20. The whole point of the standard was to have a standard way of doing things.

I don't see any reason except style consistency to remove the underscore. Maybe keep the underscore in the standard interfaces at least?

@maxsam4
Copy link

maxsam4 commented Nov 15, 2018

Can you guys please reopen this issue for further discussion among the community?
or create a new one and reference this and the concerned PR.

Thanks.

@frangio
Copy link
Contributor

frangio commented Nov 15, 2018

@maxsam4 Happy to continue the discussion here for now.

I don't see how this causes compatibility problems. Dapps aren't affected by the event argument names used in the source code, they just care about their order and indexedness, where OpenZeppelin is definitely compliant. This means that dapps don't need to know if the token is OZ or ERC20 as you implied.

Users of the OpenZeppelin interfaces will need to be aware of the lack of underscore prefixes. I think style consistency within the library is the more valuable thing from the perspective of those users, and we chose to prioritize that rather than doing verbatim what the ERC text says.

As a sidenote, it's not really clear what it means to be compliant with a Solidity interface defined in an ERC. Event argument names are only one of the issues. Perhaps we should write an ERC about it. 😛

@maxsam4
Copy link

maxsam4 commented Nov 16, 2018

Thanks for the response @frangio Here are my further thoughts

I don't see how this causes compatibility problems. Dapps aren't affected by the event argument names used in the source code, they just care about their order and indexedness, where OpenZeppelin is definitely compliant. This means that dapps don't need to know if the token is OZ or ERC20 as you implied.

I'll try to explain why some dApps will need to refactor their code to arguably worse code or will need to know if the token is OZ or ERC20.
When fetching events, Web3 1.X returns a returnValues object that maps event parameter name to value. Please refer to documentation and example available on https://web3js.readthedocs.io/en/1.0/web3-eth-contract.html#contract-events

When fetching events using Web3 0.X. it returns args object that does the same thing. Doc available on https://github.com/ethereum/wiki/wiki/JavaScript-API
A sample code:

contract.SampleContract ().watch ( (err, response) => {  
    console.log(response.args.eventParameterName);
});

I know we can use topics array for the same purpose but it has disadvantages:

  1. You have to remember array index rather than name. Or check from code every time. Extra hassle for no reason.
  2. You have to refactor your code.
  3. Code's readability slightly decreases.

Kinda similar to why we give proper names to variables :) You don't have to but it makes life easier.

I think style consistency within the library is the more valuable thing from the perspective of those users, and we chose to prioritize that rather than doing verbatim what the ERC text says.

I'd have to disagree here. If a contract is not ERC20 verbatim, I will not call it ERC20 complaint. In my opinion, You can freely add stuff that the standard does not prohibit like reverting rather than returning false but you should not change what the standard defines as "SHOULD" or "MUST".

As a sidenote, it's not really clear what it means to be compliant with a Solidity interface defined in an ERC. Event argument names are only one of the issues. Perhaps we should write an ERC about it. stuck_out_tongue

I agree with this one. Everyone has their opinion. An ERC might actually help 😛

@frangio
Copy link
Contributor

frangio commented Nov 16, 2018

I agree that using indexes instead of names is a huge hassle and compromise to readability. We would never encourage our users to do that.

When fetching events, Web3 1.X returns a returnValues object that maps event parameter name to value.

The object will use the parameter names as declared by the JSON interface used in the client, not in the source code for a contract address (which are unknown as far as the EVM goes).

Removing the underscore prefixes in OpenZeppelin allows clients built with our JSON interfaces to use non-prefixed parameter names, but it does not affect at all the ERC20 compliance of the produced bytecode.

@maxsam4
Copy link

maxsam4 commented Nov 17, 2018

I agree that using indexes instead of names is a huge hassle and compromise to readability. We would never encourage our users to do that.

Thank you for understanding.

The object will use the parameter names as declared by the JSON interface used in the client, not in the source code for a contract address (which are unknown as far as the EVM goes).

I don't want to ship pre-defined ABIs with my dApp. I want to ship the contract source code as a module and have them compiled by the user. Similar to how open zeppelin does not ship Bytecode and ABIs.
This change hurts more when we already have deployed stuff to the main net. We'll have to use a different ABI than what the original source code produces. For example, our utility token has a classic code that generates ABI with underscores while newer tokens being generated from our beta dApp won't have the underscore in the ABI. Either we'll be forced to use a slightly modified ABI for one of these or use indexes instead of names.

Removing the underscore prefixes in OpenZeppelin allows clients built with our JSON interfaces to use non-prefixed parameter names, but it does not affect at all the ERC20 compliance of the produced bytecode.

IMHO this change to the interface was not required. Style consistency is meant to make interpreting stuff easier rather than creating more confusion.
I consider ABI to be part of the ERC. Given that standards usually define the interface rather implementation, I'd argue that ABI is just as important if not more than bytecode for compliance. But it's my own interpretation and I can see why others might consider only the Bytecode to be compliant with an ERC.

@come-maiz
Copy link
Contributor Author

@maxsam4 for your code already deployed to mainnet, shouldn't you use the OpenZeppelin version you used when you deployed, instead of the latest?

@maxsam4
Copy link

maxsam4 commented Nov 20, 2018

@maxsam4 for your code already deployed to mainnet, shouldn't you use the OpenZeppelin version you used when you deployed, instead of the latest?

Our token on Mainnet does not use OpenZeppelin actually.
The security tokens generated through our platform use OpenZeppelin and the version is pinned.
The problem is that we are changing to OZ 2.0 for the next version of our security tokens.

I want both their ABIs to have same event parameter names so that I don't have to treat them differently when treating them as ERC20. I will still be loading both their ABIs separately though as other non ERC20 functions differ.

It's not that I can't refactor my code. It is rather straightforward to make the required changes than trying to change OpenZeppelin :).

The bigger concern to me is that changing a standard's interface changes the ABI and it makes the token non-compliant (IMO). The above is just an example of the inconvenience it causes.

@come-maiz
Copy link
Contributor Author

Got it. Then I agree with @frangio that we need an ERC that defines compliance. And I'll add that we need another one with a suggested style for all ERCs 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Changes that break backwards compatibility of the public API. contracts Smart contract code.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants