Hi I have one very simple question. ( actually opinion)
Once we deploy smart contract on chain, we are not able to modify it.
But sometimes, unpredictable things happen.
To deal with any kind of emergency situation, isn't it safe to have encode function ?
For example,
function encodeFunction(address _callee, bytes calldata _callData, uint256 _value) public returns (bool) {
(bool success, bytes memory returnData) = callee.call{vaule: _value}(_callData);
require(success, "tx failed");
return success;
}
Let's say there is an airdrop of certain token and your smart contract can't withdraw since you didn't expect to get an airdrop beforehand.
But if we have encode function like above, we can deal with any kind of emergency situation.
Why don't we make this kind of encode function for safety purpose?