Chuksremi15 / pop-up-store

0 stars 0 forks source link

Can't find 'USDT' when deploying contracts #1

Open escottalexander opened 2 months ago

escottalexander commented 2 months ago

When I run yarn deploy I get this error:

Error: ERROR processing /home/elliott/dev/se2-extensions-judging/pop-up-store/packages/hardhat/deploy/deploy_pop_up_store.ts:
Error: cannot find artifact "USDT"
    at getArtifact (/home/elliott/dev/se2-extensions-judging/pop-up-store/packages/hardhat/node_modules/hardhat-deploy/src/DeploymentsManager.ts:208:17)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async getArtifactFromOptions (/home/elliott/dev/se2-extensions-judging/pop-up-store/packages/hardhat/node_modules/hardhat-deploy/src/helpers.ts:494:18)
    at async getLinkedArtifact (/home/elliott/dev/se2-extensions-judging/pop-up-store/packages/hardhat/node_modules/hardhat-deploy/src/helpers.ts:504:38)
    at async fetchIfDifferent (/home/elliott/dev/se2-extensions-judging/pop-up-store/packages/hardhat/node_modules/hardhat-deploy/src/helpers.ts:830:40)
    at async _deployOne (/home/elliott/dev/se2-extensions-judging/pop-up-store/packages/hardhat/node_modules/hardhat-deploy/src/helpers.ts:907:24)
    at async Object.deployYourContract [as func] (/home/elliott/dev/se2-extensions-judging/pop-up-store/packages/hardhat/deploy/deploy_pop_up_store.ts:25:3)
    at async DeploymentsManager.executeDeployScripts (/home/elliott/dev/se2-extensions-judging/pop-up-store/packages/hardhat/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1211:22)
    at async DeploymentsManager.runDeploy (/home/elliott/dev/se2-extensions-judging/pop-up-store/packages/hardhat/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1060:5)
    at async SimpleTaskDefinition.action (/home/elliott/dev/se2-extensions-judging/pop-up-store/packages/hardhat/node_modules/hardhat-deploy/src/index.ts:450:5)
    at DeploymentsManager.executeDeployScripts (/home/elliott/dev/se2-extensions-judging/pop-up-store/packages/hardhat/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1214:19)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async DeploymentsManager.runDeploy (/home/elliott/dev/se2-extensions-judging/pop-up-store/packages/hardhat/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1060:5)
    at async SimpleTaskDefinition.action (/home/elliott/dev/se2-extensions-judging/pop-up-store/packages/hardhat/node_modules/hardhat-deploy/src/index.ts:450:5)
    at async Environment._runTaskDefinition (/home/elliott/dev/se2-extensions-judging/pop-up-store/packages/hardhat/node_modules/hardhat/src/internal/core/runtime-environment.ts:358:14)
    at async Environment.run (/home/elliott/dev/se2-extensions-judging/pop-up-store/packages/hardhat/node_modules/hardhat/src/internal/core/runtime-environment.ts:191:14)
    at async SimpleTaskDefinition.action (/home/elliott/dev/se2-extensions-judging/pop-up-store/packages/hardhat/node_modules/hardhat-deploy/src/index.ts:601:32)
    at async Environment._runTaskDefinition (/home/elliott/dev/se2-extensions-judging/pop-up-store/packages/hardhat/node_modules/hardhat/src/internal/core/runtime-environment.ts:358:14)
    at async Environment.run (/home/elliott/dev/se2-extensions-judging/pop-up-store/packages/hardhat/node_modules/hardhat/src/internal/core/runtime-environment.ts:191:14)
    at async SimpleTaskDefinition.action (/home/elliott/dev/se2-extensions-judging/pop-up-store/packages/hardhat/node_modules/hardhat-deploy/src/index.ts:690:5)

Moving the contracts to the contracts directory seems to fix the issue.

Also, clicking the "Pay now" button while using ETH causes a revert because the transaction is sent without the value.

Chuksremi15 commented 2 months ago

Okay. Thanks for the feedback. This is because we can't hard code the price. The price of the Item have to be set in the admin section. The product id is the itemId in the route params of the item page which is item1.