pragma solidity ^0.4.26;
contract Bytes32ToString{
bytes2 name=0x7a68;
function changeIt() returns(string){
// return string(name);
}
function bytes32Tostring(bytes32 _newname) view returns(string){
bytes memory newname = new bytes(_newname.length);
for(uint i = 0;i<_newname.length;i++){
newname[i] = _newname[i];
}
return string(newname);
}
}
https://www.bilibili.com/video/BV1St411a7Pk?t=41&p=16
我的这个和教程上是一样的,教程 bytes32Tostring 是起作用的,
我的一直在报这个错,不明白这个报错是表达什么意思,求教
call to Bytes32ToString.bytes32Tostring errored: Error encoding arguments: Error: incorrect data length (argument=null, value="0x7a68", code=INVALID_ARGUMENT, version=abi/5.0.7)