sway/forc-plugins
João Matos 990a84093a
Some checks are pending
CI / pre-publish-check (push) Waiting to run
Codspeed Benchmarks / benchmarks (push) Waiting to run
CI / verifications-complete (push) Blocked by required conditions
CI / check-dependency-version-formats (push) Waiting to run
CI / check-forc-manifest-version (push) Waiting to run
CI / get-fuel-core-version (push) Waiting to run
CI / build-sway-lib-std (push) Waiting to run
CI / build-sway-examples (push) Waiting to run
CI / build-reference-examples (push) Waiting to run
CI / forc-fmt-check-sway-lib-std (push) Waiting to run
CI / forc-fmt-check-sway-examples (push) Waiting to run
CI / forc-fmt-check-panic (push) Waiting to run
CI / check-sdk-harness-test-suite-compatibility (push) Waiting to run
CI / build-mdbook (push) Waiting to run
CI / build-forc-doc-sway-lib-std (push) Waiting to run
CI / build-forc-test-project (push) Waiting to run
CI / cargo-build-workspace (push) Waiting to run
CI / cargo-clippy (push) Waiting to run
CI / cargo-toml-fmt-check (push) Waiting to run
CI / cargo-fmt-check (push) Waiting to run
CI / cargo-run-e2e-test (push) Blocked by required conditions
CI / cargo-run-e2e-test-release (push) Blocked by required conditions
CI / cargo-test-lib-std (push) Waiting to run
CI / forc-run-benchmarks (push) Waiting to run
CI / forc-unit-tests (push) Waiting to run
CI / forc-pkg-fuels-deps-check (push) Waiting to run
CI / Build and test various forc tools (push) Blocked by required conditions
CI / cargo-unused-deps-check (push) Waiting to run
CI / notify-slack-on-failure (push) Blocked by required conditions
CI / publish (push) Blocked by required conditions
CI / publish-sway-lib-std (push) Blocked by required conditions
CI / Build and upload forc binaries to release (push) Blocked by required conditions
github pages / deploy (push) Waiting to run
Add event support via #[event] and #[indexed] attributes (#7158)
This PR adds two new attributes: `#[event]` and `#[indexed]`.

The `#[event]` attribute marks a struct or enum as an event that can be
emitted by a contract.

The `#[indexed]` attribute can be applied to fields within structs that
are attributed with `#[event]`. This is particularly useful for event
structs, allowing for efficient filtering and searching of emitted
events based on the values of these fields.

When using this attribute, the indexed fields must be applied
sequentially to the initial set of fields in a struct.

This attribute can only be applied to fields whose type is an exact size
ABI type. The exact size ABI types include:

- `bool`
- `u8`, `u16`, `u32`, `u64`, `u256`
- `numeric`
- `b256`
- `str[N]`
- Tuples containing only exact size types
- Structs containing only exact size types
- Arrays of exact size types with a literal length
- Type aliases to exact size types

Additionally it causes the event types to be included in the JSON ABI
representation for the contract and emits an `offset` for indexed
fields.

```sway
#[event]
struct MyEventStruct {
    #[indexed]
    id: u64,
    sender: Identity,
}
```
2025-11-05 12:43:59 +01:00
..
forc-client Reduce storage API byte allocation (#7430) 2025-11-05 19:45:27 +11:00
forc-crypto chore: bumpt rust version to 1.90 (#7427) 2025-10-02 22:28:51 +13:00
forc-debug Add --gas-costs option to forc-test and E2E test runner (#7471) 2025-10-30 08:53:28 +11:00
forc-doc Add event support via #[event] and #[indexed] attributes (#7158) 2025-11-05 12:43:59 +01:00
forc-fmt chore: bumpt rust version to 1.90 (#7427) 2025-10-02 22:28:51 +13:00
forc-lsp chore: bumpt rust version to 1.90 (#7427) 2025-10-02 22:28:51 +13:00
forc-mcp chore: bumpt rust version to 1.90 (#7427) 2025-10-02 22:28:51 +13:00
forc-migrate Improve diff between generic argument generic type argument (#7453) 2025-10-20 07:51:33 -03:00
forc-node forc-node wasm32 removal (#7436) 2025-10-03 10:17:49 +04:00
forc-publish Revert feat: introduce fuel-telemetry macros (#7295) (#7451) 2025-10-09 19:27:37 +11:00
forc-tx chore: bumpt rust version to 1.90 (#7427) 2025-10-02 22:28:51 +13:00