From 1d4d9203978dde8d342dfd6b1a8b77cb424e869c Mon Sep 17 00:00:00 2001 From: Afonina Tatiana <99973342+tafonina@users.noreply.github.com> Date: Fri, 16 Dec 2022 13:51:49 +0200 Subject: [PATCH 1/5] Alternative chains support (#281) * add new smart contract addresses on goerli and mumbai networks, update settings * fix dependencies * update circle checks go version --- .circleci/config.yml | 6 +-- README.md | 2 +- docker-compose.yml | 2 +- docs/configure.md | 14 +++---- docs/contract_deployment.md | 4 +- docs/quickstart.md | 4 +- go.mod | 12 ++++-- go.sum | 38 +++++++++++++++++++ main/config/configuration.go | 6 +-- main/handlers/blockchain/airdrop.go | 12 +++--- service/authentication.go | 2 +- sys/model/settings.go | 4 +- sys/system.go | 16 ++++++-- ui/core/.env | 2 +- ui/core/src/baseApp.js | 2 +- .../document/VerificationFileEntry.vue | 2 +- .../appDependentComponents/SettingsInner.vue | 6 +-- .../src/ProxeusEthereum/WalletInterface.js | 17 +++++++-- .../ProxeusEthereum/config/service-config.js | 25 ++++++++++-- 19 files changed, 128 insertions(+), 48 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ce902ac08..02ff0ec1d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,12 +6,12 @@ executors: environment: PROJECT_ROOT_FOLDER: ~/project docker: - - image: cimg/go:1.16-node + - image: cimg/go:1.17-node docker-image-golang-dependencies: environment: PROJECT_ROOT_FOLDER: ~/project docker: - - image: cimg/go:1.16-node + - image: cimg/go:1.17-node - image: proxeus/node-crypto-forex-rates - image: proxeus/document-service - image: proxeus/mongo-dev-cluster @@ -25,7 +25,7 @@ executors: jobs: build-ui: docker: - - image: cimg/go:1.16-node + - image: cimg/go:1.17-node steps: - checkout - restore_cache: diff --git a/README.md b/README.md index cff01e9f5..af35baa16 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ If all goes well, Proxeus should be available at http://localhost:1323. The next If you find a vulnerability that may affect live or testnet deployments please DO NOT file a public issue - send your report privately to info@proxeus.org -## License - test3 +## License Licensed under the GNU GENERAL PUBLIC LICENSE. You may read a copy of the [License here](LICENSE). diff --git a/docker-compose.yml b/docker-compose.yml index 12d99490e..eca8fcb8e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -88,7 +88,7 @@ services: restart: unless-stopped environment: PROXEUS_INSTANCE_URL: "${PROXEUS_PLATFORM_DOMAIN:-http://xes-platform:1323}" - PROXEUS_ETH_CLIENT_URL: "${PROXEUS_ETH_CLIENT_URL:-https://ropsten.infura.io/v3/}" + PROXEUS_ETH_CLIENT_URL: "${PROXEUS_ETH_CLIENT_URL:-https://goerli.infura.io/v3/}" PROXEUS_INFURA_API_KEY: ${PROXEUS_INFURA_API_KEY} SERVICE_SECRET: secret SERVICE_PORT: 8012 diff --git a/docs/configure.md b/docs/configure.md index 9c6620d83..a8cfbaf1b 100644 --- a/docs/configure.md +++ b/docs/configure.md @@ -13,9 +13,9 @@ https://dev-ds.proxeus.com/ ## Infura API Key Generate a [infura API Key](https://infura.io) -## Blockchain contract address (ropsten) +## Blockchain contract address (goerli) ``` -0x8d654e67694fda572c08edd55a86008b0c20002d +0x66FF4FBF80D4a3C85a54974446309a2858221689 ``` (alternatively deploy own smart contract from ProxeusFS.sol) @@ -50,7 +50,7 @@ Usage of ./artifacts/proxeus: -AirdropAmountXES string Amount of XES to airdrop to newly registered users. (PROXEUS_AIRDROP_AMOUNT_XES) (default "0") -AirdropEnabled string - Enables/Disables the XES & Ether airdrop feature on ropsten. (PROXEUS_AIRDROP_ENABLED) (default "false") + Enables/Disables the XES & Ether airdrop feature on test network. (PROXEUS_AIRDROP_ENABLED) (default "false") -AirdropWalletfile string Path to File containing Private Key of the Wallet to fund Airdrops of XES and Ether. (PROXEUS_AIRDROP_WALLETFILE) -AirdropWalletkey string @@ -62,7 +62,7 @@ Usage of ./artifacts/proxeus: -BlockchainContractAddress string Ethereum contract address which will be used to register files and verify them. (PROXEUS_BLOCKCHAIN_CONTRACT_ADDRESS) -BlockchainNet string - Ethereum blockchain net like mainnet or ropsten. (PROXEUS_BLOCKCHAIN_NET) (default "ropsten") + Ethereum blockchain net like mainnet/goerli/polygon-mumbai/polygon-mainnet. (PROXEUS_BLOCKCHAIN_NET) (default "goerli") -CacheExpiry string Common cache expiry which will be used for email tokens or similar. (PROXEUS_CACHE_EXPIRY) (default "24h") -DataDir string @@ -80,9 +80,9 @@ Usage of ./artifacts/proxeus: -EmailFrom string Email that is being used to send out emails. (PROXEUS_EMAIL_FROM) -EthClientURL string - Ethereum client URL (PROXEUS_ETH_CLIENT_URL) (default "https://ropsten.infura.io/v3/") + Ethereum client URL (PROXEUS_ETH_CLIENT_URL) (default "https://goerli.infura.io/v3/") -EthWebSocketURL string - Ethereum websocket URL (PROXEUS_ETH_WEB_SOCKET_URL) (default "wss://ropsten.infura.io/ws/v3/") + Ethereum websocket URL (PROXEUS_ETH_WEB_SOCKET_URL) (default "wss://goerli.infura.io/ws/v3/") -InfuraApiKey string API Key to access Infura node. (PROXEUS_INFURA_API_KEY) -LogPath string @@ -100,5 +100,5 @@ Usage of ./artifacts/proxeus: -TestMode string Run the server in test mode =NOT FOR PRODUCTION=. (PROXEUS_TEST_MODE) (default "false") -XESContractAddress string - (PROXEUS_XESCONTRACT_ADDRESS) (default "0x84E0b37e8f5B4B86d5d299b0B0e33686405A3919") + (PROXEUS_XESCONTRACT_ADDRESS) (default "0x15FeA089CC48B4f4596242c138156e3B53579B37") ``` diff --git a/docs/contract_deployment.md b/docs/contract_deployment.md index 87799254c..005201875 100644 --- a/docs/contract_deployment.md +++ b/docs/contract_deployment.md @@ -16,8 +16,8 @@ The latest ProxeusFS contract can be found in github: https://github.com/Proxeus 2. Create or Import an Ethereum Account in Metamask ### Deployment - 1. Switch to ropsten/mainnet in Metamask depending on where you would like to deploy the contract - 2. Make sure your Ethereum Account has some Ether to fund the transactions (Ropsten faucet: https://faucet.ropsten.be/) + 1. Switch to goerli/mainnet/polygon-mumbai/polygon-mainnet in Metamask depending on where you would like to deploy the contract + 2. Make sure your Ethereum Account has some Ether to fund the transactions (Goerli faucet: https://goerlifaucet.com/) 3. Open Remix: https://remix.ethereum.org 4. Upload the ProxeusFS.sol file 5. Open the "Plugin Manager" (Sidebar) and enable Plugins "Solidity Compiler" & "Deploy & Run Transactions" diff --git a/docs/quickstart.md b/docs/quickstart.md index 7d01161c4..ab0c1145b 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -19,10 +19,10 @@ Please create an account on those platform and get an API Keys. ## Proxeus Demo Ethereum Smart Contract -For your convenience, a demo smart contract is deployed on the Ropsten network at the following address: +For your convenience, a demo smart contract is deployed on the Goerli network at the following address: ``` -0x1d3e5c81bf4bc60d41a8fbbb3d1bae6f03a75f71 +0x66FF4FBF80D4a3C85a54974446309a2858221689 ``` ## Create a docker-compose.yml file diff --git a/go.mod b/go.mod index c6cfdf27e..1b71b389f 100644 --- a/go.mod +++ b/go.mod @@ -33,9 +33,9 @@ require ( github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/xeipuuv/gojsonschema v1.2.0 // indirect go.etcd.io/bbolt v1.3.6 // indirect - go.mongodb.org/mongo-driver v1.9.0 - golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 - golang.org/x/net v0.0.0-20220607020251-c690dde0001d + go.mongodb.org/mongo-driver v1.11.1 + golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d + golang.org/x/net v0.4.0 gopkg.in/gavv/httpexpect.v2 v2.3.1 ) @@ -44,9 +44,11 @@ require ( github.com/dlclark/regexp2 v1.4.1-0.20220329233251-d0559a0de6e3 // indirect github.com/fasthttp/websocket v1.4.3-rc.10 // indirect github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect + github.com/go-bindata/go-bindata/v3 v3.1.3 // indirect github.com/go-stack/stack v1.8.1 // indirect github.com/gorilla/context v1.1.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect + github.com/kisielk/errcheck v1.6.2 // indirect github.com/klauspost/compress v1.15.1 // indirect github.com/labstack/echo v3.3.10+incompatible github.com/labstack/echo-contrib v0.12.0 @@ -60,10 +62,14 @@ require ( github.com/tklauser/go-sysconf v0.3.10 // indirect github.com/tyler-smith/go-bip39 v1.1.0 // indirect github.com/valyala/fasthttp v1.35.0 // indirect + github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad // indirect github.com/xdg-go/scram v1.1.1 // indirect github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect + github.com/yuin/goldmark v1.5.3 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect golang.org/x/image v0.0.0-20220413100746-70e8d0d3baa9 // indirect + golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect + golang.org/x/tools v0.4.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.0 // indirect ) diff --git a/go.sum b/go.sum index a0c40c34c..99228e506 100644 --- a/go.sum +++ b/go.sum @@ -153,6 +153,8 @@ github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= +github.com/go-bindata/go-bindata/v3 v3.1.3 h1:F0nVttLC3ws0ojc7p60veTurcOm//D4QBODNM7EGrCI= +github.com/go-bindata/go-bindata/v3 v3.1.3/go.mod h1:1/zrpXsLD8YDIbhZRqXzm1Ghc7NhEvIN9+Z6R5/xH4I= github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -299,6 +301,8 @@ github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/errcheck v1.6.2 h1:uGQ9xI8/pgc9iOoCe7kWQgRE6SBTrCGmTSf0LrEtY7c= +github.com/kisielk/errcheck v1.6.2/go.mod h1:nXw/i/MfnvRHqXa7XXmQMUB0oNFGuBrNI8d8NLy0LPw= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= @@ -365,6 +369,7 @@ github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8oh github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= +github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe h1:iruDEfMl2E6fbMZ9s0scYfZQ84/6SPL6zC8ACM2oIL0= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -509,6 +514,8 @@ github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7Fw github.com/vmihailenco/msgpack v4.0.1+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad h1:W0LEBv82YCGEtcmPA3uNZBI33/qF//HAAs3MawDjRa0= +github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad/go.mod h1:Hy8o65+MXnS6EwGElrSRjUzQDLXreJlzYLlWiHtt8hM= github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= @@ -543,6 +550,9 @@ github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yuin/goldmark v1.5.3 h1:3HUJmBFbQW9fhQOzMgseU134xfi6hU+mjWywx5Ty+/M= +github.com/yuin/goldmark v1.5.3/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.etcd.io/bbolt v1.3.0/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= @@ -550,6 +560,8 @@ go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= go.mongodb.org/mongo-driver v1.9.0 h1:f3aLGJvQmBl8d9S40IL+jEyBC6hfLPbJjv9t5hEM9ck= go.mongodb.org/mongo-driver v1.9.0/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY= +go.mongodb.org/mongo-driver v1.11.1 h1:QP0znIRTuL0jf1oBQoAoM0C6ZJfBK4kx0Uumtv1A7w8= +go.mongodb.org/mongo-driver v1.11.1/go.mod h1:s7p5vEtfbeR1gYi6pnj3c3/urpbLv2T5Sfd6Rp2HBB8= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -573,6 +585,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 h1:kUhD7nTDoI3fVd9G4ORWrbV5NY0liEs/Jg2pv5f+bBA= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d h1:sK3txAijHtOK88l68nt020reeT1ZdKLIYetKl95FzVY= +golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -598,6 +612,8 @@ golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -607,6 +623,10 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= +golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA= +golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -641,6 +661,10 @@ golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d h1:4SFsTMi4UahlKoloni7L4eYzhFRifURQLw+yv0QDCx8= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= +golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU= +golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -655,6 +679,9 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -708,9 +735,13 @@ golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -720,6 +751,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= +golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -753,10 +786,15 @@ golang.org/x/tools v0.0.0-20191126055441-b0650ceb63d9/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200108203644-89082a384178/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= +golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.4.0 h1:7mTAgkunk3fr4GAloyyCasadO6h9zSsQZbwvcaIciV4= +golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/main/config/configuration.go b/main/config/configuration.go index c95d7bc9e..ad6dd5194 100644 --- a/main/config/configuration.go +++ b/main/config/configuration.go @@ -20,14 +20,14 @@ const ProxeusEnvPrefix = "PROXEUS_" //2. Using the specified arguments in flag type Configuration struct { SettingsFile string `json:"settingsFile" default:"~/.proxeus/settings/main.json" usage:"Path to the settings file"` - EthClientURL string `json:"ethClientURL" default:"https://ropsten.infura.io/v3/" usage:"Ethereum client URL"` - EthWebSocketURL string `json:"ethWebSocketURL" default:"wss://ropsten.infura.io/ws/v3/" usage:"Ethereum websocket URL"` + EthClientURL string `json:"ethClientURL" default:"https://goerli.infura.io/v3/" usage:"Ethereum client URL"` + EthWebSocketURL string `json:"ethWebSocketURL" default:"wss://goerli.infura.io/ws/v3/" usage:"Ethereum websocket URL"` ServiceAddress string `json:"serviceAddress" default:":1323" usage:"address and port of this service"` AutoTLS bool `json:"autoTLS" default:"false" usage:"Automatically generate Let's Encrypt certificate (Server must be reachable on port 443 from public internet)."` - XESContractAddress string `json:"XESContractAddress" default:"0x84E0b37e8f5B4B86d5d299b0B0e33686405A3919"` + XESContractAddress string `json:"XESContractAddress" default:"0x15FeA089CC48B4f4596242c138156e3B53579B37"` AirdropWalletfile string `json:"airdropWalletfile" usage:"Path to File containing Private Key of the Wallet to fund Airdrops of XES and Ether."` AirdropWalletkey string `json:"airdropWalletkey" usage:"Path to File containing the Key for the Airdrop Private Key."` diff --git a/main/handlers/blockchain/airdrop.go b/main/handlers/blockchain/airdrop.go index f93390614..768308dcf 100644 --- a/main/handlers/blockchain/airdrop.go +++ b/main/handlers/blockchain/airdrop.go @@ -60,9 +60,9 @@ func GiveTokens(toWallet string) { FreeEth(toWallet) } -// FreeXES sends ropsten XES to given wallet address +// FreeXES sends testnet XES to given wallet address func FreeXES(walletAddress string) { - log.Println("[airdrop] [Ropsten] Prepare XES for addr:", walletAddress) + log.Println("[airdrop] [testnet] Prepare XES for addr:", walletAddress) amountFloat := new(big.Float) _, parsedF := amountFloat.SetString(config.Config.AirdropAmountXES) @@ -105,11 +105,11 @@ func FreeXES(walletAddress string) { if err != nil { log.Panic("[airdrop] Failed to request token transfer:", err) } - log.Println("[airdrop] [Ropsten] Sending XES with tx:", tx.Hash().String()) + log.Println("[airdrop] [testnet] Sending XES with tx:", tx.Hash().String()) } func FreeEth(walletAddress string) { - log.Println("[airdrop] [Ropsten] Prepare ETH for addr:", walletAddress) + log.Println("[airdrop] [testnet] Prepare ETH for addr:", walletAddress) amountFloat := new(big.Float) _, parsedF := amountFloat.SetString(config.Config.AirdropAmountEther) @@ -149,7 +149,7 @@ func FreeEth(walletAddress string) { nonce := nonceManager.NextNonce() tx := types.NewTransaction(nonce.Uint64(), common.HexToAddress(walletAddress), amountInt, gasLimit, gasPrice, nil) - // chainid 3 = ropsten, see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md#list-of-chain-ids + // chainid 5 = goerli, see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md#list-of-chain-ids signedTx, err := types.SignTx(tx, types.NewEIP155Signer(big.NewInt(3)), unlockedKey.PrivateKey) if err != nil { log.Panic("[airdrop] Failed to sign transaction:", err) @@ -161,5 +161,5 @@ func FreeEth(walletAddress string) { log.Panic("[airdrop] Failed to send transaction:", err) } - log.Println("[airdrop] [Ropsten] Sending ETH with tx:", signedTx.Hash().String()) + log.Println("[airdrop] [testnet] Sending ETH with tx:", signedTx.Hash().String()) } diff --git a/service/authentication.go b/service/authentication.go index 7863d1197..5357ac5bf 100644 --- a/service/authentication.go +++ b/service/authentication.go @@ -90,7 +90,7 @@ func (me *defaultAuthenticationService) LoginWithWallet(challenge, signature str usr, err = me.userService.GetByBCAddress(address) if err == nil { me.workflowService.CopyWorkflows(rootRole, usr) - if stngs.BlockchainNet == "ropsten" && stngs.AirdropEnabled == "true" { + if stngs.BlockchainNet == "goerli" && stngs.AirdropEnabled == "true" { go func() { defer func() { if r := recover(); r != nil { diff --git a/sys/model/settings.go b/sys/model/settings.go index 7b651b85c..1a49107e0 100644 --- a/sys/model/settings.go +++ b/sys/model/settings.go @@ -9,14 +9,14 @@ type Settings struct { DefaultRole string `json:"defaultRole" default:"creator" usage:"Default role that is going to be used for new registrations. Value is case insensitive."` SessionExpiry string `json:"sessionExpiry" validate:"required=true" default:"1h" usage:"Session expiry like 1h as one hour, 1m as one minute or 1s as one second."` CacheExpiry string `json:"cacheExpiry" validate:"required=true" default:"24h" usage:"Common cache expiry which will be used for email tokens or similar."` - BlockchainNet string `json:"blockchainNet" validate:"required=true" default:"ropsten" usage:"Ethereum blockchain net like mainnet or ropsten."` + BlockchainNet string `json:"blockchainNet" validate:"required=true" default:"goerli" usage:"Ethereum blockchain net like mainnet or goerli."` InfuraApiKey string `json:"infuraApiKey" validate:"required=true" usage:"API Key to access Infura node."` BlockchainContractAddress string `json:"blockchainContractAddress" validate:"required=true" default:"" usage:"Ethereum contract address which will be used to register files and verify them."` SparkpostApiKey string `json:"sparkpostApiKey" validate:"required=true" usage:"Sparkpost API key which will be used to send out emails."` EmailFrom string `json:"emailFrom" validate:"required=true,email=true" usage:"Email that is being used to send out emails."` LogPath string `json:"logPath" default:"./log" usage:"Location of the log file of this service."` DefaultWorkflowIds string `json:"defaultWorkflowIds" usage:"Workflow IDs to set to clone and add to a new user"` - AirdropEnabled string `json:"airdropEnabled" validate:"required=true" default:"false" usage:"Enables/Disables the XES & Ether airdrop feature on ropsten."` + AirdropEnabled string `json:"airdropEnabled" validate:"required=true" default:"false" usage:"Enables/Disables the XES & Ether airdrop feature."` AirdropAmountXES string `json:"airdropAmountXES" default:"0" usage:"Amount of XES to airdrop to newly registered users."` AirdropAmountEther string `json:"airdropAmountEther" default:"0" usage:"Amount of Ether to airdrop to newly registered users."` DatabaseEngine string `json:"databaseEngine" default:"storm" usage:"Selects database engine, supported values: storm, mongo."` diff --git a/sys/system.go b/sys/system.go index 5999227b0..392c80e0b 100644 --- a/sys/system.go +++ b/sys/system.go @@ -95,14 +95,22 @@ func (me *System) init(stngs *model.Settings) error { } me.settingsInUse.SparkpostApiKey = stngs.SparkpostApiKey - if stngs.BlockchainNet == "ropsten" { - cfg.Config.XESContractAddress = "0x84E0b37e8f5B4B86d5d299b0B0e33686405A3919" - cfg.Config.EthClientURL = "https://ropsten.infura.io/v3/" + stngs.InfuraApiKey - cfg.Config.EthWebSocketURL = "wss://ropsten.infura.io/ws/v3/" + stngs.InfuraApiKey + if stngs.BlockchainNet == "goerli" { + cfg.Config.XESContractAddress = "0x15FeA089CC48B4f4596242c138156e3B53579B37" + cfg.Config.EthClientURL = "https://goerli.infura.io/v3/" + stngs.InfuraApiKey + cfg.Config.EthWebSocketURL = "wss://goerli.infura.io/ws/v3/" + stngs.InfuraApiKey } else if stngs.BlockchainNet == "mainnet" { cfg.Config.XESContractAddress = "0xa017ac5fac5941f95010b12570b812c974469c2c" cfg.Config.EthClientURL = "https://mainnet.infura.io/v3/" + stngs.InfuraApiKey cfg.Config.EthWebSocketURL = "wss://mainnet.infura.io/ws/v3/" + stngs.InfuraApiKey + } else if stngs.BlockchainNet == "polygon-mumbai" { + cfg.Config.XESContractAddress = "0xf94BdC648A30719fF0cf91B436f9819F7804e1a0" + cfg.Config.EthClientURL = "https://polygon-mumbai.infura.io/v3/" + stngs.InfuraApiKey + cfg.Config.EthWebSocketURL = "wss://polygon-mumbai.infura.io/ws/v3/" + stngs.InfuraApiKey + } else if stngs.BlockchainNet == "polygon-mainnet" { + // cfg.Config.XESContractAddress = "0xa017ac5fac5941f95010b12570b812c974469c2c" + // cfg.Config.EthClientURL = "https://polygon-mainnet.infura.io/v3/" + stngs.InfuraApiKey + // cfg.Config.EthWebSocketURL = "wss://polygon-mainnet.infura.io/ws/v3/" + stngs.InfuraApiKey } else { log.Println("Wrong blockchain network: ", stngs.BlockchainNet) } diff --git a/ui/core/.env b/ui/core/.env index 0c04fd33e..8d6e1cee6 100644 --- a/ui/core/.env +++ b/ui/core/.env @@ -1,2 +1,2 @@ # Check for how to use other environment: https://cli.vuejs.org/guide/mode-and-env.html#using-env-variables-in-client-side-code -VUE_APP_BLOCKCHAIN_NET=ropsten \ No newline at end of file +VUE_APP_BLOCKCHAIN_NET=goerli diff --git a/ui/core/src/baseApp.js b/ui/core/src/baseApp.js index 95ffcf1c7..93edb21d3 100644 --- a/ui/core/src/baseApp.js +++ b/ui/core/src/baseApp.js @@ -6,7 +6,7 @@ export default { me: null, meta: null, translations: null, - blockchainNet: 'ropsten', + blockchainNet: 'goerli', blockchainProxeusFSAddress: '', roles: [], uiBlocked: false, diff --git a/ui/core/src/components/document/VerificationFileEntry.vue b/ui/core/src/components/document/VerificationFileEntry.vue index d0dbc2a15..bd1951044 100644 --- a/ui/core/src/components/document/VerificationFileEntry.vue +++ b/ui/core/src/components/document/VerificationFileEntry.vue @@ -214,7 +214,7 @@ export default { isFileInvalidated: undefined, tx: undefined, hash: undefined, - network: process.env.VUE_APP_BLOCKCHAIN_NET === 'ropsten' ? 'ropsten.' : '', + network: process.env.VUE_APP_BLOCKCHAIN_NET === 'goerli' ? 'goerli.' : '', timestamp: undefined, creator: undefined, signatures: [], diff --git a/ui/core/src/views/appDependentComponents/SettingsInner.vue b/ui/core/src/views/appDependentComponents/SettingsInner.vue index 5a31fe055..16df7ba79 100644 --- a/ui/core/src/views/appDependentComponents/SettingsInner.vue +++ b/ui/core/src/views/appDependentComponents/SettingsInner.vue @@ -66,7 +66,7 @@ - {{$t('Blockchain net explanation','Set the ethereum blockchain net like mainnet or ropsten.')}} + {{$t('Blockchain net explanation','Set the ethereum blockchain net like mainnet or goerli.')}} @@ -81,7 +81,7 @@ - {{$t('Airdrop Enable Explanation','Enables/Disables the XES & Ether airdrop feature for new users on ropsten. The Amount and Wallet to be used is configured in the platform configuration.')}} + {{$t('Airdrop Enable Explanation','Enables/Disables the XES & Ether airdrop feature for new users on testnet (goerli, mumbai). The Amount and Wallet to be used is configured in the platform configuration.')}} @@ -281,7 +281,7 @@ export default { results: null, airdropoptions: [ { - label: 'Airdrop enabled on Ropsten', + label: 'Airdrop enabled on Testnet (goerli or mumbai)', value: 'true' }, { diff --git a/ui/wallet/src/ProxeusEthereum/WalletInterface.js b/ui/wallet/src/ProxeusEthereum/WalletInterface.js index cd33a03de..af871847e 100644 --- a/ui/wallet/src/ProxeusEthereum/WalletInterface.js +++ b/ui/wallet/src/ProxeusEthereum/WalletInterface.js @@ -14,7 +14,7 @@ import getTransactionReceiptMined from './helpers/getTransactionReceiptMined' class WalletInterface { // TODO improve checking that current network matches what is expected // TODO: network param only for compatibility reasons with blockchain/dapp - constructor (network = 'ropsten', proxeusFSAddress, forceProxeusWallet = false) { + constructor (network = 'goerli', proxeusFSAddress, forceProxeusWallet = false) { this.useProxeusWallet = forceProxeusWallet || typeof window.ethereum === 'undefined' // make sure we are using the web3 we want and not the one provided by metamask @@ -367,8 +367,19 @@ class WalletInterface { * @return string */ async getClientProvidedNetwork () { - const netId = await this.web3.eth.net.getNetworkType() - return netId || 'mainnet' + const netId = await this.web3.eth.getChainId() + switch (netId) { + case 5: + return 'goerli' + case 11155111: + return 'sepolia' + case 137: + return 'polygon-mainnet' + case 80001: + return 'polygon-mumbai' + default: + return 'mainnet' + } } async XESAmountPerFile ({ providers }) { diff --git a/ui/wallet/src/ProxeusEthereum/config/service-config.js b/ui/wallet/src/ProxeusEthereum/config/service-config.js index ea21ac679..653837d81 100644 --- a/ui/wallet/src/ProxeusEthereum/config/service-config.js +++ b/ui/wallet/src/ProxeusEthereum/config/service-config.js @@ -1,10 +1,18 @@ const serviceConfig = { - ropsten: { + goerli: { DEFAULT_GAS_REGULAR: 1000000, DEFAULT_GAS_CREATE: 4000000, - // ropsten - XES_TOKEN_ADDRESS: '0x84E0b37e8f5B4B86d5d299b0B0e33686405A3919', - PROXEUS_FS_ADDRESS: '0x1d3e5c81bf4bc60d41a8fbbb3d1bae6f03a75f71', // Eternal Storage at: 0x7b83acb323fd4bbd874c1e9c295e0f486d94b233 + XES_TOKEN_ADDRESS: '0x15FeA089CC48B4f4596242c138156e3B53579B37', + PROXEUS_FS_ADDRESS: '0x66FF4FBF80D4a3C85a54974446309a2858221689', + // When the PROXEUS_FS_ADDRESS changes add the old address to the list below so that file validation check also past contracts + PROXEUS_FS_PAST_ADDRESSES: [ + ] + }, + 'polygon-mumbai': { + DEFAULT_GAS_REGULAR: 1000000, + DEFAULT_GAS_CREATE: 4000000, + XES_TOKEN_ADDRESS: '0xf94BdC648A30719fF0cf91B436f9819F7804e1a0', + PROXEUS_FS_ADDRESS: '0x00119d8C02bbC4c1231D054BB2813792B4411Ed5', // When the PROXEUS_FS_ADDRESS changes add the old address to the list below so that file validation check also past contracts PROXEUS_FS_PAST_ADDRESSES: [ ] @@ -17,6 +25,15 @@ const serviceConfig = { // When the PROXEUS_FS_ADDRESS changes add the old address to the list below so that file validation check also past contracts PROXEUS_FS_PAST_ADDRESSES: [ ] + }, + ropsten: { + DEFAULT_GAS_REGULAR: 1000000, + DEFAULT_GAS_CREATE: 4000000, + XES_TOKEN_ADDRESS: '0x84E0b37e8f5B4B86d5d299b0B0e33686405A3919', + PROXEUS_FS_ADDRESS: '0x1d3e5c81bf4bc60d41a8fbbb3d1bae6f03a75f71', // Eternal Storage at: 0x7b83acb323fd4bbd874c1e9c295e0f486d94b233 + // When the PROXEUS_FS_ADDRESS changes add the old address to the list below so that file validation check also past contracts + PROXEUS_FS_PAST_ADDRESSES: [ + ] } } From 5dccd273bf7b080cc3c22d4a9ef648952e9d2a89 Mon Sep 17 00:00:00 2001 From: Afonina Tatiana <99973342+tafonina@users.noreply.github.com> Date: Fri, 16 Dec 2022 18:21:01 +0200 Subject: [PATCH 2/5] update readme with chains list --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index af35baa16..15840de33 100644 --- a/README.md +++ b/README.md @@ -69,3 +69,9 @@ Licensed under the GNU GENERAL PUBLIC LICENSE. You may read a copy of the [Licen ## Acknowledgements Like so many projects, this effort has roots in many places. The list can be found in [ACKNOWLEDGEMENTS](ACKNOWLEDGEMENTS). + +## Supported Chains + +- goerli +- mainnet +- polygon-mumbai From c82051f5167454c44dbe8de2d3964f69007c7d1b Mon Sep 17 00:00:00 2001 From: Afonina Tatiana <99973342+tafonina@users.noreply.github.com> Date: Fri, 16 Dec 2022 18:27:37 +0200 Subject: [PATCH 3/5] test negative scenario --- .../ProxeusEthereum/config/service-config.js | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/ui/wallet/src/ProxeusEthereum/config/service-config.js b/ui/wallet/src/ProxeusEthereum/config/service-config.js index 653837d81..2c20bec2f 100644 --- a/ui/wallet/src/ProxeusEthereum/config/service-config.js +++ b/ui/wallet/src/ProxeusEthereum/config/service-config.js @@ -1,22 +1,4 @@ const serviceConfig = { - goerli: { - DEFAULT_GAS_REGULAR: 1000000, - DEFAULT_GAS_CREATE: 4000000, - XES_TOKEN_ADDRESS: '0x15FeA089CC48B4f4596242c138156e3B53579B37', - PROXEUS_FS_ADDRESS: '0x66FF4FBF80D4a3C85a54974446309a2858221689', - // When the PROXEUS_FS_ADDRESS changes add the old address to the list below so that file validation check also past contracts - PROXEUS_FS_PAST_ADDRESSES: [ - ] - }, - 'polygon-mumbai': { - DEFAULT_GAS_REGULAR: 1000000, - DEFAULT_GAS_CREATE: 4000000, - XES_TOKEN_ADDRESS: '0xf94BdC648A30719fF0cf91B436f9819F7804e1a0', - PROXEUS_FS_ADDRESS: '0x00119d8C02bbC4c1231D054BB2813792B4411Ed5', - // When the PROXEUS_FS_ADDRESS changes add the old address to the list below so that file validation check also past contracts - PROXEUS_FS_PAST_ADDRESSES: [ - ] - }, main: { DEFAULT_GAS_REGULAR: 1000000, DEFAULT_GAS_CREATE: 4000000, From 1f20476d02edfc4d40868e38d22e0cf1fa5dfd71 Mon Sep 17 00:00:00 2001 From: Afonina Tatiana <99973342+tafonina@users.noreply.github.com> Date: Fri, 16 Dec 2022 18:42:42 +0200 Subject: [PATCH 4/5] return goerli cobfig --- .../ProxeusEthereum/config/service-config.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ui/wallet/src/ProxeusEthereum/config/service-config.js b/ui/wallet/src/ProxeusEthereum/config/service-config.js index 2c20bec2f..653837d81 100644 --- a/ui/wallet/src/ProxeusEthereum/config/service-config.js +++ b/ui/wallet/src/ProxeusEthereum/config/service-config.js @@ -1,4 +1,22 @@ const serviceConfig = { + goerli: { + DEFAULT_GAS_REGULAR: 1000000, + DEFAULT_GAS_CREATE: 4000000, + XES_TOKEN_ADDRESS: '0x15FeA089CC48B4f4596242c138156e3B53579B37', + PROXEUS_FS_ADDRESS: '0x66FF4FBF80D4a3C85a54974446309a2858221689', + // When the PROXEUS_FS_ADDRESS changes add the old address to the list below so that file validation check also past contracts + PROXEUS_FS_PAST_ADDRESSES: [ + ] + }, + 'polygon-mumbai': { + DEFAULT_GAS_REGULAR: 1000000, + DEFAULT_GAS_CREATE: 4000000, + XES_TOKEN_ADDRESS: '0xf94BdC648A30719fF0cf91B436f9819F7804e1a0', + PROXEUS_FS_ADDRESS: '0x00119d8C02bbC4c1231D054BB2813792B4411Ed5', + // When the PROXEUS_FS_ADDRESS changes add the old address to the list below so that file validation check also past contracts + PROXEUS_FS_PAST_ADDRESSES: [ + ] + }, main: { DEFAULT_GAS_REGULAR: 1000000, DEFAULT_GAS_CREATE: 4000000, From 3f3d883e110def498cc7e133025ff233dbf32151 Mon Sep 17 00:00:00 2001 From: Afonina Tatiana <99973342+tafonina@users.noreply.github.com> Date: Mon, 19 Dec 2022 12:47:56 +0200 Subject: [PATCH 5/5] remove console metamask error (#286) should fix #285 --- ui/core/src/baseApp.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/ui/core/src/baseApp.js b/ui/core/src/baseApp.js index 93edb21d3..190e55b70 100644 --- a/ui/core/src/baseApp.js +++ b/ui/core/src/baseApp.js @@ -409,14 +409,12 @@ export default { this.loadMe() // when accounts loaded register accountsChanged handler and reload page if user changes the account - web3.eth.getAccounts(() => { - window.ethereum.on('accountsChanged', function () { - window.location.reload() - }) - window.ethereum.on('chainChanged', function (e) { - console.log('Chain changed') - window.location.reload() - }) + window.ethereum.on('accountsChanged', function () { + window.location.reload() + }) + window.ethereum.on('chainChanged', function (e) { + console.log('Chain changed') + window.location.reload() }) } }