CRYPTO NEWS

How to modify or cancel a pending Ethereum transaction

A stuck or pending Ethereum transaction can be canceled or modified using two methods: in-application cancellation and setting a custom nonce.

Check condition on all elements of an array

I need to check if all elements in an array (uint[]) are in a specific range. I was wondering if there is a better way to do this. This is what I came up with at the moment: contract MyContract { /* … */ function pickNumbers(uint[5] memory _stdNumbers, uint memory _specialNumber) public { for(uint i=0;::Listen

I need to check if all elements in an array (uint[]) are in a specific range.

I was wondering if there is a better way to do this. This is what I came up with at the moment:

contract MyContract {      /* ... */      function pickNumbers(uint[5] memory _stdNumbers, uint memory _specialNumber) public {          for(uint i=0; i<_stdNumbers.length; i++) {             require(_stdNumbers[i] > 0 && _stdNumbers[i] < 70, "Invalid standard number");         }          require(_specialNumber > 0 && _specialNumber < 27, "Invalid special number");          // DO SOMETHING      } } 

Thanks in advance.

How to modify or cancel a pending Ethereum transaction

Shopping cart
There are no products in the cart!
Continue shopping
0