Skip to content

Commit e089d56

Browse files
committed
feat(examples): add Sui support to oft-main
- Add Sui Move contracts for OFT token and OFT implementation - Add Sui send task with proper RPC connection factory usage - Update layerzero.config.ts with Sui pathway configuration - Add deploy.json.example showing expected deployment format - Update .gitignore to exclude deployment artifacts Configuration notes: - Enforced options order: [TO_SUI_OPTIONS, TO_EVM_OPTIONS] - SUI_ENFORCED_OPTIONS uses 5000 gas (sufficient for Sui) - EVM_ENFORCED_OPTIONS uses 80000 gas (sufficient for EVM)
1 parent 71a4a2b commit e089d56

130 files changed

Lines changed: 28066 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/oft-main/.env.example

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-
2+
# / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \
3+
# `-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-'
4+
#
5+
# Example environment configuration
6+
#
7+
# .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-
8+
# / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \
9+
# `-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-'
10+
11+
# EVM Variables
12+
# By default, the examples support both mnemonic-based and private key-based authentication
13+
# You don't need to set both of these values, just pick the one that you prefer and set that one
14+
MNEMONIC=
15+
# Private key for EVM contract owner/delegate
16+
PRIVATE_KEY=
17+
18+
# Solana Variables
19+
SOLANA_PRIVATE_KEY=
20+
SOLANA_KEYPAIR_PATH=
21+
# By default, the Solana example will use the default cluster RPC URL if no other value is provided
22+
RPC_URL_SOLANA=
23+
RPC_URL_SOLANA_TESTNET=
24+
25+
# Sui Variables
26+
SUI_PRIVATE_KEY=
27+
RPC_URL_SUI=
28+
RPC_URL_SUI_TESTNET=
29+
30+
# Starknet Variables
31+
# NOTE: Starknet needs the account contract address (not the public key) + private key.
32+
STARKNET_ACCOUNT_ADDRESS=
33+
STARKNET_PRIVATE_KEY=
34+
RPC_URL_STARKNET=
35+
RPC_URL_STARKNET_TESTNET=

examples/oft-main/.eslintignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.anchor
2+
.turbo
3+
node_modules
4+
target
5+
artifacts
6+
cache
7+
dist
8+
out
9+
*.log
10+
*.sol
11+
*.yaml
12+
*.lock
13+
package-lock.json

examples/oft-main/.eslintrc.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
require('@rushstack/eslint-patch/modern-module-resolution');
2+
3+
module.exports = {
4+
root: true,
5+
extends: ['@layerzerolabs/eslint-config-next/recommended'],
6+
rules: {
7+
// @layerzerolabs/eslint-config-next defines rules for turborepo-based projects
8+
// that are not relevant for this particular project
9+
'turbo/no-undeclared-env-vars': 'off',
10+
'import/no-unresolved': 'warn',
11+
},
12+
};

examples/oft-main/.gitignore

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
.anchor
2+
node_modules
3+
.env
4+
coverage
5+
coverage.json
6+
target
7+
typechain
8+
typechain-types
9+
10+
# Hardhat files
11+
cache
12+
artifacts
13+
14+
# LayerZero specific files
15+
.layerzero
16+
17+
# foundry test compilation files
18+
out
19+
20+
# pnpm
21+
pnpm-error.log
22+
23+
# Editor and OS files
24+
.DS_Store
25+
.idea
26+
27+
# Deployment artifacts (user-specific, created during deploy)
28+
deployments/
29+
30+
# Sui build artifacts and deployment info
31+
sui/*/build/
32+
sui/deploy.json
33+
34+
# Starknet deployment info
35+
starknet/deploy.json
36+
37+
# Aptos deployment info
38+
aptos/deploy.json
39+
40+
# Move build artifacts
41+
build/
42+
.aptos/

examples/oft-main/.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v20.19.5

examples/oft-main/.prettierignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.anchor
2+
.turbo
3+
node_modules/
4+
target
5+
artifacts/
6+
cache/
7+
dist/
8+
out/
9+
*.log
10+
*ignore
11+
*.yaml
12+
*.lock
13+
package-lock.json
14+
package.json

examples/oft-main/.prettierrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
...require('@layerzerolabs/prettier-config-next'),
3+
};

examples/oft-main/.solhintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ['solhint:recommended', require.resolve('@layerzerolabs/solhint-config')],
3+
};

examples/oft-main/Anchor.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[toolchain]
2+
anchor_version = "0.31.1"
3+
4+
[features]
5+
seeds = false
6+
resolution = false
7+
skip-lint = false
8+
9+
[programs.localnet]
10+
oft = "G2BYTnfGCMQAErMZkTBCFSapKevzf6QCjizjXi8hFEtJ"
11+
12+
[registry]
13+
url = "https://api.apr.dev"
14+
15+
[provider]
16+
cluster = "Localnet"
17+
wallet = "./junk-id.json"
18+
19+
[scripts]
20+
test = "npx jest test/anchor"

0 commit comments

Comments
 (0)