deploy scripts

This commit is contained in:
Moon Man 2023-08-19 22:47:55 -04:00
parent ffae5e74d3
commit 98af8dccad
5 changed files with 65 additions and 3 deletions

View File

@ -1,17 +1,36 @@
import { HardhatUserConfig } from "hardhat/config"; import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox"; import "@nomicfoundation/hardhat-toolbox";
import "hardhat-contract-sizer"; import "hardhat-contract-sizer";
import "dotenv/config";
const config: HardhatUserConfig = { const config: HardhatUserConfig = {
solidity: { solidity: {
version: "0.8.19", // don't make this higher version: "0.8.19", // don"t make this higher
settings: { settings: {
optimizer: { optimizer: {
enabled: true, enabled: true,
runs: 200 runs: 200
} }
} }
} },
networks: {
"base-mainnet": {
url: "https://mainnet.base.org",
accounts: [process.env.WALLET_KEY as string],
gasPrice: 1000000000,
},
"base-goerli": {
url: "https://goerli.base.org",
accounts: [process.env.WALLET_KEY as string],
gasPrice: 1000000000,
},
"base-local": {
url: "http://localhost:8545",
accounts: [process.env.WALLET_KEY as string],
gasPrice: 1000000000,
},
},
defaultNetwork: "hardhat",
}; };
export default config; export default config;

12
package-lock.json generated
View File

@ -11,6 +11,7 @@
"dependencies": { "dependencies": {
"@eth-optimism/contracts-bedrock": "^0.16.0", "@eth-optimism/contracts-bedrock": "^0.16.0",
"@openzeppelin/contracts": "^4.9.3", "@openzeppelin/contracts": "^4.9.3",
"dotenv": "^16.3.1",
"erc-payable-token": "^4.9.3" "erc-payable-token": "^4.9.3"
}, },
"devDependencies": { "devDependencies": {
@ -3428,6 +3429,17 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/dotenv": {
"version": "16.3.1",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz",
"integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/motdotla/dotenv?sponsor=1"
}
},
"node_modules/ecc-jsbn": { "node_modules/ecc-jsbn": {
"version": "0.1.2", "version": "0.1.2",
"resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz",

View File

@ -29,6 +29,7 @@
"dependencies": { "dependencies": {
"@eth-optimism/contracts-bedrock": "^0.16.0", "@eth-optimism/contracts-bedrock": "^0.16.0",
"@openzeppelin/contracts": "^4.9.3", "@openzeppelin/contracts": "^4.9.3",
"dotenv": "^16.3.1",
"erc-payable-token": "^4.9.3" "erc-payable-token": "^4.9.3"
} }
} }

26
scripts/deploy-base.ts Normal file
View File

@ -0,0 +1,26 @@
import { ethers } from "hardhat";
import "dotenv/config";
async function main() {
if (!process.env.BRIDGE_ADDRESS) throw "Bridge address not defined";
if (!process.env.ETH_TOKEN) throw "10grans Ethereum token address not defined";
const TENGRANS = await ethers.deployContract(
"TenGransBaseToken",
[
process.env.BRIDGE_ADDRESS,
process.env.ETH_TOKEN
]
);
await TENGRANS.waitForDeployment();
console.log(`Base 10grans deployed to: ${TENGRANS.target}`);
}
// We recommend this pattern to be able to use async/await everywhere
// and properly handle errors.
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});

View File

@ -1,7 +1,11 @@
import { ethers } from "hardhat"; import { ethers } from "hardhat";
async function main() { async function main() {
// Do stuff here. const TENGRANS = await ethers.deployContract("TenGransEthToken");
await TENGRANS.waitForDeployment();
console.log(`Ethereum 10grans deployed to: ${TENGRANS.target}`);
} }
// We recommend this pattern to be able to use async/await everywhere // We recommend this pattern to be able to use async/await everywhere