Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

Features/add module install fee #358

Merged
merged 26 commits into from
Jun 12, 2023
Merged

Conversation

Kayanski
Copy link
Contributor

@Kayanski Kayanski commented Jun 2, 2023

This PR aims at adding a fee on module installation for module creators to monetize their creations

TODO

  • Add a monetization smart query on Version Control
  • Remove dangling monetization references when last module version is removed

@Kayanski Kayanski marked this pull request as draft June 2, 2023 13:20
@Kayanski Kayanski requested a review from CyberHoward June 2, 2023 13:20
@github-actions github-actions bot added account Changes to the account base logic interface native sdk labels Jun 2, 2023
@cloudflare-pages
Copy link

cloudflare-pages bot commented Jun 2, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2af3182
Status: ✅  Deploy successful!
Preview URL: https://64ed38be.contracts-egs.pages.dev
Branch Preview URL: https://features-add-module-install.contracts-egs.pages.dev

View logs

@codecov
Copy link

codecov bot commented Jun 5, 2023

Codecov Report

Merging #358 (2af3182) into main (51988c1) will increase coverage by 0.0%.
The diff coverage is 95.0%.

Impacted Files Coverage Δ
packages/abstract-core/src/core/manager.rs 36.1% <ø> (ø)
contracts/native/module-factory/src/commands.rs 96.7% <88.2%> (-0.5%) ⬇️
contracts/account/manager/src/commands.rs 95.0% <88.8%> (+<0.1%) ⬆️
contracts/native/version-control/src/commands.rs 97.3% <93.6%> (-0.2%) ⬇️
contracts/native/account-factory/src/commands.rs 94.5% <100.0%> (ø)
contracts/native/version-control/src/contract.rs 97.2% <100.0%> (+<0.1%) ⬆️
contracts/native/version-control/src/queries.rs 96.2% <100.0%> (+<0.1%) ⬆️
...ckages/abstract-core/src/native/version_control.rs 82.8% <100.0%> (+3.5%) ⬆️
packages/abstract-core/src/objects/module.rs 86.0% <100.0%> (-0.6%) ⬇️
packages/abstract-sdk/src/apis/version_registry.rs 93.7% <100.0%> (+5.2%) ⬆️

... and 1 file with indirect coverage changes

@adairrr
Copy link
Contributor

adairrr commented Jun 5, 2023

Would we want to check and remove a potentially dangling monetization configuration when removing a module?

contracts/native/version-control/src/commands.rs Outdated Show resolved Hide resolved
packages/abstract-core/src/objects/module.rs Outdated Show resolved Hide resolved
packages/abstract-core/src/objects/module.rs Outdated Show resolved Hide resolved
packages/abstract-core/src/native/version_control.rs Outdated Show resolved Hide resolved
@Kayanski
Copy link
Contributor Author

Kayanski commented Jun 6, 2023

Would we want to check and remove a potentially dangling monetization configuration when removing a module?

As we do not store the monetization object for a specific module version, this is not really possible, as we don't know which versions can still be registered and that need the monetization object.

@CyberHoward CyberHoward marked this pull request as ready for review June 8, 2023 09:06
@CyberHoward
Copy link
Contributor

Could that query that's mentioned in the description be added? Well be required for front-end stuff

@Kayanski
Copy link
Contributor Author

Kayanski commented Jun 8, 2023

Could that query that's mentioned in the description be added? Well be required for front-end stuff

2 possibilities. Either we do a separate query or we return the monetization in the current modules query. I prefer having it in the existing module query, inside a config object that is not exhaustive

@CyberHoward
Copy link
Contributor

Could you elaborate on why you prefer it?

@Kayanski
Copy link
Contributor Author

Kayanski commented Jun 8, 2023

Could you elaborate on why you prefer it?

Because we can group the queries to the module contract, no need to ask it multiple time about information.
You ask for a module and you get your monetization configuration
Moreover, if you want to add more configuration to the mix, we don't have to create a new message variant everytime,

@CyberHoward
Copy link
Contributor

Could you elaborate on why you prefer it?

Because we can group the queries to the module contract, no need to ask it multiple time about information. You ask for a module and you get your monetization configuration Moreover, if you want to add more configuration to the mix, we don't have to create a new message variant everytime,

Sure, so something like

ModuleResponse {
  module: Module,
  monetization: Monetization,
}

?

@Kayanski
Copy link
Contributor Author

Kayanski commented Jun 8, 2023

Could you elaborate on why you prefer it?

Because we can group the queries to the module contract, no need to ask it multiple time about information. You ask for a module and you get your monetization configuration Moreover, if you want to add more configuration to the mix, we don't have to create a new message variant everytime,

Sure, so something like

ModuleResponse {
  module: Module,
  monetization: Monetization,
}

?

Yes or

	pub struct ModuleResponse{
		pub info: ModuleInfo,
		pub reference: ModuleReference,
		pub config: ModuleConfig
	}

	#[non_exhaustive]
	pub struct ModuleConfig{
		pub monetization: ModuleMonetization
	}

@CyberHoward
Copy link
Contributor

Could you elaborate on why you prefer it?

Because we can group the queries to the module contract, no need to ask it multiple time about information. You ask for a module and you get your monetization configuration Moreover, if you want to add more configuration to the mix, we don't have to create a new message variant everytime,

Sure, so something like

ModuleResponse {
  module: Module,
  monetization: Monetization,
}

?

Yes or

	pub struct ModuleResponse{
		pub info: ModuleInfo,
		pub reference: ModuleReference,
		pub config: ModuleConfig
	}

	#[non_exhaustive]
	pub struct ModuleConfig{
		pub monetization: ModuleMonetization
	}

yup, great suggestion

@Kayanski
Copy link
Contributor Author

Kayanski commented Jun 8, 2023

Met you in the middle there

@CyberHoward CyberHoward merged commit 63b8a01 into main Jun 12, 2023
16 checks passed
@CyberHoward CyberHoward deleted the features/add-module-install-fee branch June 12, 2023 12:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
account Changes to the account base logic interface native sdk
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants