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

Handle agreement replacement #7

Open
spengrah opened this issue Sep 10, 2024 · 0 comments
Open

Handle agreement replacement #7

spengrah opened this issue Sep 10, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@spengrah
Copy link
Member

As of v0.2.0, if an owner makes a mistake when adding a new agreement and quickly replaces it with another new agreement, all wearers who signed the existing agreement will be made ineligible even still within the original grace period.

To resolve this, if a wearer has not signed the latest agreement, we can instead check whether we are still within the grace period of the agreement they have signed, regardless of how many new agreements there have been since the one they signed.

This would involve the following changes:

  1. introducing an Agreement struct enabling tracking of all historical agreements.
struct Agreement {
  string agreement;
  uint256 graceEndsAt;
}

mapping(uint256 id => Agreement agreement) public agreements;

// replaced
// string public currentAgreement;
// uint256 public graceEndsAt;
  1. Setting a new agreement would increment the currentAgreementId but not overwrite the previous agreement or change a global graceEndsAt.

❓ An open question is whether the new grace period should start immediately or not until after the end of the existing grace period.

  1. Wearers would now be eligible if either of the following were true:
  • a) They have signed the most recent agreement
  • b) The grace period for the agreement they most recently signed has not ended

Timing

Given the open question above, together with the non-trivial change to the contract interface and indexable data involved in this change, I recommend conducting additional user research before implementing it.

@spengrah spengrah added the enhancement New feature or request label Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant