| 493 | } |
| 494 | |
| 495 | BoolResult AddressType::isExplicitlyConvertibleTo(Type const& _convertTo) const |
| 496 | { |
| 497 | if ((_convertTo.category() == category()) || isImplicitlyConvertibleTo(_convertTo)) |
| 498 | return true; |
| 499 | else if (auto const* contractType = dynamic_cast<ContractType const*>(&_convertTo)) |
| 500 | return (m_stateMutability >= StateMutability::Payable) || !contractType->isPayable(); |
| 501 | else if (m_stateMutability == StateMutability::NonPayable) |
| 502 | { |
| 503 | if (auto integerType = dynamic_cast<IntegerType const*>(&_convertTo)) |
| 504 | return (!integerType->isSigned() && integerType->numBits() == 160); |
| 505 | else if (auto fixedBytesType = dynamic_cast<FixedBytesType const*>(&_convertTo)) |
| 506 | return (fixedBytesType->numBytes() == 20); |
| 507 | } |
| 508 | |
| 509 | return false; |
| 510 | } |
| 511 | |
| 512 | std::string AddressType::toString(bool) const |
| 513 | { |
no test coverage detected