I am asking if it's possible to change parameters of a function called, for example:

    function updatePrice(uint128 price) public onlyOwner{
        latestPrice = price;
        lastPriceUpdate = block.timestamp;
        emit UpdatePrice(price);

I understand the main concept of frontrunning is to have the transaction mined faster than the actual transaction. But not sure if it's possible to change the parameters.

2 Answers 2


Searchers don't change your transactions values, they take advantage of your transactions values. The function is onlyOwner, so a front runner not being owner wouldn't be able to front run with a different parameter. But they could front/back run the change in price to be first to liquidate an account based on the change.

Some bots are designed to try any transaction from their own address to see if profitable. So if for example there wasn't an onlyOwner modifier and using your parameters from their address resulted in profit then they would front run with the same parameters.

  • Oh so frontrunners only able to be slightly quicker than your transaction but cannot change the parameters? Commented Sep 9, 2023 at 11:59
  • They can't change the parameters in your transaction. But for completeness, they could (it's unusual outside of sandwiching or where that is the core strategy) send a transaction calling the same function with different parameters ahead of you.
    – Maka
    Commented Sep 9, 2023 at 12:31

No, Frontrunner can only mine the transaction faster. To modify the parameters, a 51% attack is required.

  • A 51% attack can't modify parameters. A 51% attack can undo your transaction if a "longer" chain is created that no longer has your transaction.
    – eth
    Commented Sep 12, 2023 at 1:52

Your Answer

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

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