Skip to main content

2 posts tagged with "rust"

View All Tags

· 3 min read
Luca Auet
Gabriel Gonzalez

PSP22​

File: psp22.rs

Functionalities:​

  • Metadata: Provides extra information about the token, such as its name and symbol.
  • Mintable: Gives the capability to create new tokens, which increases the total supply.
  • Burnable: Provides the ability to destroy tokens. This action reduces the total supply of the tokens in circulation.
  • Wrapper: This is a wrapper to create a token that is backed by another equivalent token. It comes with methods to deposit and withdraw the underlying token.
  • FlashMint: Allows for a flash loan on the token. In this process, the borrowed amount is minted and then burned after the loan is repaid, all within a single transaction.
  • Pausable: Provides the ability to pause all token transfers. This can be useful in emergency situations or for maintenance.
  • Capped: Allows setting a limit to the total supply when minting tokens. This ensures that the total number of tokens in circulation never exceeds a predefined amount.

PSP34​

File: psp34.rs

Functionalities:​

  • Metadata: Provides extra information about the token, such as its name and symbol. This helps in identifying and describing the NFT.
  • Mintable: Gives the capability to create new tokens. Since these are NFTs, each minted token is distinct and unique.
  • Burnable: Allows NFT holders to destroy their NFTs. This means removing the NFT from circulation permanently.
  • Enumerable: Assigns a unique number to each NFT. This can be useful for tracking and listing NFTs in order.

PSP37​

File: psp37.rs

Functionalities:​

  • Batch: Allows you to transfer multiple tokens in a single operation. This can be efficient when you need to distribute tokens to multiple recipients at once.
  • Metadata: Provides extra information about the token, such as its name and symbol. This helps in identifying and describing the token.
  • Mintable: Gives the capability to create new tokens, which increases the total supply. Since this is a multi-token standard, you can mint multiple types of tokens under one contract.
  • Burnable: Provides the ability to destroy tokens. This action reduces the total supply of the tokens in circulation.
  • Enumerable: Assigns a unique number to each token. This can be useful for tracking and listing tokens in order.

Security:​

All the 2 standards also have the security options:

  • None: No specific security mechanism is applied. All functions are public.
  • Ownable: The contract has an owner, which is a single account. This account is authorized to perform all privileged actions.
  • Access Control: This allows the implementation of role-based access control mechanisms. Different roles can be defined, and each role can be given specific permissions.
  • Access Control Enumerable: This is an extension of the Access Control mechanism. It allows the implementation of role-based access control mechanisms where each role has a unique identifier. This can be useful for tracking and managing roles in a more granular manner.

· 2 min read
Luca Auet
Gabriel Gonzalez

The Polkadot ecosystem is vast and ever-evolving, and to ensure its sustainable growth and interoperability, the introduction of standards becomes imperative. This is where Polkadot Standards Proposals (PSP) come into play. PSPs are a series of standards and protocols proposed for the Polkadot ecosystem to ensure a harmonized approach to development and integration.

What are PSPs?​

Polkadot Standards Proposals (PSPs) are technical specifications and standards proposed for the Polkadot ecosystem. They are similar to Ethereum's ERCs (Ethereum Request for Comments) and serve as a blueprint for building interoperable and standardized applications, platforms, and tools within the Polkadot network.

The Importance of Standards​

Standards play a crucial role in ensuring consistency, interoperability, and compatibility across different platforms and applications. By adhering to a set of predefined standards:

Interoperability: Different applications and platforms can seamlessly interact with each other without any friction. Consistency: Developers have a clear guideline to follow, ensuring uniformity in the applications they build. Efficiency: Standards eliminate the need to reinvent the wheel, allowing developers to build upon existing protocols and specifications. Trust: Users can have confidence in platforms and applications that adhere to recognized standards.

A Closer Look at Specific PSPs​

  • PSP-22: This standard is akin to Ethereum's ERC-20, which is a standard for fungible tokens. PSP-22 provides a set of standard APIs for tokens within the Polkadot ecosystem. It defines methods to transfer tokens, retrieve balances of addresses, and other token-related functionalities.

  • PSP-34: PSP-34 is a standard for non-fungible tokens (NFTs) within the Polkadot ecosystem. Similar to Ethereum's ERC-721, it provides a standard interface for NFTs, allowing for the creation, transfer, and querying of NFTs.

  • PSP-37: This standard introduces a multi-token standard for the Polkadot ecosystem. It allows for the creation of multiple tokens with a single contract. This is particularly useful for platforms that require the issuance of multiple tokens with varying functionalities.