我使用的是加纳奇网络,松露网络,web3,chai和mocha。
在终端使用松露控制台时,可以看到:松露(开发)>平衡
BN {
negative: 0,
words: [ 16777216, 62077800, 20718012, <1 empty item> ],
length: 4,
red: null }我想要的是
你能帮帮我吗?我刚进入这个领域,可以随便问一下我错过的任何事情
require('babel-register');
require('babel-polyfill');
module.exports = {
networks:{
development: {
host: '127.0.0.1',
port: '7545',
network_id: '*'
},
},
contracts_directory: './src/centracts',
contracts_build_directory: './src/truffle_abis',
compilers: {
solc: {
version: '^0.5.0',
optimizer: {
enabled: true,
runs: 200
},
}
}}Tether.sol:


发布于 2021-11-20 06:33:41
问题是javascript不支持solidity所需的大量数据,因此web3将它们封装在BN对象中。您可以使用.toString()使其更易读懂。
例如:
truffle(develompment)> balance.toString()https://ethereum.stackexchange.com/questions/113558
复制相似问题