Вызов Called при помощи address
January 31st, 2024
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
contract Called {
	bool public myBool;
	function foo() public pure returns (string memory) {
		return "A";
	}
}

contract Caller {
	function callFooFunction(address _a) public returns (bytes memory) {
		(bool success, bytes memory data) = _a.call(abi.encodeWithSignature("foo()"));
		require(success, "Call failed");
		return data;
	}
}
Subscribe to Meninsy
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.
More from Meninsy

Skeleton

Skeleton

Skeleton