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

Release v0.24.0 #295

Merged
merged 29 commits into from
Sep 2, 2024
Merged

Release v0.24.0 #295

merged 29 commits into from
Sep 2, 2024

Conversation

bitzoic
Copy link
Member

@bitzoic bitzoic commented Aug 30, 2024

Type of change

  • Release

[Version 0.24.0]

Added v0.24.0

  • #293 Adds the BytecodeRoot and ContractConfigurables types to the Bytecode Library.
  • #286 Adds the _metadata() function to the Asset Library.

Changed v0.24.0

  • #286 Updates the repository to Sway-Standards v0.6.0 and implements the new SRC-20 and SRC-7 logging specifications.
  • #286 _set_metadata(), _set_name() and _set_symbol() now revert if the metadata is an empty string.
  • #286 _set_metadata() now reverts if the metadata is empty bytes.
  • #286 _mint() and _burn() now revert if the amount argument is zero.
  • #289 Bumps Sway-Libs to forc v0.63.3, fuel-core v0.34.0, and fuels v0.66.2.
  • #290 Update the Upgradeability library to use a specific storage slot for owner functionality.
  • #291 Prepares for the v0.24.0 release.

Breaking v0.24.0

  • #290 The _proxy_owner(), only_proxy_owner() and _set_proxy_owner() functions no longer take storage.proxy_owner as a parameter. Instead they directly read and write to the storage slot 0xbb79927b15d9259ea316f2ecb2297d6cc8851888a98278c0a2e03e1a091ea754 which is sha256("storage_SRC14_1").

Before:

fn foo() {
    let stored_proxy_owner = _proxy_owner(storage.proxy_owner);
    only_proxy_owner(storage.proxy_owner);
    _set_proxy_owner(new_proxy_owner, storage.proxy_owner);
}

After:

fn foo() {
    let stored_proxy_owner = _proxy_owner();
    only_proxy_owner();
    _set_proxy_owner(new_proxy_owner);
}

bitzoic and others added 27 commits June 7, 2024 14:20
## Type of change

<!--Delete points that do not apply-->

- New feature

## Changes

The following changes have been made:

- Forces CI to build with Forc.lock file

## Checklist

- [ ] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] 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).
- [x] I have requested a review from the relevant team or maintainers.
## Type of change

<!--Delete points that do not apply-->

- Improvement (refactoring, restructuring repository, cleaning tech
debt, ...)
- Documentation

## Changes

The following changes have been made:

- Removes the Sway-Libs book deployment from CI
- All instances mentioning the Sway-Libs book now refer to the docs hub
- Removes the Libraries Overview `libraries.md` page in the book in
favor of a more extensive `index.md` home page.
- Updates all links for Sway-Standards to use the docs hub over the
repository

## Notes

- Now that the sway-lib docs hub exists, we no longer need to book.

## Checklist

- [ ] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [x] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] 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).
- [x] I have requested a review from the relevant team or maintainers.

---------

Co-authored-by: K1-R1 <[email protected]>
## Type of change

<!--Delete points that do not apply-->

- New feature

## Changes

The following changes have been made:

- Adds CHANGELOG.md file
- Adds check in PR template to ensure CHANGELOG.md file has been updated

Closes #247 

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] 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).
- [x] I have requested a review from the relevant team or maintainers.
## Type of change

<!--Delete points that do not apply-->

- Improvement (refactoring, restructuring repository, cleaning tech
debt, ...)

## Changes

The following changes have been made:

- Sway Applications team has been renamed to SwayEx

## Checklist

- [ ] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] 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).
- [x] I have requested a review from the relevant team or maintainers.

Co-authored-by: K1-R1 <[email protected]>
## Type of change

<!--Delete points that do not apply-->

- Improvement (refactoring, restructuring repository, cleaning tech
debt, ...)

## Changes

The following changes have been made:

- Updates the README with new instructions on how to run tests
- Updates the doc hub with new instructions on how to run tests

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [x] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] 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).
- [x] I have requested a review from the relevant team or maintainers.
- [x] I have updated the changelog to reflect the changes on this PR.
## Type of change

<!--Delete points that do not apply-->

- New feature
- Documentation

## Changes

The following changes have been made:

- Added a new upgradability library
- Added test for the new lib
- Added docs for the new lib

## Notes

- The upgradability library provides methods to implement the required
and optional functionality from
[SRC-14](https://docs.fuel.network/docs/sway-standards/src-14-simple-upgradeable-proxies/)
as well as additional functionality for ownership of the proxy contract.
Whilst SRC-14 standardizes the target storage slot:
```sway
/// The standard storage slot to store proxy target address.
///
/// Value is `sha256("storage_SRC14_0")`.
pub const SRC14_TARGET_STORAGE: b256 = 0x7bb458adc1d118713319a5baa00a2d049dd64d2916477d2688d76970c898cd55;
```
It doesn't standardize a storage slot for proxy owner. Consequently the
functions that read and write to the storage slot for proxy owner
require a storage key parameter:
```sway
#[storage(read)]
pub fn proxy_owner(proxy_owner_storage_key: StorageKey<State>) -> State {
    proxy_owner_storage_key.read()
}
```
- The upgradability depends on the master branch of sway-standards; as
the current release does not have the up-to-date SRC-14 ABIs. TODOs are
included, and once this PR is merged, an issue to resolve this will be
made.

## Related Issues

<!--Delete everything after the "#" symbol and replace it with a number.
No spaces between hash and number-->

Closes #260 

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [x] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] 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).
- [x] I have requested a review from the relevant team or maintainers.
- [x] I have updated the changelog to reflect the changes on this PR.
## Type of change

- Bug fix

## Changes

The IFP gt and lt functions were incorrectly implemented, this pr fixes
the implementation and adds tests to ensure functionality

## Notes

- Bug was discovered here
https://bugs.immunefi.com/dashboard/submission/32276

## Checklist

- [ ] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] 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).
- [x] I have requested a review from the relevant team or maintainers.
- [x] I have updated the changelog to reflect the changes on this PR.
## Type of change

<!--Delete points that do not apply-->

- New feature

## Changes

The following changes have been made:

- Adds a `SetMetadataEvent` struct
- Emits `SetMetadataEvent` when `_set_metadata()` is called
- Enables the metadata tests now that the SDK supports wrapped heap
types.

## Notes

- This was requested by an external member.

## Related Issues

<!--Delete everything after the "#" symbol and replace it with a number.
No spaces between hash and number-->

Closes #264 

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] 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).
- [x] I have requested a review from the relevant team or maintainers.
- [x] I have updated the changelog to reflect the changes on this PR.
## Type of change

<!--Delete points that do not apply-->

- Bug fix

## Changes

The following changes have been made:

- The `TwosComplement` trait was not correctly implemented. To stay in
line with Rust's practices, the `WrappingNeg` trait now replaces it with
the original desired functionality of the `TwosComplement` trait.
- Bits for `I128` and `I256` are now correct
- The indent for `I128` and `I256` are now correct

## Notes

- This PR changes the folder names in the tests from
`iX_twos_complement_test` to `iX_wrapping_neg_test`.

## Breaking Changes

The following demonstrates the breaking change. While this example code
uses the `I8` type, the same logic may be applied to the `I16`, `I32`,
`I64`, `I128`, and `I256` types.

Before:
```sway
let my_i8 = i8::zero();
let twos_complement = my_i8.twos_complement();
```

After:
```sway
let my_i8 = i8::zero();
let wrapping_neg = my_i8.wrapping_neg();
```

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] 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).
- [x] I have requested a review from the relevant team or maintainers.
- [x] I have updated the changelog to reflect the changes on this PR.

---------

Co-authored-by: K1-R1 <[email protected]>
## Type of change

<!--Delete points that do not apply-->

- Improvement (refactoring, restructuring repository, cleaning tech
debt, ...)

## Changes

The following changes have been made:

- Adds the string "admin" and hashes with the bits of an Identity when
creating the storage slot to storage an admin.

## Notes

- Reported in the Fuel Attackathon

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] 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).
- [x] I have requested a review from the relevant team or maintainers.
- [x] I have updated the changelog to reflect the changes on this PR.

---------

Co-authored-by: SwayStar123 <[email protected]>
## Type of change

<!--Delete points that do not apply-->

- New feature

## Changes

The following changes have been made:

- `I8`, `I16`, `I32`, `I64`, `I128`, and `I256` now support `OrdEq`.

Closes #\<issue number\>

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] 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).
- [x] I have requested a review from the relevant team or maintainers.
- [x] I have updated the changelog to reflect the changes on this PR.
## Type of change

<!--Delete points that do not apply-->

- Bug fix

## Changes

The following changes have been made:

The following changes have been made:

- Fixed when subtracting a negative from a positive number for `I8`,
`I16`, `I32`, `I64`, `I128`, and `I256`.
- Fixed when subtracting two negative numbers for `I8`, `I16`, `I32`,
`I64`, `I128`, and `I256`.

## Notes

- Reported in the Fuel Attackathon

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] 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).
- [x] I have requested a review from the relevant team or maintainers.
- [x] I have updated the changelog to reflect the changes on this PR.
## Type of change

<!--Delete points that do not apply-->

- Bug fix
- New feature
- Improvement (refactoring, restructuring repository, cleaning tech
debt, ...)

## Breaking

The `From` implementation for all signed integers to their respective
unsigned integer has been removed. The `TryFrom` implementation has been
added in its place.

The following demonstrates the breaking change. While this example code
uses the I8 type, the same logic may be applied to the I16, I32, I64,
I128, and I256 types.

Before:
```sway
let my_i8: I8 = I8::from(1u8);
```

After:
```sway
let my_i8: I8 = I8::try_from(1u8).unwrap();
```

## Changes

The following changes have been made:

- Removes the `From` implementation for `u8` into `I8`
- Removes the `From` implementation for `u16` into `I16`
- Removes the `From` implementation for `u32` into `I32`
- Removes the `From` implementation for `u64` into `I64`
- Removes the `From` implementation for `U128` into `I128`
- Removes the `From` implementation for `u256` into `I256`
- Adds the `TryFrom` implementation for `u8` into `I8`
- Adds the `TryFrom` implementation for `u16` into `I16`
- Adds the `TryFrom` implementation for `u32` into `I32`
- Adds the `TryFrom` implementation for `u64` into `I64`
- Adds the `TryFrom` implementation for `U128` into `I128`
- Adds the `TryFrom` implementation for `u256` into `I256`
- Adds the `TryFrom` implementation for `I8` into `u8`
- Adds the `TryFrom` implementation for `I16` into `u16`
- Adds the `TryFrom` implementation for `I32` into `u32`
- Adds the `TryFrom` implementation for `I64` into `u64`
- Adds the `TryFrom` implementation for `I128` into `U128`
- Adds the `TryFrom` implementation for `I256` into `u256`

## Notes

- Reported in the Fuel Attackathon
- This is a breaking change
- Previously the `From` implementations would revert if the input was
greater than the indent.

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] 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).
- [x] I have requested a review from the relevant team or maintainers.
- [x] I have updated the changelog to reflect the changes on this PR.
## Type of change

<!--Delete points that do not apply-->

- Bug fix

## Breaking

The `neg_from` implementation for all signed integers has been removed.
The `neg_try_from()` implementation has been added in its place.

The following demonstrates the breaking change. While this example code
uses the I8 type, the same logic may be applied to the I16, I32, I64,
I128, and I256 types.

Before:
```sway
let my_negative_i8: I8 = I8::neg_from(1u8);
```

After:
```sway
let my_negative_i8: I8 = I8::neg_try_from(1u8).unwrap();
```

## Changes

The following changes have been made:

- Removes `neg_from()` in favor of `neg_try_from()` for `I8`
- Removes `neg_from()` in favor of `neg_try_from()` for `I16`
- Removes `neg_from()` in favor of `neg_try_from()` for `I32`
- Removes `neg_from()` in favor of `neg_try_from()` for `I64`
- Removes `neg_from()` in favor of `neg_try_from()` for `I128`
- Removes `neg_from()` in favor of `neg_try_from()` for `I256`

## Notes

- This is a breaking change
- Previously the `neg_from()` implementation would break on values
greater than the indent for each signed integer

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] 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).
- [x] I have requested a review from the relevant team or maintainers.
- [x] I have updated the changelog to reflect the changes on this PR.
## Type of change

- Bug fix

## Changes

The following changes have been made:

- Changes the swap_configurables function to assert that the offset and
length of the configurable bytes are less than the bytecode length, in
order to avoid a buffer overflow

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] 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).
- [x] I have requested a review from the relevant team or maintainers.
- [x] I have updated the changelog to reflect the changes on this PR.

---------

Co-authored-by: Cameron Carstens <[email protected]>
## Type of change

<!--Delete points that do not apply-->

- Bug fix

## Changes

The following changes have been made:

- `_compute_bytecode_root()` now reverts when the `bytecode` argument is
an empty slice. Previously the function would enter an infinite loop.

## Notes

- This was reported as part of the attackathon

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] 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).
- [x] I have requested a review from the relevant team or maintainers.
- [x] I have updated the changelog to reflect the changes on this PR.
## Type of change

<!--Delete points that do not apply-->

- Release

## Changes

The following changes have been made:

- Updates all instances of `v0.22.0` to `v0.23.0`

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] 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).
- [x] I have requested a review from the relevant team or maintainers.
- [x] I have updated the changelog to reflect the changes on this PR.
….23.1 release (#281)

## Type of change

<!--Delete points that do not apply-->

- Improvement
- Release

## Changes

The following changes have been made:

- Bumps repo to forc v0.62.0
- Bumps repo to fuel-core v0.31.0
- Bumps repo to sway-standard v0.5.2
- Prepares for v0.23.1 release

## Checklist

- [ ] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] 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.
## Type of change


- Documentation


## Changes



-  fix some comments


## Notes

- Note 1

## Related Issues

<!--Delete everything after the "#" symbol and replace it with a number.
No spaces between hash and number-->

Closes #\<issue number\>

## Checklist

- [ ] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] 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.

Signed-off-by: withbest <[email protected]>
Co-authored-by: Cameron Carstens <[email protected]>
…`Option` instead (#285)

## Type of change

<!--Delete points that do not apply-->

- Improvement (refactoring, restructuring repository, cleaning tech
debt, ...)
- Breaking

## Breaking

The following demonstrates the breaking change:

Before:
```sway
fn foo(my_bytecode: Vec<u8>, my_configurables: ContractConfigurables, my_contract_id: ContractId, my_predicate_address: Address) {
     // Compute bytecode root
     let root_no_configurables: BytecodeRoot = compute_bytecode_root(my_bytecode);
     let root_with_configurables: BytecodeRoot = compute_bytecode_root_with_configurables(my_bytecode, my_configurables);

     // Compute predicate address
     let address_no_configurables: Address = compute_predicate_address(my_bytecode);
     let address_with_configurables: Address = compute_predicate_address_with_configurables(my_bytecode, my_configurables);

     // Verify contract bytecode
     verify_contract_bytecode(my_contract_id, my_bytecode); // No configurables
     verify_contract_bytecode_with_configurables(my_contract_id, my_bytecode, my_configurables); // With configurables

     // Verify predicate address
     verify_predicate_address(my_predicate_address, my_bytecode); // No configurables
     verify_predicate_address_with_configurables(my_predicate_address, my_bytecode, my_configurables); // With configurables
}
```

After:
```sway
fn foo(my_bytecode: Vec<u8>, my_configurables: ContractConfigurables, my_contract_id: ContractId, my_predicate_address: Address) {
     // Compute bytecode root
     let root_no_configurables: BytecodeRoot = compute_bytecode_root(my_bytecode, None);
     let root_with_configurables: BytecodeRoot = compute_bytecode_root(my_bytecode, Some(my_configurables));

     // Compute predicate address
     let address_no_configurables: Address = compute_predicate_address(my_bytecode, None);
     let address_with_configurables: Address = compute_predicate_address(my_bytecode, Some(my_configurables));

     // Verify contract bytecode
     verify_contract_bytecode(my_contract_id, my_bytecode, None); // No configurables
     verify_contract_bytecode(my_contract_id, my_bytecode, Some(my_configurables)); // With configurables

     // Verify predicate address
     verify_predicate_address(my_predicate_address, my_bytecode, None); // No configurables
     verify_predicate_address(my_predicate_address, my_bytecode, Some(my_configurables)); // With configurables
}
```

## Changes

The following changes have been made:

- `compute_bytecode_root_with_configurables()` has been removed in place
of `compute_bytecode_root()` with an `Option` argument for configurables
- `compute_predicate_address_with_configurables()` has been removed in
place of `compute_predicate_address()` with an `Option` argument for
configurables
- `verify_contract_bytecode_with_configurables()` has been removed in
place of `verify_contract_bytecode()` with an `Option` argument for
configurables
- `verify_predicate_address_with_configurables()` has been removed in
place of `verify_predicate_address()` with an `Option` argument for
configurables
- The `BytecodeRoot` type has been added
- The `ContractConfigurables` type has been added

## Related Issues

<!--Delete everything after the "#" symbol and replace it with a number.
No spaces between hash and number-->

Closes #219

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] 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).
- [x] I have requested a review from the relevant team or maintainers.
- [x] I have updated the changelog to reflect the changes on this PR.
## Type of change

<!--Delete points that do not apply-->

- Breaking
- New feature
- Improvement (refactoring, restructuring repository, cleaning tech
debt, ...)

## Breaking

The following breaking changes have been made:

1. The support functions for `Metadata` have been removed. They have
been moved to sway-standards.

Before:

```sway
use sway_libs::asset::metadata::*;

fn foo(my_metadata: Metadata) {
     let res: bool = my_metadata.is_b256(); 
     let res: bool = my_metadata.is_string(); 
     let res: bool = my_metadata.is_bytes(); 
     let res: bool = my_metadata.is_uint();
}
```

After: 

```sway
use standards::src7::*;

fn foo(my_metadata: Metadata) {
     let res: bool = my_metadata.is_b256(); 
     let res: bool = my_metadata.is_string(); 
     let res: bool = my_metadata.is_bytes(); 
     let res: bool = my_metadata.is_uint();
}
```

2. The `SetMetadata` and `_set_metadata` function definitions have
changed. The `metadata` argument is now an `Option<Metadata>` and the
argument order has changed.

Before:

```sway
impl SetAssetMetadata for Contract {
    #[storage(read, write)]
    fn set_metadata(asset: AssetId, key: String, metadata: Metadata) {
        _set_metadata(storage.metadata, asset, key, metadata);
    }
}
```

After:

```sway
impl SetAssetMetadata for Contract {
    #[storage(read, write)]
    fn set_metadata(asset: AssetId, metadata: Option<Metadata>, key: String) {
        _set_metadata(storage.metadata, asset, metadata, key);
    }
}
```

3. The `_set_name()` function's `name` argument is now an
`Option<String>`

Before: 

```sway
fn foo(asset: AssetId) {
    _set_name(storage.name, asset, String::from_ascii_str("Ether"));
}
```

After: 

```sway
fn foo(asset: AssetId) {
    _set_name(storage.name, asset, Some(String::from_ascii_str("Ether")));
}
```

3. The `_set_symbol()` function's `name` argument is now an
`Option<String>`

Before: 

```sway
fn foo(asset: AssetId) {
    _set_symbol(storage.name, asset, String::from_ascii_str("ETH"));
}
```

After: 

```sway
fn foo(asset: AssetId) {
    _set_symbol(storage.name, asset, Some(String::from_ascii_str("ETH")));
}
```

4. The `_mint()` function's `sub_id` argument is now an `Option<SubId>`

Before:

```sway
fn foo(recipient: Identity, amount: u64) {
    let asset_id = _mint(storage.total_assets, storage.total_supply, recipient, SubId::zero(), amount);
}
```

After:

```sway
fn foo(recipient: Identity, amount: u64) {
    let asset_id = _mint(storage.total_assets, storage.total_supply, recipient, Some(SubId::zero()), amount);
}
```

## Changes

The following changes have been made:

- Updated all `Forc.toml` files to use sway-standards `v0.6.0`
- Updated docs to mention logging
- Removed `Metadata` convenience functions
- The `_metadata()` function has been added
- The `_set_metadata()` function's `metadata` argument is now an
`Option<Metadata>` and the argument order has changed
- The `SetMetadata` abi's `set_metadata()` `metadata` argument is now an
`Option<Metadata>` and the argument order has changed
- `_set_metadata()` now reverts if the metadata is an empty string
- `_set_metadata()` now reverts if the metadata are empty bytes
- The `_set_name()` function's `name` argument is now an
`Option<String>`
- `_set_name()` now reverts if the `name` argument is an empty string
- The `_set_symbol()` function's `name` argument is now an
`Option<String>`
- `_set_symbol()` now reverts if the `symbol` argument is an empty
string
- The `_mint()` function's `sub_id` argument is now an `Option<SubId>`
- `_mint()` now reverts if the `amount` argument is zero
- `_burn()` now reverts if the `amount` argument is zero
- Test edge cases for `_mint()` have been added
- Test edge cases for `_burn()` have been added
- Test edge cases for `_set_name()` have been added
- Test edge cases for `_set_symbol()` have been added
- Test edge cases for `_set_decimals()` have been added

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] 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).
- [x] I have requested a review from the relevant team or maintainers.
- [x] I have updated the changelog to reflect the changes on this PR.
## Type of change

<!--Delete points that do not apply-->


- Improvement (refactoring, restructuring repository, cleaning tech
debt, ...)

## Changes

The following changes have been made:

- Update to forc 0.63.3 and fuel-core 0.34.0
- Update to fuel-rs 0.66.2

## Notes

- Bytecode tests are currently failing

## Related Issues

<!--Delete everything after the "#" symbol and replace it with a number.
No spaces between hash and number-->

Closes #288 

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [x] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] 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).
- [x] I have requested a review from the relevant team or maintainers.
- [x] I have updated the changelog to reflect the changes on this PR.

---------

Co-authored-by: bitzoic <[email protected]>
## Type of change

- Improvement (refactoring, restructuring repository, cleaning tech
debt, ...)

## Changes

The following changes have been made:

- The upgradeability lib has been updated to use a specific storage slot
for the proxy owner
- The upgradeability example has been updated to use a specific storage
slot for the proxy owner
- The upgradeability test contract has been updated to use a specific
storage slot for the proxy owner

## Notes

The `_proxy_owner()`, `only_proxy_owner()` and `_set_proxy_owner()`
functions no longer take `storage.proxy_owner` as a parameter. Instead
they directly read and write to the storage slot
`0xbb79927b15d9259ea316f2ecb2297d6cc8851888a98278c0a2e03e1a091ea754`
which is `sha256("storage_SRC14_1")`.

## Related Issues

<!--Delete everything after the "#" symbol and replace it with a number.
No spaces between hash and number-->

Closes #287 

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [x] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] 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).
- [x] I have requested a review from the relevant team or maintainers.
- [x] I have updated the changelog to reflect the changes on this PR.

---------

Co-authored-by: bitzoic <[email protected]>
## Type of change

<!--Delete points that do not apply-->

- Release

## Changes

The following changes have been made:

- Prepares master for the v0.24.0 release

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [x] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] 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).
- [x] I have requested a review from the relevant team or maintainers.
- [x] I have updated the changelog to reflect the changes on this PR.
… use Option instead (#293)

## Type of change

<!--Delete points that do not apply-->

- Improvement (refactoring, restructuring repository, cleaning tech
debt, ...)

## Changes

The following changes have been made:

- Removes the breaking changes from
#285
- Leaves the `BytecodeRoot` and `Contractconfigurables` types

## Checklist

- [ ] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] 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.
## Type of change

<!--Delete points that do not apply-->

- Improvement (refactoring, restructuring repository, cleaning tech
debt, ...)

## Changes

The following changes have been made:

- Removes the breaking changes from the asset library made in
#286
- Leaves improvements made in
#286

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] 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).
- [x] I have requested a review from the relevant team or maintainers.
- [x] I have updated the changelog to reflect the changes on this PR.
@bitzoic bitzoic self-assigned this Aug 30, 2024
@bitzoic bitzoic requested a review from a team as a code owner August 30, 2024 13:53
@K1-R1 K1-R1 requested a review from a team August 30, 2024 14:21
@K1-R1 K1-R1 requested a review from a team August 30, 2024 14:21
@bitzoic bitzoic merged commit e19f96f into release Sep 2, 2024
10 checks passed
@bitzoic bitzoic deleted the release-v0.24.0 branch September 2, 2024 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants