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

Adds fee model <-> allow list communication #271

Closed
wants to merge 8 commits into from

Conversation

vzotova
Copy link
Member

@vzotova vzotova commented May 22, 2024

Type of PR:

  • Bugfix
  • Feature
  • Documentation
  • Other

Required reviews:

  • 1
  • 2
  • 3

What this does:
Adds calls to fee model from allow list. Small PR but finishes (I hope) basic architecture of communication

Issues fixed/closed:
Refs #264

Why it's needed:

Explain how this PR fits in the greater context of the NuCypher Network.
E.g., if this PR address a nucypher/productdev issue, let reviewers know!

Notes for reviewers:
Based on #265

Copy link
Member

@arjunhassard arjunhassard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

state == Coordinator.RitualState.DKG_TIMEOUT ||
state == Coordinator.RitualState.DKG_INVALID
) {
// Refund everything minus cost of renting cohort for a day
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in the call we don't need a fully functioning refund system in the first version but fine to have this here for later

require(msg.sender == address(coordinator), "Only coordinator can call process payment");
uint256 ritualCost = getRitualInitiationCost(numberOfProviders, duration);
require(ritualCost > 0, "Invalid ritual cost");
totalPendingFees += ritualCost;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this balance cover encryptor credits and the base fee?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is initial fee model, not yet subscription. so no credits or base fee, just flat rate

Co-authored-by: David Núñez <david@nucypher.com>
Copy link
Member

@manumonti manumonti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@derekpierre derekpierre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work - 🎸 .

Left some minor suggestions.

contracts/contracts/coordination/GlobalAllowList.sol Outdated Show resolved Hide resolved
@@ -12,7 +12,26 @@ interface IFeeModel {
function currency() external view returns (IERC20);

function getRitualInitiationCost(
address[] calldata providers,
uint256 numberOfProviders,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

contracts/contracts/coordination/Subscription.sol Outdated Show resolved Hide resolved
vzotova and others added 2 commits June 7, 2024 15:02
@vzotova
Copy link
Member Author

vzotova commented Jun 7, 2024

Considering many follow up changes, skip this as separate PR and review directly #272

@vzotova vzotova closed this Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants