hardhat
Version:
Hardhat is an extensible developer tool that helps smart contract developers increase productivity by reliably bringing together the tools they want.
14 lines • 594 B
JavaScript
import { HardhatError } from "@nomicfoundation/hardhat-errors";
import { isAddress, toChecksumAddress, } from "@nomicfoundation/hardhat-utils/eth";
const toChecksumAddressAction = async ({ address }) => {
if (!isAddress(address)) {
throw new HardhatError(HardhatError.ERRORS.CORE.ARGUMENTS.INVALID_VALUE, {
value: address,
name: "address",
reason: "it must be a valid Ethereum address",
});
}
console.log(await toChecksumAddress(address));
};
export default toChecksumAddressAction;
//# sourceMappingURL=to-checksum-address.js.map