diff --git a/packages/contracts/deploy/99_verification/10_verify-contracts.ts b/packages/contracts/deploy/99_verification/10_verify-contracts.ts index cd90c057..3aa6cc97 100644 --- a/packages/contracts/deploy/99_verification/10_verify-contracts.ts +++ b/packages/contracts/deploy/99_verification/10_verify-contracts.ts @@ -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( diff --git a/packages/contracts/plugin-info.json b/packages/contracts/plugin-info.json index 30598ba0..bc4e5692 100644 --- a/packages/contracts/plugin-info.json +++ b/packages/contracts/plugin-info.json @@ -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" + } + } } } diff --git a/packages/contracts/utils/helpers.ts b/packages/contracts/utils/helpers.ts index ae573407..522fa534 100644 --- a/packages/contracts/utils/helpers.ts +++ b/packages/contracts/utils/helpers.ts @@ -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`); } @@ -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`); } @@ -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'; diff --git a/packages/js-client/src/context.ts b/packages/js-client/src/context.ts index a17f0b90..77092ec6 100644 --- a/packages/js-client/src/context.ts +++ b/packages/js-client/src/context.ts @@ -1,4 +1,5 @@ import { + DEFAULT_ADDRESSES, DEFAULT_GASLESS_VOTING_BACKEND_URL, DEFAULT_GASLESS_VOTING_REPO_ADDRESS, DEFAULT_GASLESS_VOTING_SUBHGRAPH_URL, @@ -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; diff --git a/packages/js-client/src/internal/constants.ts b/packages/js-client/src/internal/constants.ts index 8a8e533e..345ad422 100644 --- a/packages/js-client/src/internal/constants.ts +++ b/packages/js-client/src/internal/constants.ts @@ -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: '', @@ -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: '', @@ -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: '', diff --git a/packages/subgraph/scripts/deploy-subgraph.sh b/packages/subgraph/scripts/deploy-subgraph.sh index 1ec529e9..6916a54c 100755 --- a/packages/subgraph/scripts/deploy-subgraph.sh +++ b/packages/subgraph/scripts/deploy-subgraph.sh @@ -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 diff --git a/packages/subgraph/utils/constants.ts b/packages/subgraph/utils/constants.ts index 56f6cca9..edd60280 100644 --- a/packages/subgraph/utils/constants.ts +++ b/packages/subgraph/utils/constants.ts @@ -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