-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: main
Are you sure you want to change the base?
Sonic USDC.e #153
Conversation
…are/collateral-extension
…tware/comet into woof-software/collateral-extension
…software/comet into woof-software/deploy-sonic-usdc-market
…software/comet into woof-software/deploy-sonic-usdc-market
…of-software/deploy-sonic-usdc-market
…are/deploy-sonic-usdc-market
…are/deploy-sonic-usdc-market
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
/// @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
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
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
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
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
(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
/// @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
/// @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
/// @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
/// @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
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
to describe the error in detail using NatSpec.
No description provided.