-
Notifications
You must be signed in to change notification settings - Fork 167
Sonic cUSDCev3 #975
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 cUSDCev3 #975
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
function supportsInterface( | ||
bytes4 interfaceId | ||
) public view virtual override returns (bool) { | ||
return | ||
interfaceId == type(IAny2EVMMessageReceiver).interfaceId || | ||
interfaceId == type(IERC165).interfaceId; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it might be better to have it at the end.
import {IERC165} from "../../IERC165.sol"; | ||
import {IAny2EVMMessageReceiver, Any2EVMMessage} from "../../IAny2EVMMessageReceiver.sol"; | ||
|
||
contract RoninBridgeReceiver is SweepableBridgeReceiver, IERC165, IAny2EVMMessageReceiver{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
contract RoninBridgeReceiver is SweepableBridgeReceiver, IERC165, IAny2EVMMessageReceiver{ | |
contract RoninBridgeReceiver is SweepableBridgeReceiver, IERC165, IAny2EVMMessageReceiver { |
error InvalidRouter(); | ||
error InvalidChainSelector(); | ||
|
||
address public l2Router; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error InvalidRouter(); | |
error InvalidChainSelector(); | |
address public l2Router; | |
address public l2Router; | |
error InvalidRouter(); | |
error InvalidChainSelector(); |
|
||
function ccipReceive(Any2EVMMessage calldata message) external { | ||
if (msg.sender != l2Router) revert InvalidRouter(); | ||
if(message.sourceChainSelector != MAINNET_CHAIN_SELECTOR) revert InvalidChainSelector(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(message.sourceChainSelector != MAINNET_CHAIN_SELECTOR) revert InvalidChainSelector(); | |
if (message.sourceChainSelector != MAINNET_CHAIN_SELECTOR) revert InvalidChainSelector(); |
…are/deploy-sonic-usdc-market
function initialize(address _timelock, address _bridge) public { | ||
require(timelock == address(0), "already initialized"); | ||
timelock = _timelock; | ||
bridge = _bridge; | ||
} |
Check failure
Code scanning / Semgrep OSS
Semgrep Finding: compound.solidity.lack-of-revert-alreadyinitialized
mapping(uint256 => ClaimData) public claims; | ||
|
||
function initialize(address _timelock, address _bridge) public { | ||
require(timelock == address(0), "already initialized"); |
Check notice
Code scanning / Semgrep OSS
Semgrep Finding: rules.solidity.performance.use-custom-error-not-require
function setClaimData(uint256 id, address token, uint256 amount, address l2Token, address to) public { | ||
require(msg.sender == address(this), "only delegator"); | ||
claims[id] = ClaimData(id, token, amount, l2Token, to); | ||
} |
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: compound.solidity.state-changing-func-does-not-emit-event
} | ||
|
||
function setClaimData(uint256 id, address token, uint256 amount, address l2Token, address to) public { | ||
require(msg.sender == address(this), "only delegator"); |
Check notice
Code scanning / Semgrep OSS
Semgrep Finding: rules.solidity.performance.use-custom-error-not-require
} | ||
|
||
function call(address[] calldata targets, bytes[] calldata callDatas, uint256[] calldata values) public payable { | ||
require(msg.sender == timelock, "only timelock"); |
Check notice
Code scanning / Semgrep OSS
Semgrep Finding: rules.solidity.performance.use-custom-error-not-require
function call(address[] calldata targets, bytes[] calldata callDatas, uint256[] calldata values) public 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
function call(address[] calldata targets, bytes[] calldata callDatas, uint256[] calldata values) public 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
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
(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
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
No description provided.