# The fallback function is not triggered when sending eth from one contract to another

**URL:** <https://forum.openzeppelin.com/t/the-fallback-function-is-not-triggered-when-sending-eth-from-one-contract-to-another/28459>\
**Category:** Smart Contracts\
**Tags:** etherscan-verify\
**Created:** [May 7, 2022, 5:45am UTC](https://forum.openzeppelin.com/t/the-fallback-function-is-not-triggered-when-sending-eth-from-one-contract-to-another/28459 "2022-05-07T05:45:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aravindh](https://avatars.discourse-cdn.com/v4/letter/a/f0a364/32.png) [@aravindh](https://forum.openzeppelin.com/u/aravindh)\
**Post date:** [May 7, 2022, 5:45am UTC](https://forum.openzeppelin.com/t/the-fallback-function-is-not-triggered-when-sending-eth-from-one-contract-to-another/28459/1 "2022-05-07T05:45:49Z")

</div>

```auto

// SPDX-License-Identifier: MIT

pragma solidity 0.8.13;

contract storageContract {
    address public fallbackContract;

    constructor (address _fallbackContract) {
        fallbackContract = _fallbackContract;
    }

    function setFallback(address newContract) public {
        fallbackContract = newContract;
    }

    function call() external payable {
        (bool sent, ) = payable(fallbackContract).call{value: msg.value}("");
        require(sent, "Failed to call fallback");
    }

    function send() external payable {
        (bool sent) = payable(fallbackContract).send(msg.value);
        require(sent, "Failed to call fallback");
    }

    function transfer() external payable {
        payable(fallbackContract).transfer(msg.value);
    }

    function contractBalance() external view returns (uint256) {
        return (address(this).balance);
    }
}

contract Main {
    uint256 public number;

    fallback() external payable {
        callBack();
    }

    receive() external payable {
        callBack();
    }

    function callBack() internal {
        number++;
    }

    function contractBalance() external view returns (uint256) {
        return (address(this).balance);
    }
}

```

here is my code. I need experts tips.

---

<div class="post-metadata">

**Author:** ![maxareo](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/maxareo/32/11606_2.png) [@maxareo](https://forum.openzeppelin.com/u/maxareo)\
**Post date:** [May 7, 2022, 7:27am UTC](https://forum.openzeppelin.com/t/the-fallback-function-is-not-triggered-when-sending-eth-from-one-contract-to-another/28459/2 "2022-05-07T07:27:46Z")

</div>

According to the Solidity official document,

> The fallback function is executed on a call to the contract if none of the other functions match the given function signature, or if no data was supplied at all and there is no [receive Ether function](https://docs.soliditylang.org/en/v0.8.12/contracts.html?highlight=fallback#receive-ether-function). The fallback function always receives data, but in order to also receive Ether it must be marked `payable`

In your code, the `receive` function is always triggered before the `fallback` function. Also it appears that `transfer` function does not support sending `ETH` to smart contracts.
