Let us look at the following contract
contract LibraryA {
function getSenderAddress() public returns (address);
}
contract LibraryB {
function getSenderAddress() public returns (address);
}
contract UseCase {
function checkToken(LibraryA a) public returns (address)
{return a.getSenderAddress();}}
How to make sure that invocation of function checkToken only uses the address of LibraryA? Is hardcoding the address a good idea? like function checkToken(0xab3242443c23424523 a)
? What is the design rationale for this design in solidity? Are there any legitimate use cases? How to ensure the use of the library the developer intended to use?