`struct Field`
Open
breaking
enhancement
rust
- Dominant language
- TypeScript
- Stars
- 53
- Forks
- 15
- PR merge metrics
- No merged PRs in 30d
Description
Making this the tracking issue for `struct Field`, an atomic storage field that knows its own address and memoizes its value.
Pseudo-example:
```rs
#[contract]
struct Contract {
admin: Field
}
impl Contract {
fn new (storage: Storage) -> Self {
Self { admin: Field::new(storage, KEY_ADMIN_ADDR) }
}
fn assert_admin (&self, env: Env) -> StdResult<()> {
if self.admin.get() != env.message.sender {
return Err(StdError::unauthorized())
}
Ok(())
}
}
```
I'd like to avoid having a `.get()` method, so `Field` should implement `Deref`/`DerefMut`
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.