Skip to content

Commit 6dc9242

Browse files
authored
Fix Broken Docs References (#5436)
1 parent a55fabc commit 6dc9242

21 files changed

+49
-59
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ npm-debug.log
3737

3838
# docs artifacts
3939
docs/modules/api
40+
build/site
4041

4142
# only used to package @openzeppelin/contracts
4243
contracts/build/

contracts/governance/Governor.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ abstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC72
455455
* performed (for example adding a vault/timelock).
456456
*
457457
* NOTE: Calling this function directly will NOT check the current state of the proposal, set the executed flag to
458-
* true or emit the `ProposalExecuted` event. Executing a proposal should be done using {execute} or {_execute}.
458+
* true or emit the `ProposalExecuted` event. Executing a proposal should be done using {execute}.
459459
*/
460460
function _executeOperations(
461461
uint256 /* proposalId */,

contracts/governance/README.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ NOTE: Functions of the `Governor` contract do not include access control. If you
6868

6969
{{GovernorCountingFractional}}
7070

71-
{{GovernorCountingOverride}}
71+
{{GovernorCountingOverridable}}
7272

7373
{{GovernorVotes}}
7474

@@ -103,7 +103,7 @@ In a governance system, the {TimelockController} contract is in charge of introd
103103
[[timelock-terminology]]
104104
==== Terminology
105105

106-
* *Operation:* A transaction (or a set of transactions) that is the subject of the timelock. It has to be scheduled by a proposer and executed by an executor. The timelock enforces a minimum delay between the proposition and the execution (see xref:access-control.adoc#operation_lifecycle[operation lifecycle]). If the operation contains multiple transactions (batch mode), they are executed atomically. Operations are identified by the hash of their content.
106+
* *Operation:* A transaction (or a set of transactions) that is the subject of the timelock. It has to be scheduled by a proposer and executed by an executor. The timelock enforces a minimum delay between the proposition and the execution. If the operation contains multiple transactions (batch mode), they are executed atomically. Operations are identified by the hash of their content.
107107
* *Operation status:*
108108
** *Unset:* An operation that is not part of the timelock mechanism.
109109
** *Waiting:* An operation that has been scheduled, before the timer expires.

contracts/governance/extensions/GovernorStorage.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ abstract contract GovernorStorage is Governor {
5050
}
5151

5252
/**
53-
* @dev Version of {IGovernorTimelock-queue} with only `proposalId` as an argument.
53+
* @dev Version of {IGovernor-queue} with only `proposalId` as an argument.
5454
*/
5555
function queue(uint256 proposalId) public virtual {
5656
// here, using storage is more efficient than memory

contracts/governance/extensions/GovernorTimelockAccess.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ abstract contract GovernorTimelockAccess is Governor {
277277
}
278278

279279
/**
280-
* @dev See {IGovernor-_cancel}
280+
* @dev See {Governor-_cancel}
281281
*/
282282
function _cancel(
283283
address[] memory targets,

contracts/proxy/utils/UUPSUpgradeable.sol

-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ abstract contract UUPSUpgradeable is IERC1822Proxiable {
9191
/**
9292
* @dev Reverts if the execution is not performed via delegatecall or the execution
9393
* context is not of a proxy with an ERC-1967 compliant implementation pointing to self.
94-
* See {_onlyProxy}.
9594
*/
9695
function _checkProxy() internal view virtual {
9796
if (

contracts/token/ERC1155/IERC1155.sol

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ interface IERC1155 is IERC165 {
8181
* @dev Transfers a `value` amount of tokens of type `id` from `from` to `to`.
8282
*
8383
* WARNING: This function can potentially allow a reentrancy attack when transferring tokens
84-
* to an untrusted contract, when invoking {onERC1155Received} on the receiver.
84+
* to an untrusted contract, when invoking {IERC1155Receiver-onERC1155Received} on the receiver.
8585
* Ensure to follow the checks-effects-interactions pattern and consider employing
8686
* reentrancy guards when interacting with untrusted contracts.
8787
*
@@ -101,7 +101,7 @@ interface IERC1155 is IERC165 {
101101
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
102102
*
103103
* WARNING: This function can potentially allow a reentrancy attack when transferring tokens
104-
* to an untrusted contract, when invoking {onERC1155BatchReceived} on the receiver.
104+
* to an untrusted contract, when invoking {IERC1155Receiver-onERC1155BatchReceived} on the receiver.
105105
* Ensure to follow the checks-effects-interactions pattern and consider employing
106106
* reentrancy guards when interacting with untrusted contracts.
107107
*

contracts/token/ERC1155/utils/ERC1155Utils.sol

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {IERC1155Errors} from "../../../interfaces/draft-IERC6093.sol";
1515
*/
1616
library ERC1155Utils {
1717
/**
18-
* @dev Performs an acceptance check for the provided `operator` by calling {IERC1155-onERC1155Received}
18+
* @dev Performs an acceptance check for the provided `operator` by calling {IERC1155Receiver-onERC1155Received}
1919
* on the `to` address. The `operator` is generally the address that initiated the token transfer (i.e. `msg.sender`).
2020
*
2121
* The acceptance call is not executed and treated as a no-op if the target address doesn't contain code (i.e. an EOA).
@@ -50,7 +50,7 @@ library ERC1155Utils {
5050
}
5151

5252
/**
53-
* @dev Performs a batch acceptance check for the provided `operator` by calling {IERC1155-onERC1155BatchReceived}
53+
* @dev Performs a batch acceptance check for the provided `operator` by calling {IERC1155Receiver-onERC1155BatchReceived}
5454
* on the `to` address. The `operator` is generally the address that initiated the token transfer (i.e. `msg.sender`).
5555
*
5656
* The acceptance call is not executed and treated as a no-op if the target address doesn't contain code (i.e. an EOA).

contracts/token/ERC20/extensions/ERC4626.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import {Math} from "../../../utils/math/Math.sol";
3434
* offset (0) makes it non-profitable even if an attacker is able to capture value from multiple user deposits, as a result
3535
* of the value being captured by the virtual shares (out of the attacker's donation) matching the attacker's expected gains.
3636
* With a larger offset, the attack becomes orders of magnitude more expensive than it is profitable. More details about the
37-
* underlying math can be found xref:erc4626.adoc#inflation-attack[here].
37+
* underlying math can be found xref:ROOT:erc4626.adoc#inflation-attack[here].
3838
*
3939
* The drawback of this approach is that the virtual shares do capture (a very small) part of the value being accrued
4040
* to the vault. Also, if the vault experiences losses, the users try to exit the vault, the virtual shares and assets

contracts/token/ERC721/extensions/ERC721Consecutive.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ abstract contract ERC721Consecutive is IERC2309, ERC721 {
159159
}
160160

161161
/**
162-
* @dev Used to offset the first token id in {_nextConsecutiveId}
162+
* @dev Used to offset the first token id in `_nextConsecutiveId`
163163
*/
164164
function _firstConsecutiveId() internal view virtual returns (uint96) {
165165
return 0;

contracts/token/ERC721/extensions/ERC721URIStorage.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ abstract contract ERC721URIStorage is IERC4906, ERC721 {
5252
/**
5353
* @dev Sets `_tokenURI` as the tokenURI of `tokenId`.
5454
*
55-
* Emits {MetadataUpdate}.
55+
* Emits {IERC4906-MetadataUpdate}.
5656
*/
5757
function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {
5858
_tokenURIs[tokenId] = _tokenURI;

contracts/token/ERC721/utils/ERC721Utils.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {IERC721Errors} from "../../../interfaces/draft-IERC6093.sol";
1515
*/
1616
library ERC721Utils {
1717
/**
18-
* @dev Performs an acceptance check for the provided `operator` by calling {IERC721-onERC721Received}
18+
* @dev Performs an acceptance check for the provided `operator` by calling {IERC721Receiver-onERC721Received}
1919
* on the `to` address. The `operator` is generally the address that initiated the token transfer (i.e. `msg.sender`).
2020
*
2121
* The acceptance call is not executed and treated as a no-op if the target address doesn't contain code (i.e. an EOA).

contracts/utils/Multicall.sol

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import {Context} from "./Context.sol";
1313
* careful about sending transactions invoking {multicall}. For example, a relay address that filters function
1414
* selectors won't filter calls nested within a {multicall} operation.
1515
*
16-
* NOTE: Since 5.0.1 and 4.9.4, this contract identifies non-canonical contexts (i.e. `msg.sender` is not {_msgSender}).
16+
* NOTE: Since 5.0.1 and 4.9.4, this contract identifies non-canonical contexts (i.e. `msg.sender` is not {Context-_msgSender}).
1717
* If a non-canonical context is identified, the following self `delegatecall` appends the last bytes of `msg.data`
1818
* to the subcall. This makes it safe to use with {ERC2771Context}. Contexts that don't affect the resolution of
19-
* {_msgSender} are not propagated to subcalls.
19+
* {Context-_msgSender} are not propagated to subcalls.
2020
*/
2121
abstract contract Multicall is Context {
2222
/**

contracts/utils/ShortStrings.sol

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ library ShortStrings {
9595
}
9696

9797
/**
98-
* @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.
98+
* @dev Decode a string that was encoded to `ShortString` or written to storage using {toShortStringWithFallback}.
9999
*/
100100
function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {
101101
if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {
@@ -107,7 +107,7 @@ library ShortStrings {
107107

108108
/**
109109
* @dev Return the length of a string that was encoded to `ShortString` or written to storage using
110-
* {setWithFallback}.
110+
* {toShortStringWithFallback}.
111111
*
112112
* WARNING: This will return the "byte length" of the string. This may not reflect the actual length in terms of
113113
* actual characters as the UTF-8 encoding of a single character can span over multiple bytes.

contracts/utils/Strings.sol

+9-9
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ library Strings {
139139
}
140140

141141
/**
142-
* @dev Variant of {parseUint} that parses a substring of `input` located between position `begin` (included) and
142+
* @dev Variant of {parseUint-string} that parses a substring of `input` located between position `begin` (included) and
143143
* `end` (excluded).
144144
*
145145
* Requirements:
@@ -177,7 +177,7 @@ library Strings {
177177
}
178178

179179
/**
180-
* @dev Implementation of {tryParseUint} that does not check bounds. Caller should make sure that
180+
* @dev Implementation of {tryParseUint-string-uint256-uint256} that does not check bounds. Caller should make sure that
181181
* `begin <= end <= input.length`. Other inputs would result in undefined behavior.
182182
*/
183183
function _tryParseUintUncheckedBounds(
@@ -250,7 +250,7 @@ library Strings {
250250
}
251251

252252
/**
253-
* @dev Implementation of {tryParseInt} that does not check bounds. Caller should make sure that
253+
* @dev Implementation of {tryParseInt-string-uint256-uint256} that does not check bounds. Caller should make sure that
254254
* `begin <= end <= input.length`. Other inputs would result in undefined behavior.
255255
*/
256256
function _tryParseIntUncheckedBounds(
@@ -287,7 +287,7 @@ library Strings {
287287
}
288288

289289
/**
290-
* @dev Variant of {parseHexUint} that parses a substring of `input` located between position `begin` (included) and
290+
* @dev Variant of {parseHexUint-string} that parses a substring of `input` located between position `begin` (included) and
291291
* `end` (excluded).
292292
*
293293
* Requirements:
@@ -325,7 +325,7 @@ library Strings {
325325
}
326326

327327
/**
328-
* @dev Implementation of {tryParseHexUint} that does not check bounds. Caller should make sure that
328+
* @dev Implementation of {tryParseHexUint-string-uint256-uint256} that does not check bounds. Caller should make sure that
329329
* `begin <= end <= input.length`. Other inputs would result in undefined behavior.
330330
*/
331331
function _tryParseHexUintUncheckedBounds(
@@ -346,7 +346,7 @@ library Strings {
346346
result *= 16;
347347
unchecked {
348348
// Multiplying by 16 is equivalent to a shift of 4 bits (with additional overflow check).
349-
// This guaratees that adding a value < 16 will not cause an overflow, hence the unchecked.
349+
// This guarantees that adding a value < 16 will not cause an overflow, hence the unchecked.
350350
result += chr;
351351
}
352352
}
@@ -364,7 +364,7 @@ library Strings {
364364
}
365365

366366
/**
367-
* @dev Variant of {parseAddress} that parses a substring of `input` located between position `begin` (included) and
367+
* @dev Variant of {parseAddress-string} that parses a substring of `input` located between position `begin` (included) and
368368
* `end` (excluded).
369369
*
370370
* Requirements:
@@ -378,15 +378,15 @@ library Strings {
378378

379379
/**
380380
* @dev Variant of {parseAddress-string} that returns false if the parsing fails because the input is not a properly
381-
* formatted address. See {parseAddress} requirements.
381+
* formatted address. See {parseAddress-string} requirements.
382382
*/
383383
function tryParseAddress(string memory input) internal pure returns (bool success, address value) {
384384
return tryParseAddress(input, 0, bytes(input).length);
385385
}
386386

387387
/**
388388
* @dev Variant of {parseAddress-string-uint256-uint256} that returns false if the parsing fails because input is not a properly
389-
* formatted address. See {parseAddress} requirements.
389+
* formatted address. See {parseAddress-string-uint256-uint256} requirements.
390390
*/
391391
function tryParseAddress(
392392
string memory input,

contracts/utils/cryptography/EIP712.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ abstract contract EIP712 is IERC5267 {
109109
}
110110

111111
/**
112-
* @dev See {IERC-5267}.
112+
* @inheritdoc IERC5267
113113
*/
114114
function eip712Domain()
115115
public

docs/modules/ROOT/pages/crowdsales.adoc

-11
This file was deleted.

docs/modules/ROOT/pages/drafts.adoc

-19
This file was deleted.

docs/modules/ROOT/pages/governance.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ If your project already has a live token that does not include ERC20Votes and is
5252
include::api:example$governance/MyTokenWrapped.sol[]
5353
```
5454

55-
NOTE: The only other source of voting power available in OpenZeppelin Contracts currently is xref:api:token/ERC721.adoc#ERC721Votes[`ERC721Votes`]. ERC-721 tokens that don't provide this functionality can be wrapped into a voting tokens using a combination of xref:api:token/ERC721.adoc#ERC721Votes[`ERC721Votes`] and xref:api:token/ERC721Wrapper.adoc#ERC721Wrapper[`ERC721Wrapper`].
55+
NOTE: The only other source of voting power available in OpenZeppelin Contracts currently is xref:api:token/ERC721.adoc#ERC721Votes[`ERC721Votes`]. ERC-721 tokens that don't provide this functionality can be wrapped into a voting tokens using a combination of xref:api:token/ERC721.adoc#ERC721Votes[`ERC721Votes`] and xref:api:token/ERC721.adoc#ERC721Wrapper[`ERC721Wrapper`].
5656

5757
NOTE: The internal clock used by the token to store voting balances will dictate the operating mode of the Governor contract attached to it. By default, block numbers are used. Since v4.9, developers can override the xref:api:interfaces.adoc#IERC6372[IERC6372] clock to use timestamps instead of block numbers.
5858

docs/templates/contract.hbs

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
:{{name}}: pass:normal[xref:#{{anchor}}[`++{{name}}++`]]
33
{{/each}}
44

5+
{{#each functions}}
6+
:{{fullname}}: pass:normal[xref:#{{anchor}}[`++{{name}}++`]]
7+
{{/each}}
8+
59
[.contract]
610
[[{{anchor}}]]
711
=== `++{{name}}++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v{{oz-version}}/{{__item_context.file.absolutePath}}[{github-icon},role=heading-link]

docs/templates/properties.js

+16
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,22 @@ module.exports.anchor = function anchor({ item, contract }) {
1717
return res;
1818
};
1919

20+
module.exports.fullname = function fullname({ item }) {
21+
let res = '';
22+
res += item.name;
23+
if ('parameters' in item) {
24+
const signature = item.parameters.parameters.map(v => v.typeName.typeDescriptions.typeString).join(',');
25+
res += slug('(' + signature + ')');
26+
}
27+
if (isNodeType('VariableDeclaration', item)) {
28+
res += '-' + slug(item.typeName.typeDescriptions.typeString);
29+
}
30+
if (res.charAt(res.length - 1) === '-') {
31+
return res.slice(0, -1);
32+
}
33+
return res;
34+
};
35+
2036
module.exports.inheritance = function ({ item, build }) {
2137
if (!isNodeType('ContractDefinition', item)) {
2238
throw new Error('used inherited-items on non-contract');

0 commit comments

Comments
 (0)