|
@@ -144,30 +144,6 @@ library Address {
|
|
return _verifyCallResult(success, returndata, errorMessage);
|
|
return _verifyCallResult(success, returndata, errorMessage);
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
|
|
|
|
- * but performing a delegate call.
|
|
|
|
- *
|
|
|
|
- * _Available since v3.3._
|
|
|
|
- */
|
|
|
|
- function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
|
|
|
|
- return functionDelegateCall(target, data, "Address: low-level delegate call failed");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
|
|
|
|
- * but performing a delegate call.
|
|
|
|
- *
|
|
|
|
- * _Available since v3.3._
|
|
|
|
- */
|
|
|
|
- function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
|
|
|
|
- require(isContract(target), "Address: delegate call to non-contract");
|
|
|
|
-
|
|
|
|
- // solhint-disable-next-line avoid-low-level-calls
|
|
|
|
- (bool success, bytes memory returndata) = target.delegatecall(data);
|
|
|
|
- return _verifyCallResult(success, returndata, errorMessage);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
|
|
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
|
|
if (success) {
|
|
if (success) {
|
|
return returndata;
|
|
return returndata;
|