Chức năng hợp đồng có cập nhật giá trị biến không?
- INDEXERS
Nếu một hàm hợp đồng phát ra một Sự kiện A, cập nhật một biến và sau đó phát ra Sự kiện B, giá trị biến sẽ được cập nhật trong xử lý sự kiện A hoặc xử lý sự kiện B không?
Câu trả lời1
event A's handler will fetch the previous state of the variable because it is executed before the variable is updated within the transaction, event B's handler will fetch the updated state of the variable because it is executed after the update occurs within the transaction.