From 882551e102a8a2d6aed09571b6cd449c595a6e69 Mon Sep 17 00:00:00 2001 From: Nicolas Brugneaux Date: Wed, 18 Oct 2023 17:55:44 +0200 Subject: [PATCH] Ethers v6 (#13) Ethers v6 support --- package.json | 12 +- src/consts.ts | 2 +- src/lib/CeloProvider.ts | 174 +++++---- src/lib/CeloWallet.ts | 128 ++++--- src/lib/CeloscanProvider.ts | 70 ++-- src/lib/StaticCeloProvider.ts | 9 - src/lib/networks.ts | 48 +-- src/lib/transaction/utils.ts | 22 +- src/lib/transactions.ts | 314 +++++++++-------- test/HelloWorld.json | 644 ---------------------------------- test/HelloWorld.ts | 618 ++++++++++++++++++++++++++++++++ test/deployContract.ts | 12 +- test/getHistory.ts | 20 +- test/useContract.ts | 44 ++- test/utils.ts | 4 +- tsconfig.json | 2 +- yarn.lock | 633 ++++----------------------------- 17 files changed, 1136 insertions(+), 1620 deletions(-) delete mode 100644 src/lib/StaticCeloProvider.ts delete mode 100644 test/HelloWorld.json create mode 100644 test/HelloWorld.ts diff --git a/package.json b/package.json index e7470ab..2bcab97 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@celo-tools/celo-ethers-wrapper", - "version": "1.0.0", + "version": "2.0.0", "description": "A minimal wrapper to make Ethers.JS compatible with the Celo network.", "main": "build/main/index.js", "typings": "build/main/index.d.ts", @@ -26,13 +26,13 @@ "node": ">=10" }, "devDependencies": { - "@types/node": "^16.11.10", - "ethers": "^5.7.2", - "ts-node": "^10.8.1", - "typescript": "^4.5.2" + "@types/node": "^20.8.2", + "ethers": "^6.7.1", + "ts-node": "^10.9.1", + "typescript": "^5.2.2" }, "peerDependencies": { - "ethers": "^5" + "ethers": "^6" }, "files": [ "build/main", diff --git a/src/consts.ts b/src/consts.ts index 7657716..ab53b87 100644 --- a/src/consts.ts +++ b/src/consts.ts @@ -4,4 +4,4 @@ export const EIP155_NUMBER = 35; export const EIGHT = 8; // NOTE: Logic stolen from https://github.com/celo-org/celo-monorepo/blob/e7ebc92cb0715dc56c9d7f613dca81e076541cf3/packages/sdk/connect/src/connection.ts#L382-L396 -export const GAS_INFLATION_FACTOR = 1.3; +export const GAS_INFLATION_FACTOR = 130n; diff --git a/src/lib/CeloProvider.ts b/src/lib/CeloProvider.ts index cd9fbde..24dfff6 100644 --- a/src/lib/CeloProvider.ts +++ b/src/lib/CeloProvider.ts @@ -1,128 +1,116 @@ -import { BigNumber, providers, utils } from "ethers"; -import { getNetwork } from "./networks"; +import { + JsonRpcProvider, + PerformActionRequest, + TransactionResponse, + TransactionResponseParams, + getBigInt, + resolveProperties, + toBeHex, +} from "ethers"; import { CeloTransactionRequest, parseCeloTransaction } from "./transactions"; -const logger = new utils.Logger("CeloProvider"); +export default class CeloProvider extends JsonRpcProvider { + async _perform(req: PerformActionRequest): Promise { + // Legacy networks do not like the type field being passed along (which + // is fair), so we delete type if it is 0 and a non-EIP-1559 network + if (req.method === "call" || req.method === "estimateGas") { + let tx = req.transaction; + if (tx && tx.type != null && getBigInt(tx.type)) { + // If there are no EIP-1559 properties, it might be non-EIP-1559 + if (tx.maxFeePerGas == null && tx.maxPriorityFeePerGas == null) { + const feeData = await this.getFeeData(); + if ( + feeData.maxFeePerGas == null && + feeData.maxPriorityFeePerGas == null + ) { + // Network doesn't know about EIP-1559 (and hence type) + req = Object.assign({}, req, { + transaction: Object.assign({}, tx, { type: undefined }), + }); + } + } + } + } -export class CeloProvider extends providers.JsonRpcProvider { - /** - * Override to parse transaction correctly - * https://github.com/ethers-io/ethers.js/blob/master/packages/providers/src.ts/base-provider.ts - */ - async sendTransaction( - signedTransaction: string | Promise - ): Promise { - await this.getNetwork(); - const hexTx = await Promise.resolve(signedTransaction).then((t) => - utils.hexlify(t) - ); - const tx = parseCeloTransaction(hexTx); - const blockNumber = await this._getInternalBlockNumber( - 100 + 2 * this.pollingInterval - ); - try { - const hash = await this.perform("sendTransaction", { - signedTransaction: hexTx, - }); - return this._wrapTransaction(tx, hash, blockNumber); - } catch (error) { - (error).transaction = tx; - (error).transactionHash = tx.hash; - throw error; + const request = this.getRpcRequest(req); + + if (request != null) { + return await this.send(request.method, request.args); } - } - /** - * Override to handle alternative gas currencies - * getGasPrice in https://github.com/ethers-io/ethers.js/blob/master/packages/providers/src.ts/base-provider.ts - */ - async getGasPrice(feeCurrencyAddress?: string) { - await this.getNetwork(); - const params = feeCurrencyAddress ? { feeCurrencyAddress } : {}; - return BigNumber.from(await this.perform("getGasPrice", params)); + return super._perform(req); } /** * Override to handle alternative gas currencies * prepareRequest in https://github.com/ethers-io/ethers.js/blob/master/packages/providers/src.ts/json-rpc-provider.ts */ - prepareRequest(method: any, params: any): [string, Array] { - if (method === "getGasPrice") { - const param = params.feeCurrencyAddress - ? [params.feeCurrencyAddress] + getRpcRequest( + req: PerformActionRequest + ): null | { method: string; args: Array } { + if (req.method === "getGasPrice") { + // @ts-expect-error + const param = req.feeCurrencyAddress + ? // @ts-expect-error + [req.feeCurrencyAddress] : []; - return ["eth_gasPrice", param]; + return { method: "eth_gasPrice", args: param }; } - if (method === "estimateGas") { - // NOTE: somehow estimategas trims lots of fields - // this overrides it + if (req.method === "estimateGas") { const extraneous_keys = [ ["from", (x: string) => x], - ["feeCurrency", utils.hexlify], + ["feeCurrency", (x: string) => x], ["gatewayFeeRecipient", (x: string) => x], - ["gatewayFee", utils.hexlify], + ["gatewayFee", toBeHex], ] as const; const tx = { - ...providers.JsonRpcProvider.hexlifyTransaction( - params.transaction, - extraneous_keys.reduce((acc, [key]) => { - acc[key] = true; - return acc; - }, {} as Record) - ), + ...this.getRpcTransaction(req.transaction), }; extraneous_keys.forEach(([key, fn]) => { - if (params.transaction[key]) { - tx[key] = fn(params.transaction[key]); + // @ts-expect-error + if (req.transaction[key]) { + // @ts-expect-error + tx[key] = fn(req.transaction[key]); } }); - return ["eth_estimateGas", [tx]]; + return { method: "eth_estimateGas", args: [tx] }; } - return super.prepareRequest(method, params); + return super.getRpcRequest(req); } - static getNetwork(networkish: providers.Networkish): providers.Network { - const network = getNetwork(networkish == null ? "celo" : networkish); - if (network == null) { - return logger.throwError( - `unknown network: ${JSON.stringify(network)}`, - utils.Logger.errors.UNSUPPORTED_OPERATION, - { - operation: "getNetwork", - value: networkish, - } - ); - } - return network; + async estimateGas(_tx: CeloTransactionRequest): Promise { + return getBigInt( + await this._perform({ + method: "estimateGas", + // @ts-ignore + transaction: _tx, + }), + "%response" + ); } - async estimateGas( - transaction: utils.Deferrable - ): Promise { - // NOTE: Overrides the ethers method to make sure feeCurrency and from are sent - // to the rpc node - await this.getNetwork(); - const params = await utils.resolveProperties({ - transaction, + // Overrides + // https://github.com/ethers-io/ethers.js/blob/main/lib.esm/providers/abstract-provider.js#L716-L730 + // Just changes the tx parsing. + async broadcastTransaction(signedTx: string): Promise { + const { hash } = await resolveProperties({ + blockNumber: this.getBlockNumber(), + hash: this._perform({ + method: "broadcastTransaction", + signedTransaction: signedTx, + }), + network: this.getNetwork(), }); - const result = await this.perform("estimateGas", params); - try { - return BigNumber.from(result); - } catch (error) { - return logger.throwError( - "bad result from backend", - utils.Logger.errors.SERVER_ERROR, - { - method: "estimateGas", - params, - result, - error, - } - ); + + const tx = parseCeloTransaction(signedTx); + if (tx.hash !== hash) { + throw new Error("@TODO: the returned hash did not match"); } + + return new TransactionResponse(tx as TransactionResponseParams, this); } } diff --git a/src/lib/CeloWallet.ts b/src/lib/CeloWallet.ts index 596c2eb..42ddd7f 100644 --- a/src/lib/CeloWallet.ts +++ b/src/lib/CeloWallet.ts @@ -1,33 +1,43 @@ -import { BigNumber, providers, utils, Wallet, Wordlist } from "ethers"; -import type { CeloProvider } from "./CeloProvider"; +import { + assertArgument, + ErrorCode, + getAddress, + HDNodeWallet, + keccak256, + Mnemonic, + PerformActionRequest, + Provider, + resolveProperties, + TransactionResponse, + Wallet, + Wordlist, +} from "ethers"; +import CeloProvider from "./CeloProvider"; import { adjustForGasInflation } from "./transaction/utils"; import { + CeloTransaction, CeloTransactionRequest, getTxType, serializeCeloTransaction, } from "./transactions"; -const logger = new utils.Logger("CeloWallet"); - const forwardErrors = [ - utils.Logger.errors.INSUFFICIENT_FUNDS, - utils.Logger.errors.NONCE_EXPIRED, - utils.Logger.errors.REPLACEMENT_UNDERPRICED, -]; + "INSUFFICIENT_FUNDS", + "NONCE_EXPIRED", + "REPLACEMENT_UNDERPRICED", +] as ErrorCode[]; -export class CeloWallet extends Wallet { +export default class CeloWallet extends Wallet { /** * Override to skip checkTransaction step which rejects Celo tx properties * https://github.com/ethers-io/ethers.js/blob/master/packages/abstract-signer/src.ts/index.ts */ async populateTransaction( - transaction: utils.Deferrable - ): Promise { - const tx: any = await utils.resolveProperties(transaction); + transaction: CeloTransactionRequest + ): Promise { + let tx: any = await resolveProperties(transaction); if (tx.to != null) { - tx.to = Promise.resolve(tx.to).then((to) => - this.resolveName(to as string) - ); + tx.to = Promise.resolve(tx.to); } if (tx.from == null) { @@ -40,18 +50,19 @@ export class CeloWallet extends Wallet { } if (tx.nonce == null) { - tx.nonce = this.getTransactionCount("pending"); + tx.nonce = await this.provider?.getTransactionCount(tx.from, "pending"); } + tx = await resolveProperties(tx); if (tx.gasLimit == null) { tx.gasLimit = this.estimateGas(tx).catch((error) => { if (forwardErrors.indexOf(error.code) >= 0) { throw error; } - - return logger.throwError( + assertArgument( + false, "cannot estimate gas; transaction may fail or may require manual gas limit", - utils.Logger.errors.UNPREDICTABLE_GAS_LIMIT, + "transaction", { error: error, tx: tx, @@ -61,14 +72,15 @@ export class CeloWallet extends Wallet { } if (tx.chainId == null) { - tx.chainId = this.getChainId(); + tx.chainId = (await this.provider!.getNetwork()).chainId; } else { tx.chainId = Promise.all([ Promise.resolve(tx.chainId), - this.getChainId(), + (await this.provider!.getNetwork()).chainId, ]).then((results) => { - if (results[1] !== 0 && results[0] !== results[1]) { - logger.throwArgumentError( + if (results[1] !== 0n && results[0] !== results[1]) { + assertArgument( + false, "chainId address mismatch", "transaction", transaction @@ -77,8 +89,7 @@ export class CeloWallet extends Wallet { return results[0]; }); } - - return utils.resolveProperties(tx); + return resolveProperties(tx); } /** @@ -89,8 +100,9 @@ export class CeloWallet extends Wallet { const tx = await this.populateTransaction(transaction); if (tx.from != null) { - if (utils.getAddress(tx.from) !== this.address) { - logger.throwArgumentError( + if (getAddress(tx.from) !== this.address) { + assertArgument( + false, "transaction from address mismatch", "transaction.from", transaction.from @@ -99,55 +111,63 @@ export class CeloWallet extends Wallet { delete tx.from; } - const signature = this._signingKey().signDigest( - utils.keccak256(serializeCeloTransaction(tx)) + const signature = this.signingKey.sign( + keccak256(serializeCeloTransaction(tx)) ); const serialized = serializeCeloTransaction(tx, signature); return serialized; } /** - * Override just for type fix - * https://github.com/ethers-io/ethers.js/blob/master/packages/wallet/src.ts/index.ts + * Override to serialize transaction using custom serialize method */ - sendTransaction( - transaction: utils.Deferrable - ): Promise { - return super.sendTransaction(transaction); + async sendTransaction( + transaction: CeloTransactionRequest + ): Promise { + const provider = this.provider!; + + const pop = await this.populateTransaction(transaction); + delete pop.from; + return await provider.broadcastTransaction(await this.signTransaction(pop)); } /** * Override to skip checkTransaction step which rejects Celo tx properties * https://github.com/ethers-io/ethers.js/blob/master/packages/abstract-signer/src.ts/index.ts */ - async estimateGas( - transaction: utils.Deferrable - ): Promise { - this._checkProvider("estimateGas"); - const tx = await utils.resolveProperties(transaction); - return this.provider.estimateGas(tx).then(adjustForGasInflation); + async estimateGas(transaction: CeloTransactionRequest): Promise { + return this.provider!.estimateGas(transaction).then(adjustForGasInflation); } /** * Override to support alternative gas currencies * https://github.com/celo-tools/ethers.js/blob/master/packages/abstract-signer/src.ts/index.ts */ - async getGasPrice(feeCurrencyAddress?: string): Promise { - this._checkProvider("getGasPrice"); - // @ts-ignore - return await this.provider.getGasPrice(feeCurrencyAddress); - } - - connect(provider: CeloProvider): CeloWallet { - return new CeloWallet(this, provider); + async getGasPrice(feeCurrencyAddress?: string): Promise { + return await (this.provider as CeloProvider)._perform({ + method: "getGasPrice", + feeCurrencyAddress, + } as PerformActionRequest); } static fromMnemonic( - mnemonic: string, + phrase: string, path?: string, - wordlist?: Wordlist - ): CeloWallet { - const wallet = super.fromMnemonic(mnemonic, path, wordlist); - return new CeloWallet(wallet); + wordlist?: Wordlist | null + ) { + const hdWallet = HDNodeWallet.fromMnemonic( + Mnemonic.fromPhrase(phrase, null, wordlist), + path + ); + + return new CeloWallet(hdWallet.privateKey, new CeloProvider()); + } + + /** + * Override just for type fix + * https://github.com/ethers-io/ethers.js/blob/master/packages/wallet/src.ts/index.ts + */ + connect(provider: Provider | null) { + return new CeloWallet(this.signingKey, provider); } } diff --git a/src/lib/CeloscanProvider.ts b/src/lib/CeloscanProvider.ts index 1ae03d5..8bd90e5 100644 --- a/src/lib/CeloscanProvider.ts +++ b/src/lib/CeloscanProvider.ts @@ -1,37 +1,45 @@ -import { logger, providers, utils } from "ethers"; +import { + BlockTag, + EtherscanProvider, + Networkish, + assertArgument, +} from "ethers"; import { getNetwork } from "./networks"; -export class CeloscanProvider extends providers.EtherscanProvider { - constructor( - networkish: providers.Networkish = 'celo', - apiKey?: string - ) { - const network = getNetwork(networkish); - if (network == null) { - return logger.throwError( - `unknown network: ${JSON.stringify(network)}`, - utils.Logger.errors.UNSUPPORTED_OPERATION, - { - operation: 'getNetwork', - value: networkish, - }, - ); - } - super(network, apiKey); +export class CeloscanProvider extends EtherscanProvider { + constructor(networkish: Networkish = "celo", apiKey?: string) { + const network = getNetwork(networkish); + super(network!, apiKey); + } + + getBaseUrl(): string { + switch (this.network ? this.network.name : "invalid") { + case "celo": + return "https://api.celoscan.io"; + case "alfajores": + return "https://alfajores.celoscan.io"; + case "baklava": + // baklava is currently not supported by celoscan.io, so we use Blockscout + return "https://explorer.celo.org/baklava"; + default: } - getBaseUrl(): string { - switch (this.network ? this.network.name : "invalid") { - case "celo": - return "https://api.celoscan.io"; - case "alfajores": - return "https://alfajores.celoscan.io"; - case "baklava": - // baklava is currently not supported by celoscan.io, so we use Blockscout - return "https://explorer.celo.org/baklava"; - default: - }; + assertArgument(false, "unsupported network", "network", this.network); + } - return logger.throwArgumentError("unsupported network", "network", this.network.name); - } + async getHistory( + address: string, + startBlock?: BlockTag, + endBlock?: BlockTag + ): Promise> { + const params = { + action: "txlist", + address, + startblock: startBlock == null ? 0 : startBlock, + endblock: endBlock == null ? 99999999 : endBlock, + sort: "asc", + }; + + return this.fetch("account", params); + } } diff --git a/src/lib/StaticCeloProvider.ts b/src/lib/StaticCeloProvider.ts deleted file mode 100644 index f2bc466..0000000 --- a/src/lib/StaticCeloProvider.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { providers } from "ethers"; -import { CeloProvider } from "./CeloProvider"; - -// An extension of CeloProvider that mimics StaticJsonRpcProvider to avoid -// unnecessary network traffic on static nodes -// See https://docs.ethers.io/v5/api/providers/jsonrpc-provider/#StaticJsonRpcProvider -export class StaticCeloProvider extends CeloProvider { - detectNetwork = providers.StaticJsonRpcProvider.prototype.detectNetwork; -} diff --git a/src/lib/networks.ts b/src/lib/networks.ts index 831fccd..37a8b22 100644 --- a/src/lib/networks.ts +++ b/src/lib/networks.ts @@ -1,55 +1,57 @@ -import { providers, utils } from 'ethers'; - -const logger = new utils.Logger("CeloNetworks"); +import { Networkish, assertArgument } from "ethers"; const networks = [ { - name: 'celo', + name: "celo", chainId: 42220, }, { - name: 'alfajores', + name: "alfajores", chainId: 44787, }, { - name: 'baklava', + name: "baklava", chainId: 62320, }, ]; -export function getNetwork( - network?: providers.Networkish, -): null | providers.Network { +export function getNetwork(network?: Networkish): null | Networkish { { if (network == null) { return null; } // Chain ID - if (typeof network === 'number') { - const matches = networks.filter((n) => n.chainId === network); + if (typeof network === "number" || typeof network === "bigint") { + const matches = networks.filter((n) => n.chainId === Number(network)); if (matches.length) { - return { name: matches[0].name, chainId: matches[0].chainId }; + return { + name: matches[0].name, + chainId: matches[0].chainId, + }; } return { - name: 'unknown', - chainId: network, + name: "unknown", + chainId: Number(network), }; } // Chain name - if (typeof network === 'string') { + if (typeof network === "string") { const matches = networks.filter((n) => n.name === network); if (matches.length) { - return { name: matches[0].name, chainId: matches[0].chainId }; + return { + name: matches[0].name, + chainId: matches[0].chainId, + }; } return null; } if ( - typeof network.name === 'string' && - typeof network.chainId === 'number' + typeof network.name === "string" && + typeof network.chainId === "number" ) { const byName = getNetwork(network.name); const byChainId = getNetwork(network.chainId); @@ -66,17 +68,15 @@ export function getNetwork( if ( byName && byChainId && + // @ts-expect-error byName.name === byChainId.name && + // @ts-expect-error byName.chainId === byChainId.chainId ) { return byName; } } - return logger.throwArgumentError( - 'network chainId mismatch', - 'network', - network, - ); + assertArgument(false, "network chainId mismatch", "network", network); } -} \ No newline at end of file +} diff --git a/src/lib/transaction/utils.ts b/src/lib/transaction/utils.ts index 7b9d9b9..8ea7dc2 100644 --- a/src/lib/transaction/utils.ts +++ b/src/lib/transaction/utils.ts @@ -1,16 +1,14 @@ -import { BigNumber, BigNumberish } from "ethers"; -import { hexlify } from "ethers/lib/utils"; +import { hexlify, BigNumberish, isBytesLike, toBeHex } from "ethers"; import { GAS_INFLATION_FACTOR } from "../../consts"; function isEmpty(value: string | BigNumberish | undefined | null) { - return ( - value === undefined || - value === null || - value === "0" || - (typeof value == "string" - ? value.toLowerCase() === "0x" || value.toLowerCase() === "0x0" - : hexlify(value) === "0x0") - ); + if (value === undefined || value === null || value === "0" || value === 0n) { + return true; + } + if (isBytesLike(value)) { + return hexlify(value) === "0x0"; + } + return toBeHex(value) === "0x0"; } function isPresent(value: string | BigNumberish | undefined | null) { @@ -57,7 +55,7 @@ export function omit( }, {} as T); } -export function adjustForGasInflation(gas: BigNumber): BigNumber { +export function adjustForGasInflation(gas: bigint): bigint { // NOTE: prevent floating point math - return gas.mul(Math.floor(GAS_INFLATION_FACTOR * 100)).div(100); + return (gas * GAS_INFLATION_FACTOR) / 100n; } diff --git a/src/lib/transactions.ts b/src/lib/transactions.ts index b22b0b7..0b26116 100644 --- a/src/lib/transactions.ts +++ b/src/lib/transactions.ts @@ -1,50 +1,51 @@ import { - BigNumber, + accessListify, + AccessListish, + assertArgument, BytesLike, - constants, - providers, + decodeRlp, + encodeRlp, + getAddress, + getBigInt, + getBytes, + getNumber, + hexlify, + isBytesLike, + keccak256, + recoverAddress, + RlpStructuredData, Signature, - Transaction, - utils, + SignatureLike, + stripZerosLeft, + toBeArray, + toBeHex, + TransactionLike, + TransactionRequest, + zeroPadValue, } from "ethers"; -import { concatHex, isCIP64, isEIP1559, omit } from "./transaction/utils"; -import { accessListify, AccessListish } from "ethers/lib/utils"; +import { concatHex, isCIP64, isEIP1559 } from "./transaction/utils"; import { EIGHT, EIP155_NUMBER, Y_PARITY_EIP_2098 } from "../consts"; -// From https://github.com/ethers-io/ethers.js/blob/master/packages/bytes/src.ts/index.ts#L33 -// Copied because it doesn't seem to be exported from 'ethers' anywhere -type SignatureLike = - | { - r: string; - s?: string; - _vs?: string; - recoveryParam?: number; - v?: number; - } - | BytesLike; - -const logger = new utils.Logger("celo/transactions"); - -export interface CeloTransactionRequest extends providers.TransactionRequest { +export interface CeloTransactionRequest extends TransactionRequest { feeCurrency?: string; gatewayFeeRecipient?: string; - gatewayFee?: string; + gatewayFee?: bigint; } -export interface CeloTransactionCip64 extends Transaction { +export interface CeloTransactionCip64 extends TransactionLike { type: TxTypeToPrefix.cip64; feeCurrency: string; } -export interface CeloTransactionEip1559 extends Transaction { +export interface CeloTransactionEip1559 extends TransactionLike { type: TxTypeToPrefix.eip1559; } -export interface LegacyCeloTransaction extends Transaction { +export interface LegacyCeloTransaction extends TransactionLike { type: undefined; - gasPrice: BigNumber; + gasPrice: bigint; feeCurrency: string; gatewayFeeRecipient: string; - gatewayFee: BigNumber; + gatewayFee: bigint; } export type CeloTransaction = @@ -61,7 +62,6 @@ interface Field { maxLength?: number; length?: number; numeric?: true; - deprecated?: true; } export const celoAllowedTransactionKeys = { type: true, @@ -93,6 +93,8 @@ type CeloFieldName = | "from" | "customData" | "ccipReadEnabled" + | "blockTag" + | "enableCcipRead" > | "feeCurrency" | "gatewayFeeRecipient" @@ -113,41 +115,48 @@ export const celoTransactionFields: Record = { } as const; function formatCeloField(name: CeloFieldName, value: any) { - value = value || []; - const fieldInfo = celoTransactionFields[name]; const options: any = {}; + + if (!value || value === "0x") return value; + if (fieldInfo.numeric) { options.hexPad = "left"; + value = value ? toBeHex(value, fieldInfo.maxLength) : "0x"; + } else { + value = hexlify(value); } - value = utils.arrayify(utils.hexlify(value, options)); + + let _value = toBeArray(value); // Fixed-width field if ( fieldInfo.length && - value.length !== fieldInfo.length && - value.length > 0 + _value.length !== fieldInfo.length && + _value.length > 0 ) { - logger.throwArgumentError( + assertArgument( + false, "invalid length for " + name, "transaction:" + name, - value + _value ); } // Variable-width (with a maximum) if (fieldInfo.maxLength) { - value = utils.stripZeros(value); - if (value.length > fieldInfo.maxLength) { - logger.throwArgumentError( + _value = toBeArray(stripZerosLeft(_value)); + if (_value.length > fieldInfo.maxLength) { + assertArgument( + false, "invalid length for " + name, "transaction:" + name, - value + _value ); } } - return utils.hexlify(value); + return hexlify(_value); } export function getTxType(tx: CeloTransaction) { @@ -177,20 +186,20 @@ export function getTxType(tx: CeloTransaction) { function prepareEncodeTx( tx: CeloTransaction, signature?: Signature -): (string | Uint8Array)[] { - let raw: (string | Uint8Array)[] = []; +): RlpStructuredData { + let raw: RlpStructuredData[] = []; switch (tx.type) { case TxTypeToPrefix.cip64: // https://github.com/celo-org/celo-proposals/blob/master/CIPs/cip-0064.md // 0x7b || rlp([chainId, nonce, maxPriorityFeePerGas, maxFeePerGas, gasLimit, to, value, data, accessList, feeCurrency, signatureYParity, signatureR, signatureS]). raw = [ - utils.hexlify(tx.chainId!), // NOTE: is this safe or nah? - utils.hexlify(tx.nonce!), // NOTE: is this safe or nah? - tx.maxPriorityFeePerGas ? utils.hexlify(tx.maxPriorityFeePerGas) : "0x", - tx.maxFeePerGas ? utils.hexlify(tx.maxFeePerGas) : "0x", - tx.gasLimit ? utils.hexlify(tx.gasLimit) : "0x", + toBeHex(tx.chainId!), + toBeHex(tx.nonce!), + tx.maxPriorityFeePerGas ? toBeHex(tx.maxPriorityFeePerGas) : "0x", + tx.maxFeePerGas ? toBeHex(tx.maxFeePerGas) : "0x", + tx.gasLimit ? toBeHex(tx.gasLimit) : "0x", tx.to || "0x", - tx.value ? utils.hexlify(tx.value) : "0x", + tx.value ? toBeHex(tx.value) : "0x", tx.data || "0x", // @ts-expect-error tx.accessList || [], @@ -201,13 +210,13 @@ function prepareEncodeTx( // https://eips.ethereum.org/EIPS/eip-1559 // 0x02 || rlp([chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit, destination, amount, data, access_list, signature_y_parity, signature_r, signature_s]). raw = [ - utils.hexlify(tx.chainId!), - utils.hexlify(tx.nonce!), - tx.maxPriorityFeePerGas ? utils.hexlify(tx.maxPriorityFeePerGas) : "0x", - tx.maxFeePerGas ? utils.hexlify(tx.maxFeePerGas) : "0x", - tx.gasLimit ? utils.hexlify(tx.gasLimit) : "0x", + toBeHex(tx.chainId!), + toBeHex(tx.nonce!), + tx.maxPriorityFeePerGas ? toBeHex(tx.maxPriorityFeePerGas) : "0x", + tx.maxFeePerGas ? toBeHex(tx.maxFeePerGas) : "0x", + tx.gasLimit ? toBeHex(tx.gasLimit) : "0x", tx.to || "0x", - tx.value ? utils.hexlify(tx.value) : "0x", + tx.value ? toBeHex(tx.value) : "0x", tx.data || "0x", // @ts-expect-error tx.accessList || [], @@ -217,18 +226,18 @@ function prepareEncodeTx( // This order should match the order in Geth. // https://github.com/celo-org/celo-blockchain/blob/027dba2e4584936cc5a8e8993e4e27d28d5247b8/core/types/transaction.go#L65 raw = [ - utils.hexlify(tx.nonce!), - tx.gasPrice ? utils.hexlify(tx.gasPrice) : "0x", - tx.gasLimit ? utils.hexlify(tx.gasLimit) : "0x", + toBeHex(tx.nonce!), + tx.gasPrice ? toBeHex(tx.gasPrice) : "0x", + tx.gasLimit ? toBeHex(tx.gasLimit) : "0x", tx.feeCurrency || "0x", tx.gatewayFeeRecipient || "0x", - tx.gatewayFee ? utils.hexlify(tx.gatewayFee) : "0x", + tx.gatewayFee ? toBeHex(tx.gatewayFee) : "0x", tx.to || "0x", - tx.value ? utils.hexlify(tx.value) : "0x", + tx.value ? toBeHex(tx.value) : "0x", tx.data || "0x", ]; if (!signature) { - raw.push(...[utils.hexlify(tx.chainId!), "0x", "0x"]); + raw.push(...[toBeHex(tx.chainId!), "0x", "0x"]); } break; } @@ -237,9 +246,9 @@ function prepareEncodeTx( raw.push( ...[ // NOTE: Somehow geth cannot parse `0x00` because it's dumb - signature.v ? utils.hexlify(signature.v) : "0x", - utils.stripZeros(utils.arrayify(signature.r)), - utils.stripZeros(utils.arrayify(signature.s)), + signature.v ? toBeHex(signature.v) : "0x", + stripZerosLeft(getBytes(signature.r)), + stripZerosLeft(getBytes(signature.s)), ] ); } @@ -253,7 +262,16 @@ export function serializeCeloTransaction( transaction: CeloTransactionRequest, signature?: SignatureLike ): string { - utils.checkProperties(transaction, celoAllowedTransactionKeys); + Object.keys(transaction).forEach((property) => { + if (!(property in celoAllowedTransactionKeys)) { + assertArgument( + false, + "unknown property", + "serializeCeloTransaction", + property + ); + } + }); const txArgs: Partial> = {}; @@ -271,10 +289,11 @@ export function serializeCeloTransaction( let chainId = 0; if (transaction.chainId != null) { // A chainId was provided; if non-zero we'll use EIP-155 - chainId = transaction.chainId; + chainId = parseInt(transaction.chainId.toString(16), 16); if (typeof chainId !== "number") { - logger.throwArgumentError( + assertArgument( + false, "invalid transaction.chainId", "transaction", transaction @@ -282,17 +301,17 @@ export function serializeCeloTransaction( } } else if ( signature && - !utils.isBytesLike(signature) && + !isBytesLike(signature) && signature.v && - signature.v > 28 + getNumber(signature.v) > 28 ) { // No chainId provided, but the signature is signing with EIP-155; derive chainId - chainId = Math.floor((signature.v - EIP155_NUMBER) / 2); + chainId = Math.floor((getNumber(signature.v) - EIP155_NUMBER) / 2); } // We have an EIP-155 transaction (chainId was specified and non-zero) if (chainId !== 0) { - txArgs["chainId"] = utils.hexlify(chainId); // @TODO: hexValue? + txArgs["chainId"] = toBeHex(chainId); // @TODO: hexValue? } // Requesting an unsigned transation @@ -303,13 +322,13 @@ export function serializeCeloTransaction( if (!signature) { // @ts-expect-error const raw = prepareEncodeTx(txArgs); - const encoded = utils.RLP.encode(raw); - return type ? concatHex([utils.hexlify(type), encoded]) : encoded; + const encoded = encodeRlp(raw); + return type ? concatHex([toBeHex(type), encoded]) : encoded; } // The splitSignature will ensure the transaction has a recoveryParam in the // case that the signTransaction function only adds a v. - const sig = utils.splitSignature(signature); + const sig = Signature.from(signature); let v: number; if (txArgs.type) { @@ -317,21 +336,23 @@ export function serializeCeloTransaction( v = sig.v - Y_PARITY_EIP_2098; } else { // celo-legacy - v = Y_PARITY_EIP_2098 + sig.recoveryParam; + v = Y_PARITY_EIP_2098 + sig.yParity; if (chainId !== 0) { v += chainId * 2 + EIGHT; // If an EIP-155 v (directly or indirectly; maybe _vs) was provided, check it! if (sig.v > Y_PARITY_EIP_2098 + 1 && sig.v !== v) { - logger.throwArgumentError( + assertArgument( + false, "transaction.chainId/signature.v mismatch", "signature", signature ); } } else if (sig.v !== v) { - logger.throwArgumentError( + assertArgument( + false, "transaction.chainId/signature.v mismatch", "signature", signature @@ -340,15 +361,15 @@ export function serializeCeloTransaction( } // @ts-expect-error - const raw = prepareEncodeTx(txArgs, { ...sig, v }); - const encoded = utils.RLP.encode(raw); - return type ? concatHex([utils.hexlify(type), encoded]) : encoded; + const raw = prepareEncodeTx(txArgs, { ...sig.toJSON(), v }); + const encoded = encodeRlp(raw); + return type ? concatHex([toBeHex(type), encoded]) : encoded; } // Based on https://github.com/ethers-io/ethers.js/blob/0234cfbbef76b7f7a53efe4c434cc6d8892bf404/packages/transactions/src.ts/index.ts#L165 // Need to override to use the celo tx prop whitelists above export function parseCeloTransaction( - rawTransaction: utils.BytesLike + rawTransaction: BytesLike ): CeloTransaction { const [type, transaction] = splitTypeAndRawTx(rawTransaction); @@ -357,45 +378,45 @@ export function parseCeloTransaction( case TxTypeToPrefix.cip64: tx = { type: TxTypeToPrefix.cip64, - chainId: handleNumber(transaction[0]).toNumber(), - nonce: handleNumber(transaction[1]).toNumber(), - maxPriorityFeePerGas: handleNumber(transaction[2]), - maxFeePerGas: handleNumber(transaction[3]), - gasLimit: handleNumber(transaction[4]), - to: handleAddress(transaction[5]), - value: handleNumber(transaction[6]), + chainId: handleNumber(transaction[0] as string), + nonce: handleNumber(transaction[1] as string), + maxPriorityFeePerGas: handleBigInt(transaction[2] as string), + maxFeePerGas: handleBigInt(transaction[3] as string), + gasLimit: handleBigInt(transaction[4] as string), + to: handleAddress(transaction[5] as string), + value: handleBigInt(transaction[6] as string), data: transaction[7], - accessList: handleAccessList(transaction[8]), - feeCurrency: handleAddress(transaction[9]), + accessList: handleAccessList(transaction[8] as string), + feeCurrency: handleAddress(transaction[9] as string), } as CeloTransactionCip64; break; case TxTypeToPrefix.eip1559: // untested tx = { type: TxTypeToPrefix.eip1559, - chainId: handleNumber(transaction[0]).toNumber(), - nonce: handleNumber(transaction[1]).toNumber(), - maxPriorityFeePerGas: handleNumber(transaction[2]), - maxFeePerGas: handleNumber(transaction[3]), - gasLimit: handleNumber(transaction[4]), - to: handleAddress(transaction[5]), - value: handleNumber(transaction[6]), - data: transaction[7], - accessList: handleAccessList(transaction[8]), + chainId: handleNumber(transaction[0] as string), + nonce: handleNumber(transaction[1] as string), + maxPriorityFeePerGas: handleBigInt(transaction[2] as string), + maxFeePerGas: handleBigInt(transaction[3] as string), + gasLimit: handleBigInt(transaction[4] as string), + to: handleAddress(transaction[5] as string), + value: handleBigInt(transaction[6] as string), + data: transaction[7] as string, + accessList: handleAccessList(transaction[8] as string), } as CeloTransactionEip1559; break; default: tx = { - nonce: handleNumber(transaction[0]).toNumber(), - gasPrice: handleNumber(transaction[1]), - gasLimit: handleNumber(transaction[2]), - feeCurrency: handleAddress(transaction[3]), - gatewayFeeRecipient: handleAddress(transaction[4]), - gatewayFee: handleNumber(transaction[5]), - to: handleAddress(transaction[6]), - value: handleNumber(transaction[7]), - data: transaction[8], - chainId: handleNumber(transaction[9]).toNumber(), + nonce: handleNumber(transaction[0] as string), + gasPrice: handleBigInt(transaction[1] as string), + gasLimit: handleBigInt(transaction[2] as string), + feeCurrency: handleAddress(transaction[3] as string), + gatewayFeeRecipient: handleAddress(transaction[4] as string), + gatewayFee: handleBigInt(transaction[5] as string), + to: handleAddress(transaction[6] as string), + value: handleBigInt(transaction[7] as string), + data: transaction[8] as string, + chainId: handleBigInt(transaction[9] as string), } as LegacyCeloTransaction; break; } @@ -405,51 +426,49 @@ export function parseCeloTransaction( return tx; } + let v: number; try { - tx.v = handleNumber(transaction.at(-3)).toNumber(); + v = handleNumber(transaction.at(-3) as string); } catch (error) { console.log(error); return tx; } - tx.r = utils.hexZeroPad(transaction.at(-2), 32); - tx.s = utils.hexZeroPad(transaction.at(-1), 32); + const r = zeroPadValue(transaction.at(-2) as string, 32); + const s = zeroPadValue(transaction.at(-1) as string, 32); // EIP-155 unsigned transaction - if (handleNumber(tx.r).isZero() && handleNumber(tx.s).isZero()) { + if (handleBigInt(r) === 0n && handleBigInt(s) === 0n) { if (!type) { - tx.chainId = tx.v; - tx.v = 0; + tx.chainId = v; + v = 0; } } // Signed Transaction else { - let recoveryParam = tx.v; + let recoveryParam = v; if (!type) { // celo-legacy - tx.chainId = Math.max(0, Math.floor((tx.v - EIP155_NUMBER) / 2)); - recoveryParam = tx.v - Y_PARITY_EIP_2098; + tx.chainId = Math.max(0, Math.floor((v - EIP155_NUMBER) / 2)); + recoveryParam = v - Y_PARITY_EIP_2098; recoveryParam -= tx.chainId * 2 + EIGHT; } // NOTE: Serialization needs to happen here because chainId may not populated before - const serialized = serializeCeloTransaction( - omit(tx, "v", "r", "s") as CeloTransactionRequest - ); - const digest = utils.keccak256(serialized); + const serialized = serializeCeloTransaction(tx); + const digest = keccak256(serialized); try { - // TODO there may be an issue here with incorrect from address extraction - tx.from = utils.recoverAddress(digest, { - r: utils.hexlify(tx.r), - s: utils.hexlify(tx.s), - recoveryParam, + tx.from = recoverAddress(digest, { + r, + s, + yParity: recoveryParam as 0 | 1, }); } catch (error) { console.log(error); } - tx.hash = utils.keccak256(rawTransaction); + tx.hash = keccak256(rawTransaction); } return tx; @@ -460,17 +479,24 @@ function handleAddress(value: string): string | undefined { return undefined; } try { - return utils.getAddress(value); + return getAddress(value); } catch (error) { return value; } } -function handleNumber(value: string): BigNumber { +function handleNumber(value: string): number { if (value === "0x") { - return constants.Zero; + return 0; } - return BigNumber.from(value); + return getNumber(value); +} + +function handleBigInt(value: string): bigint { + if (value === "0x") { + return 0n; + } + return getBigInt(value); } function handleAccessList(value: string): AccessListish | "0x" { @@ -487,7 +513,7 @@ const baseTxLengths = { "celo-legacy": { unsigned: 12, signed: 12 }, } as const; -function isSigned(type: TxTypeToPrefix, transaction: string[]) { +function isSigned(type: TxTypeToPrefix, transaction: RlpStructuredData[]) { if (type) { const { signed } = baseTxLengths[type]; return transaction.length === signed; @@ -498,18 +524,21 @@ function isSigned(type: TxTypeToPrefix, transaction: string[]) { return r !== "0x" && s !== "0x"; } -function isCorrectLength(type: TxTypeToPrefix, transaction: string[]) { +function isCorrectLength( + type: TxTypeToPrefix, + transaction: RlpStructuredData[] +) { const { unsigned } = baseTxLengths[type || "celo-legacy"]; return transaction.length === unsigned || isSigned(type, transaction); } function splitTypeAndRawTx( - rawTransaction: utils.BytesLike -): [TxTypeToPrefix | undefined, any[]] { + rawTransaction: BytesLike +): [TxTypeToPrefix | undefined, RlpStructuredData[]] { let rawStr = rawTransaction.toString(); let type: TxTypeToPrefix | undefined; for (const _type of [TxTypeToPrefix.cip64, TxTypeToPrefix.eip1559]) { - const prefix = utils.hexlify(_type); + const prefix = toBeHex(_type); if (rawStr.startsWith(prefix)) { rawStr = `0x${rawStr.slice(prefix.length)}`; type = _type; @@ -517,13 +546,12 @@ function splitTypeAndRawTx( } } - const transaction = utils.RLP.decode(rawStr); + const transaction = decodeRlp(rawStr) as RlpStructuredData[]; if (!isCorrectLength(type!, transaction)) { - logger.throwArgumentError( - "invalid raw transaction", - "{type, rawTransaction}", - { type: type!, rawTransaction } - ); + assertArgument(false, "invalid raw transaction", "{type, rawTransaction}", { + type: type!, + rawTransaction, + }); } return [type!, transaction]; diff --git a/test/HelloWorld.json b/test/HelloWorld.json deleted file mode 100644 index 002cac0..0000000 --- a/test/HelloWorld.json +++ /dev/null @@ -1,644 +0,0 @@ -{ - "contractName": "HelloWorld", - "abi": [ - { - "constant": true, - "inputs": [], - "name": "getName", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "string", - "name": "newName", - "type": "string" - } - ], - "name": "setName", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - } - ], - "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[],\"name\":\"getName\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"string\",\"name\":\"newName\",\"type\":\"string\"}],\"name\":\"setName\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"project:/contracts/HelloWorld.sol\":\"HelloWorld\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"project:/contracts/HelloWorld.sol\":{\"keccak256\":\"0x8fad2ff358c9626a7561ece2e167393f3ebced924cbac25845ee91d1ff3e9ba3\",\"urls\":[\"bzz-raw://82d8a783cbd3930b300413af364fdb2fcf938fae887bbb5abaa5c7dd147643ac\",\"dweb:/ipfs/QmNr85DekMVPxyjp5jfrywUxs4UgHhTUMjL9rYM6rh3DHs\"]}},\"version\":1}", - "bytecode": "0x60806040526040518060400160405280600481526020017f43656c6f000000000000000000000000000000000000000000000000000000008152506000908051906020019061004f929190610062565b5034801561005c57600080fd5b50610107565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100a357805160ff19168380011785556100d1565b828001600101855582156100d1579182015b828111156100d05782518255916020019190600101906100b5565b5b5090506100de91906100e2565b5090565b61010491905b808211156101005760008160009055506001016100e8565b5090565b90565b6102c9806101166000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806317d7de7c1461003b578063c47f0027146100be575b600080fd5b610043610137565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610083578082015181840152602081019050610068565b50505050905090810190601f1680156100b05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610135600480360360208110156100d457600080fd5b81019080803590602001906401000000008111156100f157600080fd5b82018360208201111561010357600080fd5b8035906020019184600183028401116401000000008311171561012557600080fd5b90919293919293905050506101d9565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156101cf5780601f106101a4576101008083540402835291602001916101cf565b820191906000526020600020905b8154815290600101906020018083116101b257829003601f168201915b5050505050905090565b8181600091906101ea9291906101ef565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061023057803560ff191683800117855561025e565b8280016001018555821561025e579182015b8281111561025d578235825591602001919060010190610242565b5b50905061026b919061026f565b5090565b61029191905b8082111561028d576000816000905550600101610275565b5090565b9056fea265627a7a723158205867faa743de0ad88e734dcac726e97112646dfff9353fee6350cbc1f339f93c64736f6c63430005100032", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c806317d7de7c1461003b578063c47f0027146100be575b600080fd5b610043610137565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610083578082015181840152602081019050610068565b50505050905090810190601f1680156100b05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610135600480360360208110156100d457600080fd5b81019080803590602001906401000000008111156100f157600080fd5b82018360208201111561010357600080fd5b8035906020019184600183028401116401000000008311171561012557600080fd5b90919293919293905050506101d9565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156101cf5780601f106101a4576101008083540402835291602001916101cf565b820191906000526020600020905b8154815290600101906020018083116101b257829003601f168201915b5050505050905090565b8181600091906101ea9291906101ef565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061023057803560ff191683800117855561025e565b8280016001018555821561025e579182015b8281111561025d578235825591602001919060010190610242565b5b50905061026b919061026f565b5090565b61029191905b8082111561028d576000816000905550600101610275565b5090565b9056fea265627a7a723158205867faa743de0ad88e734dcac726e97112646dfff9353fee6350cbc1f339f93c64736f6c63430005100032", - "sourceMap": "195:970:0:-;;;280:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;195:970;8:9:-1;5:2;;;30:1;27;20:12;5:2;195:970:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;", - "deployedSourceMap": "195:970:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;195:970:0;;;;;;;;;;;;;;;;;;;;;;;;609:137;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;609:137:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1006:157;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1006:157:0;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;1006:157:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;1006:157:0;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;1006:157:0;;;;;;;;;;;;:::i;:::-;;609:137;664:13;737:4;730:11;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;609:137;:::o;1006:157::-;1151:7;;1144:4;:14;;;;;;;:::i;:::-;;1006:157;;:::o;195:970::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o", - "source": "// Learn more about Solidity here: https://solidity.readthedocs.io\n\n// This statement specifies the compatible compiler versions\npragma solidity >=0.5.0;\n\n// Declare a contract called HelloWorld\ncontract HelloWorld {\n \n // Define a string called name, initialize it to 'Celo'\n string name = 'Celo';\n\n // Declares a function called getName\n // The 'public' label means the function can be called internally, by transactions or other contracts\n // The 'view' label indicates that the function does not change the state of the contract\n // The function returns a string, from the memory data location \n function getName() \n public \n view \n returns (string memory) \n {\n // Return the storage variable 'name'\n return name;\n }\n\n // Declare a function called setName\n // The function takes 1 parameter, a string, called newName, with the calldata data location in the Ethereum Virtual Machine \n // The 'external' label means the function can only be called from an external source\n function setName(string calldata newName) \n external \n {\n // Set the storage variable, name, to the value passed in as newName\n name = newName;\n }\n}", - "sourcePath": "/Users/josh/Documents/GitHub/celo-contracts-workshop/truffle/contracts/HelloWorld.sol", - "ast": { - "absolutePath": "project:/contracts/HelloWorld.sol", - "exportedSymbols": { - "HelloWorld": [ - 23 - ] - }, - "id": 24, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 1, - "literals": [ - "solidity", - ">=", - "0.5", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "129:24:0" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 23, - "linearizedBaseContracts": [ - 23 - ], - "name": "HelloWorld", - "nodeType": "ContractDefinition", - "nodes": [ - { - "constant": false, - "id": 4, - "name": "name", - "nodeType": "VariableDeclaration", - "scope": 23, - "src": "280:20:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string" - }, - "typeName": { - "id": 2, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "280:6:0", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": { - "argumentTypes": null, - "hexValue": "43656c6f", - "id": 3, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "294:6:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_9d2bc54cb1b449a4cf59411d04e3148a0ebb5ba960bffb680f6141d50a7be95c", - "typeString": "literal_string \"Celo\"" - }, - "value": "Celo" - }, - "visibility": "internal" - }, - { - "body": { - "id": 11, - "nodeType": "Block", - "src": "682:64:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 9, - "name": "name", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "737:4:0", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" - } - }, - "functionReturnParameters": 8, - "id": 10, - "nodeType": "Return", - "src": "730:11:0" - } - ] - }, - "documentation": null, - "id": 12, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getName", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 5, - "nodeType": "ParameterList", - "parameters": [], - "src": "625:2:0" - }, - "returnParameters": { - "id": 8, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 7, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 12, - "src": "664:13:0", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 6, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "664:6:0", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "663:15:0" - }, - "scope": 23, - "src": "609:137:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 21, - "nodeType": "Block", - "src": "1065:98:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 19, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 17, - "name": "name", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4, - "src": "1144:4:0", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 18, - "name": "newName", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 14, - "src": "1151:7:0", - "typeDescriptions": { - "typeIdentifier": "t_string_calldata_ptr", - "typeString": "string calldata" - } - }, - "src": "1144:14:0", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" - } - }, - "id": 20, - "nodeType": "ExpressionStatement", - "src": "1144:14:0" - } - ] - }, - "documentation": null, - "id": 22, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "setName", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 15, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 14, - "name": "newName", - "nodeType": "VariableDeclaration", - "scope": 22, - "src": "1023:23:0", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_string_calldata_ptr", - "typeString": "string" - }, - "typeName": { - "id": 13, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "1023:6:0", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1022:25:0" - }, - "returnParameters": { - "id": 16, - "nodeType": "ParameterList", - "parameters": [], - "src": "1065:0:0" - }, - "scope": 23, - "src": "1006:157:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - } - ], - "scope": 24, - "src": "195:970:0" - } - ], - "src": "129:1036:0" - }, - "legacyAST": { - "attributes": { - "absolutePath": "project:/contracts/HelloWorld.sol", - "exportedSymbols": { - "HelloWorld": [ - 23 - ] - } - }, - "children": [ - { - "attributes": { - "literals": [ - "solidity", - ">=", - "0.5", - ".0" - ] - }, - "id": 1, - "name": "PragmaDirective", - "src": "129:24:0" - }, - { - "attributes": { - "baseContracts": [ - null - ], - "contractDependencies": [ - null - ], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "linearizedBaseContracts": [ - 23 - ], - "name": "HelloWorld", - "scope": 24 - }, - "children": [ - { - "attributes": { - "constant": false, - "name": "name", - "scope": 23, - "stateVariable": true, - "storageLocation": "default", - "type": "string", - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "string", - "type": "string" - }, - "id": 2, - "name": "ElementaryTypeName", - "src": "280:6:0" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "43656c6f", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "string", - "type": "literal_string \"Celo\"", - "value": "Celo" - }, - "id": 3, - "name": "Literal", - "src": "294:6:0" - } - ], - "id": 4, - "name": "VariableDeclaration", - "src": "280:20:0" - }, - { - "attributes": { - "documentation": null, - "implemented": true, - "isConstructor": false, - "kind": "function", - "modifiers": [ - null - ], - "name": "getName", - "scope": 23, - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - "children": [ - { - "attributes": { - "parameters": [ - null - ] - }, - "children": [], - "id": 5, - "name": "ParameterList", - "src": "625:2:0" - }, - { - "children": [ - { - "attributes": { - "constant": false, - "name": "", - "scope": 12, - "stateVariable": false, - "storageLocation": "memory", - "type": "string", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "string", - "type": "string" - }, - "id": 6, - "name": "ElementaryTypeName", - "src": "664:6:0" - } - ], - "id": 7, - "name": "VariableDeclaration", - "src": "664:13:0" - } - ], - "id": 8, - "name": "ParameterList", - "src": "663:15:0" - }, - { - "children": [ - { - "attributes": { - "functionReturnParameters": 8 - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4, - "type": "string storage ref", - "value": "name" - }, - "id": 9, - "name": "Identifier", - "src": "737:4:0" - } - ], - "id": 10, - "name": "Return", - "src": "730:11:0" - } - ], - "id": 11, - "name": "Block", - "src": "682:64:0" - } - ], - "id": 12, - "name": "FunctionDefinition", - "src": "609:137:0" - }, - { - "attributes": { - "documentation": null, - "implemented": true, - "isConstructor": false, - "kind": "function", - "modifiers": [ - null - ], - "name": "setName", - "scope": 23, - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - "children": [ - { - "children": [ - { - "attributes": { - "constant": false, - "name": "newName", - "scope": 22, - "stateVariable": false, - "storageLocation": "calldata", - "type": "string", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "string", - "type": "string" - }, - "id": 13, - "name": "ElementaryTypeName", - "src": "1023:6:0" - } - ], - "id": 14, - "name": "VariableDeclaration", - "src": "1023:23:0" - } - ], - "id": 15, - "name": "ParameterList", - "src": "1022:25:0" - }, - { - "attributes": { - "parameters": [ - null - ] - }, - "children": [], - "id": 16, - "name": "ParameterList", - "src": "1065:0:0" - }, - { - "children": [ - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "=", - "type": "string storage ref" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4, - "type": "string storage ref", - "value": "name" - }, - "id": 17, - "name": "Identifier", - "src": "1144:4:0" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 14, - "type": "string calldata", - "value": "newName" - }, - "id": 18, - "name": "Identifier", - "src": "1151:7:0" - } - ], - "id": 19, - "name": "Assignment", - "src": "1144:14:0" - } - ], - "id": 20, - "name": "ExpressionStatement", - "src": "1144:14:0" - } - ], - "id": 21, - "name": "Block", - "src": "1065:98:0" - } - ], - "id": 22, - "name": "FunctionDefinition", - "src": "1006:157:0" - } - ], - "id": 23, - "name": "ContractDefinition", - "src": "195:970:0" - } - ], - "id": 24, - "name": "SourceUnit", - "src": "129:1036:0" - }, - "compiler": { - "name": "solc", - "version": "0.5.16+commit.9c3226ce.Emscripten.clang" - }, - "networks": { - "44787": { - "events": {}, - "links": {}, - "address": "0x4E87943C9BF939fB2A2520b35a3ae2056dF43199", - "transactionHash": "0x0e2d3d71d9cd671fc435e3592030f72e1a0c06b01021f2ad08ec30f0ec9c0be2" - } - }, - "schemaVersion": "3.4.6", - "updatedAt": "2022-05-12T14:29:26.541Z", - "networkType": "ethereum", - "devdoc": { - "methods": {} - }, - "userdoc": { - "methods": {} - } -} \ No newline at end of file diff --git a/test/HelloWorld.ts b/test/HelloWorld.ts new file mode 100644 index 0000000..eda59d3 --- /dev/null +++ b/test/HelloWorld.ts @@ -0,0 +1,618 @@ +const HelloWorldContract = { + contractName: "HelloWorld", + abi: [ + { + constant: true, + inputs: [], + name: "getName", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "string", + name: "newName", + type: "string", + }, + ], + name: "setName", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + ], + metadata: + '{"compiler":{"version":"0.5.16+commit.9c3226ce"},"language":"Solidity","output":{"abi":[{"constant":true,"inputs":[],"name":"getName","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"string","name":"newName","type":"string"}],"name":"setName","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}],"devdoc":{"methods":{}},"userdoc":{"methods":{}}},"settings":{"compilationTarget":{"project:/contracts/HelloWorld.sol":"HelloWorld"},"evmVersion":"istanbul","libraries":{},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"project:/contracts/HelloWorld.sol":{"keccak256":"0x8fad2ff358c9626a7561ece2e167393f3ebced924cbac25845ee91d1ff3e9ba3","urls":["bzz-raw://82d8a783cbd3930b300413af364fdb2fcf938fae887bbb5abaa5c7dd147643ac","dweb:/ipfs/QmNr85DekMVPxyjp5jfrywUxs4UgHhTUMjL9rYM6rh3DHs"]}},"version":1}', + bytecode: + "0x60806040526040518060400160405280600481526020017f43656c6f000000000000000000000000000000000000000000000000000000008152506000908051906020019061004f929190610062565b5034801561005c57600080fd5b50610107565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100a357805160ff19168380011785556100d1565b828001600101855582156100d1579182015b828111156100d05782518255916020019190600101906100b5565b5b5090506100de91906100e2565b5090565b61010491905b808211156101005760008160009055506001016100e8565b5090565b90565b6102c9806101166000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806317d7de7c1461003b578063c47f0027146100be575b600080fd5b610043610137565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610083578082015181840152602081019050610068565b50505050905090810190601f1680156100b05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610135600480360360208110156100d457600080fd5b81019080803590602001906401000000008111156100f157600080fd5b82018360208201111561010357600080fd5b8035906020019184600183028401116401000000008311171561012557600080fd5b90919293919293905050506101d9565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156101cf5780601f106101a4576101008083540402835291602001916101cf565b820191906000526020600020905b8154815290600101906020018083116101b257829003601f168201915b5050505050905090565b8181600091906101ea9291906101ef565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061023057803560ff191683800117855561025e565b8280016001018555821561025e579182015b8281111561025d578235825591602001919060010190610242565b5b50905061026b919061026f565b5090565b61029191905b8082111561028d576000816000905550600101610275565b5090565b9056fea265627a7a723158205867faa743de0ad88e734dcac726e97112646dfff9353fee6350cbc1f339f93c64736f6c63430005100032", + deployedBytecode: + "0x608060405234801561001057600080fd5b50600436106100365760003560e01c806317d7de7c1461003b578063c47f0027146100be575b600080fd5b610043610137565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610083578082015181840152602081019050610068565b50505050905090810190601f1680156100b05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610135600480360360208110156100d457600080fd5b81019080803590602001906401000000008111156100f157600080fd5b82018360208201111561010357600080fd5b8035906020019184600183028401116401000000008311171561012557600080fd5b90919293919293905050506101d9565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156101cf5780601f106101a4576101008083540402835291602001916101cf565b820191906000526020600020905b8154815290600101906020018083116101b257829003601f168201915b5050505050905090565b8181600091906101ea9291906101ef565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061023057803560ff191683800117855561025e565b8280016001018555821561025e579182015b8281111561025d578235825591602001919060010190610242565b5b50905061026b919061026f565b5090565b61029191905b8082111561028d576000816000905550600101610275565b5090565b9056fea265627a7a723158205867faa743de0ad88e734dcac726e97112646dfff9353fee6350cbc1f339f93c64736f6c63430005100032", + sourceMap: + "195:970:0:-;;;280:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;195:970;8:9:-1;5:2;;;30:1;27;20:12;5:2;195:970:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;", + deployedSourceMap: + "195:970:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;195:970:0;;;;;;;;;;;;;;;;;;;;;;;;609:137;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;609:137:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1006:157;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1006:157:0;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;1006:157:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;1006:157:0;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;1006:157:0;;;;;;;;;;;;:::i;:::-;;609:137;664:13;737:4;730:11;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;609:137;:::o;1006:157::-;1151:7;;1144:4;:14;;;;;;;:::i;:::-;;1006:157;;:::o;195:970::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o", + source: + "// Learn more about Solidity here: https://solidity.readthedocs.io\n\n// This statement specifies the compatible compiler versions\npragma solidity >=0.5.0;\n\n// Declare a contract called HelloWorld\ncontract HelloWorld {\n \n // Define a string called name, initialize it to 'Celo'\n string name = 'Celo';\n\n // Declares a function called getName\n // The 'public' label means the function can be called internally, by transactions or other contracts\n // The 'view' label indicates that the function does not change the state of the contract\n // The function returns a string, from the memory data location \n function getName() \n public \n view \n returns (string memory) \n {\n // Return the storage variable 'name'\n return name;\n }\n\n // Declare a function called setName\n // The function takes 1 parameter, a string, called newName, with the calldata data location in the Ethereum Virtual Machine \n // The 'external' label means the function can only be called from an external source\n function setName(string calldata newName) \n external \n {\n // Set the storage variable, name, to the value passed in as newName\n name = newName;\n }\n}", + sourcePath: + "/Users/josh/Documents/GitHub/celo-contracts-workshop/truffle/contracts/HelloWorld.sol", + ast: { + absolutePath: "project:/contracts/HelloWorld.sol", + exportedSymbols: { + HelloWorld: [23], + }, + id: 24, + nodeType: "SourceUnit", + nodes: [ + { + id: 1, + literals: ["solidity", ">=", "0.5", ".0"], + nodeType: "PragmaDirective", + src: "129:24:0", + }, + { + baseContracts: [], + contractDependencies: [], + contractKind: "contract", + documentation: null, + fullyImplemented: true, + id: 23, + linearizedBaseContracts: [23], + name: "HelloWorld", + nodeType: "ContractDefinition", + nodes: [ + { + constant: false, + id: 4, + name: "name", + nodeType: "VariableDeclaration", + scope: 23, + src: "280:20:0", + stateVariable: true, + storageLocation: "default", + typeDescriptions: { + typeIdentifier: "t_string_storage", + typeString: "string", + }, + typeName: { + id: 2, + name: "string", + nodeType: "ElementaryTypeName", + src: "280:6:0", + typeDescriptions: { + typeIdentifier: "t_string_storage_ptr", + typeString: "string", + }, + }, + value: { + argumentTypes: null, + hexValue: "43656c6f", + id: 3, + isConstant: false, + isLValue: false, + isPure: true, + kind: "string", + lValueRequested: false, + nodeType: "Literal", + src: "294:6:0", + subdenomination: null, + typeDescriptions: { + typeIdentifier: + "t_stringliteral_9d2bc54cb1b449a4cf59411d04e3148a0ebb5ba960bffb680f6141d50a7be95c", + typeString: 'literal_string "Celo"', + }, + value: "Celo", + }, + visibility: "internal", + }, + { + body: { + id: 11, + nodeType: "Block", + src: "682:64:0", + statements: [ + { + expression: { + argumentTypes: null, + id: 9, + name: "name", + nodeType: "Identifier", + overloadedDeclarations: [], + referencedDeclaration: 4, + src: "737:4:0", + typeDescriptions: { + typeIdentifier: "t_string_storage", + typeString: "string storage ref", + }, + }, + functionReturnParameters: 8, + id: 10, + nodeType: "Return", + src: "730:11:0", + }, + ], + }, + documentation: null, + id: 12, + implemented: true, + kind: "function", + modifiers: [], + name: "getName", + nodeType: "FunctionDefinition", + parameters: { + id: 5, + nodeType: "ParameterList", + parameters: [], + src: "625:2:0", + }, + returnParameters: { + id: 8, + nodeType: "ParameterList", + parameters: [ + { + constant: false, + id: 7, + name: "", + nodeType: "VariableDeclaration", + scope: 12, + src: "664:13:0", + stateVariable: false, + storageLocation: "memory", + typeDescriptions: { + typeIdentifier: "t_string_memory_ptr", + typeString: "string", + }, + typeName: { + id: 6, + name: "string", + nodeType: "ElementaryTypeName", + src: "664:6:0", + typeDescriptions: { + typeIdentifier: "t_string_storage_ptr", + typeString: "string", + }, + }, + value: null, + visibility: "internal", + }, + ], + src: "663:15:0", + }, + scope: 23, + src: "609:137:0", + stateMutability: "view", + superFunction: null, + visibility: "public", + }, + { + body: { + id: 21, + nodeType: "Block", + src: "1065:98:0", + statements: [ + { + expression: { + argumentTypes: null, + id: 19, + isConstant: false, + isLValue: false, + isPure: false, + lValueRequested: false, + leftHandSide: { + argumentTypes: null, + id: 17, + name: "name", + nodeType: "Identifier", + overloadedDeclarations: [], + referencedDeclaration: 4, + src: "1144:4:0", + typeDescriptions: { + typeIdentifier: "t_string_storage", + typeString: "string storage ref", + }, + }, + nodeType: "Assignment", + operator: "=", + rightHandSide: { + argumentTypes: null, + id: 18, + name: "newName", + nodeType: "Identifier", + overloadedDeclarations: [], + referencedDeclaration: 14, + src: "1151:7:0", + typeDescriptions: { + typeIdentifier: "t_string_calldata_ptr", + typeString: "string calldata", + }, + }, + src: "1144:14:0", + typeDescriptions: { + typeIdentifier: "t_string_storage", + typeString: "string storage ref", + }, + }, + id: 20, + nodeType: "ExpressionStatement", + src: "1144:14:0", + }, + ], + }, + documentation: null, + id: 22, + implemented: true, + kind: "function", + modifiers: [], + name: "setName", + nodeType: "FunctionDefinition", + parameters: { + id: 15, + nodeType: "ParameterList", + parameters: [ + { + constant: false, + id: 14, + name: "newName", + nodeType: "VariableDeclaration", + scope: 22, + src: "1023:23:0", + stateVariable: false, + storageLocation: "calldata", + typeDescriptions: { + typeIdentifier: "t_string_calldata_ptr", + typeString: "string", + }, + typeName: { + id: 13, + name: "string", + nodeType: "ElementaryTypeName", + src: "1023:6:0", + typeDescriptions: { + typeIdentifier: "t_string_storage_ptr", + typeString: "string", + }, + }, + value: null, + visibility: "internal", + }, + ], + src: "1022:25:0", + }, + returnParameters: { + id: 16, + nodeType: "ParameterList", + parameters: [], + src: "1065:0:0", + }, + scope: 23, + src: "1006:157:0", + stateMutability: "nonpayable", + superFunction: null, + visibility: "external", + }, + ], + scope: 24, + src: "195:970:0", + }, + ], + src: "129:1036:0", + }, + legacyAST: { + attributes: { + absolutePath: "project:/contracts/HelloWorld.sol", + exportedSymbols: { + HelloWorld: [23], + }, + }, + children: [ + { + attributes: { + literals: ["solidity", ">=", "0.5", ".0"], + }, + id: 1, + name: "PragmaDirective", + src: "129:24:0", + }, + { + attributes: { + baseContracts: [null], + contractDependencies: [null], + contractKind: "contract", + documentation: null, + fullyImplemented: true, + linearizedBaseContracts: [23], + name: "HelloWorld", + scope: 24, + }, + children: [ + { + attributes: { + constant: false, + name: "name", + scope: 23, + stateVariable: true, + storageLocation: "default", + type: "string", + visibility: "internal", + }, + children: [ + { + attributes: { + name: "string", + type: "string", + }, + id: 2, + name: "ElementaryTypeName", + src: "280:6:0", + }, + { + attributes: { + argumentTypes: null, + hexvalue: "43656c6f", + isConstant: false, + isLValue: false, + isPure: true, + lValueRequested: false, + subdenomination: null, + token: "string", + type: 'literal_string "Celo"', + value: "Celo", + }, + id: 3, + name: "Literal", + src: "294:6:0", + }, + ], + id: 4, + name: "VariableDeclaration", + src: "280:20:0", + }, + { + attributes: { + documentation: null, + implemented: true, + isConstructor: false, + kind: "function", + modifiers: [null], + name: "getName", + scope: 23, + stateMutability: "view", + superFunction: null, + visibility: "public", + }, + children: [ + { + attributes: { + parameters: [null], + }, + children: [], + id: 5, + name: "ParameterList", + src: "625:2:0", + }, + { + children: [ + { + attributes: { + constant: false, + name: "", + scope: 12, + stateVariable: false, + storageLocation: "memory", + type: "string", + value: null, + visibility: "internal", + }, + children: [ + { + attributes: { + name: "string", + type: "string", + }, + id: 6, + name: "ElementaryTypeName", + src: "664:6:0", + }, + ], + id: 7, + name: "VariableDeclaration", + src: "664:13:0", + }, + ], + id: 8, + name: "ParameterList", + src: "663:15:0", + }, + { + children: [ + { + attributes: { + functionReturnParameters: 8, + }, + children: [ + { + attributes: { + argumentTypes: null, + overloadedDeclarations: [null], + referencedDeclaration: 4, + type: "string storage ref", + value: "name", + }, + id: 9, + name: "Identifier", + src: "737:4:0", + }, + ], + id: 10, + name: "Return", + src: "730:11:0", + }, + ], + id: 11, + name: "Block", + src: "682:64:0", + }, + ], + id: 12, + name: "FunctionDefinition", + src: "609:137:0", + }, + { + attributes: { + documentation: null, + implemented: true, + isConstructor: false, + kind: "function", + modifiers: [null], + name: "setName", + scope: 23, + stateMutability: "nonpayable", + superFunction: null, + visibility: "external", + }, + children: [ + { + children: [ + { + attributes: { + constant: false, + name: "newName", + scope: 22, + stateVariable: false, + storageLocation: "calldata", + type: "string", + value: null, + visibility: "internal", + }, + children: [ + { + attributes: { + name: "string", + type: "string", + }, + id: 13, + name: "ElementaryTypeName", + src: "1023:6:0", + }, + ], + id: 14, + name: "VariableDeclaration", + src: "1023:23:0", + }, + ], + id: 15, + name: "ParameterList", + src: "1022:25:0", + }, + { + attributes: { + parameters: [null], + }, + children: [], + id: 16, + name: "ParameterList", + src: "1065:0:0", + }, + { + children: [ + { + children: [ + { + attributes: { + argumentTypes: null, + isConstant: false, + isLValue: false, + isPure: false, + lValueRequested: false, + operator: "=", + type: "string storage ref", + }, + children: [ + { + attributes: { + argumentTypes: null, + overloadedDeclarations: [null], + referencedDeclaration: 4, + type: "string storage ref", + value: "name", + }, + id: 17, + name: "Identifier", + src: "1144:4:0", + }, + { + attributes: { + argumentTypes: null, + overloadedDeclarations: [null], + referencedDeclaration: 14, + type: "string calldata", + value: "newName", + }, + id: 18, + name: "Identifier", + src: "1151:7:0", + }, + ], + id: 19, + name: "Assignment", + src: "1144:14:0", + }, + ], + id: 20, + name: "ExpressionStatement", + src: "1144:14:0", + }, + ], + id: 21, + name: "Block", + src: "1065:98:0", + }, + ], + id: 22, + name: "FunctionDefinition", + src: "1006:157:0", + }, + ], + id: 23, + name: "ContractDefinition", + src: "195:970:0", + }, + ], + id: 24, + name: "SourceUnit", + src: "129:1036:0", + }, + compiler: { + name: "solc", + version: "0.5.16+commit.9c3226ce.Emscripten.clang", + }, + networks: { + "44787": { + events: {}, + links: {}, + address: "0x4E87943C9BF939fB2A2520b35a3ae2056dF43199", + transactionHash: + "0x0e2d3d71d9cd671fc435e3592030f72e1a0c06b01021f2ad08ec30f0ec9c0be2", + }, + }, + schemaVersion: "3.4.6", + updatedAt: "2022-05-12T14:29:26.541Z", + networkType: "ethereum", + devdoc: { + methods: {}, + }, + userdoc: { + methods: {}, + }, +} as const; +export default HelloWorldContract; diff --git a/test/deployContract.ts b/test/deployContract.ts index f120f26..284a50e 100644 --- a/test/deployContract.ts +++ b/test/deployContract.ts @@ -1,5 +1,5 @@ -import { ContractFactory } from "ethers"; -import HelloWorldContract from "./HelloWorld.json"; +import { Contract, ContractFactory } from "ethers"; +import HelloWorldContract from "./HelloWorld"; import { getSigner } from "./utils"; async function main() { @@ -11,13 +11,13 @@ async function main() { signer ); const contract = await factory.deploy(); - await contract.deployTransaction.wait(); - console.info("Contract deployed, address:", contract.address); + const receipt = await contract.deploymentTransaction()?.wait(); + console.info("Contract deployed, address:", receipt?.contractAddress); console.info("Sending tx to contract"); - const txResponse = await contract.setName("myName"); + const txResponse = await (contract as Contract).setName("myName"); const txReceipt = await txResponse.wait(); - console.info("tx sent, hash:", txReceipt.transactionHash); + console.info("tx sent, hash:", txReceipt.hash); } main() diff --git a/test/getHistory.ts b/test/getHistory.ts index bcea029..dc09193 100644 --- a/test/getHistory.ts +++ b/test/getHistory.ts @@ -1,16 +1,16 @@ import { CeloscanProvider } from "../src/lib/CeloscanProvider"; async function main() { - const account = process.env.ACCOUNT; - if (!account) throw new Error("No ACCOUNT provided in env"); - const network = process.env.NETWORK?.toLocaleLowerCase() || "celo"; - console.info("Using CeloscanProvider with", network.toUpperCase(), "network"); - const provider = new CeloscanProvider(network); - const history = await provider.getHistory(account); - console.info("Account", account, "history:"); - console.info(history); + const account = process.env.ACCOUNT; + if (!account) throw new Error("No ACCOUNT provided in env"); + const network = process.env.NETWORK?.toLocaleLowerCase() || "celo"; + console.info("Using CeloscanProvider with", network.toUpperCase(), "network"); + const provider = new CeloscanProvider(network); + const history = await provider.getHistory(account); + console.info("Account", account, "history:"); + console.info(history); } main() - .then(() => console.info("Get history complete")) - .catch(console.error); + .then(() => console.info("Get history complete")) + .catch(console.error); diff --git a/test/useContract.ts b/test/useContract.ts index b73481d..ce0e7c9 100644 --- a/test/useContract.ts +++ b/test/useContract.ts @@ -1,29 +1,29 @@ -import { BigNumber, Contract } from "ethers"; import { CUSD_ADDRESS } from "./consts"; -import { STABLE_TOKEN_ABI } from "./stableToken"; import { getSigner } from "./utils"; +import { Contract, TransactionResponse } from "ethers"; +import { STABLE_TOKEN_ABI } from "./stableToken"; async function main() { const signer = getSigner(); console.info("Getting account balance for:", signer.address); - const balance = await signer.getBalance(); - console.info("Balance:", balance.toString()); + const balance = await signer.provider?.getBalance(signer.address); + console.info("Balance:", balance); console.info("Sending 1 CELO wei", signer.address); const txResponse1 = await signer.sendTransaction({ to: signer.address, - value: BigNumber.from("1"), + value: 1n, }); // Or, alternatively, break apart signing and sending: // const signedTx = await signer.signTransaction({ // to: signer.address, - // value: BigNumber.from("1"), + // value: 1n, // }); // const provider = signer.provider; // const txResponse1 = await provider.sendTransaction(signedTx); const txReceipt1 = await txResponse1.wait(); - console.info("Funds sent. Hash:", txReceipt1.transactionHash); + console.info("Funds sent. Hash:", txReceipt1?.hash); console.info( "[celo-legacy] Sending 1 CELO wei with cUSD feeCurrency", @@ -31,38 +31,36 @@ async function main() { ); const txResponseLegacy = await signer.sendTransaction({ to: signer.address, - value: BigNumber.from("1"), + value: 1n, feeCurrency: CUSD_ADDRESS, }); const txReceiptLegacy = await txResponseLegacy.wait(); console.info( - `[celo-legacy] CELO w/ feeCurrency payment hash: ${txReceiptLegacy.transactionHash}` + `[celo-legacy] CELO w/ feeCurrency payment hash: ${txReceiptLegacy?.hash}` ); console.info("[cip64] Sending 1 CELO wei with cUSD feeCurrency"); const txResponseCip64 = await signer.sendTransaction({ to: signer.address, - value: BigNumber.from("1"), + value: 1n, feeCurrency: CUSD_ADDRESS, - maxFeePerGas: BigNumber.from(5000000000), - maxPriorityFeePerGas: BigNumber.from(5000000000), + maxFeePerGas: 5000000000n, + maxPriorityFeePerGas: 5000000000n, }); const txReceiptCip64 = await txResponseCip64.wait(); console.info( - `[cip64] CELO w/ feeCurrency payment hash: ${txReceiptCip64.transactionHash}` + `[cip64] CELO w/ feeCurrency payment hash: ${txReceiptCip64?.hash}` ); console.info("[eip1559] Sending 1 CELO wei"); const txResponseEip1559 = await signer.sendTransaction({ to: signer.address, - value: BigNumber.from("1"), - maxFeePerGas: BigNumber.from(5000000000), - maxPriorityFeePerGas: BigNumber.from(5000000000), + value: 1n, + maxFeePerGas: 5000000000n, + maxPriorityFeePerGas: 5000000000n, }); const txReceiptEip1559 = await txResponseEip1559.wait(); - console.info( - `[eip1559] CELO payment hash: ${txReceiptEip1559.transactionHash}` - ); + console.info(`[eip1559] CELO payment hash: ${txReceiptEip1559?.hash}`); const stableToken = new Contract(CUSD_ADDRESS, STABLE_TOKEN_ABI, signer); @@ -71,12 +69,12 @@ async function main() { console.info(`cUSD balance: ${stableBalance.toString()}`); console.info("Sending 1 cUSD wei"); - const txResponse2 = await stableToken.transfer( + const txResponse2 = (await stableToken.transfer( signer.address, - BigNumber.from("1") - ); + 1n + )) as TransactionResponse; const txReceipt2 = await txResponse2.wait(); - console.info(`cUSD payment hash: ${txReceipt2.transactionHash}`); + console.info(`cUSD payment hash: ${txReceipt2?.hash}`); } main() diff --git a/test/utils.ts b/test/utils.ts index 2b975b2..c39cbee 100644 --- a/test/utils.ts +++ b/test/utils.ts @@ -1,5 +1,5 @@ -import { CeloProvider } from "../src/lib/CeloProvider"; -import { CeloWallet } from "../src/lib/CeloWallet"; +import CeloProvider from "../src/lib/CeloProvider"; +import CeloWallet from "../src/lib/CeloWallet"; import { ALFAJORES_FORNO, CELO_DERIVATION_PATH } from "./consts"; export function getSigner() { diff --git a/tsconfig.json b/tsconfig.json index e7270a2..91a7372 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "incremental": true, - "target": "es2017", + "target": "ES2020", "outDir": "build/main", "rootDir": "src", "moduleResolution": "node", diff --git a/yarn.lock b/yarn.lock index afa511f..71fec49 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5,16 +5,23 @@ __metadata: version: 6 cacheKey: 8 +"@adraffy/ens-normalize@npm:1.9.2": + version: 1.9.2 + resolution: "@adraffy/ens-normalize@npm:1.9.2" + checksum: a9fdeb9e080774c19e4b7f9f60aa5b37cf23fe0e8fe80284bf8221f7396e9f78642bfd39a09a94a4dc3fb8e70f2ac81545204bdcaf222d93f4c4c2ae1f0dca0b + languageName: node + linkType: hard + "@celo-tools/celo-ethers-wrapper@workspace:.": version: 0.0.0-use.local resolution: "@celo-tools/celo-ethers-wrapper@workspace:." dependencies: - "@types/node": ^16.11.10 - ethers: ^5.7.2 - ts-node: ^10.8.1 - typescript: ^4.5.2 + "@types/node": ^20.8.2 + ethers: ^6.7.1 + ts-node: ^10.9.1 + typescript: ^5.2.2 peerDependencies: - ethers: ^5 + ethers: ^6 languageName: unknown linkType: soft @@ -27,408 +34,6 @@ __metadata: languageName: node linkType: hard -"@ethersproject/abi@npm:5.7.0, @ethersproject/abi@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/abi@npm:5.7.0" - dependencies: - "@ethersproject/address": ^5.7.0 - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/constants": ^5.7.0 - "@ethersproject/hash": ^5.7.0 - "@ethersproject/keccak256": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/strings": ^5.7.0 - checksum: bc6962bb6cb854e4d2a4d65b2c49c716477675b131b1363312234bdbb7e19badb7d9ce66f4ca2a70ae2ea84f7123dbc4e300a1bfe5d58864a7eafabc1466627e - languageName: node - linkType: hard - -"@ethersproject/abstract-provider@npm:5.7.0, @ethersproject/abstract-provider@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/abstract-provider@npm:5.7.0" - dependencies: - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/networks": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/transactions": ^5.7.0 - "@ethersproject/web": ^5.7.0 - checksum: 74cf4696245cf03bb7cc5b6cbf7b4b89dd9a79a1c4688126d214153a938126d4972d42c93182198653ce1de35f2a2cad68be40337d4774b3698a39b28f0228a8 - languageName: node - linkType: hard - -"@ethersproject/abstract-signer@npm:5.7.0, @ethersproject/abstract-signer@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/abstract-signer@npm:5.7.0" - dependencies: - "@ethersproject/abstract-provider": ^5.7.0 - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - checksum: a823dac9cfb761e009851050ebebd5b229d1b1cc4a75b125c2da130ff37e8218208f7f9d1386f77407705b889b23d4a230ad67185f8872f083143e0073cbfbe3 - languageName: node - linkType: hard - -"@ethersproject/address@npm:5.7.0, @ethersproject/address@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/address@npm:5.7.0" - dependencies: - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/keccak256": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/rlp": ^5.7.0 - checksum: 64ea5ebea9cc0e845c413e6cb1e54e157dd9fc0dffb98e239d3a3efc8177f2ff798cd4e3206cf3660ee8faeb7bef1a47dc0ebef0d7b132c32e61e550c7d4c843 - languageName: node - linkType: hard - -"@ethersproject/base64@npm:5.7.0, @ethersproject/base64@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/base64@npm:5.7.0" - dependencies: - "@ethersproject/bytes": ^5.7.0 - checksum: 7dd5d734d623582f08f665434f53685041a3d3b334a0e96c0c8afa8bbcaab934d50e5b6b980e826a8fde8d353e0b18f11e61faf17468177274b8e7c69cd9742b - languageName: node - linkType: hard - -"@ethersproject/basex@npm:5.7.0, @ethersproject/basex@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/basex@npm:5.7.0" - dependencies: - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - checksum: 326087b7e1f3787b5fe6cd1cf2b4b5abfafbc355a45e88e22e5e9d6c845b613ffc5301d629b28d5c4d5e2bfe9ec424e6782c804956dff79be05f0098cb5817de - languageName: node - linkType: hard - -"@ethersproject/bignumber@npm:5.7.0, @ethersproject/bignumber@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/bignumber@npm:5.7.0" - dependencies: - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - bn.js: ^5.2.1 - checksum: 8c9a134b76f3feb4ec26a5a27379efb4e156b8fb2de0678a67788a91c7f4e30abe9d948638458e4b20f2e42380da0adacc7c9389d05fce070692edc6ae9b4904 - languageName: node - linkType: hard - -"@ethersproject/bytes@npm:5.7.0, @ethersproject/bytes@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/bytes@npm:5.7.0" - dependencies: - "@ethersproject/logger": ^5.7.0 - checksum: 66ad365ceaab5da1b23b72225c71dce472cf37737af5118181fa8ab7447d696bea15ca22e3a0e8836fdd8cfac161afe321a7c67d0dde96f9f645ddd759676621 - languageName: node - linkType: hard - -"@ethersproject/constants@npm:5.7.0, @ethersproject/constants@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/constants@npm:5.7.0" - dependencies: - "@ethersproject/bignumber": ^5.7.0 - checksum: 6d4b1355747cce837b3e76ec3bde70e4732736f23b04f196f706ebfa5d4d9c2be50904a390d4d40ce77803b98d03d16a9b6898418e04ba63491933ce08c4ba8a - languageName: node - linkType: hard - -"@ethersproject/contracts@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/contracts@npm:5.7.0" - dependencies: - "@ethersproject/abi": ^5.7.0 - "@ethersproject/abstract-provider": ^5.7.0 - "@ethersproject/abstract-signer": ^5.7.0 - "@ethersproject/address": ^5.7.0 - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/constants": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/transactions": ^5.7.0 - checksum: 6ccf1121cba01b31e02f8c507cb971ab6bfed85706484a9ec09878ef1594a62215f43c4fdef8f4a4875b99c4a800bc95e3be69b1803f8ce479e07634b5a740c0 - languageName: node - linkType: hard - -"@ethersproject/hash@npm:5.7.0, @ethersproject/hash@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/hash@npm:5.7.0" - dependencies: - "@ethersproject/abstract-signer": ^5.7.0 - "@ethersproject/address": ^5.7.0 - "@ethersproject/base64": ^5.7.0 - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/keccak256": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/strings": ^5.7.0 - checksum: 6e9fa8d14eb08171cd32f17f98cc108ec2aeca74a427655f0d689c550fee0b22a83b3b400fad7fb3f41cf14d4111f87f170aa7905bcbcd1173a55f21b06262ef - languageName: node - linkType: hard - -"@ethersproject/hdnode@npm:5.7.0, @ethersproject/hdnode@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/hdnode@npm:5.7.0" - dependencies: - "@ethersproject/abstract-signer": ^5.7.0 - "@ethersproject/basex": ^5.7.0 - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/pbkdf2": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/sha2": ^5.7.0 - "@ethersproject/signing-key": ^5.7.0 - "@ethersproject/strings": ^5.7.0 - "@ethersproject/transactions": ^5.7.0 - "@ethersproject/wordlists": ^5.7.0 - checksum: bfe5ca2d89a42de73655f853170ef4766b933c5f481cddad709b3aca18823275b096e572f92d1602a052f80b426edde44ad6b9d028799775a7dad4a5bbed2133 - languageName: node - linkType: hard - -"@ethersproject/json-wallets@npm:5.7.0, @ethersproject/json-wallets@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/json-wallets@npm:5.7.0" - dependencies: - "@ethersproject/abstract-signer": ^5.7.0 - "@ethersproject/address": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/hdnode": ^5.7.0 - "@ethersproject/keccak256": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/pbkdf2": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/random": ^5.7.0 - "@ethersproject/strings": ^5.7.0 - "@ethersproject/transactions": ^5.7.0 - aes-js: 3.0.0 - scrypt-js: 3.0.1 - checksum: f583458d22db62efaaf94d38dd243482776a45bf90f9f3882fbad5aa0b8fd288b41eb7c1ff8ec0b99c9b751088e43d6173530db64dd33c59f9d8daa8d7ad5aa2 - languageName: node - linkType: hard - -"@ethersproject/keccak256@npm:5.7.0, @ethersproject/keccak256@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/keccak256@npm:5.7.0" - dependencies: - "@ethersproject/bytes": ^5.7.0 - js-sha3: 0.8.0 - checksum: ff70950d82203aab29ccda2553422cbac2e7a0c15c986bd20a69b13606ed8bb6e4fdd7b67b8d3b27d4f841e8222cbaccd33ed34be29f866fec7308f96ed244c6 - languageName: node - linkType: hard - -"@ethersproject/logger@npm:5.7.0, @ethersproject/logger@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/logger@npm:5.7.0" - checksum: 075ab2f605f1fd0813f2e39c3308f77b44a67732b36e712d9bc085f22a84aac4da4f71b39bee50fe78da3e1c812673fadc41180c9970fe5e486e91ea17befe0d - languageName: node - linkType: hard - -"@ethersproject/networks@npm:5.7.1, @ethersproject/networks@npm:^5.7.0": - version: 5.7.1 - resolution: "@ethersproject/networks@npm:5.7.1" - dependencies: - "@ethersproject/logger": ^5.7.0 - checksum: 0339f312304c17d9a0adce550edb825d4d2c8c9468c1634c44172c67a9ed256f594da62c4cda5c3837a0f28b7fabc03aca9b492f68ff1fdad337ee861b27bd5d - languageName: node - linkType: hard - -"@ethersproject/pbkdf2@npm:5.7.0, @ethersproject/pbkdf2@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/pbkdf2@npm:5.7.0" - dependencies: - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/sha2": ^5.7.0 - checksum: b895adb9e35a8a127e794f7aadc31a2424ef355a70e51cde10d457e3e888bb8102373199a540cf61f2d6b9a32e47358f9c65b47d559f42bf8e596b5fd67901e9 - languageName: node - linkType: hard - -"@ethersproject/properties@npm:5.7.0, @ethersproject/properties@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/properties@npm:5.7.0" - dependencies: - "@ethersproject/logger": ^5.7.0 - checksum: 6ab0ccf0c3aadc9221e0cdc5306ce6cd0df7f89f77d77bccdd1277182c9ead0202cd7521329ba3acde130820bf8af299e17cf567d0d497c736ee918207bbf59f - languageName: node - linkType: hard - -"@ethersproject/providers@npm:5.7.2": - version: 5.7.2 - resolution: "@ethersproject/providers@npm:5.7.2" - dependencies: - "@ethersproject/abstract-provider": ^5.7.0 - "@ethersproject/abstract-signer": ^5.7.0 - "@ethersproject/address": ^5.7.0 - "@ethersproject/base64": ^5.7.0 - "@ethersproject/basex": ^5.7.0 - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/constants": ^5.7.0 - "@ethersproject/hash": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/networks": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/random": ^5.7.0 - "@ethersproject/rlp": ^5.7.0 - "@ethersproject/sha2": ^5.7.0 - "@ethersproject/strings": ^5.7.0 - "@ethersproject/transactions": ^5.7.0 - "@ethersproject/web": ^5.7.0 - bech32: 1.1.4 - ws: 7.4.6 - checksum: 1754c731a5ca6782ae9677f4a9cd8b6246c4ef21a966c9a01b133750f3c578431ec43ec254e699969c4a0f87e84463ded50f96b415600aabd37d2056aee58c19 - languageName: node - linkType: hard - -"@ethersproject/random@npm:5.7.0, @ethersproject/random@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/random@npm:5.7.0" - dependencies: - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - checksum: 017829c91cff6c76470852855108115b0b52c611b6be817ed1948d56ba42d6677803ec2012aa5ae298a7660024156a64c11fcf544e235e239ab3f89f0fff7345 - languageName: node - linkType: hard - -"@ethersproject/rlp@npm:5.7.0, @ethersproject/rlp@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/rlp@npm:5.7.0" - dependencies: - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - checksum: bce165b0f7e68e4d091c9d3cf47b247cac33252df77a095ca4281d32d5eeaaa3695d9bc06b2b057c5015353a68df89f13a4a54a72e888e4beeabbe56b15dda6e - languageName: node - linkType: hard - -"@ethersproject/sha2@npm:5.7.0, @ethersproject/sha2@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/sha2@npm:5.7.0" - dependencies: - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - hash.js: 1.1.7 - checksum: 09321057c022effbff4cc2d9b9558228690b5dd916329d75c4b1ffe32ba3d24b480a367a7cc92d0f0c0b1c896814d03351ae4630e2f1f7160be2bcfbde435dbc - languageName: node - linkType: hard - -"@ethersproject/signing-key@npm:5.7.0, @ethersproject/signing-key@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/signing-key@npm:5.7.0" - dependencies: - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - bn.js: ^5.2.1 - elliptic: 6.5.4 - hash.js: 1.1.7 - checksum: 8f8de09b0aac709683bbb49339bc0a4cd2f95598f3546436c65d6f3c3a847ffa98e06d35e9ed2b17d8030bd2f02db9b7bd2e11c5cf8a71aad4537487ab4cf03a - languageName: node - linkType: hard - -"@ethersproject/solidity@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/solidity@npm:5.7.0" - dependencies: - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/keccak256": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/sha2": ^5.7.0 - "@ethersproject/strings": ^5.7.0 - checksum: 9a02f37f801c96068c3e7721f83719d060175bc4e80439fe060e92bd7acfcb6ac1330c7e71c49f4c2535ca1308f2acdcb01e00133129aac00581724c2d6293f3 - languageName: node - linkType: hard - -"@ethersproject/strings@npm:5.7.0, @ethersproject/strings@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/strings@npm:5.7.0" - dependencies: - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/constants": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - checksum: 5ff78693ae3fdf3cf23e1f6dc047a61e44c8197d2408c42719fef8cb7b7b3613a4eec88ac0ed1f9f5558c74fe0de7ae3195a29ca91a239c74b9f444d8e8b50df - languageName: node - linkType: hard - -"@ethersproject/transactions@npm:5.7.0, @ethersproject/transactions@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/transactions@npm:5.7.0" - dependencies: - "@ethersproject/address": ^5.7.0 - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/constants": ^5.7.0 - "@ethersproject/keccak256": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/rlp": ^5.7.0 - "@ethersproject/signing-key": ^5.7.0 - checksum: a31b71996d2b283f68486241bff0d3ea3f1ba0e8f1322a8fffc239ccc4f4a7eb2ea9994b8fd2f093283fd75f87bae68171e01b6265261f821369aca319884a79 - languageName: node - linkType: hard - -"@ethersproject/units@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/units@npm:5.7.0" - dependencies: - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/constants": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - checksum: 304714f848cd32e57df31bf545f7ad35c2a72adae957198b28cbc62166daa929322a07bff6e9c9ac4577ab6aa0de0546b065ed1b2d20b19e25748b7d475cb0fc - languageName: node - linkType: hard - -"@ethersproject/wallet@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/wallet@npm:5.7.0" - dependencies: - "@ethersproject/abstract-provider": ^5.7.0 - "@ethersproject/abstract-signer": ^5.7.0 - "@ethersproject/address": ^5.7.0 - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/hash": ^5.7.0 - "@ethersproject/hdnode": ^5.7.0 - "@ethersproject/json-wallets": ^5.7.0 - "@ethersproject/keccak256": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/random": ^5.7.0 - "@ethersproject/signing-key": ^5.7.0 - "@ethersproject/transactions": ^5.7.0 - "@ethersproject/wordlists": ^5.7.0 - checksum: a4009bf7331eddab38e3015b5e9101ef92de7f705b00a6196b997db0e5635b6d83561674d46c90c6f77b87c0500fe4a6b0183ba13749efc22db59c99deb82fbd - languageName: node - linkType: hard - -"@ethersproject/web@npm:5.7.1, @ethersproject/web@npm:^5.7.0": - version: 5.7.1 - resolution: "@ethersproject/web@npm:5.7.1" - dependencies: - "@ethersproject/base64": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/strings": ^5.7.0 - checksum: 7028c47103f82fd2e2c197ce0eecfacaa9180ffeec7de7845b1f4f9b19d84081b7a48227aaddde05a4aaa526af574a9a0ce01cc0fc75e3e371f84b38b5b16b2b - languageName: node - linkType: hard - -"@ethersproject/wordlists@npm:5.7.0, @ethersproject/wordlists@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/wordlists@npm:5.7.0" - dependencies: - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/hash": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/strings": ^5.7.0 - checksum: 30eb6eb0731f9ef5faa44bf9c0c6e950bcaaef61e4d2d9ce0ae6d341f4e2d6d1f4ab4f8880bfce03b7aac4b862fb740e1421170cfbf8e2aafc359277d49e6e97 - languageName: node - linkType: hard - "@jridgewell/resolve-uri@npm:^3.0.3": version: 3.1.1 resolution: "@jridgewell/resolve-uri@npm:3.1.1" @@ -453,6 +58,20 @@ __metadata: languageName: node linkType: hard +"@noble/hashes@npm:1.1.2": + version: 1.1.2 + resolution: "@noble/hashes@npm:1.1.2" + checksum: 3c2a8cb7c2e053811032f242155d870c5eb98844d924d69702244d48804cb03b42d4a666c49c2b71164420d8229cb9a6f242b972d50d5bb2f1d673b98b041de2 + languageName: node + linkType: hard + +"@noble/secp256k1@npm:1.7.1": + version: 1.7.1 + resolution: "@noble/secp256k1@npm:1.7.1" + checksum: d2301f1f7690368d8409a3152450458f27e54df47e3f917292de3de82c298770890c2de7c967d237eff9c95b70af485389a9695f73eb05a43e2bd562d18b18cb + languageName: node + linkType: hard + "@tsconfig/node10@npm:^1.0.7": version: 1.0.9 resolution: "@tsconfig/node10@npm:1.0.9" @@ -481,10 +100,17 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:^16.11.10": - version: 16.18.54 - resolution: "@types/node@npm:16.18.54" - checksum: 208e8fc64f605e9cd55ab5e620a0fd019d8fe5629e3e3c5de869a149b731ab0fac5720c516dccc0ecc834ac27df754723dfe6554551663f016ba5096ea8851df +"@types/node@npm:18.15.13": + version: 18.15.13 + resolution: "@types/node@npm:18.15.13" + checksum: 79cc5a2b5f98e8973061a4260a781425efd39161a0e117a69cd089603964816c1a14025e1387b4590c8e82d05133b7b4154fa53a7dffb3877890a66145e76515 + languageName: node + linkType: hard + +"@types/node@npm:^20.8.2": + version: 20.8.2 + resolution: "@types/node@npm:20.8.2" + checksum: 3da73e25d821bfcdb7de98589027e08bb4848e55408671c4a83ec0341e124b5313a0b20e1e4b4eff1168ea17a86f622ad73fcb04b761abd77496b9a27cbd5de5 languageName: node linkType: hard @@ -504,10 +130,10 @@ __metadata: languageName: node linkType: hard -"aes-js@npm:3.0.0": - version: 3.0.0 - resolution: "aes-js@npm:3.0.0" - checksum: 251e26d533cd1a915b44896b17d5ed68c24a02484cfdd2e74ec700a309267db96651ea4eb657bf20aac32a3baa61f6e34edf8e2fec2de440a655da9942d334b8 +"aes-js@npm:4.0.0-beta.5": + version: 4.0.0-beta.5 + resolution: "aes-js@npm:4.0.0-beta.5" + checksum: cc2ea969d77df939c32057f7e361b6530aa6cb93cb10617a17a45cd164e6d761002f031ff6330af3e67e58b1f0a3a8fd0b63a720afd591a653b02f649470e15b languageName: node linkType: hard @@ -518,34 +144,6 @@ __metadata: languageName: node linkType: hard -"bech32@npm:1.1.4": - version: 1.1.4 - resolution: "bech32@npm:1.1.4" - checksum: 0e98db619191548390d6f09ff68b0253ba7ae6a55db93dfdbb070ba234c1fd3308c0606fbcc95fad50437227b10011e2698b89f0181f6e7f845c499bd14d0f4b - languageName: node - linkType: hard - -"bn.js@npm:^4.11.9": - version: 4.12.0 - resolution: "bn.js@npm:4.12.0" - checksum: 39afb4f15f4ea537b55eaf1446c896af28ac948fdcf47171961475724d1bb65118cca49fa6e3d67706e4790955ec0e74de584e45c8f1ef89f46c812bee5b5a12 - languageName: node - linkType: hard - -"bn.js@npm:^5.2.1": - version: 5.2.1 - resolution: "bn.js@npm:5.2.1" - checksum: 3dd8c8d38055fedfa95c1d5fc3c99f8dd547b36287b37768db0abab3c239711f88ff58d18d155dd8ad902b0b0cee973747b7ae20ea12a09473272b0201c9edd3 - languageName: node - linkType: hard - -"brorand@npm:^1.1.0": - version: 1.1.0 - resolution: "brorand@npm:1.1.0" - checksum: 8a05c9f3c4b46572dec6ef71012b1946db6cae8c7bb60ccd4b7dd5a84655db49fe043ecc6272e7ef1f69dc53d6730b9e2a3a03a8310509a3d797a618cbee52be - languageName: node - linkType: hard - "create-require@npm:^1.1.0": version: 1.1.1 resolution: "create-require@npm:1.1.1" @@ -560,91 +158,18 @@ __metadata: languageName: node linkType: hard -"elliptic@npm:6.5.4": - version: 6.5.4 - resolution: "elliptic@npm:6.5.4" - dependencies: - bn.js: ^4.11.9 - brorand: ^1.1.0 - hash.js: ^1.0.0 - hmac-drbg: ^1.0.1 - inherits: ^2.0.4 - minimalistic-assert: ^1.0.1 - minimalistic-crypto-utils: ^1.0.1 - checksum: d56d21fd04e97869f7ffcc92e18903b9f67f2d4637a23c860492fbbff5a3155fd9ca0184ce0c865dd6eb2487d234ce9551335c021c376cd2d3b7cb749c7d10f4 - languageName: node - linkType: hard - -"ethers@npm:^5.7.2": - version: 5.7.2 - resolution: "ethers@npm:5.7.2" +"ethers@npm:^6.7.1": + version: 6.7.1 + resolution: "ethers@npm:6.7.1" dependencies: - "@ethersproject/abi": 5.7.0 - "@ethersproject/abstract-provider": 5.7.0 - "@ethersproject/abstract-signer": 5.7.0 - "@ethersproject/address": 5.7.0 - "@ethersproject/base64": 5.7.0 - "@ethersproject/basex": 5.7.0 - "@ethersproject/bignumber": 5.7.0 - "@ethersproject/bytes": 5.7.0 - "@ethersproject/constants": 5.7.0 - "@ethersproject/contracts": 5.7.0 - "@ethersproject/hash": 5.7.0 - "@ethersproject/hdnode": 5.7.0 - "@ethersproject/json-wallets": 5.7.0 - "@ethersproject/keccak256": 5.7.0 - "@ethersproject/logger": 5.7.0 - "@ethersproject/networks": 5.7.1 - "@ethersproject/pbkdf2": 5.7.0 - "@ethersproject/properties": 5.7.0 - "@ethersproject/providers": 5.7.2 - "@ethersproject/random": 5.7.0 - "@ethersproject/rlp": 5.7.0 - "@ethersproject/sha2": 5.7.0 - "@ethersproject/signing-key": 5.7.0 - "@ethersproject/solidity": 5.7.0 - "@ethersproject/strings": 5.7.0 - "@ethersproject/transactions": 5.7.0 - "@ethersproject/units": 5.7.0 - "@ethersproject/wallet": 5.7.0 - "@ethersproject/web": 5.7.1 - "@ethersproject/wordlists": 5.7.0 - checksum: b7c08cf3e257185a7946117dbbf764433b7ba0e77c27298dec6088b3bc871aff711462b0621930c56880ff0a7ceb8b1d3a361ffa259f93377b48e34107f62553 - languageName: node - linkType: hard - -"hash.js@npm:1.1.7, hash.js@npm:^1.0.0, hash.js@npm:^1.0.3": - version: 1.1.7 - resolution: "hash.js@npm:1.1.7" - dependencies: - inherits: ^2.0.3 - minimalistic-assert: ^1.0.1 - checksum: e350096e659c62422b85fa508e4b3669017311aa4c49b74f19f8e1bc7f3a54a584fdfd45326d4964d6011f2b2d882e38bea775a96046f2a61b7779a979629d8f - languageName: node - linkType: hard - -"hmac-drbg@npm:^1.0.1": - version: 1.0.1 - resolution: "hmac-drbg@npm:1.0.1" - dependencies: - hash.js: ^1.0.3 - minimalistic-assert: ^1.0.0 - minimalistic-crypto-utils: ^1.0.1 - checksum: bd30b6a68d7f22d63f10e1888aee497d7c2c5c0bb469e66bbdac99f143904d1dfe95f8131f95b3e86c86dd239963c9d972fcbe147e7cffa00e55d18585c43fe0 - languageName: node - linkType: hard - -"inherits@npm:^2.0.3, inherits@npm:^2.0.4": - version: 2.0.4 - resolution: "inherits@npm:2.0.4" - checksum: 4a48a733847879d6cf6691860a6b1e3f0f4754176e4d71494c41f3475553768b10f84b5ce1d40fbd0e34e6bfbb864ee35858ad4dd2cf31e02fc4a154b724d7f1 - languageName: node - linkType: hard - -"js-sha3@npm:0.8.0": - version: 0.8.0 - resolution: "js-sha3@npm:0.8.0" - checksum: 75df77c1fc266973f06cce8309ce010e9e9f07ec35ab12022ed29b7f0d9c8757f5a73e1b35aa24840dced0dea7059085aa143d817aea9e188e2a80d569d9adce + "@adraffy/ens-normalize": 1.9.2 + "@noble/hashes": 1.1.2 + "@noble/secp256k1": 1.7.1 + "@types/node": 18.15.13 + aes-js: 4.0.0-beta.5 + tslib: 2.4.0 + ws: 8.5.0 + checksum: 07833692e3f53b18e28c4cba9f53f3d5ebff8360de02ad57b2584c00c52b88f5b790373f9b9f6b4f6b52ffa2074530a6101192b30c3260f7cdeff929d34bb88b languageName: node linkType: hard @@ -655,28 +180,7 @@ __metadata: languageName: node linkType: hard -"minimalistic-assert@npm:^1.0.0, minimalistic-assert@npm:^1.0.1": - version: 1.0.1 - resolution: "minimalistic-assert@npm:1.0.1" - checksum: cc7974a9268fbf130fb055aff76700d7e2d8be5f761fb5c60318d0ed010d839ab3661a533ad29a5d37653133385204c503bfac995aaa4236f4e847461ea32ba7 - languageName: node - linkType: hard - -"minimalistic-crypto-utils@npm:^1.0.1": - version: 1.0.1 - resolution: "minimalistic-crypto-utils@npm:1.0.1" - checksum: 6e8a0422b30039406efd4c440829ea8f988845db02a3299f372fceba56ffa94994a9c0f2fd70c17f9969eedfbd72f34b5070ead9656a34d3f71c0bd72583a0ed - languageName: node - linkType: hard - -"scrypt-js@npm:3.0.1": - version: 3.0.1 - resolution: "scrypt-js@npm:3.0.1" - checksum: b7c7d1a68d6ca946f2fbb0778e0c4ec63c65501b54023b2af7d7e9f48fdb6c6580d6f7675cd53bda5944c5ebc057560d5a6365079752546865defb3b79dea454 - languageName: node - linkType: hard - -"ts-node@npm:^10.8.1": +"ts-node@npm:^10.9.1": version: 10.9.1 resolution: "ts-node@npm:10.9.1" dependencies: @@ -714,23 +218,30 @@ __metadata: languageName: node linkType: hard -"typescript@npm:^4.5.2": - version: 4.9.5 - resolution: "typescript@npm:4.9.5" +"tslib@npm:2.4.0": + version: 2.4.0 + resolution: "tslib@npm:2.4.0" + checksum: 8c4aa6a3c5a754bf76aefc38026134180c053b7bd2f81338cb5e5ebf96fefa0f417bff221592bf801077f5bf990562f6264fecbc42cd3309b33872cb6fc3b113 + languageName: node + linkType: hard + +"typescript@npm:^5.2.2": + version: 5.2.2 + resolution: "typescript@npm:5.2.2" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: ee000bc26848147ad423b581bd250075662a354d84f0e06eb76d3b892328d8d4440b7487b5a83e851b12b255f55d71835b008a66cbf8f255a11e4400159237db + checksum: 7912821dac4d962d315c36800fe387cdc0a6298dba7ec171b350b4a6e988b51d7b8f051317786db1094bd7431d526b648aba7da8236607febb26cf5b871d2d3c languageName: node linkType: hard -"typescript@patch:typescript@^4.5.2#~builtin": - version: 4.9.5 - resolution: "typescript@patch:typescript@npm%3A4.9.5#~builtin::version=4.9.5&hash=289587" +"typescript@patch:typescript@^5.2.2#~builtin": + version: 5.2.2 + resolution: "typescript@patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=14eedb" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 1f8f3b6aaea19f0f67cba79057674ba580438a7db55057eb89cc06950483c5d632115c14077f6663ea76fd09fce3c190e6414bb98582ec80aa5a4eaf345d5b68 + checksum: 07106822b4305de3f22835cbba949a2b35451cad50888759b6818421290ff95d522b38ef7919e70fb381c5fe9c1c643d7dea22c8b31652a717ddbd57b7f4d554 languageName: node linkType: hard @@ -741,9 +252,9 @@ __metadata: languageName: node linkType: hard -"ws@npm:7.4.6": - version: 7.4.6 - resolution: "ws@npm:7.4.6" +"ws@npm:8.5.0": + version: 8.5.0 + resolution: "ws@npm:8.5.0" peerDependencies: bufferutil: ^4.0.1 utf-8-validate: ^5.0.2 @@ -752,7 +263,7 @@ __metadata: optional: true utf-8-validate: optional: true - checksum: 3a990b32ed08c72070d5e8913e14dfcd831919205be52a3ff0b4cdd998c8d554f167c9df3841605cde8b11d607768cacab3e823c58c96a5c08c987e093eb767a + checksum: 76f2f90e40344bf18fd544194e7067812fb1372b2a37865678d8f12afe4b478ff2ebc0c7c0aff82cd5e6b66fc43d889eec0f1865c2365d8f7a66d92da7744a77 languageName: node linkType: hard