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

Application: pendzl-smart-contract-library #2193

Closed
wants to merge 2 commits into from
Closed

Conversation

Nradko
Copy link

@Nradko Nradko commented Jan 27, 2024

Project Abstract

The Pendzl Library represents the evolution of the OpenBrush v4.3.0 smart contract library, taking it to the ink 5.0.0 standard while introducing crucial features like event emission. Our primary focus is to enhance usability and eliminate unnecessary parts of the code (ex. macros) that have historically complicated the OpenBrush library. The mentioned evolution of OpenBrush is necessary due to it becoming too complex & introducing updates that piled up and have had a detrimental effect on the development experience.

Pendzl's core principle is simplicity. We aim to minimize the introduction of new code while maximizing utility. Our overarching vision is to establish Pendzl as an open-source project, inviting contributions from the entire ink smart contract developer community.

Grant level

  • Level 1: Up to $10,000, 2 approvals
  • Level 2: Up to $30,000, 3 approvals
  • Level 3: Unlimited, 5 approvals (for >$100k: Web3 Foundation Council approval)

Application Checklist

  • The application template has been copied and aptly renamed (project_name.md).
  • I have read the application guidelines.
  • Payment details have been provided (bank details via email or Polkadot (USDC & USDT) address in the application).
  • I am aware that, in order to receive a grant, I (and the entity I represent) have to successfully complete a KYC/KYB check.
  • The software delivered for this grant will be released under an open-source license specified in the application.
  • The initial PR contains only one commit (squash and force-push if needed).
  • The grant will only be announced once the first milestone has been accepted (see the announcement guidelines).
  • I prefer the discussion of this application to take place in a private Element/Matrix channel. My username is: @_______:matrix.org (change the homeserver if you use a different one)

Copy link
Contributor

github-actions bot commented Jan 27, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@Nradko Nradko changed the title pendzl-smart-contract-library proposal Application: pendzl-smart-contract-library Jan 27, 2024
@Nradko
Copy link
Author

Nradko commented Jan 28, 2024

I have read and hereby sign the Contributor License Agreement.

@Nradko Nradko marked this pull request as draft January 29, 2024 11:30
@Nradko Nradko marked this pull request as ready for review January 29, 2024 11:30
@keeganquigley keeganquigley added the admin-review This application requires a review from an admin. label Jan 29, 2024
Copy link
Contributor

@keeganquigley keeganquigley left a comment

Choose a reason for hiding this comment

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

Hi @Nradko thanks for the application. After an initial review, I have the following comments:

  • The sum of milestones 1 + 2 = $30k but the total costs say $90k? Can you adjust this to reflect the correct cost?
  • We only fund the technical development, so we wouldn't be able to fund the consultations in milestone 2. Perhaps you could focus on a reduced scope of just M1 to start.
  • Have you had some preliminary discussions with the ink! team to see if they like this solution?

@keeganquigley keeganquigley added the changes requested The team needs to clarify a few things first. label Jan 29, 2024
@Nradko
Copy link
Author

Nradko commented Jan 29, 2024

Hey @keeganquigley,

  • The sum was corrected. We ask for $30k 🙂
  • I understand. I have changed the scopes of M1 and M2. However, we will try to perform such consulations anyway. I beleive in the case of smarcontract library it's very important that such consulations are made.
  • We haven't. We do not know how to communicate with them efficiently. If you could establish a communication channel with ink team it would be great! 🙂. I just want to repeat, that our aim is not to introduce any new complicated tools but only to use the ink at the top of it's capabilities.

@takahser takahser self-assigned this Jan 31, 2024
Copy link
Collaborator

@takahser takahser left a comment

Choose a reason for hiding this comment

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

@Nradko thanks, this looks interesting - in general I think it'd be good to have an alternative to the abandoned OpenBrush project. However, could you be a bit more specific on how your solution would deliver a better dev experience? For example, you're saying:

We will write our own smart contract implementations that are more customizable and allow developers for much more!

How exactly will they be more customizable? What exactly will it allow devs to do "much more"? Ideally, you'd have 2-3 code examples of specific scenarios, to demonstrate the differences.

Also, I was wondering if your library is backwards-compatible with OpenBrush. That would make it much easier for existing, Openbrush-dependent projects to migrate to your solution.

Finally, the FTE rates/month for M1 and M2 are different - what's the cause for this?

@Nradko
Copy link
Author

Nradko commented Jan 31, 2024

Hey @takahser,

  • Pendzl is going to support 3 layers of abstraction which allow developers to modify one or more levels and still use the other.
    The three levels are:
  1. The ink::message layer. This is a layer on which one implements ink::trait_defiinition. For example a PSP22 trait.
  2. The contract's internal layer. This is a layer on which internal methods of contract that provide a given functionality exist. For example, in the case of PSP22, it will be a PSP22Internal trait that contains functions like _transfer, _mint_to, and _burn_from.
  3. The deepest layer is the contract storage modification layer, on which the functionality to store necessary data is defined. In the case of PSP22 it will be a PSP22Storage trait.

When we implement PSP22, PSP22Internal and PSP22Storage we will use the following constraints:

struct PSP22DefaultData {...}

impl <T: PSP22Internal> PSP22 for T{...}
impl PSP22Storage for PSP22DefaultData {...}
impl<T: StorageFieldGetter<PSP22Data>> PSP22Internal for T where PSP22Data: PSP22Storage {}

Pendzl will provide all the 3 above implementations and a default struct PSP22Data that implements StorageFieldGetter. In this way developer can use the default implementations in this way:

#[pendzl::implementation(PSP22)]
#[ink::contract]
pub mod default_psp22 {
    #[ink(storage)]
    #[derive(StorageFieldGetter)]
    pub struct Contract {
        #[storage_field]
        psp22: PSP22Data,
    }

    impl Contract {
        #[ink(constructor)]
        pub fn new(total_supply: Balance) -> Self {...}
    }
}

Moreover, a developer can choose to override methods from PSP22, and PSP22Internal (as shown in the Application), and/or he can provide his own struct that will be used in contract storage that implements PSP22Storage trait to change the storage of the contract but to keep the PSP22Internal and PSP22 implementations. In the simple example of a PSP22 contract a developer may decide that for the application he is building it is enough to use u32 to store user balance instead of Balance( which often is u128). In such a case it will be enough for a Developer to create his struct PSP22U32 and implement a PSP22Storage for it:

#[pendzl::implementation(PSP22)]
#[ink::contract]
pub mod my_psp22_with_u32_storage_and_blocked_transfer_from {
    #[ink::storage_item]
    PSP22U32{
        balances: Mapping<AccountId,u32>,
        allowances: Mapping<AccountId, u32>,
        total_supply: u64
    }

    impl PSP22Storage for PSP22U32{....}

    #[ink(storage)]
    #[derive(StorageFieldGetter)]
    pub struct Contract {
        #[storage_field]
        psp22: PSP22U32, // instead of Default PSP22Data
    }

    #[overrider(PSP22)]
    fn transfer_from(
      from: AccountId,
      to: AccountId,
      amount: Balance,
      data: Vec<u8>,
    ) -> Returns<(), PSP22Error>{
      Return Err(PSP22Error::Custom("Our Contract doesn't support PSP22 Transfer From")
    }

    impl Contract {
        #[ink(constructor)]
        pub fn new(total_supply: Balance) -> Self {...}
    }
}

Moreover, developers can choose to implement PSP22Internal from scratch but still use the provided PSP22 implementation.

  • No, the Pendzl will not be 100% backward compatible. We intend to remove most of OpenBrush 'lang' logic so the code changes will be necessary - we envision them actually making "the big picture" much more clear & straightforward than it has been with the usage of OB recently. As noted in Milestone 1 we will provide inline docs that will allow for easy adoption and lessen a "magic happening" feeling. We're confident the migration will be straightforward.

  • We price the FTE of workers differently. We have workers priced at $8k and $6k resulting in

2,5 FTE = 8+8+ 0.5 *6 = 19 [k$]
1,5 FTE = 8 + 0.5 * 6 = 11 [k$].

Copy link
Collaborator

@Noc2 Noc2 left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the application. This looks interesting. I have one question: have you considered the decentralized futures program: https://futures.web3.foundation/ I think you could apply for a slightly larger amount there to kickstart this initiative.

@Nradko Nradko closed this Feb 2, 2024
@Nradko Nradko reopened this Feb 2, 2024
@github-actions github-actions bot added the update docs PR to update the documentation of the grants program. Not a grant application. label Feb 2, 2024
@Nradko
Copy link
Author

Nradko commented Feb 2, 2024

Thanks a lot for the application. This looks interesting. I have one question: have you considered the decentralized futures program: https://futures.web3.foundation/ I think you could apply for a slightly larger amount there to kickstart this initiative.

Thanks for the suggestion. We have just applied for a grant from decentralized futures program and started a topic on the forum: https://forum.polkadot.network/t/pendzl-a-smart-contract-library/5975.

Having that in mind, shall we abandon this application?

@keeganquigley
Copy link
Contributor

Sounds good @Nradko thanks for the update. Sure we can go ahead and close this, and we will reach out to the email address on the DF application for further steps. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
admin-review This application requires a review from an admin. changes requested The team needs to clarify a few things first. update docs PR to update the documentation of the grants program. Not a grant application.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants