Skip to content

Conversation

joaquim-verges
Copy link
Member

No description provided.

Comment on lines +201 to +221
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly

assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}

Check warning

Code scanning / Slither

Assembly usage

TWAddress.verifyCallResult(bool,bytes,string) (contracts/lib/TWAddress.sol#201-221) uses assembly - INLINE ASM (contracts/lib/TWAddress.sol#213-216)
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Multicall.sol)

pragma solidity ^0.8.0;

Check warning

Code scanning / Slither

Different pragma directives are used

Different versions of Solidity are used: - Version used: ['^0.8.0', '^0.8.1'] - ^0.8.0 (contracts/feature/Multicall.sol#4) - ^0.8.0 (contracts/feature/interface/IMulticall.sol#4) - ^0.8.1 (contracts/lib/TWAddress.sol#4)
Comment on lines +128 to +139
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");

(bool success, bytes memory returndata) = target.call{ value: value }(data);
return verifyCallResult(success, returndata, errorMessage);
}

Check warning

Code scanning / Slither

Low-level calls

Low level call in TWAddress.functionCallWithValue(address,bytes,uint256,string) (contracts/lib/TWAddress.sol#128-139): - (success,returndata) = target.call{value: value}(data) (contracts/lib/TWAddress.sol#137)
Comment on lines +184 to +193
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");

(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}

Check warning

Code scanning / Slither

Low-level calls

Low level call in TWAddress.functionDelegateCall(address,bytes,string) (contracts/lib/TWAddress.sol#184-193): - (success,returndata) = target.delegatecall(data) (contracts/lib/TWAddress.sol#191)
Comment on lines +60 to +65
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");

(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}

Check warning

Code scanning / Slither

Low-level calls

Low level call in TWAddress.sendValue(address,uint256) (contracts/lib/TWAddress.sol#60-65): - (success) = recipient.call{value: amount}() (contracts/lib/TWAddress.sol#63)
Comment on lines +157 to +166
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");

(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}

Check warning

Code scanning / Slither

Low-level calls

Low level call in TWAddress.functionStaticCall(address,bytes,string) (contracts/lib/TWAddress.sol#157-166): - (success,returndata) = target.staticcall(data) (contracts/lib/TWAddress.sol#164)
@joaquim-verges joaquim-verges changed the title [WIP] Drop interfaces token structure Drop interfaces token structure Jun 10, 2022
@joaquim-verges joaquim-verges merged commit 5d74f29 into main Jun 10, 2022
@joaquim-verges joaquim-verges deleted the joaquim/drop_structure branch June 10, 2022 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant