Skip to content

Commit

Permalink
feat(contracts): add new forwarder contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
gianchandania committed Dec 27, 2023
1 parent ddea520 commit e0bbd8c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions contracts/ForwarderV4.sol
Original file line number Diff line number Diff line change
Expand Up @@ -154,20 +154,21 @@ contract ForwarderV4 is IERC721Receiver, ERC1155Receiver, IForwarderV4 {
}

/**
* @notice Method to allow for calls to other contracts. This method can only be called by the allowed address
* @notice Method to allow for calls to other contracts. This method can only be called by the parent address
* @param target The target contract address whose method needs to be called
* @param value The amount of Ether to be sent
* @param data The calldata to be sent
*/
function callFromAllowedAddress(
function callFromParent(
address target,
uint256 value,
bytes calldata data
) external onlyAllowedAddress returns (bytes memory) {
) external returns (bytes memory) {
require(msg.sender == parentAddress, 'Only Parent');
(bool success, bytes memory returnedData) = target.call{ value: value }(
data
);
require(success, 'Allowed address call execution failed');
require(success, 'Parent call execution failed');

return returnedData;
}
Expand Down

0 comments on commit e0bbd8c

Please sign in to comment.