Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: 666 pure and secure packages/core/src/clause.ts #886

Merged
merged 2 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/src/address/address.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const HEX_ADDRESS_REGEX = /^0x[0-9a-f]{40}$/i;
* - {@link secp256k1.derivePublicKey}
*
* @param {Uint8Array} privateKey - The private key used to compute the public key
* from wihich the address is computed.
* from which the address is computed.
* @returns {string} - The string representation of the address,
* prefixed with `0x` according the
* [ERC-55: Mixed-case checksum address encoding](https://eips.ethereum.org/EIPS/eip-55).
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/clause/clause.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { isAddress } from 'ethers';
import { abi, coder, type FunctionFragment } from '../abi';
import { type TransactionClause } from '../transaction';
import type { DeployParams } from './types';
import { ERC721_ABI, VIP180_ABI } from '../utils';
import { assert, buildError, DATA } from '@vechain/sdk-errors';
import { addressUtils } from '../address';

/**
* Builds a clause for deploying a smart contract.
Expand Down Expand Up @@ -157,7 +157,7 @@ function transferNFT(

assert(
'transferNFT',
isAddress(contractAddress),
addressUtils.isAddress(contractAddress),
DATA.INVALID_DATA_TYPE,
`Invalid 'contractAddress' parameter. Expected a contract address but received ${contractAddress}.`
);
Expand Down