Skip to content

Commit

Permalink
Improve wording consistency in code/doc (#3365)
Browse files Browse the repository at this point in the history
  • Loading branch information
Amxx committed May 4, 2022
1 parent 4574ce4 commit 07b1b47
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 19 deletions.
4 changes: 2 additions & 2 deletions contracts/finance/VestingWallet.sol
Expand Up @@ -84,7 +84,7 @@ contract VestingWallet is Context {
/**
* @dev Release the native token (ether) that have already vested.
*
* Emits a {TokensReleased} event.
* Emits a {EtherReleased} event.
*/
function release() public virtual {
uint256 releasable = vestedAmount(uint64(block.timestamp)) - released();
Expand All @@ -96,7 +96,7 @@ contract VestingWallet is Context {
/**
* @dev Release the tokens that have already vested.
*
* Emits a {TokensReleased} event.
* Emits a {ERC20Released} event.
*/
function release(address token) public virtual {
uint256 releasable = vestedAmount(token, uint64(block.timestamp)) - released(token);
Expand Down
2 changes: 1 addition & 1 deletion contracts/governance/Governor.sol
Expand Up @@ -217,7 +217,7 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor, IERC721Receive
) internal view virtual returns (uint256);

/**
* @dev Register a vote with a given support and voting weight.
* @dev Register a vote for `proposalId` by `account` with a given `support`, voting `weight` and voting `params`.
*
* Note: Support is generic and can represent various things depending on the voting system used.
*/
Expand Down
4 changes: 2 additions & 2 deletions contracts/governance/IGovernor.sol
Expand Up @@ -237,7 +237,7 @@ abstract contract IGovernor is IERC165 {
/**
* @dev Cast a vote with a reason and additional encoded parameters
*
* Emits a {VoteCast} event.
* Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.
*/
function castVoteWithReasonAndParams(
uint256 proposalId,
Expand All @@ -262,7 +262,7 @@ abstract contract IGovernor is IERC165 {
/**
* @dev Cast a vote with a reason and additional encoded parameters using the user's cryptographic signature.
*
* Emits a {VoteCast} event.
* Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.
*/
function castVoteWithReasonAndParamsBySig(
uint256 proposalId,
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IERC3156FlashBorrower.sol
Expand Up @@ -17,7 +17,7 @@ interface IERC3156FlashBorrower {
* @param amount The amount of tokens lent.
* @param fee The additional amount of tokens to repay.
* @param data Arbitrary data structure, intended to contain user-defined parameters.
* @return The keccak256 hash of "ERC3156FlashBorrower.onFlashLoan"
* @return The keccak256 hash of "IERC3156FlashBorrower.onFlashLoan"
*/
function onFlashLoan(
address initiator,
Expand Down
4 changes: 4 additions & 0 deletions contracts/security/PullPayment.sol
Expand Up @@ -43,6 +43,8 @@ abstract contract PullPayment {
* checks-effects-interactions pattern or using {ReentrancyGuard}.
*
* @param payee Whose payments will be withdrawn.
*
* Causes the `escrow` to emits a {Withdrawn} event.
*/
function withdrawPayments(address payable payee) public virtual {
_escrow.withdraw(payee);
Expand All @@ -63,6 +65,8 @@ abstract contract PullPayment {
*
* @param dest The destination address of the funds.
* @param amount The amount to transfer.
*
* Causes the `escrow` to emits a {Deposited} event.
*/
function _asyncTransfer(address dest, uint256 amount) internal virtual {
_escrow.deposit{value: amount}(dest);
Expand Down
8 changes: 7 additions & 1 deletion contracts/token/ERC1155/ERC1155.sol
Expand Up @@ -288,6 +288,8 @@ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
Expand Down Expand Up @@ -321,6 +323,8 @@ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
/**
* @dev Destroys `amount` tokens of token type `id` from `from`
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
Expand Down Expand Up @@ -353,6 +357,8 @@ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
Expand Down Expand Up @@ -405,7 +411,7 @@ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
* and burning, as well as batched variants.
*
* The same hook is called on both single and batched variants. For single
* transfers, the length of the `id` and `amount` arrays will be 1.
* transfers, the length of the `ids` and `amounts` arrays will be 1.
*
* Calling conditions (for each `id` and `amount` pair):
*
Expand Down
2 changes: 1 addition & 1 deletion contracts/token/ERC20/ERC20.sol
Expand Up @@ -210,7 +210,7 @@ contract ERC20 is Context, IERC20, IERC20Metadata {
}

/**
* @dev Moves `amount` of tokens from `sender` to `recipient`.
* @dev Moves `amount` of tokens from `from` to `to`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
Expand Down
20 changes: 10 additions & 10 deletions contracts/token/ERC721/ERC721.sol
Expand Up @@ -176,17 +176,17 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
address from,
address to,
uint256 tokenId,
bytes memory _data
bytes memory data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
_safeTransfer(from, to, tokenId, data);
}

/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
* `data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
Expand All @@ -204,10 +204,10 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
address from,
address to,
uint256 tokenId,
bytes memory _data
bytes memory data
) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer");
}

/**
Expand Down Expand Up @@ -256,11 +256,11 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
bytes memory data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
_checkOnERC721Received(address(0), to, tokenId, data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
Expand Down Expand Up @@ -382,17 +382,17 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @param data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
bytes memory data
) private returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {
return retval == IERC721Receiver.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
Expand Down
3 changes: 2 additions & 1 deletion contracts/token/ERC777/ERC777.sol
Expand Up @@ -288,7 +288,8 @@ contract ERC777 is Context, IERC777, IERC20 {
* the total supply.
*
* If a send hook is registered for `account`, the corresponding function
* will be called with `operator`, `data` and `operatorData`.
* will be called with the caller address as the `operator` and with
* `userData` and `operatorData`.
*
* See {IERC777Sender} and {IERC777Recipient}.
*
Expand Down
4 changes: 4 additions & 0 deletions contracts/utils/escrow/Escrow.sol
Expand Up @@ -34,6 +34,8 @@ contract Escrow is Ownable {
/**
* @dev Stores the sent amount as credit to be withdrawn.
* @param payee The destination address of the funds.
*
* Emits a {Deposited} event.
*/
function deposit(address payee) public payable virtual onlyOwner {
uint256 amount = msg.value;
Expand All @@ -50,6 +52,8 @@ contract Escrow is Ownable {
* checks-effects-interactions pattern or using {ReentrancyGuard}.
*
* @param payee The address whose funds will be withdrawn and transferred to.
*
* Emits a {Withdrawn} event.
*/
function withdraw(address payable payee) public virtual onlyOwner {
uint256 payment = _deposits[payee];
Expand Down

0 comments on commit 07b1b47

Please sign in to comment.