-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.js
55 lines (51 loc) · 1.5 KB
/
hardhat.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
require("@nomicfoundation/hardhat-toolbox");
require("@nomiclabs/hardhat-ethers");
require ("dotenv").config();
const { API_URL, PRIVATE_KEY } = process.env;
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
defaultNetwork: "sepolia",
networks: {
hardhat: {
},
sepolia: {
url: API_URL,
accounts: [`0x${PRIVATE_KEY}`],
gas: 2100000,
gasPrice: 8000000000,
gasLimit: 5000000,
}
},
solidity: {
version: "0.8.20",
settings: {
optimizer: {
enabled: true,
runs: 200
}
}
},
paths: {
sources: "./contracts",
tests: "./test",
cache: "./cache",
artifacts: "./artifacts"
},
// mocha: {
// timeout: 40000
// }
}
task('mint', 'Mint SBT')
.addParam('address', 'Address of deployed SBT')
.addParam('to', 'Address receiving SBT token')
.addParam('tokenId', 'ID of SBT token that is being minted')
.setAction(async (args, hre) => {
const sbt = await hre.ethers.getContractAt('Ticket', args.address)
// const sbt = await hre.ethers.getContractAt('Ticket', "0x6E3e552038631971f1649C565aDb0121928e0A49")
const [owner] = await hre.ethers.getSigners()
const tx = await (await sbt.mint(args.to, args.tokenId)).wait()
// const tx = await (await sbt.mint(args.to, args.tokenId, "ipfs://bafyreihvuf3xonmtrmyqcvyf7elnzzsbhsymzk2h2lqbwjhqwikbaokdvm/metadata.json")).wait()
console.log(tx)
console.log(`SBT with tokenId ${args.tokenId} was minted for address ${args.to}`)
}
)