【发布时间】:2018-08-05 02:51:24
【问题描述】:
问题: Remix 产生奇怪的行为,字符串参数后跟数组参数
转载:
contract ItemMarket is ERC721 {
struct Item {
string name;
uint[3] others;
}
Item[] public items;
function createItem(string _name, uint[6] _others) public {
uint tokenId = items.push(Item({name: _name, traits:_traits})) - 1;
}
}
当您调用带有参数"hello", [1,2,3] 的remix 中的createItem() 时,第一个参数将转换为\u0000。通过 MEW 与合约交互时,具有相同参数的相同函数调用可以正常工作
【问题讨论】:
-
这是 Remix 中的一个错误:github.com/ethereum/remix/issues/591