Closed tiequan12345 closed 2 years ago
try deleting the artifacts folder and compiling again
I deleted the artifacts folder and tried running it and had the same error.
Actually I forgot to mention before that the new 2 lines here didn't work for me:
npm run compile npm run test
I get:
adventure-party@1.0.0 compile npx hardhat run compile
Error HH601: Script compile doesn't exist.
And:
adventure-party@1.0.0 test npx hardhat run test
Creating Typechain artifacts in directory typechain for target ethers-v5 Successfully generated Typechain artifacts! Error: Cannot find module '/Users/Downloads/adventure-party/test'
I didn't see a compile script anywhere in the repo either.
ah yes probably should've test those, sorry about that! should be fixed now
Cool so compile and test both work now, but I get the same error when running display status even after deleting the artifacts directory:
adventure-party % npm run display-status
adventure-party@1.0.0 display-status npx hardhat run scripts/status.ts
Compiling 5 files with 0.8.7 Compilation finished successfully Creating Typechain artifacts in directory typechain for target ethers-v5 Successfully generated Typechain artifacts!
/Users/Downloads/adventure-party/node_modules/ts-node/src/index.ts:692
return new TSError(diagnosticText, diagnosticCodes);
^
TSError: ⨯ Unable to compile TypeScript:
typechain/factories/AdventurePartyfactory.ts:16:3 - error TS2416: Property 'deploy' in type 'AdventurePartyfactory' is not assignable to the same property in base type 'ContractFactory'.
Type '(overrides?: Overrides | undefined) => Promise
sorry for that ! Will investigate the problem
awesome! Thanks, I tested your revised code and it compiles and works now!
Hey there,
I've used the old deploy scripts with no issues in the past, was trying out the automation scripts and am getting some errors:
Creating Typechain artifacts in directory typechain for target ethers-v5 Successfully generated Typechain artifacts!
/Users/Downloads/adventure-party/node_modules/ts-node/src/index.ts:692 return new TSError(diagnosticText, diagnosticCodes); ^ TSError: ⨯ Unable to compile TypeScript: typechain/factories/AdventurePartyfactory.ts:16:3 - error TS2416: Property 'deploy' in type 'AdventurePartyfactory' is not assignable to the same property in base type 'ContractFactory'. Type '(overrides?: Overrides | undefined) => Promise' is not assignable to type '(...args: any[]) => Promise'.
Type 'Promise' is not assignable to type 'Promise'.
Type 'AdventureParty' is not assignable to type 'Contract'.
The types returned by 'queryFilter(...)' are incompatible between these types.
Type 'Promise<TypedEvent[]>' is not assignable to type 'Promise<Event[]>'.
Type 'TypedEvent[]' is not assignable to type 'Event[]'.
Type 'TypedEvent' is not assignable to type 'Event'.
Types of property 'args' are incompatible.
Type 'unknown' is not assignable to type 'Result | undefined'.
Type 'unknown' is not assignable to type 'Result'.
16 deploy(overrides?: Overrides): Promise {
typechain/factories/AdventurePartyfactory.ts:25:3 - error TS2416: Property 'connect' in type 'AdventurePartyfactory' is not assignable to the same property in base type 'ContractFactory'. Type '(signer: Signer) => AdventurePartyfactory' is not assignable to type '(signer: Signer) => ContractFactory'. Call signature return types 'AdventurePartyfactory' and 'ContractFactory' are incompatible. The types of 'deploy' are incompatible between these types. Type '(overrides?: Overrides | undefined) => Promise' is not assignable to type '(...args: any[]) => Promise'.
25 connect(signer: Signer): AdventureParty__factory {