Skip to content

Commit 48c67c7

Browse files
Amxxernestognw
andauthored
Add missing docstrings (#5168)
Co-authored-by: Ernesto García <ernestognw@gmail.com>
1 parent 1edc2ae commit 48c67c7

File tree

4 files changed

+24
-7
lines changed

4 files changed

+24
-7
lines changed

contracts/access/manager/AccessManager.sol

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,15 @@ contract AccessManager is Context, Multicall, IAccessManager {
9797
uint32 nonce;
9898
}
9999

100+
/**
101+
* @dev The identifier of the admin role. Required to perform most configuration operations including
102+
* other roles' management and target restrictions.
103+
*/
100104
uint64 public constant ADMIN_ROLE = type(uint64).min; // 0
105+
106+
/**
107+
* @dev The identifier of the public role. Automatically granted to all addresses with no delay.
108+
*/
101109
uint64 public constant PUBLIC_ROLE = type(uint64).max; // 2**64-1
102110

103111
mapping(address target => TargetConfig mode) private _targets;

contracts/proxy/ERC1967/ERC1967Utils.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {Address} from "../../utils/Address.sol";
99
import {StorageSlot} from "../../utils/StorageSlot.sol";
1010

1111
/**
12-
* @dev This abstract contract provides getters and event emitting update functions for
12+
* @dev This library provides getters and event emitting update functions for
1313
* https://eips.ethereum.org/EIPS/eip-1967[ERC-1967] slots.
1414
*/
1515
library ERC1967Utils {

contracts/proxy/transparent/TransparentUpgradeableProxy.sol

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ import {ProxyAdmin} from "./ProxyAdmin.sol";
1515
* include them in the ABI so this interface must be used to interact with it.
1616
*/
1717
interface ITransparentUpgradeableProxy is IERC1967 {
18-
function upgradeToAndCall(address, bytes calldata) external payable;
18+
/**
19+
* @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
20+
* encoded in `data`.
21+
*
22+
* See {UUPSUpgradeable-upgradeToAndCall}
23+
*/
24+
function upgradeToAndCall(address newImplementation, bytes calldata data) external payable;
1925
}
2026

2127
/**

contracts/utils/Base64.sol

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,17 @@ library Base64 {
4040

4141
// If padding is enabled, the final length should be `bytes` data length divided by 3 rounded up and then
4242
// multiplied by 4 so that it leaves room for padding the last chunk
43-
// - `data.length + 2` -> Round up
44-
// - `/ 3` -> Number of 3-bytes chunks
43+
// - `data.length + 2` -> Prepare for division rounding up
44+
// - `/ 3` -> Number of 3-bytes chunks (rounded up)
4545
// - `4 *` -> 4 characters for each chunk
46+
// This is equivalent to: 4 * Math.ceil(data.length / 3)
47+
//
4648
// If padding is disabled, the final length should be `bytes` data length multiplied by 4/3 rounded up as
4749
// opposed to when padding is required to fill the last chunk.
48-
// - `4 *` -> 4 characters for each chunk
49-
// - `data.length + 2` -> Round up
50-
// - `/ 3` -> Number of 3-bytes chunks
50+
// - `4 * data.length` -> 4 characters for each chunk
51+
// - ` + 2` -> Prepare for division rounding up
52+
// - `/ 3` -> Number of 3-bytes chunks (rounded up)
53+
// This is equivalent to: Math.ceil((4 * data.length) / 3)
5154
uint256 resultLength = withPadding ? 4 * ((data.length + 2) / 3) : (4 * data.length + 2) / 3;
5255

5356
string memory result = new string(resultLength);

0 commit comments

Comments
 (0)