Better support for overloaded functions on a Solidity contract
Users of generated interfaces can now select the method implementation in Python or from the command line. The selection is made using the function selector of each implementation.
For example, for ERC721 `safeTransferFrom`:
$ python -m wing.OwnableERC721 safe-transfer-from-0x42842e0e -h
usage: OwnableERC721.py safe-transfer-from-0x42842e0e [-h] --network NETWORK [--address ADDRESS] --sender SENDER [--password PASSWORD]
[--gas-price GAS_PRICE] [--max-fee-per-gas MAX_FEE_PER_GAS]
[--max-priority-fee-per-gas MAX_PRIORITY_FEE_PER_GAS] [--confirmations CONFIRMATIONS]
[--nonce NONCE] [--value VALUE] [--verbose] --from-arg FROM_ARG --to TO --token-id
TOKEN_ID
options:
-h, --help show this help message and exit
--network NETWORK Name of brownie network to connect to
--address ADDRESS Address of deployed contract to connect to
--sender SENDER Path to keystore file for transaction sender
--password PASSWORD Password to keystore file (if you do not provide it, you will be prompted for it)
--gas-price GAS_PRICE
Gas price at which to submit transaction
--max-fee-per-gas MAX_FEE_PER_GAS
Max fee per gas for EIP1559 transactions
--max-priority-fee-per-gas MAX_PRIORITY_FEE_PER_GAS
Max priority fee per gas for EIP1559 transactions
--confirmations CONFIRMATIONS
Number of confirmations to await before considering a transaction completed
--nonce NONCE Nonce for the transaction (optional)
--value VALUE Value of the transaction in wei(optional)
--verbose Print verbose output
--from-arg FROM_ARG Type: address
--to TO Type: address
--token-id TOKEN_ID Type: uint256
versus
$ python -m wing.OwnableERC721 safe-transfer-from-0xb88d4fde -h
usage: OwnableERC721.py safe-transfer-from-0xb88d4fde [-h] --network NETWORK [--address ADDRESS] --sender SENDER [--password PASSWORD]
[--gas-price GAS_PRICE] [--max-fee-per-gas MAX_FEE_PER_GAS]
[--max-priority-fee-per-gas MAX_PRIORITY_FEE_PER_GAS] [--confirmations CONFIRMATIONS]
[--nonce NONCE] [--value VALUE] [--verbose] --from-arg FROM_ARG --to TO --token-id
TOKEN_ID --data-arg DATA_ARG
options:
-h, --help show this help message and exit
--network NETWORK Name of brownie network to connect to
--address ADDRESS Address of deployed contract to connect to
--sender SENDER Path to keystore file for transaction sender
--password PASSWORD Password to keystore file (if you do not provide it, you will be prompted for it)
--gas-price GAS_PRICE
Gas price at which to submit transaction
--max-fee-per-gas MAX_FEE_PER_GAS
Max fee per gas for EIP1559 transactions
--max-priority-fee-per-gas MAX_PRIORITY_FEE_PER_GAS
Max priority fee per gas for EIP1559 transactions
--confirmations CONFIRMATIONS
Number of confirmations to await before considering a transaction completed
--nonce NONCE Nonce for the transaction (optional)
--value VALUE Value of the transaction in wei(optional)
--verbose Print verbose output
--from-arg FROM_ARG Type: address
--to TO Type: address
--token-id TOKEN_ID Type: uint256
--data-arg DATA_ARG Type: bytes
Pure functions no longer require transaction parameters
They are handled the same as `view` functions.