mirror of
https://github.com/zama-ai/fhevm-solidity.git
synced 2026-01-13 14:38:01 -05:00
docs: payment-limit docs docs: blind auction docs: improved the comments on example contracts, use of @dev, @params and @notice docs: readme is updated docs: imporved readme for examples docs: improve README docs: prettier docs: commit suggestions docs: shortended readme
30 lines
1.1 KiB
Solidity
30 lines
1.1 KiB
Solidity
// SPDX-License-Identifier: BSD-3-Clause-Clear
|
|
pragma solidity ^0.8.24;
|
|
|
|
import "@openzeppelin/contracts/access/Ownable2Step.sol";
|
|
|
|
/// @notice Smart account contract with batch transaction execution
|
|
contract SmartAccount is Ownable2Step {
|
|
/// @dev Structure to represent a transaction
|
|
struct Transaction {
|
|
address target;
|
|
uint256 value;
|
|
bytes data;
|
|
}
|
|
|
|
/// @notice Constructor to set the initial owner
|
|
constructor() Ownable(msg.sender) {}
|
|
|
|
/// @notice Function to execute multiple transactions in a batch
|
|
/// @param transactions Array of transactions to execute
|
|
function executeBatch(Transaction[] memory transactions) public payable onlyOwner {
|
|
for (uint i = 0; i < transactions.length; i++) {
|
|
Transaction memory transaction = transactions[i];
|
|
/// @dev Execute the transaction
|
|
(bool success, ) = transaction.target.call{value: transaction.value}(transaction.data);
|
|
/// @dev Ensure the transaction was successful
|
|
require(success, "Transaction failed");
|
|
}
|
|
}
|
|
}
|