Write a Ethereum smart contract with a function that can transfer custom amount of ether to multiple addresses. Use a mapping state to point recipient address to amount. Clear the mapping after ether has been sent.
Certainly! Below is an example of an Ethereum smart contract that allows the owner to transfer a custom amount of Ether to multiple addresses. It uses a mapping to store recipient addresses and their corresponding amounts, and clears the mapping after the Ether has been sent.

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract MultiTransfer {
    address public owner;

    // Mapping to store recipient addresses and their amounts
    mapping(address => uint256) public recipients;

    // Event to log the transfer details
    event Transfer(address indexed recipient, uint256 amount);

    // Modifier to restrict functions to the contract owner
    modifier onlyOwner() {
        require(msg.sender == owner, "Not the contract owner");
        _;
    }

    constructor() {
        owner = msg.sender; // Set the contract deployer as the owner
    }

    // Function to add recipients and their amounts
    function addRecipients(address[] calldata _recipients, uint256[] calldata _amounts) external onlyOwner {
        require(_recipients.length == _amounts.length, "Arrays must have the same length");

        for (uint256 i = 0; i < _recipients.length; i++) {
            recipients[_recipients[i]] = _amounts[i];
        }
    }

    // Function to transfer Ether to all recipients
    function transferEther() external onlyOwner payable {
        uint256 totalAmount = msg.value;

        // Calculate the total
 Here is an example of an Ethereum smart contract written in Solidity that implements a function to transfer a custom amount of ether to multiple addresses, using a mapping to store the recipient addresses and the corresponding amounts:
```
pragma solidity ^0.5.16;

contract MultiTransfer {

    // Mapping to store the recipient addresses and the corresponding amounts
    mapping(address => uint256) public recipients;

    // Function to set the recipient addresses and corresponding amounts
    function setRecipients(address[] memory _recipients, uint256[] memory _amounts) public {
        require(_recipients.length == _amounts.length, "Number of recipients and amounts must be equal");

        // Clear the mapping
        for (uint256 i = 0; i < recipients.length; i++) {
            delete recipients[address(0)];
        }

        // Set the new recipients and amounts
        for (uint256 i = 0; i < _recipients.length; i++) {
            recipients[_recipients[i]] = _amounts[i];
        }
    }

    // Function to transfer ether to the set recipients
    function transferMultiple() public payable {
        uint256 total =