Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,9 @@ jobs:
--notes "$(cat <<EOF
The $GITHUB_REF_NAME release is here.

Check out the release notes from [Anchor website](https://www.anchor-lang.com/docs/updates/release-notes/${RELEASE_URL}) or [GitHub](https://github.com/solana-foundation/anchor/blob/${GITHUB_REF_NAME}/docs/content/docs/updates/release-notes/${RELEASE_URL}.mdx).
Check out the release notes from [Anchor website](https://www.anchor-lang.com/docs/updates/release-notes/${RELEASE_URL}) or [GitHub](https://github.com/otter-sec/anchor/blob/${GITHUB_REF_NAME}/docs/content/docs/updates/release-notes/${RELEASE_URL}.mdx).

For a list of notable changes with their associated PRs, see the [CHANGELOG](https://github.com/solana-foundation/anchor/blob/${GITHUB_REF_NAME}/CHANGELOG.md#${RELEASE_CHANGELOG}).
For a list of notable changes with their associated PRs, see the [CHANGELOG](https://github.com/otter-sec/anchor/blob/${GITHUB_REF_NAME}/CHANGELOG.md#${RELEASE_CHANGELOG}).
EOF
)" \
"${publish_args[@]}"
Expand Down
6 changes: 3 additions & 3 deletions cli/npm-package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"name": "@anchor-lang/cli",
"version": "2.0.0",
"description": "Anchor CLI tool",
"homepage": "https://github.com/solana-foundation/anchor#readme",
"homepage": "https://github.com/otter-sec/anchor#readme",
"bugs": {
"url": "https://github.com/solana-foundation/anchor/issues"
"url": "https://github.com/otter-sec/anchor/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/solana-foundation/anchor.git"
"url": "git+https://github.com/otter-sec/anchor.git"
},
"license": "(MIT OR Apache-2.0)",
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,7 @@ fn override_toolchain(cfg_override: &ConfigOverride) -> Result<RestoreToolchainC
// binaries in various commands.
fn override_solana_version(version: String) -> Result<bool> {
// There is a deprecation warning message starting with `1.18.19` which causes
// parsing problems https://github.com/solana-foundation/anchor/issues/3147
// parsing problems https://github.com/otter-sec/anchor/issues/3147
let (cmd_name, domain) =
if Version::parse(&version)? < Version::parse("1.18.19")? {
("solana-install", "solana.com")
Expand Down
2 changes: 1 addition & 1 deletion client/example/run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# Run this script from within the `example/` directory in which it is located.
# The anchor cli must be installed.
#
# cargo install --git https://github.com/solana-foundation/anchor anchor-cli --locked
# cargo install --git https://github.com/otter-sec/anchor anchor-cli --locked
#
################################################################################

Expand Down
2 changes: 1 addition & 1 deletion client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
//!
//! More examples can be found in [here].
//!
//! [here]: https://github.com/solana-foundation/anchor/tree/v2.0.0-rc.1/client/example/src
//! [here]: https://github.com/otter-sec/anchor/tree/v2.0.0-rc.1/client/example/src
//!
//! # Features
//!
Expand Down
2 changes: 1 addition & 1 deletion docs/app/docs/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default async function Page(props: {

function EditOnGithub({ path }: { path: string }) {
// placeholder
const href = `https://github.com/solana-foundation/anchor/blob/master/docs/content/docs/${path.startsWith("/") ? path.slice(1) : path}`;
const href = `https://github.com/otter-sec/anchor/blob/master/docs/content/docs/${path.startsWith("/") ? path.slice(1) : path}`;
return (
<a
href={href}
Expand Down
2 changes: 1 addition & 1 deletion docs/app/layout.config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const baseOptions: HomeLayoutProps = {
{
icon: <GithubIcon />,
text: "Github",
url: "https://github.com/solana-foundation/anchor",
url: "https://github.com/otter-sec/anchor",
active: "none",
},
{
Expand Down
6 changes: 3 additions & 3 deletions docs/content/docs/basics/cpi.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ The `sol_transfer` instruction included in the example code shows a typical
approach for constructing CPIs using the Anchor framework.

This approach involves creating a
[`CpiContext`](https://github.com/solana-foundation/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/src/context.rs#L173),
[`CpiContext`](https://github.com/otter-sec/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/src/context.rs#L173),
which includes the `program_id` and accounts required for the instruction being
called. The `CpiContext` is then passed to an Anchor helper function
([`transfer`](https://github.com/solana-foundation/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/src/system_program.rs#L298))
([`transfer`](https://github.com/otter-sec/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/src/system_program.rs#L298))
to invoke a specific instruction.

```rust
Expand Down Expand Up @@ -472,7 +472,7 @@ The `sol_transfer` instruction included in the example code shows a typical
approach for constructing CPIs using the Anchor framework.

This approach involves creating a
[`CpiContext`](https://github.com/solana-foundation/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/src/context.rs#L173),
[`CpiContext`](https://github.com/otter-sec/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/src/context.rs#L173),
which includes the `program_id` and accounts required for the instruction being
called, followed by a helper function (`transfer`) to invoke a specific
instruction.
Expand Down
8 changes: 4 additions & 4 deletions docs/content/docs/basics/idl.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -428,10 +428,10 @@ ed = 237

You can find the implementation of the discriminator generation in the Anchor
codebase
[here](https://github.com/solana-foundation/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/syn/src/codegen/program/common.rs#L5-L22),
for the [`gen_discriminator` method here](https://github.com/solana-foundation/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/syn/src/codegen/program/common.rs#L19-L22),
[here](https://github.com/otter-sec/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/syn/src/codegen/program/common.rs#L5-L22),
for the [`gen_discriminator` method here](https://github.com/otter-sec/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/syn/src/codegen/program/common.rs#L19-L22),
which is used
[here](https://github.com/solana-foundation/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/syn/src/codegen/program/instruction.rs#L33).
[here](https://github.com/otter-sec/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/syn/src/codegen/program/instruction.rs#L33).

</Tab>
<Tab value="Accounts">
Expand Down Expand Up @@ -480,7 +480,7 @@ e8 = 232

You can find the implementation of the discriminator generation in the Anchor
codebase
[here](https://github.com/solana-foundation/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/attribute/account/src/lib.rs#L113-L125).
[here](https://github.com/otter-sec/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/attribute/account/src/lib.rs#L113-L125).

<Callout type="info">
Note that different programs using identical account names will generate the
Expand Down
34 changes: 17 additions & 17 deletions docs/content/docs/basics/program-structure.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ pub struct NewAccount {
## declare_id! macro

The
[`declare_id`](https://github.com/solana-foundation/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/attribute/account/src/lib.rs#L539)
[`declare_id`](https://github.com/otter-sec/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/attribute/account/src/lib.rs#L539)
macro specifies the on-chain address of the program, known as the program ID.
You can find the implementation of the code generated by the `declare_id!` macro
[here](https://github.com/solana-foundation/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/attribute/account/src/id.rs#L54-L83).
[here](https://github.com/otter-sec/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/attribute/account/src/id.rs#L54-L83).

```rust title="lib.rs"
use anchor_lang::prelude::*;
Expand All @@ -91,14 +91,14 @@ the one generated when you run `anchor build` locally.
## #[program] attribute

The
[`#[program]`](https://github.com/solana-foundation/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/attribute/program/src/lib.rs#L10)
[`#[program]`](https://github.com/otter-sec/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/attribute/program/src/lib.rs#L10)
attribute annotates the module containing all the instruction handlers for your
program. Each public function within this module corresponds to an instruction
that can be invoked.

You can find the implementation of the code generated by the `#[program]`
attribute
[here](https://github.com/solana-foundation/anchor/tree/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/syn/src/codegen/program).
[here](https://github.com/otter-sec/anchor/tree/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/syn/src/codegen/program).

```rust title="lib.rs"
use anchor_lang::prelude::*;
Expand Down Expand Up @@ -137,11 +137,11 @@ pub struct NewAccount {
Instruction handlers are functions that define the logic executed when an
instruction is invoked. The first parameter of each handler is a `Context<T>`
type, where `T` is a struct implementing the
[`Accounts`](https://github.com/solana-foundation/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/src/lib.rs#L194)
[`Accounts`](https://github.com/otter-sec/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/src/lib.rs#L194)
trait and specifies the accounts the instruction requires.

The
[`Context`](https://github.com/solana-foundation/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/src/context.rs#L26)
[`Context`](https://github.com/otter-sec/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/src/context.rs#L26)
type provides the instruction with access to the following non-argument inputs:

```rust
Expand Down Expand Up @@ -213,16 +213,16 @@ pub struct Initialize<'info> {
## #[derive(Accounts)] macro

The
[`#[derive(Accounts)]`](https://github.com/solana-foundation/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/derive/accounts/src/lib.rs#L647)
[`#[derive(Accounts)]`](https://github.com/otter-sec/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/derive/accounts/src/lib.rs#L647)
macro is applied to a struct to specify the accounts that must be provided when
an instruction is invoked. This macro implements the
[`Accounts`](https://github.com/solana-foundation/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/src/lib.rs#L194)
[`Accounts`](https://github.com/otter-sec/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/src/lib.rs#L194)
trait, which simplifies account validation and serialization and deserialization
of account data.

You can find the implementation of the code generated by the
`#[derive(Accounts)]` macro
[here](https://github.com/solana-foundation/anchor/tree/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/syn/src/codegen/accounts).
[here](https://github.com/otter-sec/anchor/tree/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/syn/src/codegen/accounts).

```rust
// [!code word:Accounts]
Expand Down Expand Up @@ -268,9 +268,9 @@ Anchor programs in two ways that are generally used together:
`Accounts` trait.

You can find a full list of the constraints
[here](https://github.com/solana-foundation/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/syn/src/parser/accounts/constraints.rs)
[here](https://github.com/otter-sec/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/syn/src/parser/accounts/constraints.rs)
and implementation
[here](https://github.com/solana-foundation/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/syn/src/codegen/accounts/constraints.rs).
[here](https://github.com/otter-sec/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/syn/src/codegen/accounts/constraints.rs).

```rust
#[derive(Accounts)]
Expand All @@ -290,7 +290,7 @@ Anchor programs in two ways that are generally used together:
what the program expects.

You can find the implementation of the account types
[here](https://github.com/solana-foundation/anchor/tree/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/src/accounts).
[here](https://github.com/otter-sec/anchor/tree/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/src/accounts).

```rust
#[derive(Accounts)]
Expand Down Expand Up @@ -346,7 +346,7 @@ pub struct NewAccount {
## #[account] attribute

The
[`#[account]`](https://github.com/solana-foundation/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/attribute/account/src/lib.rs#L99)
[`#[account]`](https://github.com/otter-sec/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/attribute/account/src/lib.rs#L99)
attribute is applied to structs that define the structure of the data stored in
custom accounts created by your program.

Expand All @@ -362,14 +362,14 @@ This macro implements various traits
[detailed here](https://docs.rs/anchor-lang/latest/anchor_lang/attr.account.html).
The key functionalities of the `#[account]` macro include:

- [Assign Program Owner](https://github.com/solana-foundation/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/attribute/account/src/lib.rs#L132-L145):
- [Assign Program Owner](https://github.com/otter-sec/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/attribute/account/src/lib.rs#L132-L145):
When creating an account, the program owner of the account is automatically
set to the program specified in `declare_id`.
- [Set Discriminator](https://github.com/solana-foundation/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/attribute/account/src/lib.rs#L113-L130):
- [Set Discriminator](https://github.com/otter-sec/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/attribute/account/src/lib.rs#L113-L130):
A unique 8 byte discriminator, specific to the account type, is added as the
first 8 bytes of account data during its initialization. This helps in
differentiating account types and is used for account validation.
- [Data Serialization and Deserialization](https://github.com/solana-foundation/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/attribute/account/src/lib.rs#L226-L272):
- [Data Serialization and Deserialization](https://github.com/otter-sec/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/attribute/account/src/lib.rs#L226-L272):
Account data is automatically serialized and deserialized as the account type.

```rust title="lib.rs"
Expand Down Expand Up @@ -411,7 +411,7 @@ pub struct NewAccount {
An account discriminator in an Anchor program refers to an 8 byte identifier
unique to each account type. You can find the implementation of the account
discriminator
[here](https://github.com/solana-foundation/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/attribute/account/src/lib.rs#L113-L130).
[here](https://github.com/otter-sec/anchor/blob/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/lang/attribute/account/src/lib.rs#L113-L130).

The discriminator is the first 8 bytes of the SHA256 hash of the string
`account:<AccountName>`. This discriminator is stored as the first 8 bytes of
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/clients/rust.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description:

The [`anchor-client`](https://docs.rs/anchor-client/latest/anchor_client/) crate
is the Rust client library for interacting with Anchor programs. You can find
the source code [here](https://github.com/solana-foundation/anchor/tree/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/client).
the source code [here](https://github.com/otter-sec/anchor/tree/62865c636aecc6974fc9cfebfc6cf08ca4f0bb72/client).

## Example

Expand Down
Loading
Loading