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

Deploy contracts upgrade to ethereum, moonbase and moonbeam #522

Merged
merged 3 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
558 changes: 558 additions & 0 deletions packages/core/.openzeppelin/mainnet.json

Large diffs are not rendered by default.

558 changes: 558 additions & 0 deletions packages/core/.openzeppelin/unknown-1284.json

Large diffs are not rendered by default.

558 changes: 558 additions & 0 deletions packages/core/.openzeppelin/unknown-1287.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/core/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const config: HardhatUserConfig = {
},
mainnet: {
chainId: 1,
url: process.env.ETH_MAINNET_TESTNET_URL || '',
url: process.env.ETH_MAINNET_URL || '',
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
timeout: 2000000,
Expand Down
23 changes: 23 additions & 0 deletions packages/examples/fortune/launcher/client/src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export enum ChainId {
POLYGON = 137,
POLYGON_MUMBAI = 80001,
MOONBEAM = 1284,
MOONBASE_ALPHA = 1287,
LOCALHOST = 1338,
SKALE = 1273227453,
}
Expand Down Expand Up @@ -39,6 +40,17 @@ export interface IEscrowNetwork {
export const ESCROW_NETWORKS: {
[chainId in ChainId]?: IEscrowNetwork;
} = {
[ChainId.MAINNET]: {
chainId: ChainId.MAINNET,
title: 'Ethereum',
scanUrl: 'https://etherscan.io',
rpcUrl:
'https://eth-mainnet.g.alchemy.com/v2/VVDrD3TpJv8ZBP4CiwH2m5Oj6r0hM2st',
subgraphUrl:
'https://api.thegraph.com/subgraphs/name/humanprotocol/mainnet-v1',
factoryAddress: '0xD9c75a1Aa4237BB72a41E5E26bd8384f10c1f55a',
hmtAddress: '0xd1ba9BAC957322D6e8c07a160a3A8dA11A0d2867',
},
[ChainId.GOERLI]: {
chainId: ChainId.GOERLI,
title: 'Ethereum Goerli',
Expand Down Expand Up @@ -106,6 +118,17 @@ export const ESCROW_NETWORKS: {
// factoryAddress: '0xD9c75a1Aa4237BB72a41E5E26bd8384f10c1f55a',
// hmtAddress: '0x3b25BC1dC591D24d60560d0135D6750A561D4764',
// },
[ChainId.MOONBASE_ALPHA]: {
chainId: ChainId.MOONBASE_ALPHA,
title: 'Moonbase Alpha',
scanUrl: 'https://moonbase.moonscan.io/',
rpcUrl: 'https://rpc.api.moonbase.moonbeam.network',
subgraphUrl:
'https://api.thegraph.com/subgraphs/name/humanprotocol/moonbase-alpha-v1',

factoryAddress: '0x5e622FF522D81aa426f082bDD95210BC25fCA7Ed',
hmtAddress: '0x2dd72db2bBA65cE663e476bA8b84A1aAF802A8e3',
},
[ChainId.LOCALHOST]: {
chainId: ChainId.LOCALHOST,
title: 'Localhost',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ export interface IEscrowNetwork {
export const ESCROW_NETWORKS: {
[chainId in ChainId]?: IEscrowNetwork;
} = {
[ChainId.MAINNET]: {
chainId: ChainId.MAINNET,
title: 'Ethereum',
rpcUrl:
'https://eth-mainnet.g.alchemy.com/v2/VVDrD3TpJv8ZBP4CiwH2m5Oj6r0hM2st',
factoryAddress: '0xD9c75a1Aa4237BB72a41E5E26bd8384f10c1f55a',
hmtAddress: '0xd1ba9BAC957322D6e8c07a160a3A8dA11A0d2867',
},
[ChainId.GOERLI]: {
chainId: ChainId.GOERLI,
title: 'Ethereum Goerli',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,7 @@ class Escrow {
private exOracleUrl = process.env.EX_ORACLE_URL as string;
private recOracleFee = Number(process.env.REC_ORACLE_PERCENTAGE_FEE);
private repOracleFee = Number(process.env.REP_ORACLE_PERCENTAGE_FEE);
async setupEscrow(
web3: Web3,
escrowAddress: string,
url: string,
fortunesRequested: number
) {
async setupEscrow(web3: Web3, escrowAddress: string, url: string) {
const escrowContract = new web3.eth.Contract(
EscrowAbi as [],
escrowAddress
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,7 @@ export const createEscrow: FastifyPluginAsync = async (server) => {
);
const data = escrow.addOraclesData(escrowData);
const url = await s3.uploadManifest(data, escrowAddress);
const fortunesRequested = Number(escrowData.fortunesRequired);
await escrow.setupEscrow(
web3Client,
escrowAddress,
url,
fortunesRequested
);
await escrow.setupEscrow(web3Client, escrowAddress, url);
return {
escrowAddress,
exchangeUrl: `${data.exchangeOracleUrl}?address=${escrowAddress}`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { IEscrowNetwork } from '../interfaces/networks';

export enum ChainId {
MAINNET = 1,
GOERLI = 5,
BSC_TESTNET = 97,
POLYGON = 137,
Expand All @@ -13,6 +14,14 @@ export enum ChainId {
export const ESCROW_NETWORKS: {
[chainId in ChainId]?: IEscrowNetwork;
} = {
[ChainId.MAINNET]: {
chainId: ChainId.MAINNET,
title: 'Ethereum',
rpcUrl:
'https://eth-mainnet.g.alchemy.com/v2/VVDrD3TpJv8ZBP4CiwH2m5Oj6r0hM2st',
factoryAddress: '0xD9c75a1Aa4237BB72a41E5E26bd8384f10c1f55a',
hmtAddress: '0xd1ba9BAC957322D6e8c07a160a3A8dA11A0d2867',
},
[ChainId.GOERLI]: {
chainId: ChainId.GOERLI,
title: 'Ethereum Goerli',
Expand Down Expand Up @@ -41,13 +50,13 @@ export const ESCROW_NETWORKS: {
factoryAddress: '0x79aE9b3Ad106AEdc1F813AaD98f550FADd9e2254',
hmtAddress: '0xc2B8bb720e5df43e6E13b84B27dF5543B3485EA4',
},
// [ChainId.MOONBASE_ALPHA]: {
// chainId: ChainId.MOONBASE_ALPHA,
// title: 'Moonbase Alpha',
// rpcUrl: 'https://rpc.api.moonbase.moonbeam.network',
// factoryAddress: '0x5e622FF522D81aa426f082bDD95210BC25fCA7Ed',
// hmtAddress: '0x2dd72db2bBA65cE663e476bA8b84A1aAF802A8e3',
// },
[ChainId.MOONBASE_ALPHA]: {
chainId: ChainId.MOONBASE_ALPHA,
title: 'Moonbase Alpha',
rpcUrl: 'https://rpc.api.moonbase.moonbeam.network',
factoryAddress: '0x5e622FF522D81aa426f082bDD95210BC25fCA7Ed',
hmtAddress: '0x2dd72db2bBA65cE663e476bA8b84A1aAF802A8e3',
},
[ChainId.LOCALHOST]: {
chainId: ChainId.LOCALHOST,
title: 'Localhost',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ export interface IReputationNetwork {
export const REPUTATION_NETWORKS: {
[chainId in ChainId]?: IReputationNetwork;
} = {
[ChainId.MAINNET]: {
chainId: ChainId.MAINNET,
title: 'Ethereum',
rpcUrl:
'https://eth-mainnet.g.alchemy.com/v2/VVDrD3TpJv8ZBP4CiwH2m5Oj6r0hM2st',
},
[ChainId.GOERLI]: {
chainId: ChainId.GOERLI,
title: 'Ethereum Goerli',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Human subgraph on Moonbase Alpha network",
"graft": {
"base": "QmeMPFuH9eorte4yeySqGWrbpYdazyxSn3m8WsZn7dG92v",
"block": 4213548
"block": 4446285
},
"EscrowFactory": {
"address": "0x5e622FF522D81aa426f082bDD95210BC25fCA7Ed",
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk/typescript/subgraph/config/moonbeam-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"network": "moonbeam",
"description": "Human subgraph on Moonbeam network",
"graft": {
"base": "QmfPG7dSeccKtGYvQACFwVAWm4K3nfFkz6JjbYAMY9iXq5",
"block": 3116433
"base": "Qmdjpy13L5NxCM4gkvKP7xVZMb1NuMrZXh75w4Z3b7D5Ub",
"block": 3672079
},
"EscrowFactory": {
"address": "0xD9c75a1Aa4237BB72a41E5E26bd8384f10c1f55a",
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/typescript/subgraph/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ type RewardAddedEvent @entity {
id: ID!
escrow: Bytes! # address
staker: Bytes! # address
slasher: Bytes! # address
slasher: Bytes # address
amount: BigInt!
block: BigInt!
timestamp: BigInt!
Expand Down