Skip to content

Commit

Permalink
feat: update hook name
Browse files Browse the repository at this point in the history
  • Loading branch information
vittominacori committed Aug 26, 2024
1 parent 789c6bc commit 9bed2bb
Show file tree
Hide file tree
Showing 7 changed files with 1,214 additions and 775 deletions.
Binary file modified analysis/control-flow/ERC1363.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions analysis/description-table/ERC1363.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@
|| transferFromAndCall | Public ❗️ | 🛑 |NO❗️ |
|| approveAndCall | Public ❗️ | 🛑 |NO❗️ |
|| approveAndCall | Public ❗️ | 🛑 |NO❗️ |
|| _checkOnTransferReceived | Private 🔐 | 🛑 | |
|| _checkOnApprovalReceived | Private 🔐 | 🛑 | |
|| _checkOnERC1363TransferReceived | Private 🔐 | 🛑 | |
|| _checkOnERC1363ApprovalReceived | Private 🔐 | 🛑 | |


### Legend
Expand Down
76 changes: 38 additions & 38 deletions analysis/uml/ERC1363.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions contracts/token/ERC1363/ERC1363.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ abstract contract ERC1363 is ERC20, ERC165, IERC1363, IERC1363Errors {
if (!transfer(to, value)) {
revert ERC1363TransferFailed(to, value);
}
_checkOnTransferReceived(_msgSender(), to, value, data);
_checkOnERC1363TransferReceived(_msgSender(), to, value, data);
return true;
}

Expand All @@ -61,7 +61,7 @@ abstract contract ERC1363 is ERC20, ERC165, IERC1363, IERC1363Errors {
if (!transferFrom(from, to, value)) {
revert ERC1363TransferFromFailed(from, to, value);
}
_checkOnTransferReceived(from, to, value, data);
_checkOnERC1363TransferReceived(from, to, value, data);
return true;
}

Expand All @@ -79,7 +79,7 @@ abstract contract ERC1363 is ERC20, ERC165, IERC1363, IERC1363Errors {
if (!approve(spender, value)) {
revert ERC1363ApproveFailed(spender, value);
}
_checkOnApprovalReceived(spender, value, data);
_checkOnERC1363ApprovalReceived(spender, value, data);
return true;
}

Expand All @@ -94,7 +94,7 @@ abstract contract ERC1363 is ERC20, ERC165, IERC1363, IERC1363Errors {
* @param value The amount of tokens to be transferred.
* @param data Optional data to send along with the call.
*/
function _checkOnTransferReceived(address from, address to, uint256 value, bytes memory data) private {
function _checkOnERC1363TransferReceived(address from, address to, uint256 value, bytes memory data) private {
if (to.code.length == 0) {
revert ERC1363EOAReceiver(to);
}
Expand Down Expand Up @@ -124,7 +124,7 @@ abstract contract ERC1363 is ERC20, ERC165, IERC1363, IERC1363Errors {
* @param value The amount of tokens to be spent.
* @param data Optional data to send along with the call.
*/
function _checkOnApprovalReceived(address spender, uint256 value, bytes memory data) private {
function _checkOnERC1363ApprovalReceived(address spender, uint256 value, bytes memory data) private {
if (spender.code.length == 0) {
revert ERC1363EOASpender(spender);
}
Expand Down
12 changes: 6 additions & 6 deletions dist/ERC1363.dist.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

// Sources flattened with hardhat v2.22.5 https://hardhat.org
// Sources flattened with hardhat v2.22.9 https://hardhat.org



Expand Down Expand Up @@ -925,7 +925,7 @@ abstract contract ERC1363 is ERC20, ERC165, IERC1363, IERC1363Errors {
if (!transfer(to, value)) {
revert ERC1363TransferFailed(to, value);
}
_checkOnTransferReceived(_msgSender(), to, value, data);
_checkOnERC1363TransferReceived(_msgSender(), to, value, data);
return true;
}

Expand All @@ -948,7 +948,7 @@ abstract contract ERC1363 is ERC20, ERC165, IERC1363, IERC1363Errors {
if (!transferFrom(from, to, value)) {
revert ERC1363TransferFromFailed(from, to, value);
}
_checkOnTransferReceived(from, to, value, data);
_checkOnERC1363TransferReceived(from, to, value, data);
return true;
}

Expand All @@ -966,7 +966,7 @@ abstract contract ERC1363 is ERC20, ERC165, IERC1363, IERC1363Errors {
if (!approve(spender, value)) {
revert ERC1363ApproveFailed(spender, value);
}
_checkOnApprovalReceived(spender, value, data);
_checkOnERC1363ApprovalReceived(spender, value, data);
return true;
}

Expand All @@ -981,7 +981,7 @@ abstract contract ERC1363 is ERC20, ERC165, IERC1363, IERC1363Errors {
* @param value The amount of tokens to be transferred.
* @param data Optional data to send along with the call.
*/
function _checkOnTransferReceived(address from, address to, uint256 value, bytes memory data) private {
function _checkOnERC1363TransferReceived(address from, address to, uint256 value, bytes memory data) private {
if (to.code.length == 0) {
revert ERC1363EOAReceiver(to);
}
Expand Down Expand Up @@ -1011,7 +1011,7 @@ abstract contract ERC1363 is ERC20, ERC165, IERC1363, IERC1363Errors {
* @param value The amount of tokens to be spent.
* @param data Optional data to send along with the call.
*/
function _checkOnApprovalReceived(address spender, uint256 value, bytes memory data) private {
function _checkOnERC1363ApprovalReceived(address spender, uint256 value, bytes memory data) private {
if (spender.code.length == 0) {
revert ERC1363EOASpender(spender);
}
Expand Down
Loading

0 comments on commit 9bed2bb

Please sign in to comment.