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

Improve ERC-1363 documentation #4854

Merged
merged 3 commits into from
Jan 24, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions contracts/token/ERC20/extensions/ERC1363.sol
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ abstract contract ERC1363 is ERC20, ERC165, IERC1363 {
*
* - The target has code (i.e. is a contract).
* - The target `to` must implement the {IERC1363Receiver} interface.
* - The target should return the {IERC1363Receiver} interface id.
* - The target must return the {IERC1363Receiver-onTransferReceived} selector to accept the transfer.
* - The internal {transfer} must succeed (returned `true`).
*/
function transferAndCall(address to, uint256 value) public returns (bool) {
Expand All @@ -85,7 +85,7 @@ abstract contract ERC1363 is ERC20, ERC165, IERC1363 {
*
* - The target has code (i.e. is a contract).
* - The target `to` must implement the {IERC1363Receiver} interface.
* - The target should return the {IERC1363Receiver} interface id.
* - The target must return the {IERC1363Receiver-onTransferReceived} selector to accept the transfer.
* - The internal {transferFrom} must succeed (returned `true`).
*/
function transferFromAndCall(address from, address to, uint256 value) public returns (bool) {
Expand Down Expand Up @@ -117,7 +117,7 @@ abstract contract ERC1363 is ERC20, ERC165, IERC1363 {
*
* - The target has code (i.e. is a contract).
* - The target `to` must implement the {IERC1363Spender} interface.
ernestognw marked this conversation as resolved.
Show resolved Hide resolved
* - The target should return the {IERC1363Spender} interface id.
* - The target must return the {IERC1363Spender-onApprovalReceived} selector to accept the approval.
* - The internal {approve} must succeed (returned `true`).
*/
function approveAndCall(address spender, uint256 value) public returns (bool) {
Expand All @@ -143,7 +143,7 @@ abstract contract ERC1363 is ERC20, ERC165, IERC1363 {
*
* - The target has code (i.e. is a contract).
* - The target `to` must implement the {IERC1363Receiver} interface.
* - The target should return the {IERC1363Receiver} interface id.
* - The target must return the {IERC1363Receiver-onTransferReceived} selector to accept the transfer.
*/
function _checkOnTransferReceived(address from, address to, uint256 value, bytes memory data) private {
if (to.code.length == 0) {
Expand Down Expand Up @@ -173,7 +173,7 @@ abstract contract ERC1363 is ERC20, ERC165, IERC1363 {
*
* - The target has code (i.e. is a contract).
* - The target `to` must implement the {IERC1363Spender} interface.
ernestognw marked this conversation as resolved.
Show resolved Hide resolved
* - The target should return the {IERC1363Spender} interface id.
* - The target must return the {IERC1363Spender-onApprovalReceived} selector to accept the approval.
*/
function _checkOnApprovalReceived(address spender, uint256 value, bytes memory data) private {
if (spender.code.length == 0) {
Expand Down