Skip to content

Commit 017448f

Browse files
Merge pull request #61 from dev-protocol/polygon
Polygon
2 parents 79da465 + 74b93c2 commit 017448f

File tree

9 files changed

+65
-20
lines changed

9 files changed

+65
-20
lines changed

.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
node_modules/
22
types/
3-
typechain/
3+
typechain-types/

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,4 @@ package-lock.json
7676
artifacts/
7777
cache/
7878
typechain/
79+
typechain-types/

hardhat.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ const config: HardhatUserConfig = {
2727
mnemonic: mnemnoc,
2828
},
2929
},
30+
polygonMunbai: {
31+
url: `https://polygon-mumbai.infura.io/v3/${process.env.INFURA_KEY!}`,
32+
accounts: {
33+
mnemonic: mnemnoc,
34+
},
35+
},
3036
},
3137
}
3238

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
"devDependencies": {
2222
"@nomiclabs/hardhat-ethers": "2.0.3",
2323
"@nomiclabs/hardhat-waffle": "2.0.1",
24+
"@typechain/ethers-v5": "8.0.5",
25+
"@typechain/hardhat": "3.1.0",
2426
"@types/chai": "4.3.0",
2527
"@types/dotenv": "8.2.0",
2628
"@types/mocha": "9.0.0",
@@ -41,12 +43,10 @@
4143
"prettier": "2.5.1",
4244
"prettier-plugin-solidity": "1.0.0-beta.19",
4345
"rimraf": "3.0.2",
44-
"ts-node": "10.4.0",
45-
"typescript": "4.5.4",
46-
"@typechain/ethers-v5": "8.0.5",
47-
"@typechain/hardhat": "3.1.0",
4846
"solhint": "3.3.6",
49-
"typechain": "6.1.0"
47+
"ts-node": "10.4.0",
48+
"typechain": "6.1.0",
49+
"typescript": "4.5.4"
5050
},
5151
"dependencies": {
5252
"@devprotocol/protocol-v2": "0.5.0",

scripts/deploy.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
/* eslint-disable capitalized-comments */
2-
/* eslint-disable spaced-comment */
2+
/* eslint-disable @typescript-eslint/no-non-null-assertion */
3+
34
import { ethers } from 'hardhat'
45

56
async function main() {
6-
//!please check!!!!!!!!!
7-
const adminAddress = ''
8-
//!!!!!!!!!!!!!!!!!!!!!!
7+
const [deployer] = await ethers.getSigners()
8+
console.log('the account:', deployer.address)
9+
console.log('Account balance:', (await deployer.getBalance()).toString())
10+
11+
const adminAddress = process.env.ADMIN!
12+
console.log('admin:', adminAddress)
913

1014
// GitHubMarket
1115
const gitHubMarketFactory = await ethers.getContractFactory('GitHubMarket')
1216
const gitHubMarket = await gitHubMarketFactory.deploy()
1317
await gitHubMarket.deployed()
14-
1518
const data = ethers.utils.arrayify('0x')
1619

1720
// MarketProxy
@@ -38,6 +41,6 @@ main()
3841
})
3942

4043
// memo
41-
// set registryAddress and adminAddress and update .env file
44+
// add admin address to .env file
4245
// and execute this command
4346
// npx hardhat run --network arbitrumRinkeby scripts/deploy.ts

scripts/initialize.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/* eslint-disable capitalized-comments */
2+
/* eslint-disable @typescript-eslint/no-non-null-assertion */
3+
4+
import { ethers } from 'hardhat'
5+
6+
async function main() {
7+
const [deployer] = await ethers.getSigners()
8+
console.log('the account:', deployer.address)
9+
console.log('Account balance:', (await deployer.getBalance()).toString())
10+
11+
const githubMarketProxy = process.env.GITHUB_MARKET_PROXY!
12+
console.log('github market:', githubMarketProxy)
13+
14+
// GitHubMarket
15+
const gitHubMarketFactory = await ethers.getContractFactory('GitHubMarket')
16+
17+
const proxy = gitHubMarketFactory.attach(githubMarketProxy)
18+
await proxy.initialize()
19+
}
20+
21+
main()
22+
.then(() => process.exit(0))
23+
.catch((error) => {
24+
console.error(error)
25+
process.exit(1)
26+
})
27+
28+
// memo
29+
// add admin address to .env file
30+
// and execute this command
31+
// npx hardhat run --network arbitrumRinkeby scripts/deploy.ts

scripts/set-khaos-role.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
/* eslint-disable new-cap */
22
/* eslint-disable @typescript-eslint/await-thenable */
3-
/* eslint-disable spaced-comment */
3+
/* eslint-disable @typescript-eslint/no-non-null-assertion */
44

55
import { ethers } from 'hardhat'
66

77
async function main() {
8-
//!please check!!!!!!!!!
9-
const marketBehaviorProxyAddress = ''
10-
const addRole = ''
11-
//!!!!!!!!!!!!!!!!!!!!!!
8+
const [deployer] = await ethers.getSigners()
9+
console.log('the account:', deployer.address)
10+
console.log('Account balance:', (await deployer.getBalance()).toString())
11+
12+
const marketBehaviorProxyAddress = process.env.GITHUB_MARKET_PROXY!
13+
const addRole = process.env.ADD_ROLE!
1214

1315
console.log(`market behavior address:${marketBehaviorProxyAddress}`)
16+
console.log(`add role address:${addRole}`)
17+
1418
// GitHubMarket
1519
const gitHubMarketFactory = await ethers.getContractFactory('GitHubMarket')
1620
const gitHubMarket = await gitHubMarketFactory.attach(
@@ -31,6 +35,6 @@ main()
3135
})
3236

3337
// Memo
34-
// set marketBehaviorProxyAddress and update .env file
38+
// Add the market behavior proxy address and the address of the wallet where you want to add the khaos roll to the .env file.
3539
// and execute this command
3640
// npx hardhat run --network arbitrumRinkeby scripts/set-khaos-role.ts

test/github-market.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { solidity } from 'ethereum-waffle'
99
import GitHubMarketArtifact from '../artifacts/contracts/GitHubMarket.sol/GitHubMarket.json'
1010
import MarketAdminArtifact from '../artifacts/contracts/test/MarketAdmin.sol/MarketAdmin.json'
1111
import MarketProxyArtifact from '../artifacts/contracts/MarketProxy.sol/MarketProxy.json'
12-
import { GitHubMarket, MarketAdmin, MarketProxy } from '../typechain'
12+
import { GitHubMarket, MarketAdmin, MarketProxy } from '../typechain-types'
1313

1414
use(solidity)
1515

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
"target": "es2019",
1111
"outDir": "dist"
1212
},
13-
"include": ["./scripts", "./test", "./typechain"],
13+
"include": ["./scripts", "./test", "./typechain-types"],
1414
"files": ["./hardhat.config.ts"]
1515
}

0 commit comments

Comments
 (0)