Skip to content

Commit

Permalink
test updated 4naly3er SARIF
Browse files Browse the repository at this point in the history
  • Loading branch information
mcp-coinbase committed Sep 18, 2024
1 parent 409e8ec commit a4b6205
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/delegateLoop.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
contract DelegateCaller {
address public libraryAddress; // Address of the library contract

constructor(address _libraryAddress) {
libraryAddress = _libraryAddress;
}

// Function to perform delegatecall inside a loop
function delegateInLoop(address[] calldata targets, bytes calldata data) external {
for (uint i = 0; i < targets.length; i++) {
(bool success, ) = targets[i].delegatecall(abi.encodePacked(data));
require(success, "Delegatecall failed");
}
}
}

0 comments on commit a4b6205

Please sign in to comment.