Skip to content

Commit

Permalink
Deploy contracts and subgraph for Polygon Mumbai
Browse files Browse the repository at this point in the history
  • Loading branch information
emmdim committed Feb 28, 2024
1 parent 6985499 commit b45f1e8
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {

export default func;

func.tags = ['Verification'];
func.tags = ['Verification1'];
func.runAtTheEnd = true;
func.skip = (hre: HardhatRuntimeEnvironment) =>
Promise.resolve(
Expand Down
30 changes: 30 additions & 0 deletions packages/contracts/plugin-info.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,35 @@
"releaseMetadataURI": "ipfs://QmcuUcHeFcQe4LhLyXBkLCxU61Asy6nYi1WRYZ6C4Ui42V"
}
}
},
"polygonMumbai": {
"repo": "vocdoni-gasless-voting-poc-vanilla-erc20",
"address": "0xfc7a07b6b22c1044a5dF4DF48B52AFAFcD370ECd",
"args": [],
"blockNumberOfDeployment": 46457348,
"releases": {
"1": {
"builds": {
"1": {
"setup": {
"name": "VocdoniVotingSetup",
"address": "0xdb0Ae82868a899c556990C3C818C5521cc13A7B0",
"args": [],
"blockNumberOfDeployment": 46457426
},
"implementation": {
"name": "VocdoniVoting",
"address": "0x485112889C9Ef9a860423844A7dF752D4A227aF5",
"args": [],
"blockNumberOfDeployment": 46457426
},
"helpers": [],
"buildMetadataURI": "ipfs://QmSH3MLwaKV4SH4r4RdrqFQUoSjk97H2Z4VjMewXvu7yLT",
"blockNumberOfPublication": 46457551
}
},
"releaseMetadataURI": "ipfs://QmcuUcHeFcQe4LhLyXBkLCxU61Asy6nYi1WRYZ6C4Ui42V"
}
}
}
}
10 changes: 7 additions & 3 deletions packages/contracts/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function getPluginRepoFactoryAddress(networkName: string) {
`Using the "${hardhatForkNetwork}" PluginRepoFactory address (${pluginRepoFactoryAddr}) for deployment testing on network "${networkName}"`
);
} else {
const network = getNetworkByNameOrAlias(networkName);
const network = getNetworkByNameOrAlias(networkNameMapping[networkName]);
if (!network) {
throw new Error(`Network "${networkName}" not found`);
}
Expand Down Expand Up @@ -95,7 +95,7 @@ export function getTokensAddresses(networkName: string) {
];
// pluginRepoFactoryAddr = osxContracts[hardhatForkNetwork].PluginRepoFactory;
} else {
const network = getNetworkByNameOrAlias(networkName);
const network = getNetworkByNameOrAlias(networkNameMapping[networkName]);
if (!network) {
throw new Error(`Network "${networkName}" not found`);
}
Expand All @@ -112,7 +112,11 @@ export function getPluginInfo(networkName: string): any {
let pluginInfoFilePath: string;
let pluginInfo: any = {};

if (['localhost', 'hardhat', 'coverage', 'sepolia'].includes(networkName)) {
if (
['localhost', 'hardhat', 'coverage', 'sepolia', 'polygoMumbai'].includes(
networkName
)
) {
pluginInfoFilePath = 'plugin-info-testing.json';
} else {
pluginInfoFilePath = 'plugin-info.json';
Expand Down
12 changes: 11 additions & 1 deletion packages/js-client/src/context.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
DEFAULT_ADDRESSES,
DEFAULT_GASLESS_VOTING_BACKEND_URL,
DEFAULT_GASLESS_VOTING_REPO_ADDRESS,
DEFAULT_GASLESS_VOTING_SUBHGRAPH_URL,
Expand Down Expand Up @@ -32,8 +33,17 @@ export class GaslessVotingContext extends ContextCore {
if (contextParams) {
// overide the aragonContext and default values with the ones from the contextParams
this.set(contextParams);
const graphqlNodes = Object.values(DEFAULT_ADDRESSES)
.filter(
(network) => network.subgraphUrl && network.subgraphUrl?.length > 0
)
.map((network) => {
return {
url: network.subgraphUrl || DEFAULT_GASLESS_VOTING_SUBHGRAPH_URL,
};
});
this.set({
graphqlNodes: [{ url: DEFAULT_GASLESS_VOTING_SUBHGRAPH_URL }],
graphqlNodes,
});
this.overriden.graphqlNodes = true;
this.overriden.graphql = true;
Expand Down
14 changes: 11 additions & 3 deletions packages/js-client/src/internal/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ export const DEFAULT_GASLESS_VOTING_REPO_ADDRESS =
export const DEFAULT_GASLESS_VOTING_SUBHGRAPH_URL =
'https://api.studio.thegraph.com/query/56701/vocdoni-gasless-voting-plugin/version/latest';
export const DEFAULT_ADDRESSES: {
[K in SupportedNetwork]: { repoAddress: string; setupAddress: string };
[K in SupportedNetwork]: {
repoAddress: string;
setupAddress: string;
subgraphUrl?: string;
};
} = {
homestead: {
setupAddress: '',
Expand All @@ -35,8 +39,10 @@ export const DEFAULT_ADDRESSES: {
repoAddress: '',
},
maticmum: {
setupAddress: '0x5A6E29875cCa6eb7a9c39938720e6096468a8917',
repoAddress: '0x5BD8F8Dc73476d24F37c4d885c4528d5abB8cBe6',
setupAddress: '0xdb0Ae82868a899c556990C3C818C5521cc13A7B0',
repoAddress: '0xfc7a07b6b22c1044a5dF4DF48B52AFAFcD370ECd',
subgraphUrl:
'https://api.studio.thegraph.com/query/56701/vocdoni-gasless-voting-mumbai/version/latest',
},
base: {
setupAddress: '',
Expand All @@ -57,6 +63,8 @@ export const DEFAULT_ADDRESSES: {
sepolia: {
setupAddress: '0x5A6E29875cCa6eb7a9c39938720e6096468a8917',
repoAddress: '0xb663C36d6fd959beeF2b82Bb40823660FEAaa55f',
subgraphUrl:
'https://api.studio.thegraph.com/query/56701/vocdoni-gasless-voting-plugin/version/latest',
},
arbitrum: {
setupAddress: '',
Expand Down
2 changes: 1 addition & 1 deletion packages/subgraph/scripts/deploy-subgraph.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ then
fi

# Prepare subgraph name
FULLNAME=$SUBGRAPH_NAME-$NETWORK_NAME
FULLNAME=$SUBGRAPH_NAME-$SUBGRAPH_NETWORK_NAME
if [ "$STAGING" ]; then
FULLNAME=$FULLNAME-staging
fi
Expand Down
2 changes: 1 addition & 1 deletion packages/subgraph/utils/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const ADDRESS_ZERO = '0x0000000000000000000000000000000000000000';

export const PLUGIN_INTERFACE = '0x11223344';
export const PLUGIN_REPO_ADDRESS = '0xb663C36d6fd959beeF2b82Bb40823660FEAaa55f'; // make sure address are lowercased
export const PLUGIN_REPO_ADDRESS = '0xfc7a07b6b22c1044a5dF4DF48B52AFAFcD370ECd'; // make sure address are lowercased

0 comments on commit b45f1e8

Please sign in to comment.