Open Siegrift opened 3 years ago
The update is costly and we should avoid it if possible.
Server-side web3 was updated in https://github.com/district0x/name-bazaar/pull/175. For ui-side upgrade, work would first need to be done outside of the namebazaar project, in https://github.com/district0x/cljs-web3-next and in the numerous district-ui-*
libraries.
This is gonna be a longer description of this error which can be seen in current version of the project, which I thought required an update of web3. I tried updating web3, but ran into many issues and the whole process of updating web3 will be challenging. This is just a sneak peak of changes that we need to do.
Original error
The error in the devtools looks like this: (The error is intended. We try to resolve a name from an address using
PublicResolver
. https://docs.ens.domains/dapp-developer-guide/resolving-names#reverse-resolution. Not sure if this should error out, but even if no, this error is handled in the app)This error lead me to following chain of resources:
0.19.0
, which is what we use. Fortunately, we don't need to update yet, but we might run into another issue and the update will be necessary.Current state
As mentioned, we use web3 version
0.19.0
and it's a dependency of the following libraries:cljs-web3
)cljs-web3
)cljs-web3
) You can verify this by running:lein deps :tree
. This will include[cljsjs/web3 "0.19.0-0"]
(https://clojars.org/cljsjs/web3).Updating to newer web3
Some of the libraries we use have changed significantly and stopped using
cljs-web3
in favor ofcljs-web3-next
, which uses web3 version1.2.0
.When I tried updating
district0x/district-server-web3
to latest version another error indistrict0x/district-server-smart-contracts
I found a small issue (https://github.com/district0x/district-server-web3/pull/10), which can be fixed in our codebase by providing:host
explicitly in our config.The problem is that updating this dependency, causes an error in
district-server-smart-contracts
, which is probably because it should beweb3.eth.Contract
instead ofweb3.eth.contract
. The full stack trace is:However
district0x/district-server-smart-contracts
has many breaking changes (see e.g. PR for updating to version1.1.0
https://github.com/district0x/district-server-smart-contracts/commit/f3350f3c378b5432226a35afbfebc7266745b96b), most of the functions we use in Namebazaar have been removed and others refactored. This library is used for deploying smart contracts in dev mode and tests as well as call insyncer.cljs
.