Skip to content

Commit

Permalink
remove submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
St0rmBr3w committed Aug 2, 2024
1 parent 57f1f9c commit 033e5c2
Show file tree
Hide file tree
Showing 51 changed files with 10,362 additions and 1 deletion.
1 change: 0 additions & 1 deletion examples/oft-solana
Submodule oft-solana deleted from c81c33
3 changes: 3 additions & 0 deletions examples/oft-solana/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
...require('@layerzerolabs/prettier-config-next'),
};
3 changes: 3 additions & 0 deletions examples/oft-solana/.solhintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['solhint:recommended', require.resolve('@layerzerolabs/solhint-config')],
};
893 changes: 893 additions & 0 deletions examples/oft-solana/.yarn/releases/yarn-4.0.2.cjs

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions examples/oft-solana/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
compressionLevel: mixed

enableGlobalCache: true
globalFolder: .yarn/berry

nodeLinker: node-modules

unsafeHttpWhitelist:
- localhost

npmRegistries:
"//localhost:4873":
npmAuthToken: "${LOCAL_NPM_TOKEN-}"
//registry.npmjs.org:
npmAuthToken: "${NPM_TOKEN-}"

npmScopes:
layerzerolabs:
npmAlwaysAuth: true
npmPublishRegistry: "${NPM_REGISTRY-https://registry.npmjs.org}"
npmRegistryServer: "${NPM_REGISTRY-https://registry.npmjs.org}"

yarnPath: .yarn/releases/yarn-4.0.2.cjs
69 changes: 69 additions & 0 deletions examples/oft-solana/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<div align="center">
<a href="https://layerzero.network">
<img alt="LayerZero" style="width: 60%" src="https://layerzero.network/static/logo.svg"/>
</a>

<h1>LayerZero OFT</h1>

<p>
<strong>Omnichain Fungible Token(Beta)</strong>
</p>

<p>
<a href="https://docs.layerzero.network/v2/home/protocol/contract-standards#oft"><img alt="Tutorials" src="https://img.shields.io/badge/docs-tutorials-blueviolet" /></a>
</p>
</div>

The Omnichain Fungible Token (OFT) Standard allows fungible tokens to be transferred across multiple blockchains without asset wrapping or middlechains.

This standard works by burning tokens on the source chain whenever an omnichain transfer is initiated, sending a message via the protocol, and delivering a function call to the destination contract to mint the same number of tokens burned. This creates a unified supply across all networks LayerZero supports that the OFT is deployed on.

![title](oft.jpg)

[Audit Reports](https://github.com/LayerZero-Labs/Audits)

## Prepare ProgramId

create programId keypair files if not existed

```
cd packages/solana/contracts
solana-keygen new -o target/deploy/endpoint-keypair.json
solana-keygen new -o target/deploy/oft-keypair.json
anchor keys sync
```

## Build & Test

```bash
yarn && yarn build && yarn test
```

## Deploy

```
cd packages/solana/contracts
```

1. with anchor

```bash
anchor build -v
solana program deploy --program-id target/deploy/oft-keypair.json target/verifiable/oft.so -u mainnet-beta
```

or

2. with solana-verify
```bash
solana-verify build
solana program deploy --program-id target/deploy/oft-keypair.json target/deploy/oft.so -u mainnet-beta
```

please visit [Solana Verify CLI](https://github.com/Ellipsis-Labs/solana-verifiable-build) and [Deploy a Solana Program with the CLI](https://docs.solanalabs.com/cli/examples/deploy-a-program) for more detail.

#### Notice

If you encounter issues during compilation and testing, it might be due to the versions of Solana and Anchor. You can switch to Solana version `1.17.31` and Anchor version `0.29.0`, as these are the versions we have tested and verified to be working.
Binary file added examples/oft-solana/oft.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions examples/oft-solana/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "@layerzerolabs/oft",
"version": "0.0.1",
"private": true,
"workspaces": [
"packages/**"
],
"scripts": {
"build": "$npm_execpath workspaces foreach --all run build",
"clean": "$npm_execpath workspaces foreach --all run clean",
"test": "$npm_execpath workspaces foreach --all run test"
},
"devDependencies": {
"@layerzerolabs/prettier-config-next": "^2.0.1",
"@layerzerolabs/solhint-config": "^2.0.1",
"prettier": "^3.1.0",
"rimraf": "^5.0.5",
"solhint": "^4.0.0",
"typescript": "^4.3.5"
},
"packageManager": "[email protected]",
"engines": {
"node": ">=18.12.0"
}
}
8 changes: 8 additions & 0 deletions examples/oft-solana/packages/solana/contracts/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

.anchor
.DS_Store
target
node_modules
dist
build
test-ledger
20 changes: 20 additions & 0 deletions examples/oft-solana/packages/solana/contracts/Anchor.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[toolchain]
anchor_version = "0.29.0"
solana_version = "1.17.31"

[features]
seeds = false
skip-lint = false

[programs.localnet]
oft = "HRPXLCqspQocTjfcX4rvAPaY9q6Gwb1rrD3xXWrfJWdW"

[registry]
url = "https://api.apr.dev"

[provider]
cluster = "Localnet"
wallet = "~/.config/solana/id.json"

[scripts]
test = "yarn run ts-mocha -b -p ./tsconfig.json -t 1000000 tests/**/*.test.ts"
Loading

0 comments on commit 033e5c2

Please sign in to comment.