【发布时间】:2019-11-19 07:21:45
【问题描述】:
我想知道分配给以太坊 Solidity 语言变量的值。
在JavaScript中,即使我不知道它是什么类型的变量,我也可以使用console.log来输出变量的值。
例如)
....
.........
var l = Math.ceil(8 * n.length / (Math.log(t.length) / Math.log(2))),
console.log(I);
c = Array(l);
console.log(c); // This can be very useful when I want to know what value is outputting, such as using console.table
..........
....
您可能知道,在分析和调试代码时,这些方法通常很有用。
我应该如何在“solidity”中实现这种方法,如console.log?
例如)
...
......
wonder = uint(keccak256(abi.encodePacked(now, msg.sender, Rnd_entropy_2))) % Ana;
// There are three variables in this line: "Ana, Rnd_entropy_2, wonder". I want to know what value assigned to each variable has and what they are output.
// In JavaScript, Can easily be found console.log (Ana, Rnd_entropy_2, wonder). What should I do?
....
........
没有更简单的方法可以到达那里吗?我很高兴听到您对此事的看法。
【问题讨论】:
标签: javascript ethereum solidity