Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

when i am trying to deploy smart contract on polygon-amoy i am getting error #5475

Closed
block98ct opened this issue Jul 3, 2024 · 4 comments
Closed
Assignees
Labels
status:needs-more-info There's not enough information to start working on this issue

Comments

@block98ct
Copy link

npx hardhat run --network polygon-amoy scripts/deploy_upgrade.js
^^^^^^^

SyntaxError: Unexpected identifier 'hardhat'

npx hardhat compile working fine

npx --version
10.8.1

npx hardhat --version
2.22.6

@block98ct block98ct changed the title when i am trying to deploy smart contract polygon-amoy i am getting error when i am trying to deploy smart contract on polygon-amoy i am getting error Jul 3, 2024
@kanej
Copy link
Member

kanej commented Jul 8, 2024

Hey @block98ct, the Unexpected identifier 'hardhat probable refers to a usage of hardhat in the deploy_upgrade.js script not on the command line.

@kanej kanej added status:needs-more-info There's not enough information to start working on this issue and removed status:triaging labels Jul 8, 2024
@block98ct
Copy link
Author

@kanej thanks for the reply
i am getting another issue while deploying smart contract on bsc network

const { ethers, upgrades } = require("hardhat");
async function main() {
// CONTRACT DEPLOYER
const [deployer, deployer1, deployer2, deployer3, deployer4, deployer5, deployer6, deployer7] = await ethers.getSigners();
console.log(Deployer account E66 ${deployer5.address});

const balance = await ethers.provider.getBalance(deployer5.address);
console.log(Deploying contracts with the account: ${deployer5.address});
console.log(The balance of account: ${balance});

const Token = await ethers.getContractFactory("BTS20")
const token = await upgrades.deployProxy(Token, [deployer5.address])
await token.waitForDeployment()
console.log(Token contract deployed to : ${await token.getAddress()});

}
main()
.then(() => process.exit(0))
.catch((error) => {
console.info("check");
console.log(error);
process.exit(1);
});

This is my deployment script. When I try to deploy the smart contract on the BSC network, it gives an 'insufficient balance' error, but I have enough balance to deploy the smart contract.

Deployer account E66 0x91CCB0C9686a756EB2326afD4E11fdc40e3b0E66
Deploying contracts with the account: 0x91CCB0C9686a756EB2326afD4E11fdc40e3b0E66
The balance of account: 13300000000000000
check
ProviderError: insufficient funds for gas * price + value: balance 0, tx cost 1690420001690420, overshot 1690420001690420

and why it showing 0 balance, I have balance of 13300000000000000

@kanej
Copy link
Member

kanej commented Jul 8, 2024

I would look on the OpenZeppelin forums for help with OpenZeppelin's upgradable contracts plugin. Maybe upgrades.deployProxy is running under the deployer account even though the owner is being set to deployer5.address.

@kanej kanej closed this as completed Jul 8, 2024
@block98ct
Copy link
Author

block98ct commented Jul 8, 2024

@kanej but it deployed on sepolia, polygon-amoy and bscTestnet networks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:needs-more-info There's not enough information to start working on this issue
Projects
Status: Done
Development

No branches or pull requests

3 participants