TodoList
contract TodoList
One way to create a "trello" like application would require creating more modifiers and perhaps role based access control., Stores a todolist on solidity, since an array of structs cannot easily be returned the structs must be decomposed on the front-end.
Source: TodoList.sol
Reference
Modifiers
onlyOwner
modifier onlyOwner(address _owner)
- Parameters:
_owner
- address
Functions
addTodo
function addTodo(bytes32 _content) public
Add a todo to the list, updates mappings todos and lastIds.
- Parameters:
_content
- bytes32 todo item, this must be short
markTodoAsCompleted
function markTodoAsCompleted(uint256 _todoId) public
Only the todo item owner can mark the todo as complete, Mark a todo as completed.
- Modifiers:
- onlyOwner
- Parameters:
_todoId
- todo item owned by only to mark as complete
returnAllTodos
function returnAllTodos(uint[] indexes) external view returns (uint256[], bytes32[], address[], bool[], uint256[])
Consider renamng this function to returnTodos.
- Parameters:
indexes
- array of uints corresponding to the number of todos- Returns:
- decomposed arrays that mirror the struct.