Skip to content

Commit ecfd727

Browse files
committed
Better comments related to the isIncrease flag value
1 parent 18737a5 commit ecfd727

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/enforcers/ERC1155BalanceChangeEnforcer.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ contract ERC1155BalanceChangeEnforcer is CaveatEnforcer {
5656
/**
5757
* @notice This function caches the recipient's ERC1155 token balance before the delegation is executed.
5858
* @param _terms 105 bytes where:
59-
* - first byte: boolean indicating if the balance should decrease
59+
* - first byte: boolean indicating if the balance should decrease (true | 0x01) or increase (false | 0x00)
6060
* - next 20 bytes: address of the ERC1155 token
6161
* - next 20 bytes: address of the recipient
6262
* - next 32 bytes: token ID
@@ -89,7 +89,7 @@ contract ERC1155BalanceChangeEnforcer is CaveatEnforcer {
8989
/**
9090
* @notice This function enforces that the recipient's ERC1155 token balance has changed by the expected amount.
9191
* @param _terms 105 bytes where:
92-
* - first byte: boolean indicating if the balance should decrease
92+
* - first byte: boolean indicating if the balance should decrease (true | 0x01) or increase (false | 0x00)
9393
* - next 20 bytes: address of the ERC1155 token
9494
* - next 20 bytes: address of the recipient
9595
* - next 32 bytes: token ID
@@ -123,7 +123,7 @@ contract ERC1155BalanceChangeEnforcer is CaveatEnforcer {
123123
/**
124124
* @notice Decodes the terms used in this CaveatEnforcer.
125125
* @param _terms Encoded data that is used during the execution hooks.
126-
* @return isDecrease_ Boolean indicating if the balance should decrease (true) or increase (false).
126+
* @return isDecrease_ Boolean indicating if the balance should decrease (true | 0x01) or increase (false | 0x00).
127127
* @return token_ The address of the ERC1155 token.
128128
* @return recipient_ The address of the recipient of the token.
129129
* @return tokenId_ The ID of the ERC1155 token.

src/enforcers/ERC20BalanceChangeEnforcer.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ contract ERC20BalanceChangeEnforcer is CaveatEnforcer {
4444
/**
4545
* @notice This function caches the delegators ERC20 balance before the delegation is executed.
4646
* @param _terms 73 packed bytes where:
47-
* - first byte: boolean indicating if the balance should decrease
47+
* - first byte: boolean indicating if the balance should decrease (true | 0x01) or increase (false | 0x00)
4848
* - next 20 bytes: address of the token
4949
* - next 20 bytes: address of the recipient
5050
* - next 32 bytes: balance change guardrail amount (i.e., minimum increase OR maximum decrease, depending on
@@ -75,7 +75,7 @@ contract ERC20BalanceChangeEnforcer is CaveatEnforcer {
7575
/**
7676
* @notice This function enforces that the delegators ERC20 balance has changed by the expected amount.
7777
* @param _terms 73 packed bytes where:
78-
* - first byte: boolean indicating if the balance should decrease
78+
* - first byte: boolean indicating if the balance should decrease (true | 0x01) or increase (false | 0x00)
7979
* - next 20 bytes: address of the token
8080
* - next 20 bytes: address of the recipient
8181
* - next 32 bytes: balance change guardrail amount (i.e., minimum increase OR maximum decrease, depending on
@@ -107,7 +107,7 @@ contract ERC20BalanceChangeEnforcer is CaveatEnforcer {
107107
/**
108108
* @notice Decodes the terms used in this CaveatEnforcer.
109109
* @param _terms encoded data that is used during the execution hooks.
110-
* @return isDecrease_ Boolean indicating if the balance should decrease (true) or increase (false).
110+
* @return isDecrease_ Boolean indicating if the balance should decrease (true | 0x01) or increase (false | 0x00).
111111
* @return token_ The address of the token.
112112
* @return recipient_ The address of the recipient.
113113
* @return amount_ Balance change guardrail amount (i.e., minimum increase OR maximum decrease, depending on

src/enforcers/ERC721BalanceChangeEnforcer.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ contract ERC721BalanceChangeEnforcer is CaveatEnforcer {
5454
/**
5555
* @notice This function caches the delegator's ERC721 token balance before the delegation is executed.
5656
* @param _terms 73 bytes where:
57-
* - first byte: boolean indicating if the balance should decrease
57+
* - first byte: boolean indicating if the balance should decrease (true | 0x01) or increase (false | 0x00)
5858
* - next 20 bytes: address of the ERC721 token
5959
* - next 20 bytes: address of the recipient
6060
* - next 32 bytes: balance change guardrail amount (i.e., minimum increase OR maximum decrease, depending on
@@ -86,7 +86,7 @@ contract ERC721BalanceChangeEnforcer is CaveatEnforcer {
8686
/**
8787
* @notice This function enforces that the delegator's ERC721 token balance has changed by the expected amount.
8888
* @param _terms 73 bytes where:
89-
* - first byte: boolean indicating if the balance should decrease
89+
* - first byte: boolean indicating if the balance should decrease (true | 0x01) or increase (false | 0x00)
9090
* - next 20 bytes: address of the ERC721 token
9191
* - next 20 bytes: address of the recipient
9292
* - next 32 bytes: balance change guardrail amount (i.e., minimum increase OR maximum decrease, depending on
@@ -119,7 +119,7 @@ contract ERC721BalanceChangeEnforcer is CaveatEnforcer {
119119
/**
120120
* @notice Decodes the terms used in this CaveatEnforcer.
121121
* @param _terms Encoded data that is used during the execution hooks.
122-
* @return isDecrease_ Boolean indicating if the balance should decrease (true) or increase (false).
122+
* @return isDecrease_ Boolean indicating if the balance should decrease (true | 0x01) or increase (false | 0x00).
123123
* @return token_ The address of the ERC721 token.
124124
* @return recipient_ The address of the recipient of the token.
125125
* @return amount_ Balance change guardrail amount (i.e., minimum increase OR maximum decrease, depending on

src/enforcers/NativeBalanceChangeEnforcer.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ contract NativeBalanceChangeEnforcer is CaveatEnforcer {
4141
/**
4242
* @notice This function caches the delegator's native token balance before the delegation is executed.
4343
* @param _terms 53 packed bytes where:
44-
* - first byte: boolean indicating if the balance should decrease
44+
* - first byte: boolean indicating if the balance should decrease (true | 0x01) or increase (false | 0x00)
4545
* - next 20 bytes: address of the recipient
4646
* - next 32 bytes: balance change guardrail amount (i.e., minimum increase OR maximum decrease, depending on
4747
* isDecrease)
@@ -71,7 +71,7 @@ contract NativeBalanceChangeEnforcer is CaveatEnforcer {
7171
/**
7272
* @notice This function enforces that the delegator's native token balance has changed by the expected amount.
7373
* @param _terms 53 packed bytes where:
74-
* - first byte: boolean indicating if the balance should decrease
74+
* - first byte: boolean indicating if the balance should decrease (true | 0x01) or increase (false | 0x00)
7575
* - next 20 bytes: address of the recipient
7676
* - next 32 bytes: balance change guardrail amount (i.e., minimum increase OR maximum decrease, depending on
7777
* isDecrease)
@@ -104,7 +104,7 @@ contract NativeBalanceChangeEnforcer is CaveatEnforcer {
104104
/**
105105
* @notice Decodes the terms used in this CaveatEnforcer.
106106
* @param _terms 53 packed bytes where:
107-
* - first byte: boolean indicating if the balance should decrease
107+
* - first byte: boolean indicating if the balance should decrease (true | 0x01) or increase (false | 0x00)
108108
* - next 20 bytes: address of the recipient
109109
* - next 32 bytes: balance change guardrail amount (i.e., minimum increase OR maximum decrease, depending on
110110
* isDecrease)

0 commit comments

Comments
 (0)