Sup guys, I'm a newbie to Solidity and trying to deploy an NFT contract and mint NFT afterwards with the help from this guide: https://docs.opensea.io/docs/minting-from-your-new-contract-and-improvements
The network is BSC. When I'm executing
npx hardhat deploy
I'm not getting contract address, but instead I'm getting this:
Error: missing provider (operation="sendTransaction", code=UNSUPPORTED_OPERATION, version=abstract-signer/5.7.0)
[bla bla]{
reason: 'missing provider',
code: 'UNSUPPORTED_OPERATION',
operation: 'sendTransaction'
}
I understand the guide is for ETH, but BSC is supposed to be compatible with that since it's an EVM-like network, could you help me to understand how can I make it work on BSC?
Mar 14, 2023, 4:50 AM
Npx hardhat deploy --network nameNetwork
Yep
It's a strange override
If you need to fork, you set the url in hardhat "url" key
8545 is used by hardhat network by default
Mar 14, 2023, 5:08 AM
It worked, thank you! Now I'm getting the same error when trying to mint:
npx hardhat mint --network testnet --address 0x5E24ea64027d2F91B922Dd5744D26D82CE91e827
Error: sending a transaction requires a signer (operation="sendTransaction", code=UNSUPPORTED_OPERATION, version=contracts/5.7.0)
bla bla {
reason: 'sending a transaction requires a signer',
code: 'UNSUPPORTED_OPERATION',
operation: 'sendTransaction'
npx hardhat mint --network testnet --address 0x5E24ea64027d2F91B922Dd5744D26D82CE91e827
Error: sending a transaction requires a signer (operation="sendTransaction", code=UNSUPPORTED_OPERATION, version=contracts/5.7.0)
bla bla {
reason: 'sending a transaction requires a signer',
code: 'UNSUPPORTED_OPERATION',
operation: 'sendTransaction'
Mar 14, 2023, 5:09 AM
but i dont get any error when i try to call get function
Mar 14, 2023, 5:09 AM
oops, not the same, but looks similar 🙂
Mar 14, 2023, 5:10 AM
Seems your contract or tx has no signer
Look up on ethers docs for contractFactory
Or just do
contract.connect(signer). functionToCall()
contract.connect(signer). functionToCall()
Mar 14, 2023, 5:12 AM
this is the full error
Mar 14, 2023, 5:12 AM
That's a network error, try to remove "localhost" from networks and retry
Mar 14, 2023, 5:13 AM
It actually didn't work, my apologies for confusion. Can we get a step back?
This command is still throwing a missing provider error:
npx hardhat deploy --network testnet
Error: missing provider (operation="sendTransaction", code=UNSUPPORTED_OPERATION, version=abstract-signer/5.7.0)
{
reason: 'missing provider',
code: 'UNSUPPORTED_OPERATION',
operation: 'sendTransaction'
This command is still throwing a missing provider error:
npx hardhat deploy --network testnet
Error: missing provider (operation="sendTransaction", code=UNSUPPORTED_OPERATION, version=abstract-signer/5.7.0)
{
reason: 'missing provider',
code: 'UNSUPPORTED_OPERATION',
operation: 'sendTransaction'
Mar 14, 2023, 5:17 AM
Mmm i think the guide you're following is outdated, hardhat connects the providers automatically
I'll suggest you to make a new folder, npx hardhat init, open a YouTube video of erc721 & hardhat docs
Mar 14, 2023, 5:19 AM
I see, thank you!
Mar 14, 2023, 5:21 AM
i got these error after removing localhost key
reason: `Error: VM Exception while
processing transaction: reverted with custom error 'Charity_MinimumFundNotMet("not met minimum fund")'`,
code: 'UNPREDICTABLE_GAS_LIMIT',
method: 'estimateGas',
transaction: {
from: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
to: '0x5FbDB2315678afecb367f032d93F642f64180aa3',
value: BigNumber { _hex: '0x29a2241af62c0000', _isBigNumber: true },
data: '0x256a1b60',
accessList: null
},
error: ProviderError: HttpProviderError
processing transaction: reverted with custom error 'Charity_MinimumFundNotMet("not met minimum fund")'`,
code: 'UNPREDICTABLE_GAS_LIMIT',
method: 'estimateGas',
transaction: {
from: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
to: '0x5FbDB2315678afecb367f032d93F642f64180aa3',
value: BigNumber { _hex: '0x29a2241af62c0000', _isBigNumber: true },
data: '0x256a1b60',
accessList: null
},
error: ProviderError: HttpProviderError
Mar 14, 2023, 5:32 AM
npx hardhat mint --network testnet --address 0x5E24ea64027d2F91B922Dd5744D26D82CE91e827 --from 0xYOUR_ACCOUNT_ADDRESS
Replace 0xYOUR_ACCOUNT_ADDRESS with the address of the account that will sign the transactio
No. The reason for this is that the constructor is a special function in a Solidity contract that is only executed once during the deployment of the contract
this error indicates that the minimum fund requirement set by smart contract was not met and the transaction was therefor reverted
Mar 14, 2023, 7:04 AM
already solved bro, thanks 👍
Mar 14, 2023, 7:04 AM
cool
Mar 14, 2023, 7:05 AM
It throws Error HH305: Unrecognized param --from
Mar 14, 2023, 7:12 AM
The --from parameter is used to specify the Ethereum address that should be used as the transaction sender
Mar 14, 2023, 7:13 AM
sure, the full command was
npx hardhat mint --network testnet --address 0x5E24ea64027d2F91B922Dd5744D26D82CE91e827 --from 0x5697691BDe33E2065Dc00E7d9037D7f182aE95bb
npx hardhat mint --network testnet --address 0x5E24ea64027d2F91B922Dd5744D26D82CE91e827 --from 0x5697691BDe33E2065Dc00E7d9037D7f182aE95bb
Mar 14, 2023, 7:14 AM
npx hardhat --network testnet --overrides '{"from":"0x5697691BDe33E2065Dc00E7d9037D7f182aE95bb"}' mint --address 0x5E24ea64027d2F91B922Dd5744D26D82CE91e827
Mar 14, 2023, 7:15 AM
Error HH304: Unrecognised command line argument --overrides.
Mar 14, 2023, 7:15 AM
replace testnet with the name of your network
Mar 14, 2023, 7:18 AM
that's the name of the network from the config
Mar 14, 2023, 7:18 AM
this is bsc
Mar 14, 2023, 7:22 AM
that's the source of the issue 🙂
Mar 14, 2023, 7:25 AM
yes
Mar 14, 2023, 7:31 AM