From 25f69a782cb20f74e137ff34d3bd06766589a67e Mon Sep 17 00:00:00 2001 From: martinsaporiti Date: Tue, 22 Oct 2024 06:08:27 -0300 Subject: [PATCH 1/7] chore: update contracts --- .github/workflows/deploy_new_account.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy_new_account.yml b/.github/workflows/deploy_new_account.yml index b273d2d..9b12965 100644 --- a/.github/workflows/deploy_new_account.yml +++ b/.github/workflows/deploy_new_account.yml @@ -21,12 +21,12 @@ env: POLYGON_MAIN_NETWORK_FLAG: "0b0001_0001" POLYGON_MAIN_CHAIN_ID: "137" - PRIVADO_MAIN_CONTRACT_ADDRESS: "0x975556428F077dB5877Ea2474D783D6C69233742" + PRIVADO_MAIN_CONTRACT_ADDRESS: "0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896" PRIVADO_MAIN_SENDER_DID: "did:iden3:privado:main:2SZz8Kvfb6CXGTiiqNiz8CTFTnySV7PKN7iVUvsNMH" PRIVADO_MAIN_NETWORK_FLAG: "0b1010_0001" PRIVADO_MAIN_CHAIN_ID: "21000" - PRIVADO_TEST_CONTRACT_ADDRESS: "0x975556428F077dB5877Ea2474D783D6C69233742" + PRIVADO_TEST_CONTRACT_ADDRESS: "0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896" PRIVADO_TEST_SENDER_DID: "did:iden3:privado:test:2Sn9bnRFiTYNfbS1dVTaGCUXuMfnQMUcTCAXtFv4Gr" PRIVADO_TEST_NETWORK_FLAG: "0b1010_0010" PRIVADO_TEST_CHAIN_ID: "21001" @@ -37,7 +37,7 @@ env: CAMINO_COLUMBUS_NETWORK_FLAG: "0b10000011" CAMINO_COLUMBUS_CHAIN_ID: "501" - LINEA_SEPOLIA_CONTRACT_ADDRESS: "0xD8869a439a07Edcc990F8f21E638702ee9273293" + LINEA_SEPOLIA_CONTRACT_ADDRESS: "0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896" LINEA_SEPOLIA_SENDER_DID: "did:iden3:linea:sepolia:28itzVLBHnMJV8sdjyffcAtWCx8HZ7btdKXxs7fJ6v" LINEA_SEPOLIA_NETWORK_FLAG: "0b0100_1000" LINEA_SEPOLIA_NODE_URL: "https://rpc.sepolia.linea.build" From 339c6f57b97c86e62d6e57e4032f52a8cc72e545 Mon Sep 17 00:00:00 2001 From: martinsaporiti Date: Tue, 22 Oct 2024 06:51:53 -0300 Subject: [PATCH 2/7] chore: update contracts and libs --- .github/workflows/deploy_new_account.yml | 17 ++++++++++++++ go.mod | 14 ++++++------ go.sum | 28 ++++++++++++------------ 3 files changed, 38 insertions(+), 21 deletions(-) diff --git a/.github/workflows/deploy_new_account.yml b/.github/workflows/deploy_new_account.yml index 9b12965..73c20d4 100644 --- a/.github/workflows/deploy_new_account.yml +++ b/.github/workflows/deploy_new_account.yml @@ -21,6 +21,16 @@ env: POLYGON_MAIN_NETWORK_FLAG: "0b0001_0001" POLYGON_MAIN_CHAIN_ID: "137" + POLYGON_ZKVM_CONTRACT_ADDRESS: "0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896" + POLYGON_ZKVM_SENDER_DID: "did:iden3:polygon:zkevm:xJa94Ky3oeawnDdQVoTotncYnBA1fCLW6C4NZVpRu" + POLYGON_ZKVM_NETWORK_FLAG: "0b0001_0100" + POLYGON_ZKVM_CHAIN_ID: "1101" + + POLYGON_CARDONA_CONTRACT_ADDRESS: "0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896" + POLYGON_CARDONA_SENDER_DID: "did:iden3:polygon:cardona:xWCCEr5ycUDRWQp3Zu6UJvyUuGsEUpwfenMQXixEj" + POLYGON_CARDONA_NETWORK_FLAG: "0b0001_0101" + POLYGON_CARDONA_CHAIN_ID: "2442" + PRIVADO_MAIN_CONTRACT_ADDRESS: "0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896" PRIVADO_MAIN_SENDER_DID: "did:iden3:privado:main:2SZz8Kvfb6CXGTiiqNiz8CTFTnySV7PKN7iVUvsNMH" PRIVADO_MAIN_NETWORK_FLAG: "0b1010_0001" @@ -44,6 +54,13 @@ env: LINEA_SEPOLIA_CHAIN_ID: "59141" LINEA_SEPOLIA_METHOD: "iden3" + LINEA_MAIN_CONTRACT_ADDRESS: "0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896" + LINEA_MAIN_SENDER_DID: "did:iden3:linea:main:28vX3frJDbAvHLSMHEwxuxRk1GPpjBeUEsXdAwVxDm" + LINEA_MAIN_NETWORK_FLAG: "0b0100_1001" + LINEA_MAIN_NODE_URL: "https://rpc.linea.build" + LINEA_MAIN_CHAIN_ID: "59144" + LINEA_MAIN_METHOD: "iden3" + jobs: build-backend: environment: diff --git a/go.mod b/go.mod index 193c226..ef17c8a 100644 --- a/go.mod +++ b/go.mod @@ -9,12 +9,12 @@ require ( github.com/go-chi/cors v1.2.1 github.com/golangci/golangci-lint v1.55.1 github.com/google/uuid v1.6.0 - github.com/iden3/go-circuits/v2 v2.3.0 - github.com/iden3/go-iden3-auth/v2 v2.4.1 - github.com/iden3/go-iden3-core/v2 v2.2.0 - github.com/iden3/go-jwz/v2 v2.1.1 - github.com/iden3/go-schema-processor/v2 v2.4.0 - github.com/iden3/iden3comm/v2 v2.5.1 + github.com/iden3/go-circuits/v2 v2.4.0 + github.com/iden3/go-iden3-auth/v2 v2.5.0 + github.com/iden3/go-iden3-core/v2 v2.3.1 + github.com/iden3/go-jwz/v2 v2.2.0 + github.com/iden3/go-schema-processor/v2 v2.5.0 + github.com/iden3/iden3comm/v2 v2.6.0 github.com/ipfs/go-ipfs-api v0.7.0 github.com/joho/godotenv v1.5.1 github.com/kelseyhightower/envconfig v1.4.0 @@ -124,7 +124,7 @@ require ( github.com/hexops/gotextdiff v1.0.3 // indirect github.com/holiman/uint256 v1.2.4 // indirect github.com/iden3/contracts-abi/state/go/abi v1.0.1 // indirect - github.com/iden3/go-iden3-crypto v0.0.16 // indirect + github.com/iden3/go-iden3-crypto v0.0.17 // indirect github.com/iden3/go-merkletree-sql/v2 v2.0.6 // indirect github.com/iden3/go-rapidsnark/prover v0.0.10 // indirect github.com/iden3/go-rapidsnark/types v0.0.3 // indirect diff --git a/go.sum b/go.sum index 0b9c45d..a226e13 100644 --- a/go.sum +++ b/go.sum @@ -429,16 +429,16 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1: github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/iden3/contracts-abi/state/go/abi v1.0.1 h1:FsaLJSy3NSyJl5k1yfDxc5DhUHRY7Z/UCj0/1YueMrY= github.com/iden3/contracts-abi/state/go/abi v1.0.1/go.mod h1:TxgIrXCvxms3sbOdsy8kTvffUCIpEEifNy0fSXdkU4w= -github.com/iden3/go-circuits/v2 v2.3.0 h1:xzDVuq4JkTgtz+AjatquuPgGVbOxRpcWMhUOcWEZJN4= -github.com/iden3/go-circuits/v2 v2.3.0/go.mod h1:APhXQaRQr4txd+u0Y7liBjN/Wnox0d31wR40LkXywAE= -github.com/iden3/go-iden3-auth/v2 v2.4.1 h1:hJxoTKsaxDxyN2hMWE2smSJkWXI0T+mIySjl4o4QPYc= -github.com/iden3/go-iden3-auth/v2 v2.4.1/go.mod h1:YFqVZ2s8oPyx64UI/rBRqeziQu86rH7OJ5RGAPZrdY0= -github.com/iden3/go-iden3-core/v2 v2.2.0 h1:PcMSxJRLAoJausj1gKstzgt25HS18K+IHLaSPeI9p8Q= -github.com/iden3/go-iden3-core/v2 v2.2.0/go.mod h1:L9PxhWPvoS9qTb3inEkZBm1RpjHBt+VTwvxssdzbAdw= -github.com/iden3/go-iden3-crypto v0.0.16 h1:zN867xiz6HgErXVIV/6WyteGcOukE9gybYTorBMEdsk= -github.com/iden3/go-iden3-crypto v0.0.16/go.mod h1:dLpM4vEPJ3nDHzhWFXDjzkn1qHoBeOT/3UEhXsEsP3E= -github.com/iden3/go-jwz/v2 v2.1.1 h1:6274wip59HAi9GkKewG0kKj/WBJeT6T4B+IotQM8IrY= -github.com/iden3/go-jwz/v2 v2.1.1/go.mod h1:1mEhNrtAO4eACWZeg9k6T0CxadN4XUkj/dfWUBk3exE= +github.com/iden3/go-circuits/v2 v2.4.0 h1:m+7uYtrvJKuc+gVhbXDXl1BJQyK7sWdW7OWttM3R/8I= +github.com/iden3/go-circuits/v2 v2.4.0/go.mod h1:k0uYx/ZdZPiDEIy7kI3MAixnREKcc7NdCKDRw8Q+iFA= +github.com/iden3/go-iden3-auth/v2 v2.5.0 h1:vvleEbb9WvZ5dH9FSLnE9pYCsdKh+jgIBLfr1tgP+7o= +github.com/iden3/go-iden3-auth/v2 v2.5.0/go.mod h1:z+7+loGUSX2loVVyyipwySvxAizrecz8sbDqdGwqKiI= +github.com/iden3/go-iden3-core/v2 v2.3.1 h1:ytQqiclnVAIWyRKR2LF31hfz4DGRBD6nMjiPILXGSKk= +github.com/iden3/go-iden3-core/v2 v2.3.1/go.mod h1:8vmG6y8k9VS7iNoxuiKukKbRQFsMyabCc+i8er07zOs= +github.com/iden3/go-iden3-crypto v0.0.17 h1:NdkceRLJo/pI4UpcjVah4lN/a3yzxRUGXqxbWcYh9mY= +github.com/iden3/go-iden3-crypto v0.0.17/go.mod h1:dLpM4vEPJ3nDHzhWFXDjzkn1qHoBeOT/3UEhXsEsP3E= +github.com/iden3/go-jwz/v2 v2.2.0 h1:YUefhlOJ4KkI5uLdfcYO2wTqNH1kuHUlRGXtC/l3Sn0= +github.com/iden3/go-jwz/v2 v2.2.0/go.mod h1:cJvSBnKiyccIGx1DkEgzkmxXEXYcKj1/K7BZfmU67u4= github.com/iden3/go-merkletree-sql/v2 v2.0.6 h1:vsVDImnvnHf7Ggr45ptFOXJyWNA/8IwVQO1jzRLUlY8= github.com/iden3/go-merkletree-sql/v2 v2.0.6/go.mod h1:kRhHKYpui5DUsry5RpveP6IC4XMe6iApdV9VChRYuEk= github.com/iden3/go-rapidsnark/prover v0.0.10 h1:NvOfRPpex/k646UsqOcUy7a7uVl17t4ok9kWvpQg4+k= @@ -451,10 +451,10 @@ github.com/iden3/go-rapidsnark/witness/v2 v2.0.0 h1:mkY6VDfwKVJc83QGKmwVXY2LYepi github.com/iden3/go-rapidsnark/witness/v2 v2.0.0/go.mod h1:3JRjqUfW1hgI9hzLDO0v8z/DUkR0ZUehhYLlnIfRxnA= github.com/iden3/go-rapidsnark/witness/wazero v0.0.0-20230524142950-0986cf057d4e h1:WeiFCrpj5pLRtSA4Mg03yTrSZhHHqN/k5b6bwxd9/tY= github.com/iden3/go-rapidsnark/witness/wazero v0.0.0-20230524142950-0986cf057d4e/go.mod h1:UEBifEzw62T6VzIHJeHuUgeLg2U/J9ttf7hOwQEqnYk= -github.com/iden3/go-schema-processor/v2 v2.4.0 h1:SlyWHTBKeS6P7asDvGKA9R2nWxwqOdeMRirU3TnDLyM= -github.com/iden3/go-schema-processor/v2 v2.4.0/go.mod h1:eBtILnPjh4wnsAg3LWnvcZlGG+5IkAJaRqhVBnDjerg= -github.com/iden3/iden3comm/v2 v2.5.1 h1:Tp0jRa91r96fBREKOa7aXckusfrqyWfosTHJi+8g+nw= -github.com/iden3/iden3comm/v2 v2.5.1/go.mod h1:j9Vh4b2azIc7J7g0WzHV54z7MpYmq89KkvxsVyBkjIE= +github.com/iden3/go-schema-processor/v2 v2.5.0 h1:MX84oFb9kYq0ntKiU4DrPPaRgCDUCKlurtHB6nvPPAs= +github.com/iden3/go-schema-processor/v2 v2.5.0/go.mod h1:hMqYi4lKOzEGkmCRks/r4Crj8H4G8YaTt8H4jZHzX9Y= +github.com/iden3/iden3comm/v2 v2.6.0 h1:6cu0N2b9oluJGDMvM2C0r2IH1GtrMUmmHOcJTn3O0mQ= +github.com/iden3/iden3comm/v2 v2.6.0/go.mod h1:ZRnfFg4geX336Bp9+29ZQdSqchbsBoVcd7ARn6JXH5Y= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/invopop/yaml v0.1.0 h1:YW3WGUoJEXYfzWBjn00zIlrw7brGVD0fUKRYDPAPhrc= From e11087bb8ca0532325e35fcf293290be641fc706 Mon Sep 17 00:00:00 2001 From: martinsaporiti Date: Tue, 22 Oct 2024 10:01:08 -0300 Subject: [PATCH 3/7] chore: update action --- .github/workflows/deploy_new_account.yml | 66 ++++++++++++++++++++---- 1 file changed, 55 insertions(+), 11 deletions(-) diff --git a/.github/workflows/deploy_new_account.yml b/.github/workflows/deploy_new_account.yml index 73c20d4..336eaf5 100644 --- a/.github/workflows/deploy_new_account.yml +++ b/.github/workflows/deploy_new_account.yml @@ -21,15 +21,15 @@ env: POLYGON_MAIN_NETWORK_FLAG: "0b0001_0001" POLYGON_MAIN_CHAIN_ID: "137" - POLYGON_ZKVM_CONTRACT_ADDRESS: "0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896" - POLYGON_ZKVM_SENDER_DID: "did:iden3:polygon:zkevm:xJa94Ky3oeawnDdQVoTotncYnBA1fCLW6C4NZVpRu" - POLYGON_ZKVM_NETWORK_FLAG: "0b0001_0100" - POLYGON_ZKVM_CHAIN_ID: "1101" + POLYGON_ZKEVM_MAIN_CONTRACT_ADDRESS: "0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896" + POLYGON_ZKEVM_MAIN_SENDER_DID: "did:iden3:polygon:zkevm:xJa94Ky3oeawnDdQVoTotncYnBA1fCLW6C4NZVpRu" + POLYGON_ZKEVM_MAIN_NETWORK_FLAG: "0b0001_0100" + POLYGON_ZKEVM_MAIN_CHAIN_ID: "1101" - POLYGON_CARDONA_CONTRACT_ADDRESS: "0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896" - POLYGON_CARDONA_SENDER_DID: "did:iden3:polygon:cardona:xWCCEr5ycUDRWQp3Zu6UJvyUuGsEUpwfenMQXixEj" - POLYGON_CARDONA_NETWORK_FLAG: "0b0001_0101" - POLYGON_CARDONA_CHAIN_ID: "2442" + POLYGON_ZKEVM_CARDONA_CONTRACT_ADDRESS: "0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896" + POLYGON_ZKEVM_CARDONA_SENDER_DID: "did:iden3:polygon:cardona:xWCCEr5ycUDRWQp3Zu6UJvyUuGsEUpwfenMQXixEj" + POLYGON_ZKEVM_CARDONA_NETWORK_FLAG: "0b0001_0101" + POLYGON_ZKEVM_CARDONA_CHAIN_ID: "2442" PRIVADO_MAIN_CONTRACT_ADDRESS: "0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896" PRIVADO_MAIN_SENDER_DID: "did:iden3:privado:main:2SZz8Kvfb6CXGTiiqNiz8CTFTnySV7PKN7iVUvsNMH" @@ -50,17 +50,29 @@ env: LINEA_SEPOLIA_CONTRACT_ADDRESS: "0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896" LINEA_SEPOLIA_SENDER_DID: "did:iden3:linea:sepolia:28itzVLBHnMJV8sdjyffcAtWCx8HZ7btdKXxs7fJ6v" LINEA_SEPOLIA_NETWORK_FLAG: "0b0100_1000" - LINEA_SEPOLIA_NODE_URL: "https://rpc.sepolia.linea.build" LINEA_SEPOLIA_CHAIN_ID: "59141" LINEA_SEPOLIA_METHOD: "iden3" LINEA_MAIN_CONTRACT_ADDRESS: "0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896" LINEA_MAIN_SENDER_DID: "did:iden3:linea:main:28vX3frJDbAvHLSMHEwxuxRk1GPpjBeUEsXdAwVxDm" LINEA_MAIN_NETWORK_FLAG: "0b0100_1001" - LINEA_MAIN_NODE_URL: "https://rpc.linea.build" LINEA_MAIN_CHAIN_ID: "59144" LINEA_MAIN_METHOD: "iden3" + ETHEREUM_SEPOLIA_CONTRACT_ADDRESS: "0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896" + ETHEREUM_SEPOLIA_SENDER_DID: "did:iden3:eth:sepolia:21Jtxn7kxuy27h7NzZFwk8x2YcepKyfRyX4Tt6tqYK" + ETHEREUM_SEPOLIA_NETWORK_FLAG: "0b0010_0011" + ETHEREUM_SEPOLIA_NODE_URL: "https://rpc.sepolia.org" + ETHEREUM_SEPOLIA_CHAIN_ID: "11155111" + ETHEREUM_SEPOLIA_METHOD: "iden3" + + ETHEREUM_MAIN_CONTRACT_ADDRESS: "0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896" + ETHEREUM_MAIN_SENDER_DID: "did:iden3:eth:main:zuerR5X7JKmAEj1iR4gRJfJgNTPtLQDePsspASZvf" + ETHEREUM_MAIN_NETWORK_FLAG: "0b0010_0001" + ETHEREUM_MAIN_NODE_URL: "https://eth-mainnet.g.alchemy.com/v2/demo" + ETHEREUM_MAIN_CHAIN_ID: "1" + ETHEREUM_MAIN_METHOD: "iden3" + jobs: build-backend: environment: @@ -106,6 +118,18 @@ jobs: echo -e " chainID: ${{ env.POLYGON_MAIN_CHAIN_ID }}" >> resolvers_settings.yaml echo -e " networkFlag: ${{ env.POLYGON_MAIN_NETWORK_FLAG }}" >> resolvers_settings.yaml echo -e " did: ${{ env.POLYGON_MAIN_SENDER_DID }}" >> resolvers_settings.yaml + echo -e " zkevm:" >> resolvers_settings.yaml + echo -e " contractAddress: ${{ env.POLYGON_ZKEVM_MAIN_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml + echo -e " networkURL: ${{ secrets.POLYGON_ZKEVM_MAIN_NODE_URL }}" >> resolvers_settings.yaml + echo -e " chainID: ${{ env.POLYGON_ZKEVM_MAIN_CHAIN_ID }}" >> resolvers_settings.yaml + echo -e " networkFlag: ${{ env.POLYGON_ZKEVM_MAIN_NETWORK_FLAG }}" >> resolvers_settings.yaml + echo -e " did: ${{ env.POLYGON_ZKEVM_MAIN_SENDER_DID }}" >> resolvers_settings.yaml + echo -e " cardona:" >> resolvers_settings.yaml + echo -e " contractAddress: ${{ env.POLYGON_ZKEVM_CARDONA_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml + echo -e " networkURL: ${{ secrets.POLYGON_ZKEVM_CARDONA_NODE_URL }}" >> resolvers_settings.yaml + echo -e " chainID: ${{ env.POLYGON_ZKEVM_CARDONA_CHAIN_ID }}" >> resolvers_settings.yaml + echo -e " networkFlag: ${{ env.POLYGON_ZKEVM_CARDONA_NETWORK_FLAG }}" >> resolvers_settings.yaml + echo -e " did: ${{ env.POLYGON_ZKEVM_CARDONA_SENDER_DID }}" >> resolvers_settings.yaml echo -e "camino:" >> resolvers_settings.yaml echo -e " columbus:" >> resolvers_settings.yaml echo -e " contractAddress: ${{ env.CAMINO_COLUMBUS_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml @@ -116,11 +140,18 @@ jobs: echo -e "linea:" >> resolvers_settings.yaml echo -e " sepolia:" >> resolvers_settings.yaml echo -e " contractAddress: ${{ env.LINEA_SEPOLIA_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml - echo -e " networkURL: ${{ env.LINEA_SEPOLIA_NODE_URL }}" >> resolvers_settings.yaml + echo -e " networkURL: ${{ secrets.LINEA_SEPOLIA_NODE_URL }}" >> resolvers_settings.yaml echo -e " chainID: ${{ env.LINEA_SEPOLIA_CHAIN_ID }}" >> resolvers_settings.yaml echo -e " networkFlag: ${{ env.LINEA_SEPOLIA_NETWORK_FLAG }}" >> resolvers_settings.yaml echo -e " did: ${{ env.LINEA_SEPOLIA_SENDER_DID }}" >> resolvers_settings.yaml echo -e " method: ${{ env.LINEA_SEPOLIA_METHOD }}" >> resolvers_settings.yaml + echo -e " main:" >> resolvers_settings.yaml + echo -e " contractAddress: ${{ env.LINEA_MAIN_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml + echo -e " networkURL: ${{ secrets.LINEA_MAIN_NODE_URL }}" >> resolvers_settings.yaml + echo -e " chainID: ${{ env.LINEA_MAIN_CHAIN_ID }}" >> resolvers_settings.yaml + echo -e " networkFlag: ${{ env.LINEA_MAIN_NETWORK_FLAG }}" >> resolvers_settings.yaml + echo -e " did: ${{ env.LINEA_MAIN_SENDER_DID }}" >> resolvers_settings.yaml + echo -e " method: ${{ env.LINEA_MAIN_METHOD }}" >> resolvers_settings.yaml echo -e "privado:" >> resolvers_settings.yaml echo -e " test:" >> resolvers_settings.yaml echo -e " contractAddress: ${{ env.PRIVADO_TEST_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml @@ -134,6 +165,19 @@ jobs: echo -e " chainID: ${{ env.PRIVADO_MAIN_CHAIN_ID }}" >> resolvers_settings.yaml echo -e " networkFlag: ${{ env.PRIVADO_MAIN_NETWORK_FLAG }}" >> resolvers_settings.yaml echo -e " did: ${{ env.PRIVADO_MAIN_SENDER_DID }}" >> resolvers_settings.yaml + echo -e "ethereum:" >> resolvers_settings.yaml + echo -e " sepolia:" >> resolvers_settings.yaml + echo -e " contractAddress: ${{ env.ETHEREUM_SEPOLIA_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml + echo -e " networkURL: ${{ secrets.ETHEREUM_SEPOLIA_NODE_URL }}" >> resolvers_settings.yaml + echo -e " chainID: ${{ env.ETHEREUM_SEPOLIA_CHAIN_ID }}" >> resolvers_settings.yaml + echo -e " networkFlag: ${{ env.ETHEREUM_SEPOLIA_NETWORK_FLAG }}" >> resolvers_settings.yaml + echo -e " did: ${{ env.ETHEREUM_SEPOLIA_SENDER_DID }}" >> resolvers_settings.yaml + echo -e " main:" >> resolvers_settings.yaml + echo -e " contractAddress: ${{ env.ETHEREUM_MAIN_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml + echo -e " networkURL: ${{ secrets.ETHEREUM_MAIN_NODE_URL }}" >> resolvers_settings.yaml + echo -e " chainID: ${{ env.ETHEREUM_MAIN_CHAIN_ID }}" >> resolvers_settings.yaml + echo -e " networkFlag: ${{ env.ETHEREUM_MAIN_NETWORK_FLAG }}" >> resolvers_settings.yaml + echo -e " did: ${{ env.ETHEREUM_MAIN_SENDER_DID }}" >> resolvers_settings.yaml cat resolvers_settings.yaml - run: make build/docker From ae8b2408f4232a680e940a49301f60e9b7f2a5b4 Mon Sep 17 00:00:00 2001 From: martinsaporiti Date: Tue, 22 Oct 2024 12:25:11 -0300 Subject: [PATCH 4/7] chore: remove_network_flag --- .github/workflows/deploy_new_account.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/deploy_new_account.yml b/.github/workflows/deploy_new_account.yml index 336eaf5..2f358d9 100644 --- a/.github/workflows/deploy_new_account.yml +++ b/.github/workflows/deploy_new_account.yml @@ -13,62 +13,51 @@ env: POLYGON_AMOY_CONTRACT_ADDRESS: "0x1a4cC30f2aA0377b0c3bc9848766D90cb4404124" POLYGON_AMOY_SENDER_DID: "did:polygonid:polygon:amoy:2qV9QXdhXXmN5sKjN1YueMjxgRbnJcEGK2kGpvk3cq" - POLYGON_AMOY_NETWORK_FLAG: "0b0001_0011" POLYGON_AMOY_CHAIN_ID: "80002" POLYGON_MAIN_CONTRACT_ADDRESS: "0x624ce98D2d27b20b8f8d521723Df8fC4db71D79D" POLYGON_MAIN_SENDER_DID: "did:polygonid:polygon:main:2q4Q7F7tM1xpwUTgWivb6TgKX3vWirsE3mqymuYjVv" - POLYGON_MAIN_NETWORK_FLAG: "0b0001_0001" POLYGON_MAIN_CHAIN_ID: "137" POLYGON_ZKEVM_MAIN_CONTRACT_ADDRESS: "0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896" POLYGON_ZKEVM_MAIN_SENDER_DID: "did:iden3:polygon:zkevm:xJa94Ky3oeawnDdQVoTotncYnBA1fCLW6C4NZVpRu" - POLYGON_ZKEVM_MAIN_NETWORK_FLAG: "0b0001_0100" POLYGON_ZKEVM_MAIN_CHAIN_ID: "1101" POLYGON_ZKEVM_CARDONA_CONTRACT_ADDRESS: "0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896" POLYGON_ZKEVM_CARDONA_SENDER_DID: "did:iden3:polygon:cardona:xWCCEr5ycUDRWQp3Zu6UJvyUuGsEUpwfenMQXixEj" - POLYGON_ZKEVM_CARDONA_NETWORK_FLAG: "0b0001_0101" POLYGON_ZKEVM_CARDONA_CHAIN_ID: "2442" PRIVADO_MAIN_CONTRACT_ADDRESS: "0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896" PRIVADO_MAIN_SENDER_DID: "did:iden3:privado:main:2SZz8Kvfb6CXGTiiqNiz8CTFTnySV7PKN7iVUvsNMH" - PRIVADO_MAIN_NETWORK_FLAG: "0b1010_0001" PRIVADO_MAIN_CHAIN_ID: "21000" PRIVADO_TEST_CONTRACT_ADDRESS: "0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896" PRIVADO_TEST_SENDER_DID: "did:iden3:privado:test:2Sn9bnRFiTYNfbS1dVTaGCUXuMfnQMUcTCAXtFv4Gr" - PRIVADO_TEST_NETWORK_FLAG: "0b1010_0010" PRIVADO_TEST_CHAIN_ID: "21001" CAMINO_COLUMBUS_CONTRACT_ADDRESS: "0x34eCe5eCe59B978C95147bBa6db8fb62F127e601" CAMINO_COLUMBUS_NODE_URL: "https://columbus.camino.network/ext/bc/C/rpc" CAMINO_COLUMBUS_SENDER_DID: "did:polygonid:camino:columbus:3E1DZ5qrNCJctmUS3nphEkfsvqYs1kL5oGTtEpYiov" - CAMINO_COLUMBUS_NETWORK_FLAG: "0b10000011" CAMINO_COLUMBUS_CHAIN_ID: "501" LINEA_SEPOLIA_CONTRACT_ADDRESS: "0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896" LINEA_SEPOLIA_SENDER_DID: "did:iden3:linea:sepolia:28itzVLBHnMJV8sdjyffcAtWCx8HZ7btdKXxs7fJ6v" - LINEA_SEPOLIA_NETWORK_FLAG: "0b0100_1000" LINEA_SEPOLIA_CHAIN_ID: "59141" LINEA_SEPOLIA_METHOD: "iden3" LINEA_MAIN_CONTRACT_ADDRESS: "0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896" LINEA_MAIN_SENDER_DID: "did:iden3:linea:main:28vX3frJDbAvHLSMHEwxuxRk1GPpjBeUEsXdAwVxDm" - LINEA_MAIN_NETWORK_FLAG: "0b0100_1001" LINEA_MAIN_CHAIN_ID: "59144" LINEA_MAIN_METHOD: "iden3" ETHEREUM_SEPOLIA_CONTRACT_ADDRESS: "0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896" ETHEREUM_SEPOLIA_SENDER_DID: "did:iden3:eth:sepolia:21Jtxn7kxuy27h7NzZFwk8x2YcepKyfRyX4Tt6tqYK" - ETHEREUM_SEPOLIA_NETWORK_FLAG: "0b0010_0011" ETHEREUM_SEPOLIA_NODE_URL: "https://rpc.sepolia.org" ETHEREUM_SEPOLIA_CHAIN_ID: "11155111" ETHEREUM_SEPOLIA_METHOD: "iden3" ETHEREUM_MAIN_CONTRACT_ADDRESS: "0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896" ETHEREUM_MAIN_SENDER_DID: "did:iden3:eth:main:zuerR5X7JKmAEj1iR4gRJfJgNTPtLQDePsspASZvf" - ETHEREUM_MAIN_NETWORK_FLAG: "0b0010_0001" ETHEREUM_MAIN_NODE_URL: "https://eth-mainnet.g.alchemy.com/v2/demo" ETHEREUM_MAIN_CHAIN_ID: "1" ETHEREUM_MAIN_METHOD: "iden3" From 1d7b790c13cef96f9ed33ba98db3f6e04731354c Mon Sep 17 00:00:00 2001 From: martinsaporiti Date: Tue, 22 Oct 2024 12:44:59 -0300 Subject: [PATCH 5/7] chore: remove network flag from yaml file --- .github/workflows/deploy_new_account.yml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/.github/workflows/deploy_new_account.yml b/.github/workflows/deploy_new_account.yml index 2f358d9..376cad3 100644 --- a/.github/workflows/deploy_new_account.yml +++ b/.github/workflows/deploy_new_account.yml @@ -99,46 +99,33 @@ jobs: echo -e " contractAddress: ${{ env.POLYGON_AMOY_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml echo -e " networkURL: ${{ secrets.POLYGON_AMOY_NODE_URL }}" >> resolvers_settings.yaml echo -e " chainID: ${{ env.POLYGON_AMOY_CHAIN_ID }}" >> resolvers_settings.yaml - echo -e " networkFlag: ${{ env.POLYGON_AMOY_NETWORK_FLAG }}" >> resolvers_settings.yaml echo -e " did: ${{ env.POLYGON_AMOY_SENDER_DID }}" >> resolvers_settings.yaml echo -e " main:" >> resolvers_settings.yaml echo -e " contractAddress: ${{ env.POLYGON_MAIN_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml echo -e " networkURL: ${{ secrets.POLYGON_MAINET_NODE_URL }}" >> resolvers_settings.yaml echo -e " chainID: ${{ env.POLYGON_MAIN_CHAIN_ID }}" >> resolvers_settings.yaml - echo -e " networkFlag: ${{ env.POLYGON_MAIN_NETWORK_FLAG }}" >> resolvers_settings.yaml echo -e " did: ${{ env.POLYGON_MAIN_SENDER_DID }}" >> resolvers_settings.yaml echo -e " zkevm:" >> resolvers_settings.yaml echo -e " contractAddress: ${{ env.POLYGON_ZKEVM_MAIN_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml echo -e " networkURL: ${{ secrets.POLYGON_ZKEVM_MAIN_NODE_URL }}" >> resolvers_settings.yaml echo -e " chainID: ${{ env.POLYGON_ZKEVM_MAIN_CHAIN_ID }}" >> resolvers_settings.yaml - echo -e " networkFlag: ${{ env.POLYGON_ZKEVM_MAIN_NETWORK_FLAG }}" >> resolvers_settings.yaml echo -e " did: ${{ env.POLYGON_ZKEVM_MAIN_SENDER_DID }}" >> resolvers_settings.yaml echo -e " cardona:" >> resolvers_settings.yaml echo -e " contractAddress: ${{ env.POLYGON_ZKEVM_CARDONA_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml echo -e " networkURL: ${{ secrets.POLYGON_ZKEVM_CARDONA_NODE_URL }}" >> resolvers_settings.yaml echo -e " chainID: ${{ env.POLYGON_ZKEVM_CARDONA_CHAIN_ID }}" >> resolvers_settings.yaml - echo -e " networkFlag: ${{ env.POLYGON_ZKEVM_CARDONA_NETWORK_FLAG }}" >> resolvers_settings.yaml echo -e " did: ${{ env.POLYGON_ZKEVM_CARDONA_SENDER_DID }}" >> resolvers_settings.yaml - echo -e "camino:" >> resolvers_settings.yaml - echo -e " columbus:" >> resolvers_settings.yaml - echo -e " contractAddress: ${{ env.CAMINO_COLUMBUS_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml - echo -e " networkURL: ${{ env.CAMINO_COLUMBUS_NODE_URL }}" >> resolvers_settings.yaml - echo -e " chainID: ${{ env.CAMINO_COLUMBUS_CHAIN_ID }}" >> resolvers_settings.yaml - echo -e " networkFlag: ${{ env.CAMINO_COLUMBUS_NETWORK_FLAG }}" >> resolvers_settings.yaml - echo -e " did: ${{ env.CAMINO_COLUMBUS_SENDER_DID }}" >> resolvers_settings.yaml echo -e "linea:" >> resolvers_settings.yaml echo -e " sepolia:" >> resolvers_settings.yaml echo -e " contractAddress: ${{ env.LINEA_SEPOLIA_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml echo -e " networkURL: ${{ secrets.LINEA_SEPOLIA_NODE_URL }}" >> resolvers_settings.yaml echo -e " chainID: ${{ env.LINEA_SEPOLIA_CHAIN_ID }}" >> resolvers_settings.yaml - echo -e " networkFlag: ${{ env.LINEA_SEPOLIA_NETWORK_FLAG }}" >> resolvers_settings.yaml echo -e " did: ${{ env.LINEA_SEPOLIA_SENDER_DID }}" >> resolvers_settings.yaml echo -e " method: ${{ env.LINEA_SEPOLIA_METHOD }}" >> resolvers_settings.yaml echo -e " main:" >> resolvers_settings.yaml echo -e " contractAddress: ${{ env.LINEA_MAIN_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml echo -e " networkURL: ${{ secrets.LINEA_MAIN_NODE_URL }}" >> resolvers_settings.yaml echo -e " chainID: ${{ env.LINEA_MAIN_CHAIN_ID }}" >> resolvers_settings.yaml - echo -e " networkFlag: ${{ env.LINEA_MAIN_NETWORK_FLAG }}" >> resolvers_settings.yaml echo -e " did: ${{ env.LINEA_MAIN_SENDER_DID }}" >> resolvers_settings.yaml echo -e " method: ${{ env.LINEA_MAIN_METHOD }}" >> resolvers_settings.yaml echo -e "privado:" >> resolvers_settings.yaml @@ -146,26 +133,22 @@ jobs: echo -e " contractAddress: ${{ env.PRIVADO_TEST_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml echo -e " networkURL: ${{ secrets.PRIVADO_TEST_NODE_URL }}" >> resolvers_settings.yaml echo -e " chainID: ${{ env.PRIVADO_TEST_CHAIN_ID }}" >> resolvers_settings.yaml - echo -e " networkFlag: ${{ env.PRIVADO_TEST_NETWORK_FLAG }}" >> resolvers_settings.yaml echo -e " did: ${{ env.PRIVADO_TEST_SENDER_DID }}" >> resolvers_settings.yaml echo -e " main:" >> resolvers_settings.yaml echo -e " contractAddress: ${{ env.PRIVADO_MAIN_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml echo -e " networkURL: ${{ secrets.PRIVADO_MAINET_NODE_URL }}" >> resolvers_settings.yaml echo -e " chainID: ${{ env.PRIVADO_MAIN_CHAIN_ID }}" >> resolvers_settings.yaml - echo -e " networkFlag: ${{ env.PRIVADO_MAIN_NETWORK_FLAG }}" >> resolvers_settings.yaml echo -e " did: ${{ env.PRIVADO_MAIN_SENDER_DID }}" >> resolvers_settings.yaml echo -e "ethereum:" >> resolvers_settings.yaml echo -e " sepolia:" >> resolvers_settings.yaml echo -e " contractAddress: ${{ env.ETHEREUM_SEPOLIA_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml echo -e " networkURL: ${{ secrets.ETHEREUM_SEPOLIA_NODE_URL }}" >> resolvers_settings.yaml echo -e " chainID: ${{ env.ETHEREUM_SEPOLIA_CHAIN_ID }}" >> resolvers_settings.yaml - echo -e " networkFlag: ${{ env.ETHEREUM_SEPOLIA_NETWORK_FLAG }}" >> resolvers_settings.yaml echo -e " did: ${{ env.ETHEREUM_SEPOLIA_SENDER_DID }}" >> resolvers_settings.yaml echo -e " main:" >> resolvers_settings.yaml echo -e " contractAddress: ${{ env.ETHEREUM_MAIN_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml echo -e " networkURL: ${{ secrets.ETHEREUM_MAIN_NODE_URL }}" >> resolvers_settings.yaml echo -e " chainID: ${{ env.ETHEREUM_MAIN_CHAIN_ID }}" >> resolvers_settings.yaml - echo -e " networkFlag: ${{ env.ETHEREUM_MAIN_NETWORK_FLAG }}" >> resolvers_settings.yaml echo -e " did: ${{ env.ETHEREUM_MAIN_SENDER_DID }}" >> resolvers_settings.yaml cat resolvers_settings.yaml - run: make build/docker From 910d3d5375490daa61b946c3d0db79a1a1562d05 Mon Sep 17 00:00:00 2001 From: martinsaporiti Date: Tue, 22 Oct 2024 13:22:05 -0300 Subject: [PATCH 6/7] chore: remove custom registration --- .github/workflows/deploy_new_account.yml | 5 ----- cmd/main.go | 8 ++++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deploy_new_account.yml b/.github/workflows/deploy_new_account.yml index 376cad3..a9aa49b 100644 --- a/.github/workflows/deploy_new_account.yml +++ b/.github/workflows/deploy_new_account.yml @@ -35,11 +35,6 @@ env: PRIVADO_TEST_SENDER_DID: "did:iden3:privado:test:2Sn9bnRFiTYNfbS1dVTaGCUXuMfnQMUcTCAXtFv4Gr" PRIVADO_TEST_CHAIN_ID: "21001" - CAMINO_COLUMBUS_CONTRACT_ADDRESS: "0x34eCe5eCe59B978C95147bBa6db8fb62F127e601" - CAMINO_COLUMBUS_NODE_URL: "https://columbus.camino.network/ext/bc/C/rpc" - CAMINO_COLUMBUS_SENDER_DID: "did:polygonid:camino:columbus:3E1DZ5qrNCJctmUS3nphEkfsvqYs1kL5oGTtEpYiov" - CAMINO_COLUMBUS_CHAIN_ID: "501" - LINEA_SEPOLIA_CONTRACT_ADDRESS: "0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896" LINEA_SEPOLIA_SENDER_DID: "did:iden3:linea:sepolia:28itzVLBHnMJV8sdjyffcAtWCx8HZ7btdKXxs7fJ6v" LINEA_SEPOLIA_CHAIN_ID: "59141" diff --git a/cmd/main.go b/cmd/main.go index 41bfd2f..1fc94e0 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -92,10 +92,10 @@ func parseResolverSettings(ctx context.Context, rs config.ResolverSettings) (map resolver := state.NewETHResolver(networkSettings.NetworkURL, networkSettings.ContractAddress) resolvers[prefix] = resolver - if err := registerCustomDIDMethod(ctx, chainName, networkName, networkSettings); err != nil { - log.Error(ctx, "cannot register custom DID method", "err", err) - return nil, nil, err - } + //if err := registerCustomDIDMethod(ctx, chainName, networkName, networkSettings); err != nil { + // log.Error(ctx, "cannot register custom DID method", "err", err) + // return nil, nil, err + //} verifiersDIDs[networkSettings.ChainID] = networkSettings.DID } From 0cb12c340894f73a5faac2751e18f2657decd048 Mon Sep 17 00:00:00 2001 From: vmidyllic <74898029+vmidyllic@users.noreply.github.com> Date: Tue, 22 Oct 2024 19:35:44 +0300 Subject: [PATCH 7/7] fix linter --- cmd/main.go | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/cmd/main.go b/cmd/main.go index 1fc94e0..a0a0803 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -6,7 +6,6 @@ import ( "net/http" "os" "os/signal" - "strconv" "syscall" "github.com/go-chi/chi/v5" @@ -16,7 +15,6 @@ import ( "github.com/iden3/go-iden3-auth/v2/loaders" "github.com/iden3/go-iden3-auth/v2/pubsignals" "github.com/iden3/go-iden3-auth/v2/state" - core "github.com/iden3/go-iden3-core/v2" log "github.com/sirupsen/logrus" "github.com/0xPolygonID/verifier-backend/internal/api" @@ -104,20 +102,20 @@ func parseResolverSettings(ctx context.Context, rs config.ResolverSettings) (map return resolvers, verifiersDIDs, nil } -func registerCustomDIDMethod(ctx context.Context, blockchain string, network string, resolverAttrs config.ResolverSettingsAttrs) error { - chainID, err := strconv.Atoi(resolverAttrs.ChainID) - if err != nil { - return fmt.Errorf("cannot convert chainID to int: %w", err) - } - params := core.DIDMethodNetworkParams{ - Method: core.DIDMethod(resolverAttrs.Method), - Blockchain: core.Blockchain(blockchain), - Network: core.NetworkID(network), - NetworkFlag: resolverAttrs.NetworkFlag, - } - if err := core.RegisterDIDMethodNetwork(params, core.WithChainID(chainID)); err != nil { - log.Error(ctx, "cannot register custom DID method", "err", err, "customDID", chainID) - return err - } - return nil -} +//func registerCustomDIDMethod(ctx context.Context, blockchain string, network string, resolverAttrs config.ResolverSettingsAttrs) error { +// chainID, err := strconv.Atoi(resolverAttrs.ChainID) +// if err != nil { +// return fmt.Errorf("cannot convert chainID to int: %w", err) +// } +// params := core.DIDMethodNetworkParams{ +// Method: core.DIDMethod(resolverAttrs.Method), +// Blockchain: core.Blockchain(blockchain), +// Network: core.NetworkID(network), +// NetworkFlag: resolverAttrs.NetworkFlag, +// } +// if err := core.RegisterDIDMethodNetwork(params, core.WithChainID(chainID)); err != nil { +// log.Error(ctx, "cannot register custom DID method", "err", err, "customDID", chainID) +// return err +// } +// return nil +//}