Yes, as you're saying, it should simply be a single table with a single row that contains your data as a struct with the 3 fields.
You would need to define your struct and table as something like this:
//@abi table state i64
struct state {
string field1;
string field2;
uint64_t field3;
// Set the primary key to a constant value to store only one row
uint64_t primary_key() const { return 0; }
};
And then you can use it inside an action like this:
state_table s_table(_self, _self);
// Write to the state for the first time
s_table.emplace(_self, [&](state& row) {
row.field1 = "something";
row.field2 = "something else";
row.field3 = 1234;
});
// Update the state
s_table.modify(state_table.begin(), 0, [&](state& row) {
row.field1 = "something new";
row.field2 = "some other thing";
row.field3 = 12345;
});
// Read from the state
state saved_state = s_table.get(0, "Error message for when state is not set yet");