Todo[] public todos;
...
function updateTODO(uint _id, bool _state) public onlyMine(_id) {
// 指定の id の TODO をアップデートする
// アップデートは完了・非完了のみ
Todo[_id].state = _state;
}
Compiling your contracts...
===========================
> Compiling ./contracts/Migrations.sol
> Compiling ./contracts/todo.sol
TypeError: Integer constant expected.
--> project:/contracts/todo.sol:63:10:
|
63 | Todo[_id].state = _state;
| ^^^
compile err になるなぜ。
function updateTODO(uint _id, bool _state) public onlyMine(_id) {
// 指定の id の TODO をアップデートする
// アップデートは完了・非完了のみ
- Todo[_id].state = _state;
+ todos[_id].state = _state;
}
こうだった。todos
が変数じゃん・・・凡ミス
というかエラーメッセージがひどすぎる・・・。