We have recently added a new feature to the ethers.js Contract API, so we wanted to make a quick post to demonstrate using it.
The Application Binary Interface (ABI) for the Contract object now supports standard Solidity function signatures and event signatures, which makes the code much easier to read and understand.
The Contract object also fully supports ABIv2 signatures, so you can use tuples, dynamic arrays and any arbitrary level of nesting your heart desires.
We often receive requests for examples of using ERC-20 tokens with ethers.js, so we have put together a quick example using the new Solidity contract signature ABI format. Other than the ABI object, there would be absolutely no changes required to the rest of the code.
If you wish to add support to your own scripts or utilities, you can parse a Solidity signature using the AbiCoder.parseSignature(signature) function to convert a Solidity signature to a standard ABI fragment.