I assume that two functions of different prototypes will yield two different encoded ABIs.
Is that correct?
With regards to two functions of the same prototype, I tested a pair of functions which are identical not only in their prototype but also in their implementation:
address public owner;
address public pendingOwner;
function claimOwnership1() public {
owner = pendingOwner;
pendingOwner = address(0);
}
function claimOwnership2() public {
owner = pendingOwner;
pendingOwner = address(0);
}
I then checked the encoded ABI via web3.js (1.0.0-beta.34):
console.log("claimOwnership1:", myContract.methods.claimOwnership1().encodeABI());
console.log("claimOwnership2:", myContract.methods.claimOwnership2().encodeABI());
And the printout is:
claimOwnership1: 0x45fd9e23
claimOwnership2: 0xa75343bf
But of course, that doesn't guarantee encoded-ABI uniqueness.
Is such uniqueness guaranteed anywhere in the Solidity standard?
Thank you!
encodeABI()
uses the function prototype and params and have nothing to do with the implementation.