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;