what is the meaning of 0x0? say when variable gets assigned to it, example: keccak256(number) = 0x0;Using the “Publish” button of Solidity Online CompilerNot able to read Array of Addresses in FunctionWhat is uint256?What does “0x0 Transaction mined but execution failed” mean when attempting to deploy via Remix on Rinkeby?What is the keccak256 reference in opcodes from solc?What is the meaning of “Expressions that might have a side-effect on memory allocation are allowed”?Why do people hash the address?Why send ether to 0x0 if user accidentally sends to contract?how to hash an array of address?Transaction reverted during contract execution [Reverted]

Was Luke Skywalker the leader of the Rebel forces on Hoth?

Makefile strange variable substitution

In the quantum hamiltonian, why does kinetic energy turn into an operator while potential doesn't?

How many characters using PHB rules does it take to be able to have access to any PHB spell at the start of an adventuring day?

Meaning of ちはース as an exclamation

They call me Inspector Morse

Do f-stop and exposure time perfectly cancel?

Is "history" a male-biased word ("his+story")?

Counting all the hearts

Do I really need to have a scientific explanation for my premise?

Why was Goose renamed from Chewie for the Captain Marvel film?

Reversed Sudoku

How did Alan Turing break the enigma code using the hint given by the lady in the bar?

Difference on montgomery curve equation between EFD and RFC7748

PTIJ: Should I kill my computer after installing software?

Why the color red for the Republican Party

Could you please stop shuffling the deck and play already?

Hotkey (or other quick way) to insert a keyframe for only one component of a vector-valued property?

What are actual Tesla M60 models used by AWS?

Vocabulary for giving just numbers, not a full answer

What problems would a superhuman have whose skin is constantly hot?

Can Mathematica be used to create an Artistic 3D extrusion from a 2D image and wrap a line pattern around it?

Accepted offer letter, position changed

Did Carol Danvers really receive a Kree blood tranfusion?



what is the meaning of 0x0? say when variable gets assigned to it, example: keccak256(number) = 0x0;


Using the “Publish” button of Solidity Online CompilerNot able to read Array of Addresses in FunctionWhat is uint256?What does “0x0 Transaction mined but execution failed” mean when attempting to deploy via Remix on Rinkeby?What is the keccak256 reference in opcodes from solc?What is the meaning of “Expressions that might have a side-effect on memory allocation are allowed”?Why do people hash the address?Why send ether to 0x0 if user accidentally sends to contract?how to hash an array of address?Transaction reverted during contract execution [Reverted]













1















Is 0x0 just zero? thanks



keccak256(number) = 0x0; 


Or when not used as address I mean just to denote variable?










share|improve this question


























    1















    Is 0x0 just zero? thanks



    keccak256(number) = 0x0; 


    Or when not used as address I mean just to denote variable?










    share|improve this question
























      1












      1








      1








      Is 0x0 just zero? thanks



      keccak256(number) = 0x0; 


      Or when not used as address I mean just to denote variable?










      share|improve this question














      Is 0x0 just zero? thanks



      keccak256(number) = 0x0; 


      Or when not used as address I mean just to denote variable?







      solidity remix






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 7 hours ago









      kpopguykpopguy

      374




      374




















          2 Answers
          2






          active

          oldest

          votes


















          2














          The example given wouldn't actually work because you're trying to assign 0x0 to the keccak function.



          It has the same meaning as bytes32(0). So, you can go:



          require(bytes32(0) == 0x0);


          That would be comparing equivalents. It was possible to compare address and 0x0 but the trend seems to be toward explicit type casting, so you would go address(0) with a recent compiler.



          This type of expression is often used to validate inputs, in particular, catching important values that were not passed in. This is common:



          function doSomething(bytes32 key) ... 
          require(key != 0x0);
          // carry on



          Hope it helps.






          share|improve this answer






























            1














            The 0x prefix means hexadecimal and it's a way to tell programs, contracts, APIs that the input should be interpreted as a hexadecimal number (we'll shorten to hex). 0x0 is actually 0 but in hex. Usually we use 0x0 to check whether the address is not set by us and it is set to default value by the solidity which is 0x0.



            require(_addressIn != address(0))



            E.g. 0x0 in Solidity is short for 0x0000000000000000000000000000000000000000, and if we use this as some address than it does have value greater than zero. check here.



            Keccak256 computes the Ethereum-SHA-3 (Keccak-256) hash (doc) of the arguments passed into the function. So the above line of code is not correct because keccak256(number) is returning the hash value which you can store in some variable, instead you are trying to treat the output hash value as an variable and assigning the 0x0 to that.



            I hope it helps.






            share|improve this answer








            New contributor




            Abdullah Aziz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.




















            • "0x0 in Solidity is short for 0x0000000000000000000000000000000000000000" I guess technically that's true, just like in decimal, 0 is short for 0000000000 (for any number of 0s). But I think it's misleading to say that, as it makes people think it represents some special value or some specific type. It just means 0.

              – smarx
              5 hours ago










            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "642"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fethereum.stackexchange.com%2fquestions%2f68238%2fwhat-is-the-meaning-of-0x0-say-when-variable-gets-assigned-to-it-example-kecc%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2














            The example given wouldn't actually work because you're trying to assign 0x0 to the keccak function.



            It has the same meaning as bytes32(0). So, you can go:



            require(bytes32(0) == 0x0);


            That would be comparing equivalents. It was possible to compare address and 0x0 but the trend seems to be toward explicit type casting, so you would go address(0) with a recent compiler.



            This type of expression is often used to validate inputs, in particular, catching important values that were not passed in. This is common:



            function doSomething(bytes32 key) ... 
            require(key != 0x0);
            // carry on



            Hope it helps.






            share|improve this answer



























              2














              The example given wouldn't actually work because you're trying to assign 0x0 to the keccak function.



              It has the same meaning as bytes32(0). So, you can go:



              require(bytes32(0) == 0x0);


              That would be comparing equivalents. It was possible to compare address and 0x0 but the trend seems to be toward explicit type casting, so you would go address(0) with a recent compiler.



              This type of expression is often used to validate inputs, in particular, catching important values that were not passed in. This is common:



              function doSomething(bytes32 key) ... 
              require(key != 0x0);
              // carry on



              Hope it helps.






              share|improve this answer

























                2












                2








                2







                The example given wouldn't actually work because you're trying to assign 0x0 to the keccak function.



                It has the same meaning as bytes32(0). So, you can go:



                require(bytes32(0) == 0x0);


                That would be comparing equivalents. It was possible to compare address and 0x0 but the trend seems to be toward explicit type casting, so you would go address(0) with a recent compiler.



                This type of expression is often used to validate inputs, in particular, catching important values that were not passed in. This is common:



                function doSomething(bytes32 key) ... 
                require(key != 0x0);
                // carry on



                Hope it helps.






                share|improve this answer













                The example given wouldn't actually work because you're trying to assign 0x0 to the keccak function.



                It has the same meaning as bytes32(0). So, you can go:



                require(bytes32(0) == 0x0);


                That would be comparing equivalents. It was possible to compare address and 0x0 but the trend seems to be toward explicit type casting, so you would go address(0) with a recent compiler.



                This type of expression is often used to validate inputs, in particular, catching important values that were not passed in. This is common:



                function doSomething(bytes32 key) ... 
                require(key != 0x0);
                // carry on



                Hope it helps.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 7 hours ago









                Rob HitchensRob Hitchens

                28.7k74481




                28.7k74481





















                    1














                    The 0x prefix means hexadecimal and it's a way to tell programs, contracts, APIs that the input should be interpreted as a hexadecimal number (we'll shorten to hex). 0x0 is actually 0 but in hex. Usually we use 0x0 to check whether the address is not set by us and it is set to default value by the solidity which is 0x0.



                    require(_addressIn != address(0))



                    E.g. 0x0 in Solidity is short for 0x0000000000000000000000000000000000000000, and if we use this as some address than it does have value greater than zero. check here.



                    Keccak256 computes the Ethereum-SHA-3 (Keccak-256) hash (doc) of the arguments passed into the function. So the above line of code is not correct because keccak256(number) is returning the hash value which you can store in some variable, instead you are trying to treat the output hash value as an variable and assigning the 0x0 to that.



                    I hope it helps.






                    share|improve this answer








                    New contributor




                    Abdullah Aziz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.




















                    • "0x0 in Solidity is short for 0x0000000000000000000000000000000000000000" I guess technically that's true, just like in decimal, 0 is short for 0000000000 (for any number of 0s). But I think it's misleading to say that, as it makes people think it represents some special value or some specific type. It just means 0.

                      – smarx
                      5 hours ago















                    1














                    The 0x prefix means hexadecimal and it's a way to tell programs, contracts, APIs that the input should be interpreted as a hexadecimal number (we'll shorten to hex). 0x0 is actually 0 but in hex. Usually we use 0x0 to check whether the address is not set by us and it is set to default value by the solidity which is 0x0.



                    require(_addressIn != address(0))



                    E.g. 0x0 in Solidity is short for 0x0000000000000000000000000000000000000000, and if we use this as some address than it does have value greater than zero. check here.



                    Keccak256 computes the Ethereum-SHA-3 (Keccak-256) hash (doc) of the arguments passed into the function. So the above line of code is not correct because keccak256(number) is returning the hash value which you can store in some variable, instead you are trying to treat the output hash value as an variable and assigning the 0x0 to that.



                    I hope it helps.






                    share|improve this answer








                    New contributor




                    Abdullah Aziz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.




















                    • "0x0 in Solidity is short for 0x0000000000000000000000000000000000000000" I guess technically that's true, just like in decimal, 0 is short for 0000000000 (for any number of 0s). But I think it's misleading to say that, as it makes people think it represents some special value or some specific type. It just means 0.

                      – smarx
                      5 hours ago













                    1












                    1








                    1







                    The 0x prefix means hexadecimal and it's a way to tell programs, contracts, APIs that the input should be interpreted as a hexadecimal number (we'll shorten to hex). 0x0 is actually 0 but in hex. Usually we use 0x0 to check whether the address is not set by us and it is set to default value by the solidity which is 0x0.



                    require(_addressIn != address(0))



                    E.g. 0x0 in Solidity is short for 0x0000000000000000000000000000000000000000, and if we use this as some address than it does have value greater than zero. check here.



                    Keccak256 computes the Ethereum-SHA-3 (Keccak-256) hash (doc) of the arguments passed into the function. So the above line of code is not correct because keccak256(number) is returning the hash value which you can store in some variable, instead you are trying to treat the output hash value as an variable and assigning the 0x0 to that.



                    I hope it helps.






                    share|improve this answer








                    New contributor




                    Abdullah Aziz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.










                    The 0x prefix means hexadecimal and it's a way to tell programs, contracts, APIs that the input should be interpreted as a hexadecimal number (we'll shorten to hex). 0x0 is actually 0 but in hex. Usually we use 0x0 to check whether the address is not set by us and it is set to default value by the solidity which is 0x0.



                    require(_addressIn != address(0))



                    E.g. 0x0 in Solidity is short for 0x0000000000000000000000000000000000000000, and if we use this as some address than it does have value greater than zero. check here.



                    Keccak256 computes the Ethereum-SHA-3 (Keccak-256) hash (doc) of the arguments passed into the function. So the above line of code is not correct because keccak256(number) is returning the hash value which you can store in some variable, instead you are trying to treat the output hash value as an variable and assigning the 0x0 to that.



                    I hope it helps.







                    share|improve this answer








                    New contributor




                    Abdullah Aziz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.









                    share|improve this answer



                    share|improve this answer






                    New contributor




                    Abdullah Aziz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.









                    answered 5 hours ago









                    Abdullah AzizAbdullah Aziz

                    311




                    311




                    New contributor




                    Abdullah Aziz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.





                    New contributor





                    Abdullah Aziz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.






                    Abdullah Aziz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.












                    • "0x0 in Solidity is short for 0x0000000000000000000000000000000000000000" I guess technically that's true, just like in decimal, 0 is short for 0000000000 (for any number of 0s). But I think it's misleading to say that, as it makes people think it represents some special value or some specific type. It just means 0.

                      – smarx
                      5 hours ago

















                    • "0x0 in Solidity is short for 0x0000000000000000000000000000000000000000" I guess technically that's true, just like in decimal, 0 is short for 0000000000 (for any number of 0s). But I think it's misleading to say that, as it makes people think it represents some special value or some specific type. It just means 0.

                      – smarx
                      5 hours ago
















                    "0x0 in Solidity is short for 0x0000000000000000000000000000000000000000" I guess technically that's true, just like in decimal, 0 is short for 0000000000 (for any number of 0s). But I think it's misleading to say that, as it makes people think it represents some special value or some specific type. It just means 0.

                    – smarx
                    5 hours ago





                    "0x0 in Solidity is short for 0x0000000000000000000000000000000000000000" I guess technically that's true, just like in decimal, 0 is short for 0000000000 (for any number of 0s). But I think it's misleading to say that, as it makes people think it represents some special value or some specific type. It just means 0.

                    – smarx
                    5 hours ago

















                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Ethereum Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fethereum.stackexchange.com%2fquestions%2f68238%2fwhat-is-the-meaning-of-0x0-say-when-variable-gets-assigned-to-it-example-kecc%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Isabella Eugénie Boyer Biographie | Références | Menu de navigationmodifiermodifier le codeComparator to Compute the Relative Value of a U.S. Dollar Amount – 1774 to Present.

                    Lioubotyn Sommaire Géographie | Histoire | Population | Notes et références | Liens externes | Menu de navigationlubotin.kharkov.uamodifier« Recensements et estimations de la population depuis 1897 »« Office des statistiques d'Ukraine : population au 1er janvier 2010, 2011 et 2012 »« Office des statistiques d'Ukraine : population au 1er janvier 2011, 2012 et 2013 »Informations officiellesCartes topographiquesCarte routièrem

                    Mpande kaSenzangakhona Biographie | Références | Menu de navigationmodifierMpande kaSenzangakhonavoir la liste des auteursm