I'm implementing a DoubleAuction and I want to call the breakEven function, that finds the market clearing price, always as very last function in the current Block. Is there any way that I can check in solidity if the current transaction is the last transaction in the current block and if so, I'd call the breakEven function?


No, there's no good way to get this sort of information about the current block in Solidity.

An idea that may be more practical is to call the function in the next block, and have it find the price for the previous block

  • any ideas on how I could make sure that this call would be the very first function call in the next block then? Jun 20 '18 at 11:44
  • You can keep track of the last time the function was called, and require that it has not been called yet on this block Jun 20 '18 at 15:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.