Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Make inner fields private for our contracts #447

Open
1 task done
qalisander opened this issue Dec 11, 2024 · 0 comments
Open
1 task done

[Feature]: Make inner fields private for our contracts #447

qalisander opened this issue Dec 11, 2024 · 0 comments
Assignees
Labels
effort: low Easy or tiny task that takes less than a day. good first issue Good for newcomers. priority: 0 Nice-to-have. Willing to ship without this. type: ref A code update that doesn't meaningfully change functionality.

Comments

@qalisander
Copy link
Member

What is the feature you would like to see?

Currently our contracts expose inner fields as publicly accessible and looks like that:

/// State of an [`Erc721`] token.
#[storage]
pub struct Erc721 {
    /// Maps tokens to owners.
    pub _owners: StorageMap<U256, StorageAddress>,
    /// Maps users to balances.
    pub _balances: StorageMap<Address, StorageU256>,
    /// Maps tokens to approvals.
    pub _token_approvals: StorageMap<U256, StorageAddress>,
    /// Maps owners to a mapping of operator approvals.
    pub _operator_approvals:
        StorageMap<Address, StorageMap<Address, StorageBool>>,
}

Since some of our extensions and example consumers depends on pub availability of inner fields.
We should refactor some tests and examples, to make fields private.
e.g. add pub accessor method should be more preferable, then have a publicly available field.

Contribution Guidelines

  • I agree to follow this project's Contribution Guidelines
@qalisander qalisander added type: feature New feature request. needs triage Needs to be assigned the appropriate labels labels Dec 11, 2024
@qalisander qalisander changed the title [Feature]: Make all inner fields private for our contracts [Feature]: Make inner fields private for our contracts Dec 11, 2024
@0xNeshi 0xNeshi mentioned this issue Dec 19, 2024
3 tasks
@bidzyyys bidzyyys added this to the Release v0.2.0 milestone Jan 8, 2025
@0xNeshi 0xNeshi self-assigned this Jan 16, 2025
@0xNeshi 0xNeshi added priority: 0 Nice-to-have. Willing to ship without this. good first issue Good for newcomers. effort: low Easy or tiny task that takes less than a day. type: ref A code update that doesn't meaningfully change functionality. and removed type: feature New feature request. needs triage Needs to be assigned the appropriate labels labels Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: low Easy or tiny task that takes less than a day. good first issue Good for newcomers. priority: 0 Nice-to-have. Willing to ship without this. type: ref A code update that doesn't meaningfully change functionality.
Projects
Status: Todo
Development

No branches or pull requests

3 participants