Ethers/6/Contracts/Other Method Operations

/icons/calendar.svg

Last update

Aug 28, 2024

This codemod transforms some of the other method operations that are present in Contracts class of ethers.

Example

Before

contract.functions.foo(addr);

After

contract.foo.staticCallResult(addr);

Before

contract.callStatic.foo(addr);

After

contract.foo.staticCall(addr);

Before

contract.estimateGas.foo(addr);

After

contract.foo.estimateGas(addr);

Before

contract.populateTransaction.foo(addr);

After

contract.foo.populateTransaction(addr);

Below transformation is not done using codemod, since it is a new feature in v6

Explicitly sends a transaction, regardless of function type

contract.foo.send(addr)

Build custom codemods

Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community

background illustrationGet Started Now