CRYPTO NEWS

how to change syntax color on remix?

i am confused how to change syntax color on remix because my defaukt color syntax not apply when it call functionName, .call and etc.

this is my code:

function checkBookings(uint256 id, string[] memory newBookings) private view returns (bool){      for (uint i = 0; i < newBookings.length; i++) {         for (uint j = 0; j < rentals[id].datesBooked.length; j++) {             if (keccak256(abi.encodePacked(rentals[id].datesBooked[j])) == keccak256(abi.encodePacked(newBookings[i]))) {                 return false;             }         }     }     return true; }  function addDatesBooked(uint256 id, string[] memory newBookings) public payable {     require(id < counter, "No such Rental");     require(checkBookings(id, newBookings), "Already Booked For Requested Date");     require(msg.value == (rentals[id].pricePerDay * 1 ether * newBookings.length) , "Please submit the asking price in order to complete the purchase");      for (uint i = 0; i < newBookings.length; i++) {         rentals[id].datesBooked.push(newBookings[i]);     }      payable(owner).transfer(msg.value);     emit newDatesBooked(newBookings, id, msg.sender, rentals[id].category,  rentals[id].imgUrl); }  function getRental(uint256 id) public view returns (string memory, uint256, string[] memory){     require(id < counter, "No such Rental");      rentalInfo storage s = rentals[id];     return (s.name,s.pricePerDay,s.datesBooked); } 

}

When exactly does a state change happen for a variable?

I am not sure if I asked right. What I don’t understand is if a tx changes value of a state variable , it has to be mined and confirmed and brodcasted to network in order for the rest of network to know it. But that is a rather long time. So what happens to::Listen

I am not sure if I asked right. What I don’t understand is if a tx changes value of a state variable , it has to be mined and confirmed and brodcasted to network in order for the rest of network to know it. But that is a rather long time. So what happens to other write function calls that do something with that state variable in meantime?

int balance=10;  function change() {     if (balance >= 10)          balance = balance - 10; } 

if you invoke change twice within 1 sec what will happen? It seems like balance can go -10.

how to change syntax color on remix?

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