> For the complete documentation index, see [llms.txt](https://thryec.gitbook.io/dev-compedium/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://thryec.gitbook.io/dev-compedium/ethereum/yul/calldata/transferring-value.md).

# Transferring Value

* `selfbalance()` - exists in Yul but not Solidity, essentially `address(this).balance`
* The Yul contract will use less gas upon deployment, as well as when calling the withdraw function

```solidity
// Solidity version 
contract WithdrawV1 {
    constructor() payable {}

    address public constant owner = 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4;

    function withdraw() external {
        payable(owner).transfer(address(this).balance);
        (bool s, ) = payable(owner).call{value: address(this).balance}("");
        require(s);
    }
}

// Yul version 
contract WithdrawV2 {
    constructor() payable {}

    address public constant owner = 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4;

    function withdraw() external {
        assembly {
            let s := call(gas(), owner, selfbalance(), 0, 0, 0, 0)
            if iszero(s) {
                revert(0, 0)
            }
        }
    }
}
```
