Skip to content

Commit d4c5703

Browse files
committed
refactor: remame to isForwardingValue
1 parent dc75b7a commit d4c5703

25 files changed

+94
-93
lines changed

contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol

+9-10
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ abstract contract LSP0ERC725AccountCore is
764764
/**
765765
* @dev Forwards the call to an extension mapped to a function selector.
766766
*
767-
* Calls {_getExtensionAndPayableBool} to get the address of the extension mapped to the function selector being
767+
* Calls {_getExtensionAndFowardValue} to get the address of the extension mapped to the function selector being
768768
* called on the account. If there is no extension, the `address(0)` will be returned.
769769
* Forwards the value sent with the call to the extension if the function selector is mapped to a payable extension.
770770
*
@@ -786,25 +786,24 @@ abstract contract LSP0ERC725AccountCore is
786786
bytes calldata callData
787787
) internal virtual override returns (bytes memory) {
788788
// If there is a function selector
789-
(address extension, bool isPayable) = _getExtensionAndPayableBool(
790-
msg.sig
791-
);
789+
(
790+
address extension,
791+
bool isForwardingValue
792+
) = _getExtensionAndFowardValue(msg.sig);
792793

793794
// if value is associated with the extension call and extension function selector is not payable, use the universalReceiver
794-
if (msg.value != 0 && !isPayable)
795+
if (msg.value != 0 && !isForwardingValue)
795796
universalReceiver(_TYPEID_LSP0_VALUE_RECEIVED, callData);
796797

797798
// if no extension was found for bytes4(0) return don't revert
798-
if (msg.sig == bytes4(0) && extension == address(0)) {
799-
return "";
800-
}
799+
if (msg.sig == bytes4(0) && extension == address(0)) return "";
801800

802801
// if no extension was found for other function selectors, revert
803802
if (extension == address(0))
804803
revert NoExtensionFoundForFunctionSelector(msg.sig);
805804

806805
(bool success, bytes memory result) = extension.call{
807-
value: isPayable ? msg.value : 0
806+
value: isForwardingValue ? msg.value : 0
808807
}(abi.encodePacked(callData, msg.sender, msg.value));
809808

810809
if (success) {
@@ -824,7 +823,7 @@ abstract contract LSP0ERC725AccountCore is
824823
* - {_LSP17_EXTENSION_PREFIX} + `<bytes4>` (Check [LSP2-ERC725YJSONSchema] for encoding the data key).
825824
* - If no extension is stored, returns the address(0).
826825
*/
827-
function _getExtensionAndPayableBool(
826+
function _getExtensionAndFowardValue(
828827
bytes4 functionSelector
829828
) internal view virtual override returns (address, bool) {
830829
// Generate the data key relevant for the functionSelector being called

contracts/LSP17ContractExtension/LSP17Extendable.sol

+8-7
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ abstract contract LSP17Extendable is ERC165 {
4444
function _supportsInterfaceInERC165Extension(
4545
bytes4 interfaceId
4646
) internal view virtual returns (bool) {
47-
(address erc165Extension, ) = _getExtensionAndPayableBool(
47+
(address erc165Extension, ) = _getExtensionAndFowardValue(
4848
ERC165.supportsInterface.selector
4949
);
5050
if (erc165Extension == address(0)) return false;
@@ -62,14 +62,14 @@ abstract contract LSP17Extendable is ERC165 {
6262
* To be overrided.
6363
* Up to the implementor contract to return an extension based on a function selector
6464
*/
65-
function _getExtensionAndPayableBool(
65+
function _getExtensionAndFowardValue(
6666
bytes4 functionSelector
6767
) internal view virtual returns (address, bool);
6868

6969
/**
7070
* @dev Forwards the call to an extension mapped to a function selector.
7171
*
72-
* Calls {_getExtensionAndPayableBool} to get the address of the extension mapped to the function selector being
72+
* Calls {_getExtensionAndFowardValue} to get the address of the extension mapped to the function selector being
7373
* called on the account. If there is no extension, the `address(0)` will be returned.
7474
* Forwards the value if the extension is payable.
7575
*
@@ -91,16 +91,17 @@ abstract contract LSP17Extendable is ERC165 {
9191
bytes calldata callData
9292
) internal virtual returns (bytes memory) {
9393
// If there is a function selector
94-
(address extension, bool isPayable) = _getExtensionAndPayableBool(
95-
msg.sig
96-
);
94+
(
95+
address extension,
96+
bool isForwardingValue
97+
) = _getExtensionAndFowardValue(msg.sig);
9798

9899
// if no extension was found, revert
99100
if (extension == address(0))
100101
revert NoExtensionFoundForFunctionSelector(msg.sig);
101102

102103
(bool success, bytes memory result) = extension.call{
103-
value: isPayable ? msg.value : 0
104+
value: isForwardingValue ? msg.value : 0
104105
}(abi.encodePacked(callData, msg.sender, msg.value));
105106

106107
if (success) {

contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol

+3-3
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ abstract contract LSP7DigitalAsset is
108108
/**
109109
* @dev Forwards the call with the received value to an extension mapped to a function selector.
110110
*
111-
* Calls {_getExtensionAndPayableBool} to get the address of the extension mapped to the function selector being
111+
* Calls {_getExtensionAndFowardValue} to get the address of the extension mapped to the function selector being
112112
* called on the account. If there is no extension, the address(0) will be returned.
113113
* Forwards the value if the extension is payable.
114114
*
@@ -125,7 +125,7 @@ abstract contract LSP7DigitalAsset is
125125
bytes calldata callData
126126
) internal virtual override returns (bytes memory) {
127127
// If there is a function selector
128-
(address extension, ) = _getExtensionAndPayableBool(msg.sig);
128+
(address extension, ) = _getExtensionAndFowardValue(msg.sig);
129129

130130
// if no extension was found, revert
131131
if (extension == address(0))
@@ -155,7 +155,7 @@ abstract contract LSP7DigitalAsset is
155155
* - If no extension is stored, returns the address(0).
156156
* - we do not check that payable bool as in lsp7 standard we will always forward the value to the extension
157157
*/
158-
function _getExtensionAndPayableBool(
158+
function _getExtensionAndFowardValue(
159159
bytes4 functionSelector
160160
) internal view virtual override returns (address, bool) {
161161
// Generate the data key relevant for the functionSelector being called

contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol

+3-3
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ abstract contract LSP7DigitalAssetInitAbstract is
103103
/**
104104
* @dev Forwards the call with the received value to an extension mapped to a function selector.
105105
*
106-
* Calls {_getExtensionAndPayableBool} to get the address of the extension mapped to the function selector being
106+
* Calls {_getExtensionAndFowardValue} to get the address of the extension mapped to the function selector being
107107
* called on the account. If there is no extension, the address(0) will be returned.
108108
* Forwards the value if the extension is payable.
109109
*
@@ -120,7 +120,7 @@ abstract contract LSP7DigitalAssetInitAbstract is
120120
bytes calldata callData
121121
) internal virtual override returns (bytes memory) {
122122
// If there is a function selector
123-
(address extension, ) = _getExtensionAndPayableBool(msg.sig);
123+
(address extension, ) = _getExtensionAndFowardValue(msg.sig);
124124

125125
// if no extension was found, revert
126126
if (extension == address(0))
@@ -150,7 +150,7 @@ abstract contract LSP7DigitalAssetInitAbstract is
150150
* - If no extension is stored, returns the address(0).
151151
* - We do not check that payable bool as in lsp7 standard we will always forward the value to the extension
152152
*/
153-
function _getExtensionAndPayableBool(
153+
function _getExtensionAndFowardValue(
154154
bytes4 functionSelector
155155
) internal view virtual override returns (address, bool) {
156156
// Generate the data key relevant for the functionSelector being called

contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol

+3-3
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ abstract contract LSP8IdentifiableDigitalAsset is
130130
/**
131131
* @dev Forwards the call with the received value to an extension mapped to a function selector.
132132
*
133-
* Calls {_getExtensionAndPayableBool} to get the address of the extension mapped to the function selector being
133+
* Calls {_getExtensionAndFowardValue} to get the address of the extension mapped to the function selector being
134134
* called on the account. If there is no extension, the address(0) will be returned.
135135
* We will always forward the value to the extension, as the LSP8 contract is not supposed to hold any native tokens.
136136
*
@@ -147,7 +147,7 @@ abstract contract LSP8IdentifiableDigitalAsset is
147147
bytes calldata callData
148148
) internal virtual override returns (bytes memory) {
149149
// If there is a function selector
150-
(address extension, ) = _getExtensionAndPayableBool(msg.sig);
150+
(address extension, ) = _getExtensionAndFowardValue(msg.sig);
151151

152152
// if no extension was found, revert
153153
if (extension == address(0))
@@ -176,7 +176,7 @@ abstract contract LSP8IdentifiableDigitalAsset is
176176
* - {_LSP17_EXTENSION_PREFIX} + `<bytes4>` (Check [LSP2-ERC725YJSONSchema] for encoding the data key).
177177
* - If no extension is stored, returns the address(0).
178178
*/
179-
function _getExtensionAndPayableBool(
179+
function _getExtensionAndFowardValue(
180180
bytes4 functionSelector
181181
) internal view virtual override returns (address, bool) {
182182
// Generate the data key relevant for the functionSelector being called

contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol

+3-3
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ abstract contract LSP8IdentifiableDigitalAssetInitAbstract is
133133
/**
134134
* @dev Forwards the call with the received value to an extension mapped to a function selector.
135135
*
136-
* Calls {_getExtensionAndPayableBool} to get the address of the extension mapped to the function selector being
136+
* Calls {_getExtensionAndFowardValue} to get the address of the extension mapped to the function selector being
137137
* called on the account. If there is no extension, the address(0) will be returned.
138138
* We will always forward the value to the extension, as the LSP8 contract is not supposed to hold any native tokens.
139139
*
@@ -150,7 +150,7 @@ abstract contract LSP8IdentifiableDigitalAssetInitAbstract is
150150
bytes calldata callData
151151
) internal virtual override returns (bytes memory) {
152152
// If there is a function selector
153-
(address extension, ) = _getExtensionAndPayableBool(msg.sig);
153+
(address extension, ) = _getExtensionAndFowardValue(msg.sig);
154154

155155
// if no extension was found, revert
156156
if (extension == address(0))
@@ -179,7 +179,7 @@ abstract contract LSP8IdentifiableDigitalAssetInitAbstract is
179179
* - {_LSP17_EXTENSION_PREFIX} + `<bytes4>` (Check [LSP2-ERC725YJSONSchema] for encoding the data key).
180180
* - If no extension is stored, returns the address(0).
181181
*/
182-
function _getExtensionAndPayableBool(
182+
function _getExtensionAndFowardValue(
183183
bytes4 functionSelector
184184
) internal view virtual override returns (address, bool) {
185185
// Generate the data key relevant for the functionSelector being called

contracts/LSP9Vault/LSP9VaultCore.sol

+8-7
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ contract LSP9VaultCore is
527527
/**
528528
* @dev Forwards the call to an extension mapped to a function selector.
529529
*
530-
* Calls {_getExtensionAndPayableBool} to get the address of the extension mapped to the function selector being
530+
* Calls {_getExtensionAndFowardValue} to get the address of the extension mapped to the function selector being
531531
* called on the account. If there is no extension, the `address(0)` will be returned.
532532
* Forwards the value if the extension is payable.
533533
*
@@ -549,12 +549,13 @@ contract LSP9VaultCore is
549549
bytes calldata callData
550550
) internal virtual override returns (bytes memory) {
551551
// If there is a function selector
552-
(address extension, bool isPayable) = _getExtensionAndPayableBool(
553-
msg.sig
554-
);
552+
(
553+
address extension,
554+
bool isForwardingValue
555+
) = _getExtensionAndFowardValue(msg.sig);
555556

556557
// if value is associated with the extension call and function selector is not payable, use the universalReceiver
557-
if (msg.value != 0 && !isPayable)
558+
if (msg.value != 0 && !isForwardingValue)
558559
universalReceiver(_TYPEID_LSP9_VALUE_RECEIVED, callData);
559560

560561
// if no extension was found for bytes4(0) return don't revert
@@ -565,7 +566,7 @@ contract LSP9VaultCore is
565566
revert NoExtensionFoundForFunctionSelector(msg.sig);
566567

567568
(bool success, bytes memory result) = extension.call{
568-
value: isPayable ? msg.value : 0
569+
value: isForwardingValue ? msg.value : 0
569570
}(abi.encodePacked(callData, msg.sender, msg.value));
570571

571572
if (success) {
@@ -587,7 +588,7 @@ contract LSP9VaultCore is
587588
* - {_LSP17_EXTENSION_PREFIX} + `<bytes4>` (Check [LSP2-ERC725YJSONSchema] for encoding the data key).
588589
* - If no extension is stored, returns the address(0).
589590
*/
590-
function _getExtensionAndPayableBool(
591+
function _getExtensionAndFowardValue(
591592
bytes4 functionSelector
592593
) internal view virtual override returns (address, bool) {
593594
// Generate the data key relevant for the functionSelector being called

contracts/Mocks/LSP17ExtendableTester.sol

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ contract LSP17ExtendableTester is LSP17Extendable {
3535
function getExtension(
3636
bytes4 functionSelector
3737
) public view returns (address, bool) {
38-
return _getExtensionAndPayableBool(functionSelector);
38+
return _getExtensionAndFowardValue(functionSelector);
3939
}
4040

4141
function setExtension(
4242
bytes4 functionSelector,
4343
address extensionContract,
44-
bool isPayable
44+
bool isForwardingValue
4545
) public {
4646
_extensions[functionSelector] = extensionContract;
47-
_payableExtensions[functionSelector] = isPayable;
47+
_payableExtensions[functionSelector] = isForwardingValue;
4848
}
4949

5050
function getStorageData() public view returns (string memory) {
@@ -63,7 +63,7 @@ contract LSP17ExtendableTester is LSP17Extendable {
6363
_anotherStorageData = newData;
6464
}
6565

66-
function _getExtensionAndPayableBool(
66+
function _getExtensionAndFowardValue(
6767
bytes4 functionSelector
6868
) internal view override returns (address, bool) {
6969
return (

docs/contracts/LSP0ERC725Account/LSP0ERC725Account.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1145,10 +1145,10 @@ extension if the extension is set, if not it returns false.
11451145

11461146
<br/>
11471147

1148-
### \_getExtensionAndPayableBool
1148+
### \_getExtensionAndFowardValue
11491149

11501150
```solidity
1151-
function _getExtensionAndPayableBool(
1151+
function _getExtensionAndFowardValue(
11521152
bytes4 functionSelector
11531153
) internal view returns (address, bool);
11541154
```
@@ -1183,7 +1183,7 @@ function _fallbackLSP17Extendable(
11831183
```
11841184

11851185
Forwards the call to an extension mapped to a function selector.
1186-
Calls [`_getExtensionAndPayableBool`](#_getextensionandpayablebool) to get the address of the extension mapped to the function selector being
1186+
Calls [`_getExtensionAndFowardValue`](#_getextensionandfowardvalue) to get the address of the extension mapped to the function selector being
11871187
called on the account. If there is no extension, the `address(0)` will be returned.
11881188
Forwards the value sent with the call to the extension if the function selector is mapped to a payable extension.
11891189
Reverts if there is no extension for the function being called, except for the `bytes4(0)` function selector, which passes even if there is no extension for it.

docs/contracts/LSP17ContractExtension/LSP17Extendable.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ extension if the extension is set, if not it returns false.
7878

7979
<br/>
8080

81-
### \_getExtensionAndPayableBool
81+
### \_getExtensionAndFowardValue
8282

8383
```solidity
84-
function _getExtensionAndPayableBool(
84+
function _getExtensionAndFowardValue(
8585
bytes4 functionSelector
8686
) internal view returns (address, bool);
8787
```
@@ -115,7 +115,7 @@ function _fallbackLSP17Extendable(
115115
```
116116

117117
Forwards the call to an extension mapped to a function selector.
118-
Calls [`_getExtensionAndPayableBool`](#_getextensionandpayablebool) to get the address of the extension mapped to the function selector being
118+
Calls [`_getExtensionAndFowardValue`](#_getextensionandfowardvalue) to get the address of the extension mapped to the function selector being
119119
called on the account. If there is no extension, the `address(0)` will be returned.
120120
Forwards the value if the extension is payable.
121121
Reverts if there is no extension for the function being called.

docs/contracts/LSP7DigitalAsset/LSP7DigitalAsset.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1123,10 +1123,10 @@ extension if the extension is set, if not it returns false.
11231123

11241124
<br/>
11251125

1126-
### \_getExtensionAndPayableBool
1126+
### \_getExtensionAndFowardValue
11271127

11281128
```solidity
1129-
function _getExtensionAndPayableBool(
1129+
function _getExtensionAndFowardValue(
11301130
bytes4 functionSelector
11311131
) internal view returns (address, bool);
11321132
```
@@ -1157,7 +1157,7 @@ function _fallbackLSP17Extendable(
11571157
```
11581158

11591159
Forwards the call with the received value to an extension mapped to a function selector.
1160-
Calls [`_getExtensionAndPayableBool`](#_getextensionandpayablebool) to get the address of the extension mapped to the function selector being
1160+
Calls [`_getExtensionAndFowardValue`](#_getextensionandfowardvalue) to get the address of the extension mapped to the function selector being
11611161
called on the account. If there is no extension, the address(0) will be returned.
11621162
Forwards the value if the extension is payable.
11631163
Reverts if there is no extension for the function being called.

docs/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1148,10 +1148,10 @@ extension if the extension is set, if not it returns false.
11481148

11491149
<br/>
11501150

1151-
### \_getExtensionAndPayableBool
1151+
### \_getExtensionAndFowardValue
11521152

11531153
```solidity
1154-
function _getExtensionAndPayableBool(
1154+
function _getExtensionAndFowardValue(
11551155
bytes4 functionSelector
11561156
) internal view returns (address, bool);
11571157
```
@@ -1182,7 +1182,7 @@ function _fallbackLSP17Extendable(
11821182
```
11831183

11841184
Forwards the call with the received value to an extension mapped to a function selector.
1185-
Calls [`_getExtensionAndPayableBool`](#_getextensionandpayablebool) to get the address of the extension mapped to the function selector being
1185+
Calls [`_getExtensionAndFowardValue`](#_getextensionandfowardvalue) to get the address of the extension mapped to the function selector being
11861186
called on the account. If there is no extension, the address(0) will be returned.
11871187
Forwards the value if the extension is payable.
11881188
Reverts if there is no extension for the function being called.

docs/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1122,10 +1122,10 @@ extension if the extension is set, if not it returns false.
11221122

11231123
<br/>
11241124

1125-
### \_getExtensionAndPayableBool
1125+
### \_getExtensionAndFowardValue
11261126

11271127
```solidity
1128-
function _getExtensionAndPayableBool(
1128+
function _getExtensionAndFowardValue(
11291129
bytes4 functionSelector
11301130
) internal view returns (address, bool);
11311131
```
@@ -1156,7 +1156,7 @@ function _fallbackLSP17Extendable(
11561156
```
11571157

11581158
Forwards the call with the received value to an extension mapped to a function selector.
1159-
Calls [`_getExtensionAndPayableBool`](#_getextensionandpayablebool) to get the address of the extension mapped to the function selector being
1159+
Calls [`_getExtensionAndFowardValue`](#_getextensionandfowardvalue) to get the address of the extension mapped to the function selector being
11601160
called on the account. If there is no extension, the address(0) will be returned.
11611161
Forwards the value if the extension is payable.
11621162
Reverts if there is no extension for the function being called.

0 commit comments

Comments
 (0)