Skip to main content
. 2020 Feb 11;22(2):203. doi: 10.3390/e22020203
Algorithm 7 Loop smart contract.
  • 1:

    pragma solidity ˆ0.5.0;

  • 2:

    contract TestLoop {

  • 3:

        function test() public returns (uint) {

  • 4:

           uint x = 0;

  • 5:

           for (uint i = 0; i < 256; i++) {

  • 6:

                x = x*i + x;

  • 7:

           }

  • 8:

           return x;

  • 9:

        }

  • 10:

    }