Articles → BLOCKCHAIN → Address Datatype In Solidity

Address Datatype In Solidity






Purpose





Example




// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;

contract ExampleAddress {

    address public someAddress;

    function setSomeAddress(address _someAddress) public {
        someAddress = _someAddress;
    }

    function getAddressBalance() public view returns(uint) {
        return someAddress.balance;
    }

}



Output


Picture showing the output of address data type in solidity


Picture showing the output of address data type in solidity



Posted By  -  Karan Gupta
 
Posted On  -  Monday, October 7, 2024

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250