1

How many transactions can be executed in one smart contract?

I'm curious about the theoretical explanation.

1
  • 2
    As many as the block gas limit allows. Someone else can give you the more precise calculations for minimal contract call gas requirements Nov 8, 2022 at 13:26

3 Answers 3

2

Three scenarios (assuming no gas has been consumed yet in the block):

  • If a single transaction costs more than the block gas limit, the transaction cannot be executed (because the cost of this single transaction exceeds the block gas limit)

  • If a single transaction costs the same as the block gas limit, only one transaction can be executed (theoretically) in one smart contract (because the cost of this single transaction equals the block gas limit).

  • If a single transaction costs less than the block gas limit, the number of transactions can be executed is (block gas limit)/(cost of the transaction), with the number rounded down, in one smart contract.

0

I take that to mean how many can be executed with a single initial contract call, to which I would say one. Can have multiple function calls from within the one transaction.

If you want to chain multiple transactions you have to use something like flashbots.

If you want some theoretical block gas limit / gas to call a contract. As if an entire block was saturated with only calls to that contract, then you need the gas cost for the function or functions being called.

0

How many transactions can be executed in one smart contract?

That question doesn't really make sense, it's a bit like asking "how many times a program can be run", well... depends how much time you give it, lmao.

Now if you're asking how many transactions can be executed by a smart contract in a single block, then the answer depends on the specific function you're executing and on the block gas limit of the chain you're on.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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