10000 Sonic USDC.e by MishaShWoof · Pull Request #153 · woof-software/comet · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Sonic USDC.e #153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 80 commits into
base: main
Choose a base branch
from
Open

Conversation

MishaShWoof
Copy link
Collaborator

No description provided.

Comment on lines 31 to 35
function initialize(address _timelock, address _bridge) external {
require(timelock == address(0), "already initialized");
timelock = _timelock;
bridge = _bridge;
}

Check failure

Code scanning / Semgrep OSS

Semgrep Finding: compound.solidity.lack-of-revert-alreadyinitialized Error

Function initialize() doesn't have AlreadyInitialized revert
/// @param to The address to send the claimed tokens to
/// @dev This function can only be called by the contract itself
function setClaimData(uint256 id, address token, uint256 amount, address l2Token, address to) external {
require(msg.sender == address(this), "only delegator");

Check notice

Code scanning / Semgrep OSS

Semgrep Finding: rules.solidity.performance.use-custom-error-not-require Note

Consider using custom errors as they are more gas efficient while allowing developers
to describe the error in detail using NatSpec.
/// @param values The values to send with each call
/// @dev This function can only be called by the timelock contract
function call(address[] calldata targets, bytes[] calldata callDatas, uint256[] calldata values) external payable {
require(msg.sender == timelock, "only timelock");

Check notice

Code scanning / Semgrep OSS

Semgrep Finding: rules.solidity.performance.use-custom-error-not-require Note

Consider using custom errors as they are more gas efficient while allowing developers
to describe the error in detail using NatSpec.
function call(address[] calldata targets, bytes[] calldata callDatas, uint256[] calldata values) external payable {
require(msg.sender == timelock, "only timelock");
require(targets.length == callDatas.length && targets.length == values.length, "targets and data length mismatch");
for (uint i = 0; i < targets.length; i++) {

Check notice

Code scanning / Semgrep OSS

Semgrep Finding: rules.solidity.performance.unnecessary-checked-arithmetic-in-loop Note

A lot of times there is no risk that the loop counter can overflow.
Using Solidity's unchecked block saves the overflow checks.
function call(address[] calldata targets, bytes[] calldata callDatas, uint256[] calldata values) external payable {
require(msg.sender == timelock, "only timelock");
require(targets.length == callDatas.length && targets.length == values.length, "targets and data length mismatch");
for (uint i = 0; i < targets.length; i++) {

Check notice

Code scanning / Semgrep OSS

Semgrep Finding: rules.solidity.performance.use-prefix-increment-not-postfix Note

Consider using the prefix increment expression whenever the return value is not needed.
The prefix increment expression is cheaper in terms of gas.
require(msg.sender == timelock, "only timelock");
require(targets.length == callDatas.length && targets.length == values.length, "targets and data length mismatch");
for (uint i = 0; i < targets.length; i++) {
(bool success, bytes memory returnData) = targets[i].call{value: values[i]}(callDatas[i]);

Check failure

Code scanning / Semgrep OSS

Semgrep Finding: rules.solidity.security.arbitrary-low-level-call Error

An attacker may perform call() to an arbitrary address with controlled calldata
(bool success, bytes memory returnData) = targets[i].call{value: values[i]}(callDatas[i]);
if (!success) {
// revert with the original error message from the call
if (returnData.length > 0) {

Check notice

Code scanning / Semgrep OSS

Semgrep Finding: rules.solidity.performance.array-length-outside-loop Note

Caching the array length outside a loop saves reading it on each iteration, as long as the array's length is not changed during the loop.
/// @notice Emitted when contract is initialized
event Initialized(address indexed timelock, address indexed bridge);
/// @notice Emitted when the claim data is set
event ClaimDataSet(uint256 id, address token, uint256 amount, address l2Token, address to);

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: compound.solidity.lack-of-indexed-parameter Warning

Event parameters with type 'address' should be indexed
/// @notice Emitted when the claim data is set
event ClaimDataSet(uint256 id, address token, uint256 amount, address l2Token, address to);
/// @notice Emitted when the claim is executed
event ClaimExecuted(uint256 id, address token, uint256 amount, address l2Token, address to);

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: compound.solidity.lack-of-indexed-parameter Warning

Event parameters with type 'address' should be indexed
/// @notice Emitted when the claim is executed
event ClaimExecuted(uint256 id, address token, uint256 amount, address l2Token, address to);
/// @notice Emitted when a call is executed
event CallExecuted(address target, bytes data, uint256 value);

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: compound.solidity.lack-of-indexed-parameter Warning

Event parameters with type 'address' should be indexed
/// @param _timelock Address of the timelock contract that this contract will receive messages from
/// @param _bridge Address of the bridge contract that this contract will send funds to
function initialize(address _timelock, address _bridge) external {
require(timelock == address(0), "already initialized");

Check notice

Code scanning / Semgrep OSS

Semgrep Finding: rules.solidity.performance.use-custom-error-not-require Note

Consider using custom errors as they are more gas efficient while allowing developers
to describe the error in detail using NatSpec.
revert(add(32, returnData), returndata_size)
}
} else {
revert("Delegator: call failed");

Check notice

Code scanning / Semgrep OSS

Semgrep Finding: rules.solidity.performance.use-custom-error-not-require Note

Consider using custom errors as they are more gas efficient while allowing developers
to describe the error in detail using NatSpec.
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.

3 participants
0