Skip to content

Commit 2c1bcc3

Browse files
committed
deploy token to pgn sepolia
1 parent 213987a commit 2c1bcc3

File tree

7 files changed

+1516
-138
lines changed

7 files changed

+1516
-138
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
//SPDX-License-Identifier: MIT
2+
pragma solidity >=0.8.0 <0.9.0;
3+
4+
// Use openzeppelin to inherit battle-tested implementations (ERC20, ERC721, etc)
5+
import "@openzeppelin/contracts/access/Ownable.sol";
6+
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
7+
import "@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol";
8+
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol";
9+
10+
/// @title JaxToken
11+
/// @author @codenamejason <[email protected]>
12+
contract JaxToken is Ownable, ERC20, ERC20Permit, ERC20Votes {
13+
constructor(address _owner) ERC20("JaxToken", "JAX") ERC20Permit("JaxToken") {
14+
// Mint 100 million tokens to the contract creator
15+
_mint(_owner, 100000000 * 10**decimals());
16+
_transferOwnership(_owner);
17+
}
18+
19+
function mint(address _to, uint256 _amount) public onlyOwner {
20+
_mint(_to, _amount);
21+
}
22+
23+
function burn(address _from, uint256 _amount) public onlyOwner {
24+
_burn(_from, _amount);
25+
}
26+
27+
/// @notice Override the parent implementation to add a post-hook after any transfer
28+
function _afterTokenTransfer(address from, address to, uint256 amount) internal override(ERC20, ERC20Votes) {
29+
super._afterTokenTransfer(from, to, amount);
30+
}
31+
32+
function _mint(address to, uint256 amount) internal override(ERC20, ERC20Votes) {
33+
super._mint(to, amount);
34+
}
35+
36+
function _burn(address account, uint256 amount) internal override(ERC20, ERC20Votes) {
37+
super._burn(account, amount);
38+
}
39+
40+
/**
41+
* Function that allows the contract to receive ETH
42+
*/
43+
receive() external payable {}
44+
}

packages/hardhat/contracts/YourContract.sol

Lines changed: 0 additions & 87 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { DeployFunction } from "hardhat-deploy/types";
2+
import { HardhatRuntimeEnvironment } from "hardhat/types";
3+
4+
/**
5+
* Deploys a contract named "JaxToken" using the deployer account and
6+
* constructor arguments set to the deployer address
7+
*
8+
* @param hre HardhatRuntimeEnvironment object.
9+
*/
10+
const deployJaxToken: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
11+
const { deployer } = await hre.getNamedAccounts();
12+
const { deploy } = hre.deployments;
13+
14+
await deploy("JaxToken", {
15+
from: deployer,
16+
args: ["0xE849b2a694184B8739a04C915518330757cDB18B"],
17+
log: true,
18+
autoMine: true,
19+
});
20+
21+
// Get the deployed contract
22+
// const JaxToken = await hre.ethers.getContract("JaxToken", deployer);
23+
};
24+
25+
export default deployJaxToken;
26+
27+
// Tags are useful if you have multiple deploy files and only want to run one of them.
28+
// e.g. yarn deploy --tags JaxToken
29+
deployJaxToken.tags = ["JaxToken"];

packages/hardhat/deploy/00_deploy_your_contract.ts

Lines changed: 0 additions & 42 deletions
This file was deleted.

packages/hardhat/hardhat.config.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import * as dotenv from "dotenv";
2-
dotenv.config();
3-
import { HardhatUserConfig } from "hardhat/config";
4-
import "@nomicfoundation/hardhat-toolbox";
5-
import "hardhat-deploy";
61
import "@matterlabs/hardhat-zksync-solc";
72
import "@matterlabs/hardhat-zksync-verify";
3+
import "@nomicfoundation/hardhat-toolbox";
4+
import * as dotenv from "dotenv";
5+
import "hardhat-deploy";
6+
import { HardhatUserConfig } from "hardhat/config";
7+
dotenv.config();
88

99
// If not set, it uses ours Alchemy's default API key.
1010
// You can get your own at https://dashboard.alchemyapi.io
@@ -26,7 +26,7 @@ const config: HardhatUserConfig = {
2626
},
2727
},
2828
},
29-
defaultNetwork: "localhost",
29+
defaultNetwork: "sepoliaPgn",
3030
namedAccounts: {
3131
deployer: {
3232
// By default, it will take the first Hardhat account as the deployer
@@ -50,6 +50,11 @@ const config: HardhatUserConfig = {
5050
url: `https://eth-sepolia.g.alchemy.com/v2/${providerApiKey}`,
5151
accounts: [deployerPrivateKey],
5252
},
53+
sepoliaPgn: {
54+
url: `https://sepolia.publicgoods.network`,
55+
accounts: [deployerPrivateKey],
56+
gasPrice: 20000000000, // 20 gwei
57+
},
5358
goerli: {
5459
url: `https://eth-goerli.alchemyapi.io/v2/${providerApiKey}`,
5560
accounts: [deployerPrivateKey],

0 commit comments

Comments
 (0)