Skip to content

Commit

Permalink
Merge pull request #114 from FuelLabs/release-v0.5.1
Browse files Browse the repository at this point in the history
Release v0.5.1
  • Loading branch information
K1-R1 authored Jun 27, 2024
2 parents 348f717 + af9b3a9 commit 22533b1
Show file tree
Hide file tree
Showing 51 changed files with 1,116 additions and 602 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @FuelLabs/application-dev
* @FuelLabs/swayex
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ Closes #\<issue number\>
- [ ] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant.
- [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [ ] I have requested a review from the relevant team or maintainers.
- [ ] I have updated the changelog to reflect the changes on this PR.
11 changes: 11 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Docs

on:
pull_request:

jobs:
test:
uses: FuelLabs/github-actions/.github/workflows/mdbook-docs.yml@master
with:
docs-src-path: 'docs/src'
spellcheck-config-path: 'docs/.spellcheck.yml'
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Change Log

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Version 0.5.1]

Description of the upcoming release here.

### Added

- [#107](https://github.com/FuelLabs/sway-standards/pull/107): Adds the `proxy_owner()` function to the SRC-14 standard.
- [#104](https://github.com/FuelLabs/sway-standards/pull/104): Adds the CHANGELOG.md file to Sway-Standards.
- [#110](https://github.com/FuelLabs/sway-standards/pull/110) Adds the `proxy_target()` function to the SRC-14 standard.
- [#103](https://github.com/FuelLabs/sway-standards/pull/103): Adds Sway-Standards to the [docs hub](https://docs.fuel.network/docs/sway-standards/).

### Changed

- [#103](https://github.com/FuelLabs/sway-standards/pull/103) Removes standards in the `./SRC` folder in favor of `./docs`.
- [#106](https://github.com/FuelLabs/sway-standards/pull/106) Updates links from the Sway Book to Docs Hub.

### Fixed

- [#107](https://github.com/FuelLabs/sway-standards/pull/107) resolves the conflict when SRC-5's `owner()` function is used in both the proxy and target contract in the SRC-14 standard.
- [#99](https://github.com/FuelLabs/sway-standards/pull/99) Fixes links and typos in the SRC-14 standard.
- [#112](https://github.com/FuelLabs/sway-standards/pull/112) Fixes inline documentation code in the SRC-3 standard.

#### Breaking

- [#110](https://github.com/FuelLabs/sway-standards/pull/110) Breaks the `SRC14` abi by adding the `proxy_target()` function. This will need to be added to any SRC14 implementation. The new abi is as follows:

```sway
abi SRC14 {
#[storage(read, write)]
fn set_proxy_target(new_target: ContractId);
#[storage(read)]
fn proxy_target() -> Option<ContractId>;
}
```
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[package]
name = "sway-standards"
version = "0.5.0"
edition = "2021"
44 changes: 28 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset=".docs/sway-standards-logo-dark-theme.png">
<img alt="Sway Standards logo" width="400px" src=".docs/sway-standards-logo-light-theme.png">
<source media="(prefers-color-scheme: dark)" srcset="assets/sway-standards-logo-dark-theme.png">
<img alt="Sway Standards logo" width="400px" src="assets/sway-standards-logo-light-theme.png">
</picture>
</p>

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

### Native Assets

- [SRC-20; Native Asset Standard](./SRCs/src-20.md) defines the implementation of a standard API for [Native Assets](https://docs.fuel.network/docs/sway/blockchain-development/native_assets) using the Sway Language.
- [SRC-3; Mint and Burn](./SRCs/src-3.md) is used to enable mint and burn functionality for fungible assets.
- [SRC-7; Arbitrary Asset Metadata Standard](./SRCs/src-7.md) is used to store metadata for [Native Assets](https://docs.fuel.network/docs/sway/blockchain-development/native_assets).
- [SRC-9; Metadata Keys Standard](./SRCs/src-9.md) is used to store standardized metadata keys for [Native Assets](https://docs.fuel.network/docs/sway/blockchain-development/native_assets) in combination with the SRC-7 standard.
- [SRC-6; Vault Standard](./SRCs/src-6.md) defines the implementation of a standard API for asset vaults developed in Sway.
- [SRC-20; Native Asset Standard](https://docs.fuel.network/docs/sway-standards/src-20-native-asset/) defines the implementation of a standard API for [Native Assets](https://docs.fuel.network/docs/sway/blockchain-development/native_assets) using the Sway Language.
- [SRC-3; Mint and Burn](https://docs.fuel.network/docs/sway-standards/src-3-minting-and-burning/) is used to enable mint and burn functionality for fungible assets.
- [SRC-7; Arbitrary Asset Metadata Standard](https://docs.fuel.network/docs/sway-standards/src-7-asset-metadata/) is used to store metadata for [Native Assets](https://docs.fuel.network/docs/sway/blockchain-development/native_assets).
- [SRC-9; Metadata Keys Standard](https://docs.fuel.network/docs/sway-standards/src-9-metadata-keys/) is used to store standardized metadata keys for [Native Assets](https://docs.fuel.network/docs/sway/blockchain-development/native_assets) in combination with the SRC-7 standard.
- [SRC-6; Vault Standard](https://docs.fuel.network/docs/sway-standards/src-6-vault/) defines the implementation of a standard API for asset vaults developed in Sway.
- [SRC-13; Soulbound Address](https://docs.fuel.network/docs/sway-standards/src-13-soulbound-address/) provides a predicate interface to lock [Native Assets](https://docs.fuel.network/docs/sway/blockchain-development/native_assets) as soulbound.

### Access Control

- [SRC-5; Ownership Standard](./SRCs/src-5.md) is used to restrict function calls to admin users in contracts.
- [SRC-5; Ownership Standard](https://docs.fuel.network/docs/sway-standards/src-5-ownership/) is used to restrict function calls to admin users in contracts.

### Contracts

- [SRC-12; Contract Factory](./SRCs/src-12.md) defines the implementation of a standard API for contract factories.
- [SRC-12; Contract Factory](https://docs.fuel.network/docs/sway-standards/src-12-contract-factory/) defines the implementation of a standard API for contract factories.
- [SRC-14; Simple Upgradable Proxies](https://docs.fuel.network/docs/sway-standards/src-14-simple-upgradeable-proxies/) defines the implementation of a standard API for simple upgradable proxies.

### Bridge

- [SRC-8; Bridged Asset](./SRCs/src-8.md) defines the metadata required for an asset bridged to the Fuel Network.
- [SRC-10; Native Bridge Standard](./SRCs/src-10.md) defines the standard API for the Native Bridge between the Fuel Chain and the canonical base chain.
- [SRC-8; Bridged Asset](https://docs.fuel.network/docs/sway-standards/src-8-bridged-asset/) defines the metadata required for an asset bridged to the Fuel Network.
- [SRC-10; Native Bridge Standard](https://docs.fuel.network/docs/sway-standards/src-10-native-bridge/) defines the standard API for the Native Bridge between the Fuel Chain and the canonical base chain.

### Documentation

- [SRC-2; Inline Documentation](./SRCs/src-2.md) defines how to document your Sway files.
- [SRC-2; Inline Documentation](https://docs.fuel.network/docs/sway-standards/src-2-inline-documentation/) defines how to document your Sway files.

## Using a standard

To import a standard the following should be added to the project's `Forc.toml` file under `[dependencies]` with the most recent release:

```rust
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.5.0" }
```toml
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.5.1" }
```

> **NOTE:**
> Be sure to set the tag to the latest release.
You may then import your desired standard in your Sway Smart Contract as so:

```rust
```sway
use standards::<standard>::<standard_abi>;
```

For example, to import the SRC-20 Native Asset Standard use the following statement in your Sway Smart Contract file:

```rust
```sway
use standards::src20::SRC20;
```

Expand Down Expand Up @@ -149,6 +151,16 @@ Example of the SRC-12 implementation where contract deployments contain configur

Example of the SRC-12 implementation where all contract deployments are identical and thus have the same bytecode and root.

#### SRC-14; Simple Upgradable Proxies Standard Examples

##### [Minimal](./examples/src14-simple-proxy/minimal/src/minimal.sw)

Example of a minimal SRC-14 implementation with no access control.

##### [Owned Proxy](./examples/src14-simple-proxy/owned/src/owned.sw)

Example of a SRC-14 implementation that also implements [SRC-5](https://docs.fuel.network/docs/sway-standards/src-5-ownership/).

> **Note**
> All standards currently use `forc v0.60.0`.
Expand Down
Binary file removed SRCs/.docs/src-10-logo-dark-theme.png
Binary file not shown.
Binary file removed SRCs/.docs/src-10-logo-light-theme.png
Binary file not shown.
Binary file removed SRCs/.docs/src-11-logo-dark-theme.png
Binary file not shown.
Binary file removed SRCs/.docs/src-11-logo-light-theme.png
Binary file not shown.
Binary file removed SRCs/.docs/src-12-logo-dark-theme.png
Binary file not shown.
Binary file removed SRCs/.docs/src-12-logo-light-theme.png
Binary file not shown.
Binary file removed SRCs/.docs/src-13-logo-dark-theme.png
Binary file not shown.
Binary file removed SRCs/.docs/src-13-logo-light-theme.png
Binary file not shown.
Binary file removed SRCs/.docs/src-2-logo-dark-theme.png
Binary file not shown.
Binary file removed SRCs/.docs/src-2-logo-light-theme.png
Binary file not shown.
Binary file removed SRCs/.docs/src-20-logo-dark-theme.png
Binary file not shown.
Binary file removed SRCs/.docs/src-20-logo-light-theme.png
Binary file not shown.
Binary file removed SRCs/.docs/src-5-logo-dark-theme.png
Binary file not shown.
Binary file removed SRCs/.docs/src-5-logo-light-theme.png
Binary file not shown.
Binary file removed SRCs/.docs/src-6-logo-dark-theme.png
Binary file not shown.
Binary file removed SRCs/.docs/src-6-logo-light-theme.png
Binary file not shown.
Binary file removed SRCs/.docs/src-7-logo-dark-theme.png
Binary file not shown.
Binary file removed SRCs/.docs/src-7-logo-light-theme.png
Binary file not shown.
Binary file removed SRCs/.docs/src-8-logo-dark-theme.png
Binary file not shown.
Binary file removed SRCs/.docs/src-8-logo-light-theme.png
Binary file not shown.
Binary file removed SRCs/.docs/src-9-logo-dark-theme.png
Binary file not shown.
Binary file removed SRCs/.docs/src-9-logo-light-theme.png
Binary file not shown.
File renamed without changes
File renamed without changes
28 changes: 28 additions & 0 deletions docs/.spellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
matrix:
- name: SPCheck
aspell:
lang: en
dictionary:
encoding: utf-8
wordlists:
- docs/spell-check-custom-words.txt
pipeline:
- pyspelling.filters.context:
context_visible_first: true
escapes: \\[\\`~]
delimiters:
# Ignore all code blocks
- open: '(?s)^(?P<open> *`{3,}\s*(\w+\s*,?\s*)+.*?)$'
close: '^( *`{3,})$'
- pyspelling.filters.markdown:
markdown_extensions:
- pymdownx.superfences:
- pyspelling.filters.html:
comments: false
ignores:
- code
- pre
sources:
- 'docs/src/*.md'
- 'docs/src/**/*.md'
default_encoding: utf-8
Loading

0 comments on commit 22533b1

Please sign in to comment.