6

如何使用golang比较token地址大小. | 登链社区 | 技术问答

 2 years ago
source link: https://learnblockchain.cn/question/2972
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

5 如何使用golang比较token地址大小.

tokenA 地址'0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56', tokenB 地址'0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c'
如何使用golang来比较2个地址的大小呢,谢谢.

最佳答案 2天前

找到答案了.
wbnb := "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"
usdt := "0x55d398326f99059fF775485246999027B3197955"

bn_bnb, _ := big.NewInt(**0**).SetString(wbnb, **0**)
bn_usdt, _ := big.NewInt(**0**).SetString(usdt, **0**)
`bn_bnb.Cmp(bn_usdt)`
采纳率 100% | 回答于 2天前

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK