From 7c19c568449e0df7a754c10ac6c742250b0319fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Venturo?= Date: Fri, 3 Apr 2020 17:01:19 -0300 Subject: [PATCH 1/3] Improve API docgen sorting --- scripts/gen-nav.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/scripts/gen-nav.js b/scripts/gen-nav.js index cb1c99a7c..c796dea6c 100644 --- a/scripts/gen-nav.js +++ b/scripts/gen-nav.js @@ -12,8 +12,21 @@ const files = proc.execFileSync( console.log('.API'); -for (const file of files) { - const doc = file.replace(baseDir, ''); - const title = path.parse(file).name; - console.log(`* xref:${doc}[${startCase(title)}]`); +const links = files.map((file) => { + const doc = file.replace(baseDir, ''); + const title = path.parse(file).name; + + return { + xref: `* xref:${doc}[${startCase(title)}]`, + title, + }; +}); + +// Case-insensitive sort based on titles (so 'token/ERC20' gets sorted as 'erc20') +const sortedLinks = links.sort(function (a, b) { + return a.title.toLowerCase().localeCompare(b.title.toLowerCase()); +}); + +for (const link of sortedLinks) { + console.log(link.xref); } From 96a7113a16fd8b6bb6beef03d7fb8d18607b9915 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Venturo?= Date: Fri, 3 Apr 2020 17:05:36 -0300 Subject: [PATCH 2/3] Fix broken links --- contracts/access/AccessControl.sol | 2 +- contracts/token/ERC20/ERC20.sol | 2 +- contracts/token/ERC20/IERC20.sol | 3 +-- contracts/token/ERC777/ERC777.sol | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/contracts/access/AccessControl.sol b/contracts/access/AccessControl.sol index e03f72b2a..90a8f1a98 100644 --- a/contracts/access/AccessControl.sol +++ b/contracts/access/AccessControl.sol @@ -28,7 +28,7 @@ import "../GSN/Context.sol"; * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only - * accounts that have a role's admin role can call {grantRole} and {revokeRoke}. + * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other diff --git a/contracts/token/ERC20/ERC20.sol b/contracts/token/ERC20/ERC20.sol index 3a0948635..dee5b916b 100644 --- a/contracts/token/ERC20/ERC20.sol +++ b/contracts/token/ERC20/ERC20.sol @@ -10,7 +10,7 @@ import "../../utils/Address.sol"; * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. - * For a generic mechanism see {ERC20Mintable}. + * For a generic mechanism see {ERC20MinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How diff --git a/contracts/token/ERC20/IERC20.sol b/contracts/token/ERC20/IERC20.sol index 462fa5437..8c69d9687 100644 --- a/contracts/token/ERC20/IERC20.sol +++ b/contracts/token/ERC20/IERC20.sol @@ -1,8 +1,7 @@ pragma solidity ^0.6.0; /** - * @dev Interface of the ERC20 standard as defined in the EIP. Does not include - * the optional functions; to access them see {ERC20Detailed}. + * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** diff --git a/contracts/token/ERC777/ERC777.sol b/contracts/token/ERC777/ERC777.sol index adbfa77e1..d76276377 100644 --- a/contracts/token/ERC777/ERC777.sol +++ b/contracts/token/ERC777/ERC777.sol @@ -97,7 +97,7 @@ contract ERC777 is Context, IERC777, IERC20 { } /** - * @dev See {ERC20Detailed-decimals}. + * @dev See {ERC20-decimals}. * * Always returns 18, as per the * [ERC777 EIP](https://eips.ethereum.org/EIPS/eip-777#backward-compatibility). From c4e5daff86581160487da185bf87b36308531b59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Venturo?= Date: Fri, 3 Apr 2020 17:06:33 -0300 Subject: [PATCH 3/3] Fix Pausable docs --- contracts/utils/Pausable.sol | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/contracts/utils/Pausable.sol b/contracts/utils/Pausable.sol index 0a434042f..71301d6de 100644 --- a/contracts/utils/Pausable.sol +++ b/contracts/utils/Pausable.sol @@ -13,20 +13,19 @@ import "../GSN/Context.sol"; */ contract Pausable is Context { /** - * @dev Emitted when the pause is triggered by a pauser (`account`). + * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** - * @dev Emitted when the pause is lifted by a pauser (`account`). + * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** - * @dev Initializes the contract in unpaused state. Assigns the Pauser role - * to the deployer. + * @dev Initializes the contract in unpaused state. */ constructor () internal { _paused = false; @@ -56,7 +55,7 @@ contract Pausable is Context { } /** - * @dev Called by a pauser to pause, triggers stopped state. + * @dev Triggers stopped state. */ function _pause() internal virtual whenNotPaused { _paused = true; @@ -64,7 +63,7 @@ contract Pausable is Context { } /** - * @dev Called by a pauser to unpause, returns to normal state. + * @dev Returns to normal state. */ function _unpause() internal virtual whenPaused { _paused = false;