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

change references of example-native-token-transfers to native-token-t… #557

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Depending on the platforms you will deploy on:
Run

``` bash
curl -fsSL https://raw.githubusercontent.com/wormhole-foundation/example-native-token-transfers/main/cli/install.sh | bash
curl -fsSL https://raw.githubusercontent.com/wormhole-foundation/native-token-transfers/main/cli/install.sh | bash
```

The installer will put the `ntt` binary in `$HOME/.bun/bin`, so make sure that directory is included in your `$PATH`. Once `ntt` is installed, it can be updated to the latest release any time by running
Expand Down
2 changes: 1 addition & 1 deletion cli/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if ! command -v bun > /dev/null; then
exit 1
fi

REPO="https://github.com/wormhole-foundation/example-native-token-transfers.git"
REPO="https://github.com/wormhole-foundation/native-token-transfers.git"

function main {
branch=""
Expand Down
6 changes: 3 additions & 3 deletions cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ yargs(hideBin(process.argv))
if (argv["repo"]) {
repoArg = `--repo ${argv["repo"]}`;
}
const installScript = "https://raw.githubusercontent.com/wormhole-foundation/example-native-token-transfers/main/cli/install.sh";
const installScript = "https://raw.githubusercontent.com/wormhole-foundation/native-token-transfers/main/cli/install.sh";
// save it to "$HOME/.ntt-cli/install.sh"
const nttDir = `${process.env.HOME}/.ntt-cli`;
const installer = `${nttDir}/install.sh`;
Expand Down Expand Up @@ -285,7 +285,7 @@ yargs(hideBin(process.argv))
process.exit(1);
}
const path = argv["path"];
await $`git clone -b main https://github.com/wormhole-foundation/example-native-token-transfers.git ${path}`;
await $`git clone -b main https://github.com/wormhole-foundation/native-token-transfers.git ${path}`;
})
.command("add-chain <chain>",
"add a chain to the deployment file",
Expand Down Expand Up @@ -1267,7 +1267,7 @@ async function deploySolana<N extends Network, C extends SolanaChains>(
}

const anchorTomlPath = `${pwd}/solana/Anchor.toml`;
const libRsPath = `${pwd}/solana/programs/example-native-token-transfers/src/lib.rs`;
const libRsPath = `${pwd}/solana/programs/native-token-transfers/src/lib.rs`;

const anchorToml = fs.readFileSync(anchorTomlPath).toString();
const newAnchorToml = anchorToml.replace(existingProgramId, providedProgramId);
Expand Down
2 changes: 1 addition & 1 deletion docs/Transceiver.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

The Transceiver is intended to offer a protocol-agnostic interface for sending and receiving cross-chain messages. For Native Token Transfers, this entails initiating attestation generation on the source chain, verifying the resulting attestation on the destination chain, and delivering the message to the associated `NttManager`.

In the provided implementations ([EVM](/evm/src/Transceiver/Transceiver.sol)/[SVM](/solana/programs/example-native-token-transfers/src/transceivers/wormhole/)), Transceiver are intended to have a many-to-one or one-to-one relationship with Managers.
In the provided implementations ([EVM](/evm/src/Transceiver/Transceiver.sol)/[SVM](/solana/programs/native-token-transfers/src/transceivers/wormhole/)), Transceiver are intended to have a many-to-one or one-to-one relationship with Managers.

## Message Specification

Expand Down
4 changes: 2 additions & 2 deletions evm/ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"version": "0.5.0",
"repository": {
"type": "git",
"url": "git+https://github.com/wormhole-foundation/example-native-token-transfers.git"
"url": "git+https://github.com/wormhole-foundation/native-token-transfers.git"
},
"bugs": {
"url": "https://github.com/wormhole-foundation/example-native-token-transfers"
"url": "https://github.com/wormhole-foundation/native-token-transfers"
},
"directories": {
"test": "__tests__"
Expand Down
6 changes: 3 additions & 3 deletions sdk/definitions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"version": "0.5.0",
"repository": {
"type": "git",
"url": "git+https://github.com/wormhole-foundation/example-native-token-transfers.git"
"url": "git+https://github.com/wormhole-foundation/native-token-transfers.git"
},
"bugs": {
"url": "https://github.com/wormhole-foundation/example-native-token-transfers"
"url": "https://github.com/wormhole-foundation/native-token-transfers"
},
"homepage": "https://github.com/wormhole-foundation/example-native-token-transfers#readme",
"homepage": "https://github.com/wormhole-foundation/native-token-transfers#readme",
"directories": {
"test": "__tests__"
},
Expand Down
6 changes: 3 additions & 3 deletions sdk/route/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"version": "0.5.0",
"repository": {
"type": "git",
"url": "git+https://github.com/wormhole-foundation/example-native-token-transfers.git"
"url": "git+https://github.com/wormhole-foundation/native-token-transfers.git"
},
"bugs": {
"url": "https://github.com/wormhole-foundation/example-native-token-transfers"
"url": "https://github.com/wormhole-foundation/native-token-transfers"
},
"homepage": "https://github.com/wormhole-foundation/example-native-token-transfers#readme",
"homepage": "https://github.com/wormhole-foundation/native-token-transfers#readme",
"directories": {
"test": "__tests__"
},
Expand Down
2 changes: 1 addition & 1 deletion solana/Anchor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ upgradeable = true

[[test.genesis]]
address = "worm2ZoG2kUd4vFXhvjh93UUH596ayRfgQ2MgjNMTth"
program = "programs/example-native-token-transfers/tests/fixtures/mainnet_core_bridge.so"
program = "programs/native-token-transfers/tests/fixtures/mainnet_core_bridge.so"

[test.validator]
bind_address = "0.0.0.0"
Expand Down
68 changes: 34 additions & 34 deletions solana/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion solana/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# turn `const VERSION: &str = "major.minor.patch";` into `major_minor_patch`
#use make functions to minimize dependence on shell
VERSION = $(subst .,_,$(subst ;,,$(subst ",,$(lastword \
$(shell grep "const VERSION" programs/example-native-token-transfers/src/lib.rs) \
$(shell grep "const VERSION" programs/native-token-transfers/src/lib.rs) \
))))


Expand Down
8 changes: 4 additions & 4 deletions solana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ See the [NttManager](../docs/NttManager.md) doc for wire format details.

### NativeTokenTransfer Additional Payload

Modify [transfer.rs](./programs/example-native-token-transfers/src/transfer.rs) and replace the `EmptyPayload` with your own custom struct. See [ntt.rs](./modules/ntt-messages/src/ntt.rs) for an example. It is highly encouraged to use a 4-byte prefix for your payload.
Modify [transfer.rs](./programs/native-token-transfers/src/transfer.rs) and replace the `EmptyPayload` with your own custom struct. See [ntt.rs](./modules/ntt-messages/src/ntt.rs) for an example. It is highly encouraged to use a 4-byte prefix for your payload.

The additional payload field should then have your custom struct available everywhere `NativeTokenTransfer<Payload>` is used. Due to typing, parsing, and account allocation restrictions, this implementation expects that _all_ `NativeTokenTransfer` payloads for your contract adhere to your custom struct definition.

You can then modify [release_outbound](./programs/example-native-token-transfers/src/transceivers/wormhole/instructions/release_outbound.rs) and [redeem](./programs/example-native-token-transfers/src/instructions/redeem.rs) to generate and process the additional payload.
You can then modify [release_outbound](./programs/native-token-transfers/src/transceivers/wormhole/instructions/release_outbound.rs) and [redeem](./programs/native-token-transfers/src/instructions/redeem.rs) to generate and process the additional payload.

## Testing

Expand All @@ -134,7 +134,7 @@ make test

- Screenshot:
<img src="images/tsx-command-not-found.png" alt="tsx command not found screenshot">
- Update `Makefile` ([line #29](https://github.com/wormhole-foundation/example-native-token-transfers/blob/main/solana/Makefile#L29)) from:
- Update `Makefile` ([line #29](https://github.com/wormhole-foundation/native-token-transfers/blob/main/solana/Makefile#L29)) from:

```sh
tsx scripts/regenerateIdl.ts $$jsonfile > $$tsfile; \
Expand All @@ -154,6 +154,6 @@ make test
- Screenshot:
<img src="images/lifecycle-script.png" alt="lifecycle script screenshot">
- This occurs due to Typescript files failing compilation.
- [`patch-idl` script](https://github.com/wormhole-foundation/example-native-token-transfers/blob/main/solana/scripts/patch-idl) requires [`jq`](https://jqlang.github.io/jq/) to be installed. Install `jq` and retry.
- [`patch-idl` script](https://github.com/wormhole-foundation/native-token-transfers/blob/main/solana/scripts/patch-idl) requires [`jq`](https://jqlang.github.io/jq/) to be installed. Install `jq` and retry.

</details>
6 changes: 3 additions & 3 deletions solana/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"version": "0.5.0",
"repository": {
"type": "git",
"url": "git+https://github.com/wormhole-foundation/example-native-token-transfers.git"
"url": "git+https://github.com/wormhole-foundation/native-token-transfers.git"
},
"bugs": {
"url": "https://github.com/wormhole-foundation/example-native-token-transfers"
"url": "https://github.com/wormhole-foundation/native-token-transfers"
},
"homepage": "https://github.com/wormhole-foundation/example-native-token-transfers#readme",
"homepage": "https://github.com/wormhole-foundation/native-token-transfers#readme",
"directories": {
"test": "tests"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "example-native-token-transfers"
name = "native-token-transfers"
version = "2.0.0"
description = "Example implementation of native token transfer standard"
edition = "2021"
Expand Down
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion solana/programs/ntt-quoter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ cfg-if.workspace = true
wormhole-io.workspace = true
wormhole-solana-utils.workspace = true

example-native-token-transfers = { path = "../example-native-token-transfers", features = ["no-entrypoint"] }
native-token-transfers = { path = "../native-token-transfers", features = ["no-entrypoint"] }
2 changes: 1 addition & 1 deletion solana/tests/anchor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const coreBridge = new SolanaWormholeCore("Devnet", "Solana", connection, {

const TOKEN_PROGRAM = spl.TOKEN_2022_PROGRAM_ID;

describe("example-native-token-transfers", () => {
describe("native-token-transfers", () => {
let ntt: SolanaNtt<"Devnet", "Solana">;
let signer: Signer;
let sender: AccountAddress<"Solana">;
Expand Down
Loading