-
Notifications
You must be signed in to change notification settings - Fork 7
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
chore(testnet): examples using psp22 contract #337
Comments
@chungquantin , can this be considered as one example contract using the Fungible contract: |
@ndkazu the contract in examples/fungible is the base contract that follows the PSP22 standard. In the "Use Cases" section of that contract, you can find several examples of how the contract can be used. The PSP22 contract in the example crate can be applied to any case that requires a fungible mechanism:
It’s worth noting that this does not have to be just an example contract but can be used as a real DApps contract as well. In summary, the idea is to have more contracts that leverage examples/fungible for fungible token management across a variety of use cases. So I would recommend you to start with something like an AMM, Staking or DAO contract. |
@chungquantin , |
@ndkazu Here is the example to use the fungible contract using Edit: I updated the PR description to list some ideas I have in mind. |
That is a good point though. Be mindful though that based on your use case you might not need the When deploying smart contracts on a Polkadot parachain, it's best to design them with specialized logic. Specialized contracts generate less data for the Proof of Validity (PoV) required by the relay chain during validation. In contrast, contracts that handle multiple functionalities increase the PoV size, leading to greater validation overhead. Focusing on single-purpose contracts helps keep the PoV smaller and ensures more efficient validation. |
I opened a Dao_example PR. Still a work in progress, but would love to get some reviews at this stage, as I am also discovering ink! while doing this. |
The same kind of detailed explanation might be required for Issue #378. |
We would want to showcase the power of Pop API through and example contracts. With the upcoming #108 , we need some example contracts that use the Fungible contract to build a real DApps.
Description
Contract in examples/fungible is the base contract that follows the PSP22 standard. In the "Use Cases" section of that contract, you can find several examples of how the contract can be used. The PSP22 contract in the example crate can be applied to any case that requires a fungible mechanism:
It’s worth noting that this does not have to be just an example contract but can be used as a real DApps contract as well. In summary, the idea is to have more contracts that leverage examples/fungible for fungible token management across a variety of use cases.
Integration Guide
To use the fungible contract in your ink! contract, you can use the
contract_ref!
macro with the contract address as a parameter. Here is the example https://github.com/r0gue-io/sub0-ink-challenges-solution/blob/7b48d58a2e727530400b70e3ee7b137458de00d1/challenges/challenge-7/lib.rs#L179References
The text was updated successfully, but these errors were encountered: