TypeError: Invalid type for argument in function call. Invalid implicit conversion from string memory to bytes memory requested. This function requires a single bytes argument. Use abi.encodePacked(...) to obtain the pre-0.5.0 behaviour or abi.encode(...) to use ABI encoding.
if (keccak256(_species) == keccak256("kitty"))
这是版本不兼容问题,解决方法:if (keccak256(_species) == keccak256("kitty"))改为:if (keccak256(abi.encode(_species)) == keccak256("kitty"))
Wrong argument count for function call: 3 arguments given but expected 1. This function requires a single bytes argument. Use abi.encodePacked(...) to obtain the pre-0.5.0 behaviour or abi.encode(...) to use ABI encoding.
return uint(keccak256(now, msg.sender, randNonce)) % _modulus; ^-----------------------------------^
同理改为:return uint(keccak256(abi.encode(now, msg.sender, randNonce))) % _modulus;