Uniswap-TypeError:无法读取未定义的属性'sortsBefore'

问题描述

我们正在构建ERC20令牌,并计划将其部署在Uniswap上。

当前,我们希望在Uniswap上获得转换率,但遇到此错误

Reseller="cpusernameInputField"; declare -A myAssociativeArray ; echo "==========================================" | tee -a ${Reseller}_disk_breakdown.txt ; echo "Reseller ${Reseller}'s disk usage by account"| tee -a ${Reseller}_disk_breakdown.txt; for acct in $(sudo grep ${Reseller} /etc/trueuserowners | cut -d: -f1); do disk_usage=0; disk_usage=$(du -s /home/${acct} | grep -oE '[[:digit:]]+');  echo "$acct: $(echo $disk_usage | tail -1 | awk {'print $1'} | awk '{ total = $1 / 1024/1024 ; printf("%.2fGB\n",total) }')" | tee -a ${Reseller}_disk_breakdown.txt ; myAssociativeArray[${acct}]=${disk_usage}; done ; total=$(IFS=+; echo "$((${myAssociativeArray[*]}))"); echo "Total disk usage: $(echo $total | tail -1 | awk {'print $1'} | awk '{ total = $1 / 1024/1024 ; printf("%.2fGB\n",total) }')" | tee -a ${Reseller}_disk_breakdown.txt; unset total; unset disk_usage;echo "==========================================" | tee -a ${Reseller}_disk_breakdown.txt ; echo "Sorted by top users" | tee -a ${Reseller}_disk_breakdown.txt; for key in "${!myAssociativeArray[@]}"; do printf '%s:%s\n' "$key" "${myAssociativeArray[$key]}"; done | sort -t : -k 2rn | tee -a ${Reseller}_disk_breakdown.txt;echo "==========================================" | tee -a ${Reseller}_disk_breakdown.txt ;for key in "${!myAssociativeArray[@]}"; do USER_HOME=$(eval echo ~${key}); echo "disk breakdown for $key" | tee -a ${Reseller}_disk_breakdown.txt ; sudo du -h ${USER_HOME} --exclude=/app --exclude=/home/virtfs| grep ^[0-9.]*[G,M]  | sort -rh|head -n20 | tee -a ${Reseller}_disk_breakdown.txt;echo "=======================================" | tee -a ${Reseller}_disk_breakdown.txt; done

这是代码

TypeError: Cannot read property 'sortsBefore' of undefined

UNI到ETH正常运行,但我们的ERC20令牌无效。

require('rootpath')();

const {ChainId,Token,WETH,Fetcher,Route,Pair} = require('@uniswap/sdk');
const {Config} = require('config');
const Web3 = require('web3');

module.exports = class UniswapManager {

    // Docs: https://uniswap.org/docs/v2/javascript-SDK/pricing/
    static async getPrice() {
        const network = ChainId.RINKEBY;

        const HelloWorldContract = Web3.utils.tochecksumAddress(Config.Contract.token()); 
        const HWD = new Token(network,HelloWorldContract,18);   
        const pair = new Pair(HWD,WETH[network]); > Error here
        const route = new Route([pair],WETH[network]); 

        // Logging only
        return  'HWD/ETH: ' + route.midPrice.toSignificant(6) + '\n' +
                'ETH/HWD: ' + route.midPrice.invert().toSignificant(6);
    }

}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...