diff --git a/TransactionExecutor.sol b/TransactionExecutor.sol new file mode 100644 index 0000000..e351b7f --- /dev/null +++ b/TransactionExecutor.sol @@ -0,0 +1,11 @@ +pragma solidity ^0.8.0; + +contract TransactionExecutor { + function executeTransaction(address payable receiver, uint256 amount) external payable { + // 检查合约的余额是否足够支付交易 + require(address(this).balance >= amount, "Insufficient contract balance"); + + // 执行转账交易 + receiver.transfer(amount); + } +}