Skip to content

Commit

Permalink
Merge pull request #22 from FuelLabs/bitzoic-typo-fix
Browse files Browse the repository at this point in the history
Fix typos, grammar, and add a better example
  • Loading branch information
bitzoic authored Sep 12, 2023
2 parents f8ef3d3 + 5dcf818 commit e2f2ea4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<a href="https://github.com/FuelLabs/sway-standards/actions/workflows/ci.yml" alt="CI">
<img src="https://github.com/FuelLabs/sway-standards/actions/workflows/ci.yml/badge.svg" />
</a>
<a href="https://crates.io/crates/forc/0.38.0" alt="forc">
<img src="https://img.shields.io/badge/forc-v0.38.0-orange" />
<a href="https://crates.io/crates/forc/0.44.0" alt="forc">
<img src="https://img.shields.io/badge/forc-v0.44.0-orange" />
</a>
<a href="./LICENSE" alt="forc">
<img src="https://img.shields.io/github/license/FuelLabs/sway-standards" />
Expand All @@ -24,7 +24,7 @@

The purpose of this repository is to contain standards for the Sway Language which users can import and use.

Standards in this repository may be in various stages of development. Use of draft standards and feedback on the proposed standards is encouraged. To use a draft, search for a standard using the appropriate github label and implement the standard abi into your contract.
Standards in this repository may be in various stages of development. Use of draft standards and feedback on the proposed standards is encouraged. To use a draft, search for a standard using the appropriate GitHub label and implement the standard abi into your contract.

If you don't find what you're looking for, feel free to create an issue and propose a new standard!

Expand All @@ -35,7 +35,7 @@ If you don't find what you're looking for, feel free to create an issue and prop

- [SRC-20; Token Standard](./standards/src_20/) defines the implementation of a standard API for [Native Assets](https://fuellabs.github.io/sway/v0.44.0/book/blockchain-development/native_assets.html) using the Sway Language.
- [SRC-2; Inline Documentation](./standards/src_2/) defines how to document your Sway files.
- [SRC-3; Mint and Burn](./standards/src_3/) is used to enabling mint and burn functionality for Native Assets.
- [SRC-3; Mint and Burn](./standards/src_3/) is used to enable mint and burn functionality for Native Assets.
- [SRC-5; Ownership Standard](./standards/src_5/) is used to restrict function calls to admin users in contracts.

## Using a standard
Expand All @@ -52,10 +52,14 @@ You may then import your desired standard in your Sway Smart Contract as so:
use standard::<standard_abi>;
```

For example, to import the SRC-20 Token Standard use the following statement:
For example, to import the SRC-20 Token Standard use the following statements in your `Forc.toml` and Sway Smart Contract file respectively:

```rust
use src20::SRC20;
src_20 = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.1.1" }
```

```rust
use src_20::SRC20;
```

> **Note**
Expand Down
6 changes: 3 additions & 3 deletions standards/src_2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ Example:

# Rationale

The SRC-2 standard should help provide developers with an easy way to both quickly write inline documentation and get up to speed on other developers' code. This standard in combination with Fuel's VS Code extension provides for readily accessible information on functions, structs, and enums
The SRC-2 standard should help provide developers with an easy way to both quickly write inline documentation and get up to speed on other developers' code. This standard in combination with Fuel's VS Code extension provides readily accessible information on functions, structs, and enums

![Screenshot 2023-05-10 125656](https://github.com/FuelLabs/sway-standards/assets/54727135/f03073b9-2a28-44d1-b12a-5603a0738fee)

Expand Down Expand Up @@ -361,7 +361,7 @@ pub struct Bid {
pub enum State {
/// The ownership has not been set.
Uninitialized: (),
/// The user which has been given ownership.
/// The user who has been given ownership.
Initialized: Identity,
/// The ownership has been given up and can never be set again.
Revoked: (),
Expand All @@ -382,7 +382,7 @@ pub enum AccessError {
storage {
/// The contract of the tokens which is to be distributed.
asset: Option<ContractId> = Option::None,
/// Stores the ClaimState of users that have interacted with the Airdrop Distrubutor contract.
/// Stores the ClaimState of users that have interacted with the Airdrop Distributor contract.
///
/// # Additional Information
///
Expand Down
2 changes: 1 addition & 1 deletion standards/src_20/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ This function must return the symbol of the asset, such as “ETH”. This funct

### `fn decimals(asset: AssetId) -> Option<u8>`

This function must return the number of decimals the asset uses - e.g. 8, means to divide the token amount by 100000000 to get its user representation. This function MUST return `Some` for any assets minted by the contract.
This function must return the number of decimals the asset uses - e.g. 8, which means to divide the token amount by 100000000 to get its user representation. This function MUST return `Some` for any assets minted by the contract.

## Non-Fungible Token Restrictions

Expand Down
6 changes: 2 additions & 4 deletions standards/src_3/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
### Motivation

# Abstract

The following standard enables the minting and burning of tokens for any fungible assets within the Sway Language. It seeks to define mint and burn functions defined separately from the [SRC-20](https://github.com/FuelLabs/sway-standards/tree/master/standards/src_20) standard. Any contract that implements the SRC-3 standard MUST implement the [SRC-20](https://github.com/FuelLabs/sway-standards/tree/master/standards/src_20) standard.
Expand Down Expand Up @@ -32,7 +30,7 @@ This function MAY contain arbitrary conditions for minting, and revert if those
### `fn burn(sub_id: SubId, amount: u64)`

This function MUST burn `amount` tokens with the sub-identifier `sub_id` and MUST ensure the `AssetId` of the token is the sha-256 hash of `(ContractId, SubId)` for the implementing contract.
This function MUST ensure at least `amount` tokens have been transfered to the implementing contract.
This function MUST ensure at least `amount` tokens have been transferred to the implementing contract.
This function MUST update the total supply defined in the [SRC-20](https://github.com/FuelLabs/sway-standards/tree/master/standards/src_20) standard.
This function MAY contain arbitrary conditions for burning, and revert if those conditions are not met.

Expand All @@ -47,7 +45,7 @@ This standard has been added to enable compatibility between applications and al

# Backwards Compatibility

This standard is compatible with Fuel's [Native Assets](https://fuellabs.github.io/sway/v0.38.0/book/blockchain-development/native_assets.html) ensuring it's compatibility with the [SRC-20](https://github.com/FuelLabs/sway-standards/tree/master/standards/src_20) standard.
This standard is compatible with Fuel's [Native Assets](https://fuellabs.github.io/sway/v0.38.0/book/blockchain-development/native_assets.html) ensuring its compatibility with the [SRC-20](https://github.com/FuelLabs/sway-standards/tree/master/standards/src_20) standard.

# Security Considerations

Expand Down

0 comments on commit e2f2ea4

Please sign in to comment.