You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The === is an explicit check that checks the data, as well as the datatype. But the letter 'a' is not equal to 'A'. If we uppercase all letters, then this issue is fixed.
The reason for this is that when you receive token0 and token1, the WBNB address contains letters that are uppercased and lowercased while adresses.WBNB contains all lowercase letters.
Hope this helps other devs out.
The text was updated successfully, but these errors were encountered:
SyntaxError: Unexpected token '{'
←[90m at wrapSafe (internal/modules/cjs/loader.js:979:16)←[39m
←[90m at Module._compile (internal/modules/cjs/loader.js:1027:27)←[39m
←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)←[39m
←[90m at Module.load (internal/modules/cjs/loader.js:928:32)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:769:14)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)←[39m
←[90m at internal/main/run_main_module.js:17:47←[39m
Bot.js does not executes transactions because of a simple check should be changed in the factory.on() body.
The factory returns token0 and token1 and the WBNB address contains uppercased letters which are different as hardcoded in the adresses.WBNB.
in Bot.js in the body of factory.on() there is a check:
if(token0 === addresses.WBNB)...
if(token1 === addresses.WBNB)...
should be:
if(token0.toUpperCase() === addresses.WBNB.toUpperCase())...
if(token1.toUpperCase() === addresses.WBNB.toUpperCase())...
The === is an explicit check that checks the data, as well as the datatype. But the letter 'a' is not equal to 'A'. If we uppercase all letters, then this issue is fixed.
The reason for this is that when you receive token0 and token1, the WBNB address contains letters that are uppercased and lowercased while adresses.WBNB contains all lowercase letters.
Hope this helps other devs out.
The text was updated successfully, but these errors were encountered: