Procházet zdrojové kódy

Remove unused solana contracts and their wasm creations (#110)

Removes token bridge, nft bridge, migration. Also removes them from deployments and docs.
Ali Behjati před 3 roky
rodič
revize
e4959768f4
66 změnil soubory, kde provedl 1 přidání a 21670 odebrání
  1. 1 4
      Dockerfile.client
  2. 0 7
      Dockerfile.solana
  3. 0 36
      Dockerfile.wasm
  4. 0 12
      devnet/solana-devnet.yaml
  5. 0 6
      docs/devnet.md
  6. 0 76
      solana/devnet_setup.sh
  7. 0 3550
      solana/migration/Cargo.lock
  8. 0 41
      solana/migration/Cargo.toml
  9. 0 11
      solana/migration/rustfmt.toml
  10. 0 84
      solana/migration/src/accounts.rs
  11. 0 5
      solana/migration/src/api.rs
  12. 0 119
      solana/migration/src/api/add_liquidity.rs
  13. 0 96
      solana/migration/src/api/claim_shares.rs
  14. 0 118
      solana/migration/src/api/create_pool.rs
  15. 0 121
      solana/migration/src/api/migrate_tokens.rs
  16. 0 117
      solana/migration/src/api/remove_liquidity.rs
  17. 0 294
      solana/migration/src/instructions.rs
  18. 0 48
      solana/migration/src/lib.rs
  19. 0 35
      solana/migration/src/types.rs
  20. 0 222
      solana/migration/src/wasm.rs
  21. 0 3665
      solana/modules/nft_bridge/Cargo.lock
  22. 0 5
      solana/modules/nft_bridge/Cargo.toml
  23. 0 44
      solana/modules/nft_bridge/program/Cargo.toml
  24. 0 2
      solana/modules/nft_bridge/program/Xargo.toml
  25. 0 108
      solana/modules/nft_bridge/program/src/accounts.rs
  26. 0 9
      solana/modules/nft_bridge/program/src/api.rs
  27. 0 411
      solana/modules/nft_bridge/program/src/api/complete_transfer.rs
  28. 0 170
      solana/modules/nft_bridge/program/src/api/governance.rs
  29. 0 35
      solana/modules/nft_bridge/program/src/api/initialize.rs
  30. 0 389
      solana/modules/nft_bridge/program/src/api/transfer.rs
  31. 0 518
      solana/modules/nft_bridge/program/src/instructions.rs
  32. 0 83
      solana/modules/nft_bridge/program/src/lib.rs
  33. 0 311
      solana/modules/nft_bridge/program/src/messages.rs
  34. 0 62
      solana/modules/nft_bridge/program/src/types.rs
  35. 0 429
      solana/modules/nft_bridge/program/src/wasm.rs
  36. 0 767
      solana/modules/nft_bridge/program/tests/common.rs
  37. 0 631
      solana/modules/nft_bridge/program/tests/integration.rs
  38. 0 3694
      solana/modules/token_bridge/Cargo.lock
  39. 0 5
      solana/modules/token_bridge/Cargo.toml
  40. 0 21
      solana/modules/token_bridge/client/Cargo.toml
  41. 0 452
      solana/modules/token_bridge/client/src/main.rs
  42. 0 43
      solana/modules/token_bridge/program/Cargo.toml
  43. 0 2
      solana/modules/token_bridge/program/Xargo.toml
  44. 0 107
      solana/modules/token_bridge/program/src/accounts.rs
  45. 0 13
      solana/modules/token_bridge/program/src/api.rs
  46. 0 194
      solana/modules/token_bridge/program/src/api/attest.rs
  47. 0 277
      solana/modules/token_bridge/program/src/api/complete_transfer.rs
  48. 0 291
      solana/modules/token_bridge/program/src/api/create_wrapped.rs
  49. 0 173
      solana/modules/token_bridge/program/src/api/governance.rs
  50. 0 44
      solana/modules/token_bridge/program/src/api/initialize.rs
  51. 0 381
      solana/modules/token_bridge/program/src/api/transfer.rs
  52. 0 579
      solana/modules/token_bridge/program/src/instructions.rs
  53. 0 87
      solana/modules/token_bridge/program/src/lib.rs
  54. 0 389
      solana/modules/token_bridge/program/src/messages.rs
  55. 0 63
      solana/modules/token_bridge/program/src/types.rs
  56. 0 449
      solana/modules/token_bridge/program/src/wasm.rs
  57. 0 767
      solana/modules/token_bridge/program/tests/common.rs
  58. 0 631
      solana/modules/token_bridge/program/tests/integration.rs
  59. 0 20
      solana/modules/token_bridge/token-metadata/Cargo.toml
  60. 0 8
      solana/modules/token_bridge/token-metadata/README.md
  61. 0 2
      solana/modules/token_bridge/token-metadata/Xargo.toml
  62. binární
      solana/modules/token_bridge/token-metadata/spl_token_metadata.so
  63. 0 138
      solana/modules/token_bridge/token-metadata/src/instruction.rs
  64. 0 7
      solana/modules/token_bridge/token-metadata/src/lib.rs
  65. 0 126
      solana/modules/token_bridge/token-metadata/src/state.rs
  66. 0 66
      solana/modules/token_bridge/token-metadata/src/utils.rs

+ 1 - 4
Dockerfile.client

@@ -41,9 +41,6 @@ ENV BRIDGE_ADDRESS="Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o"
 
 RUN --mount=type=cache,target=/root/.cache \
     --mount=type=cache,target=bridge/target \
-    --mount=type=cache,target=modules/token_bridge/target \
 	set -xe && \
     cargo build --manifest-path ./bridge/Cargo.toml --package client --release --locked && \
-    cargo build --manifest-path ./modules/token_bridge/Cargo.toml --package client --release --locked && \
-    cp bridge/target/release/client /usr/local/bin && \
-    cp modules/token_bridge/target/release/client /usr/local/bin/token-bridge-client
+    cp bridge/target/release/client /usr/local/bin

+ 0 - 7
Dockerfile.solana

@@ -43,16 +43,9 @@ RUN --mount=type=cache,target=solana/bridge/target \
     --mount=type=cache,target=solana/migration/target \
     cargo build-bpf --manifest-path "solana/bridge/program/Cargo.toml" -- --locked && \
     cargo build-bpf --manifest-path "solana/bridge/cpi_poster/Cargo.toml" -- --locked && \
-    cargo build-bpf --manifest-path "solana/modules/token_bridge/program/Cargo.toml" -- --locked && \
     cargo build-bpf --manifest-path "solana/pyth2wormhole/program/Cargo.toml" -- --locked && \
-    cargo build-bpf --manifest-path "solana/modules/nft_bridge/program/Cargo.toml" -- --locked && \
-    cargo build-bpf --manifest-path "solana/migration/Cargo.toml" -- --locked && \
     cp solana/bridge/target/deploy/bridge.so /opt/solana/deps/bridge.so && \
     cp solana/bridge/target/deploy/cpi_poster.so /opt/solana/deps/cpi_poster.so && \
-    cp solana/migration/target/deploy/wormhole_migration.so /opt/solana/deps/wormhole_migration.so && \
-    cp solana/modules/token_bridge/target/deploy/token_bridge.so /opt/solana/deps/token_bridge.so && \
-    cp solana/modules/nft_bridge/target/deploy/nft_bridge.so /opt/solana/deps/nft_bridge.so && \
-    cp solana/modules/token_bridge/token-metadata/spl_token_metadata.so /opt/solana/deps/spl_token_metadata.so && \
     cp solana/pyth2wormhole/target/deploy/pyth2wormhole.so /opt/solana/deps/pyth2wormhole.so
 
 COPY --from=pyth-oracle-copy /home/pyth/pyth-client/target/oracle.so /opt/solana/deps/pyth_oracle.so

+ 0 - 36
Dockerfile.wasm

@@ -34,36 +34,6 @@ RUN --mount=type=cache,target=/root/.cache \
 	--mount=type=cache,target=solana/bridge/target \
     cd solana/bridge/program && /usr/local/cargo/bin/wasm-pack build --target nodejs -d nodejs -- --features wasm --locked
 
-# Compile Token Bridge
-RUN --mount=type=cache,target=/root/.cache \
-	--mount=type=cache,target=solana/modules/token_bridge/target \
-    cd solana/modules/token_bridge/program && /usr/local/cargo/bin/wasm-pack build --target bundler -d bundler -- --features wasm --locked && \
-    cd bundler && sed -i $SED_REMOVE_INVALID_REFERENCE token_bridge_bg.js
-
-RUN --mount=type=cache,target=/root/.cache \
-	--mount=type=cache,target=solana/modules/token_bridge/target \
-    cd solana/modules/token_bridge/program && /usr/local/cargo/bin/wasm-pack build --target nodejs -d nodejs -- --features wasm --locked
-
-# Compile Migration
-RUN --mount=type=cache,target=/root/.cache \
-	--mount=type=cache,target=solana/migration/target \
-    cd solana/migration && /usr/local/cargo/bin/wasm-pack build --target bundler -d bundler -- --features wasm --locked && \
-    cd bundler && sed -i $SED_REMOVE_INVALID_REFERENCE wormhole_migration_bg.js
-
-RUN --mount=type=cache,target=/root/.cache \
-	--mount=type=cache,target=solana/migration/target \
-    cd solana/migration && /usr/local/cargo/bin/wasm-pack build --target nodejs -d nodejs -- --features wasm --locked
-
-# Compile NFT Bridge
-RUN --mount=type=cache,target=/root/.cache \
-	--mount=type=cache,target=solana/modules/nft_bridge/target \
-    cd solana/modules/nft_bridge/program && /usr/local/cargo/bin/wasm-pack build --target bundler -d bundler -- --features wasm --locked && \
-    cd bundler && sed -i $SED_REMOVE_INVALID_REFERENCE nft_bridge_bg.js
-
-RUN --mount=type=cache,target=/root/.cache \
-	--mount=type=cache,target=solana/modules/nft_bridge/target \
-    cd solana/modules/nft_bridge/program && /usr/local/cargo/bin/wasm-pack build --target nodejs -d nodejs -- --features wasm --locked
-
 # Compile pyth2wormhole
 RUN --mount=type=cache,target=/root/.cache \
 	--mount=type=cache,target=third_party/pyth/p2w-sdk/rust/target \
@@ -78,14 +48,8 @@ RUN --mount=type=cache,target=/root/.cache \
 FROM scratch AS export
 
 COPY --from=build /usr/src/bridge/solana/bridge/program/bundler sdk/js/src/solana/core
-COPY --from=build /usr/src/bridge/solana/modules/token_bridge/program/bundler sdk/js/src/solana/token
-COPY --from=build /usr/src/bridge/solana/migration/bundler sdk/js/src/solana/migration
-COPY --from=build /usr/src/bridge/solana/modules/nft_bridge/program/bundler sdk/js/src/solana/nft
 
 COPY --from=build /usr/src/bridge/third_party/pyth/p2w-sdk/rust/bundler third_party/pyth/p2w-sdk/js/src/solana/p2w-core
 COPY --from=build /usr/src/bridge/solana/bridge/program/bundler third_party/pyth/p2w-sdk/js/src/solana/wormhole-core
 
 COPY --from=build /usr/src/bridge/solana/bridge/program/nodejs sdk/js/src/solana/core-node
-COPY --from=build /usr/src/bridge/solana/modules/token_bridge/program/nodejs sdk/js/src/solana/token-node
-COPY --from=build /usr/src/bridge/solana/migration/nodejs sdk/js/src/solana/migration-node
-COPY --from=build /usr/src/bridge/solana/modules/nft_bridge/program/nodejs sdk/js/src/solana/nft-node

+ 0 - 12
devnet/solana-devnet.yaml

@@ -42,26 +42,14 @@ spec:
             - Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o
             - /opt/solana/deps/bridge.so
             - --bpf-program
-            - B6RHG3mfcckmrYN1UhmJzyS1XX3fZKbkeUcpJe9Sy3FE
-            - /opt/solana/deps/token_bridge.so
-            - --bpf-program
-            - NFTWqJR8YnRVqPDvTJrYuLrQDitTG5AScqbeghi4zSA
-            - /opt/solana/deps/nft_bridge.so
-            - --bpf-program
             - CP1co2QMMoDPbsmV7PGcUTLFwyhgCgTXt25gLQ5LewE1
             - /opt/solana/deps/cpi_poster.so
             - --bpf-program
-            - metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s
-            - /opt/solana/deps/spl_token_metadata.so
-            - --bpf-program
             - gMYYig2utAxVoXnM9UhtTWrt8e7x2SVBZqsWZJeT5Gw # Derived from pyth_program.json
             - /opt/solana/deps/pyth_oracle.so
             - --bpf-program
             - P2WH424242424242424242424242424242424242424
             - /opt/solana/deps/pyth2wormhole.so
-            - --bpf-program
-            - Ex9bCdVMSfx7EzB3pgSi2R4UHwJAXvTw18rBQm5YQ8gK
-            - /opt/solana/deps/wormhole_migration.so
             - --log
           ports:
             - containerPort: 8001

+ 0 - 6
docs/devnet.md

@@ -10,13 +10,7 @@
 | Token Bridge       | ETH             | 0x0290FB167208Af455bB137780163b7B7a9a10C16                                                            |                                                                                                                                                                |
 | NFT Bridge         | ETH             | 0x26b4afb60d6c903165150c6f0aa14f8016be4aec                                                            |                                                                                                                                                                |
 | Test Wallet        | SOL             | 6sbzC1eH4FTujJXWj51eQe25cYvr4xfXbJ1vAj7j2k5J                                                          | Key in `solana/keys/solana-devnet.json`                                                                                                                        |
-| Example Token      | SOL             | 2WDq7wSs9zYrpx2kbHDA4RUTRch2CCTP6ZWaH4GNfnQQ                                                          | Tokens minted to Test Wallet                                                                                                                                   |
-| Example NFT        | SOL             | BVxyYhm498L79r4HMQ9sxZ5bi41DmJmeWZ7SCS7Cyvna                                                          | One minted to Test Wallet                                                                                                                                      |
-| Example NFT 2      | SOL             | nftMANh29jbMboVnbYt1AUAWFP9N4Jnckr9Zeq85WUs                                                           | One minted to Test Wallet                                                                                                                                      |
 | Bridge Core        | SOL             | Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o                                                           |                                                                                                                                                                |
-| Token Bridge       | SOL             | B6RHG3mfcckmrYN1UhmJzyS1XX3fZKbkeUcpJe9Sy3FE                                                          |                                                                                                                                                                |
-| NFT Bridge         | SOL             | NFTWqJR8YnRVqPDvTJrYuLrQDitTG5AScqbeghi4zSA                                                           |                                                                                                                                                                |
-| Migration Contract | SOL             | Ex9bCdVMSfx7EzB3pgSi2R4UHwJAXvTw18rBQm5YQ8gK                                                          |                                                                                                                                                                |
 | P2W Emitter        | SOL             | 8fuAZUxHecYLMC76ZNjYzwRybUiDv9LhkRQsAccEykLr                                                          |                                                                                                                                                                |
 | Test Wallet        | Terra           | terra1x46rqay4d3cssq8gxxvqz8xt6nwlz4td20k38v                                                          | Mnemonic: `notice oak worry limit wrap speak medal online prefer cluster roof addict wrist behave treat actual wasp year salad speed social layer crew genius` |
 | Bridge Core        | Terra           | terra18vd8fpwxzck93qlwghaj6arh4p7c5n896xzem5                                                          |                                                                                                                                                                |              |

+ 0 - 76
solana/devnet_setup.sh

@@ -10,29 +10,9 @@ websocket_url: ""
 keypair_path: /usr/src/solana/keys/solana-devnet.json
 EOF
 
-# Static key for the mint so it always has the same address
-cat <<EOF > token.json
-[179,228,102,38,68,102,75,133,127,56,63,167,143,42,59,29,220,215,100,149,220,241,176,204,154,241,168,147,195,139,55,100,22,88,9,115,146,64,160,172,3,185,132,64,254,137,133,84,142,58,166,131,205,13,77,157,245,181,101,150,105,250,163,1]
-EOF
-
-# Static key for the NFT mint so it always has the same address
-cat <<EOF > nft.json
-[155,117,110,235,96,214,56,128,109,79,49,209,212,13,134,5,43,123,213,68,21,156,128,100,95,8,43,51,188,230,21,197,156,0,108,72,200,203,243,56,73,203,7,163,249,54,21,156,197,35,249,89,28,177,153,154,189,69,137,14,197,254,233,183]
-EOF
-
-# Static key for the 2nd NFT mint so it always has the same address
-cat <<EOF > nft2.json
-[40,74,92,250,81,56,202,67,129,124,193,219,24,161,198,98,191,214,136,7,112,26,72,17,33,249,24,225,183,237,27,216,11,179,26,170,82,220,3,253,152,185,151,186,12,21,138,161,175,46,180,3,167,165,70,51,128,45,237,143,146,49,34,180]
-EOF
-
 # Constants
-cli_address=6sbzC1eH4FTujJXWj51eQe25cYvr4xfXbJ1vAj7j2k5J
 bridge_address=Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o
-nft_bridge_address=NFTWqJR8YnRVqPDvTJrYuLrQDitTG5AScqbeghi4zSA
-token_bridge_address=B6RHG3mfcckmrYN1UhmJzyS1XX3fZKbkeUcpJe9Sy3FE
 initial_guardian=befa429d57cd18b7f8a4d91a2da9ab4af05d0fbe
-recipient_address=90F8bf6A479f320ead074411a4B0e7944Ea8c9C1
-chain_id_ethereum=2
 
 retry () {
   while ! $@; do
@@ -43,65 +23,9 @@ retry () {
 # Fund our account (as defined in solana/keys/solana-devnet.json).
 retry solana airdrop 1000
 
-# Create a new SPL token
-token=$(spl-token create-token -- token.json | grep 'Creating token' | awk '{ print $3 }')
-echo "Created token $token"
-
-# Create token account
-account=$(spl-token create-account "$token" | grep 'Creating account' | awk '{ print $3 }')
-echo "Created token account $account"
-
-# Mint new tokens owned by our CLI account
-spl-token mint "$token" 10000000000 "$account"
-
-# Create meta for token
-token-bridge-client create-meta "$token" "Solana Test Token" "SOLT" ""
-
-# Create a new SPL NFT
-nft=$(spl-token create-token --decimals 0 -- nft.json | grep 'Creating token' | awk '{ print $3 }')
-echo "Created NFT $nft"
-
-# Create NFT account
-nft_account=$(spl-token create-account "$nft" | grep 'Creating account' | awk '{ print $3 }')
-echo "Created NFT account $nft_account"
-
-# Mint new NFT owned by our CLI account
-spl-token mint "$nft" 1 "$nft_account"
-
-# Create meta for token
-token-bridge-client create-meta "$nft" "Not a PUNK🎸" "PUNK🎸" "https://wrappedpunks.com:3000/api/punks/metadata/39"
-
-nft=$(spl-token create-token --decimals 0 -- nft2.json | grep 'Creating token' | awk '{ print $3 }')
-echo "Created NFT $nft"
-
-nft_account=$(spl-token create-account "$nft" | grep 'Creating account' | awk '{ print $3 }')
-echo "Created NFT account $nft_account"
-
-spl-token mint "$nft" 1 "$nft_account"
-
-token-bridge-client create-meta "$nft" "Not a PUNK 2🎸" "PUNK2🎸" "https://wrappedpunks.com:3000/api/punks/metadata/51"
-
 # Create the bridge contract at a known address
 # OK to fail on subsequent attempts (already created).
 retry client create-bridge "$bridge_address" "$initial_guardian" 86400 100
 
-# Initialize the token bridge
-retry token-bridge-client create-bridge "$token_bridge_address" "$bridge_address"
-# Initialize the NFT bridge
-retry token-bridge-client create-bridge "$nft_bridge_address" "$bridge_address"
-
-pushd /usr/src/clients/token_bridge
-# Register the Token Bridge Endpoint on ETH
-node main.js solana execute_governance_vaa $(node main.js generate_register_chain_vaa 2 0x0000000000000000000000000290FB167208Af455bB137780163b7B7a9a10C16)
-node main.js solana execute_governance_vaa $(node main.js generate_register_chain_vaa 3 0x000000000000000000000000784999135aaa8a3ca5914468852fdddbddd8789d)
-node main.js solana execute_governance_vaa $(node main.js generate_register_chain_vaa 4 0x0000000000000000000000000290FB167208Af455bB137780163b7B7a9a10C16)
-popd
-
-pushd /usr/src/clients/nft_bridge
-# Register the NFT Bridge Endpoint on ETH
-node main.js solana execute_governance_vaa $(node main.js generate_register_chain_vaa 2 0x00000000000000000000000026b4afb60d6c903165150c6f0aa14f8016be4aec)
-node main.js solana execute_governance_vaa $(node main.js generate_register_chain_vaa 3 0x000000000000000000000000288246bebae560e006d01c675ae332ac8e146bb7)
-popd
-
 # Let k8s startup probe succeed
 nc -k -l -p 2000

+ 0 - 3550
solana/migration/Cargo.lock

@@ -1,3550 +0,0 @@
-# This file is automatically @generated by Cargo.
-# It is not intended for manual editing.
-version = 3
-
-[[package]]
-name = "Inflector"
-version = "0.11.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3"
-dependencies = [
- "lazy_static",
- "regex",
-]
-
-[[package]]
-name = "addr2line"
-version = "0.17.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b"
-dependencies = [
- "gimli",
-]
-
-[[package]]
-name = "adler"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
-
-[[package]]
-name = "ahash"
-version = "0.4.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e"
-
-[[package]]
-name = "aho-corasick"
-version = "0.7.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "aliasable"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd"
-
-[[package]]
-name = "ansi_term"
-version = "0.12.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2"
-dependencies = [
- "winapi",
-]
-
-[[package]]
-name = "anyhow"
-version = "1.0.52"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "84450d0b4a8bd1ba4144ce8ce718fbc5d071358b1e5384bace6536b3d1f2d5b3"
-
-[[package]]
-name = "arrayref"
-version = "0.3.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544"
-
-[[package]]
-name = "arrayvec"
-version = "0.7.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6"
-
-[[package]]
-name = "assert_matches"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9"
-
-[[package]]
-name = "atty"
-version = "0.2.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
-dependencies = [
- "hermit-abi",
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "autocfg"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
-
-[[package]]
-name = "backtrace"
-version = "0.3.63"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "321629d8ba6513061f26707241fa9bc89524ff1cd7a915a97ef0c62c666ce1b6"
-dependencies = [
- "addr2line",
- "cc",
- "cfg-if",
- "libc",
- "miniz_oxide",
- "object",
- "rustc-demangle",
-]
-
-[[package]]
-name = "base32"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "23ce669cd6c8588f79e15cf450314f9638f967fc5770ff1c7c1deb0925ea7cfa"
-
-[[package]]
-name = "base64"
-version = "0.12.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff"
-
-[[package]]
-name = "base64"
-version = "0.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
-
-[[package]]
-name = "bincode"
-version = "1.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "bitflags"
-version = "1.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
-
-[[package]]
-name = "blake3"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "882e99e4a0cb2ae6cb6e442102e8e6b7131718d94110e64c3e6a34ea9b106f37"
-dependencies = [
- "arrayref",
- "arrayvec",
- "cc",
- "cfg-if",
- "constant_time_eq",
- "digest 0.10.1",
-]
-
-[[package]]
-name = "block-buffer"
-version = "0.7.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b"
-dependencies = [
- "block-padding 0.1.5",
- "byte-tools",
- "byteorder",
- "generic-array 0.12.4",
-]
-
-[[package]]
-name = "block-buffer"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4"
-dependencies = [
- "block-padding 0.2.1",
- "generic-array 0.14.5",
-]
-
-[[package]]
-name = "block-buffer"
-version = "0.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1d36a02058e76b040de25a4464ba1c80935655595b661505c8b39b664828b95"
-dependencies = [
- "generic-array 0.14.5",
-]
-
-[[package]]
-name = "block-padding"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5"
-dependencies = [
- "byte-tools",
-]
-
-[[package]]
-name = "block-padding"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae"
-
-[[package]]
-name = "borsh"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "18dda7dc709193c0d86a1a51050a926dc3df1cf262ec46a23a25dba421ea1924"
-dependencies = [
- "borsh-derive",
- "hashbrown 0.9.1",
-]
-
-[[package]]
-name = "borsh-derive"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "684155372435f578c0fa1acd13ebbb182cc19d6b38b64ae7901da4393217d264"
-dependencies = [
- "borsh-derive-internal",
- "borsh-schema-derive-internal",
- "proc-macro-crate 0.1.5",
- "proc-macro2 1.0.36",
- "syn 1.0.85",
-]
-
-[[package]]
-name = "borsh-derive-internal"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2102f62f8b6d3edeab871830782285b64cc1830168094db05c8e458f209bc5c3"
-dependencies = [
- "proc-macro2 1.0.36",
- "quote 1.0.14",
- "syn 1.0.85",
-]
-
-[[package]]
-name = "borsh-schema-derive-internal"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "196c978c4c9b0b142d446ef3240690bf5a8a33497074a113ff9a337ccb750483"
-dependencies = [
- "proc-macro2 1.0.36",
- "quote 1.0.14",
- "syn 1.0.85",
-]
-
-[[package]]
-name = "bs58"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3"
-
-[[package]]
-name = "bumpalo"
-version = "3.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899"
-
-[[package]]
-name = "bv"
-version = "0.11.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8834bb1d8ee5dc048ee3124f2c7c1afcc6bc9aed03f11e9dfd8c69470a5db340"
-dependencies = [
- "feature-probe",
- "serde",
-]
-
-[[package]]
-name = "byte-tools"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7"
-
-[[package]]
-name = "bytemuck"
-version = "1.7.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "439989e6b8c38d1b6570a384ef1e49c8848128f5a97f3914baef02920842712f"
-dependencies = [
- "bytemuck_derive",
-]
-
-[[package]]
-name = "bytemuck_derive"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e215f8c2f9f79cb53c8335e687ffd07d5bfcb6fe5fc80723762d0be46e7cc54"
-dependencies = [
- "proc-macro2 1.0.36",
- "quote 1.0.14",
- "syn 1.0.85",
-]
-
-[[package]]
-name = "byteorder"
-version = "1.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
-
-[[package]]
-name = "bytes"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8"
-
-[[package]]
-name = "bzip2"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6afcd980b5f3a45017c57e57a2fcccbb351cc43a356ce117ef760ef8052b89b0"
-dependencies = [
- "bzip2-sys",
- "libc",
-]
-
-[[package]]
-name = "bzip2-sys"
-version = "0.1.11+1.0.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc"
-dependencies = [
- "cc",
- "libc",
- "pkg-config",
-]
-
-[[package]]
-name = "caps"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "61bf7211aad104ce2769ec05efcdfabf85ee84ac92461d142f22cf8badd0e54c"
-dependencies = [
- "errno",
- "libc",
- "thiserror",
-]
-
-[[package]]
-name = "cc"
-version = "1.0.72"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee"
-dependencies = [
- "jobserver",
-]
-
-[[package]]
-name = "cfg-if"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
-
-[[package]]
-name = "chrono"
-version = "0.4.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73"
-dependencies = [
- "libc",
- "num-integer",
- "num-traits",
- "serde",
- "time",
- "winapi",
-]
-
-[[package]]
-name = "clap"
-version = "2.34.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c"
-dependencies = [
- "ansi_term",
- "atty",
- "bitflags",
- "strsim",
- "textwrap",
- "unicode-width",
- "vec_map",
-]
-
-[[package]]
-name = "console"
-version = "0.15.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a28b32d32ca44b70c3e4acd7db1babf555fa026e385fb95f18028f88848b3c31"
-dependencies = [
- "encode_unicode",
- "libc",
- "once_cell",
- "regex",
- "terminal_size",
- "unicode-width",
- "winapi",
-]
-
-[[package]]
-name = "console_error_panic_hook"
-version = "0.1.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc"
-dependencies = [
- "cfg-if",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "console_log"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "501a375961cef1a0d44767200e66e4a559283097e91d0730b1d75dfb2f8a1494"
-dependencies = [
- "log",
- "web-sys",
-]
-
-[[package]]
-name = "constant_time_eq"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc"
-
-[[package]]
-name = "cpufeatures"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "crc32fast"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "738c290dfaea84fc1ca15ad9c168d083b05a714e1efddd8edaab678dc28d2836"
-dependencies = [
- "cfg-if",
-]
-
-[[package]]
-name = "crossbeam-channel"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e54ea8bc3fb1ee042f5aace6e3c6e025d3874866da222930f70ce62aceba0bfa"
-dependencies = [
- "cfg-if",
- "crossbeam-utils",
-]
-
-[[package]]
-name = "crossbeam-deque"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e"
-dependencies = [
- "cfg-if",
- "crossbeam-epoch",
- "crossbeam-utils",
-]
-
-[[package]]
-name = "crossbeam-epoch"
-version = "0.9.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97242a70df9b89a65d0b6df3c4bf5b9ce03c5b7309019777fbde37e7537f8762"
-dependencies = [
- "cfg-if",
- "crossbeam-utils",
- "lazy_static",
- "memoffset",
- "scopeguard",
-]
-
-[[package]]
-name = "crossbeam-utils"
-version = "0.8.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cfcae03edb34f947e64acdb1c33ec169824e20657e9ecb61cef6c8c74dcb8120"
-dependencies = [
- "cfg-if",
- "lazy_static",
-]
-
-[[package]]
-name = "crunchy"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7"
-
-[[package]]
-name = "crypto-common"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "683d6b536309245c849479fba3da410962a43ed8e51c26b729208ec0ac2798d0"
-dependencies = [
- "generic-array 0.14.5",
-]
-
-[[package]]
-name = "crypto-mac"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5"
-dependencies = [
- "generic-array 0.12.4",
- "subtle 1.0.0",
-]
-
-[[package]]
-name = "crypto-mac"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab"
-dependencies = [
- "generic-array 0.14.5",
- "subtle 2.4.1",
-]
-
-[[package]]
-name = "crypto-mac"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "58bcd97a54c7ca5ce2f6eb16f6bede5b0ab5f0055fedc17d2f0b4466e21671ca"
-dependencies = [
- "generic-array 0.14.5",
- "subtle 2.4.1",
-]
-
-[[package]]
-name = "crypto-mac"
-version = "0.11.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714"
-dependencies = [
- "generic-array 0.14.5",
- "subtle 2.4.1",
-]
-
-[[package]]
-name = "curve25519-dalek"
-version = "3.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61"
-dependencies = [
- "byteorder",
- "digest 0.9.0",
- "rand_core 0.5.1",
- "subtle 2.4.1",
- "zeroize",
-]
-
-[[package]]
-name = "dashmap"
-version = "4.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e77a43b28d0668df09411cb0bc9a8c2adc40f9a048afe863e05fd43251e8e39c"
-dependencies = [
- "cfg-if",
- "num_cpus",
- "rayon",
-]
-
-[[package]]
-name = "derivation-path"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "193388a8c8c75a490b604ff61775e236541b8975e98e5ca1f6ea97d122b7e2db"
-dependencies = [
- "failure",
-]
-
-[[package]]
-name = "dialoguer"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "61579ada4ec0c6031cfac3f86fdba0d195a7ebeb5e36693bd53cb5999a25beeb"
-dependencies = [
- "console",
- "lazy_static",
- "tempfile",
- "zeroize",
-]
-
-[[package]]
-name = "digest"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5"
-dependencies = [
- "generic-array 0.12.4",
-]
-
-[[package]]
-name = "digest"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066"
-dependencies = [
- "generic-array 0.14.5",
-]
-
-[[package]]
-name = "digest"
-version = "0.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b697d66081d42af4fba142d56918a3cb21dc8eb63372c6b85d14f44fb9c5979b"
-dependencies = [
- "block-buffer 0.10.0",
- "crypto-common",
- "generic-array 0.14.5",
- "subtle 2.4.1",
-]
-
-[[package]]
-name = "dir-diff"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2860407d7d7e2e004bb2128510ad9e8d669e76fa005ccf567977b5d71b8b4a0b"
-dependencies = [
- "walkdir",
-]
-
-[[package]]
-name = "dirs-next"
-version = "2.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1"
-dependencies = [
- "cfg-if",
- "dirs-sys-next",
-]
-
-[[package]]
-name = "dirs-sys-next"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d"
-dependencies = [
- "libc",
- "redox_users",
- "winapi",
-]
-
-[[package]]
-name = "dlopen"
-version = "0.1.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "71e80ad39f814a9abe68583cd50a2d45c8a67561c3361ab8da240587dda80937"
-dependencies = [
- "dlopen_derive",
- "lazy_static",
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "dlopen_derive"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f236d9e1b1fbd81cea0f9cbdc8dcc7e8ebcd80e6659cd7cb2ad5f6c05946c581"
-dependencies = [
- "libc",
- "quote 0.6.13",
- "syn 0.15.44",
-]
-
-[[package]]
-name = "ed25519"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "74e1069e39f1454367eb2de793ed062fac4c35c2934b76a81d90dd9abcd28816"
-dependencies = [
- "signature",
-]
-
-[[package]]
-name = "ed25519-dalek"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d"
-dependencies = [
- "curve25519-dalek",
- "ed25519",
- "rand 0.7.3",
- "serde",
- "sha2 0.9.9",
- "zeroize",
-]
-
-[[package]]
-name = "ed25519-dalek-bip32"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "057f328f31294b5ab432e6c39642f54afd1531677d6d4ba2905932844cc242f3"
-dependencies = [
- "derivation-path",
- "ed25519-dalek",
- "failure",
- "hmac 0.9.0",
- "sha2 0.9.9",
-]
-
-[[package]]
-name = "either"
-version = "1.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
-
-[[package]]
-name = "encode_unicode"
-version = "0.3.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f"
-
-[[package]]
-name = "encoding_rs"
-version = "0.8.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7896dc8abb250ffdda33912550faa54c88ec8b998dec0b2c55ab224921ce11df"
-dependencies = [
- "cfg-if",
-]
-
-[[package]]
-name = "env_logger"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3"
-dependencies = [
- "atty",
- "humantime",
- "log",
- "regex",
- "termcolor",
-]
-
-[[package]]
-name = "errno"
-version = "0.2.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1"
-dependencies = [
- "errno-dragonfly",
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "errno-dragonfly"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf"
-dependencies = [
- "cc",
- "libc",
-]
-
-[[package]]
-name = "failure"
-version = "0.1.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86"
-dependencies = [
- "backtrace",
- "failure_derive",
-]
-
-[[package]]
-name = "failure_derive"
-version = "0.1.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4"
-dependencies = [
- "proc-macro2 1.0.36",
- "quote 1.0.14",
- "syn 1.0.85",
- "synstructure",
-]
-
-[[package]]
-name = "fake-simd"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed"
-
-[[package]]
-name = "fastrand"
-version = "1.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "779d043b6a0b90cc4c0ed7ee380a6504394cee7efd7db050e3774eee387324b2"
-dependencies = [
- "instant",
-]
-
-[[package]]
-name = "feature-probe"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da"
-
-[[package]]
-name = "filetime"
-version = "0.2.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "975ccf83d8d9d0d84682850a38c8169027be83368805971cc4f238c2b245bc98"
-dependencies = [
- "cfg-if",
- "libc",
- "redox_syscall",
- "winapi",
-]
-
-[[package]]
-name = "flate2"
-version = "1.0.22"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e6988e897c1c9c485f43b47a529cef42fde0547f9d8d41a7062518f1d8fc53f"
-dependencies = [
- "cfg-if",
- "crc32fast",
- "libc",
- "miniz_oxide",
-]
-
-[[package]]
-name = "fnv"
-version = "1.0.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
-
-[[package]]
-name = "form_urlencoded"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191"
-dependencies = [
- "matches",
- "percent-encoding",
-]
-
-[[package]]
-name = "fs_extra"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394"
-
-[[package]]
-name = "futures"
-version = "0.3.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "28560757fe2bb34e79f907794bb6b22ae8b0e5c669b638a1132f2592b19035b4"
-dependencies = [
- "futures-channel",
- "futures-core",
- "futures-executor",
- "futures-io",
- "futures-sink",
- "futures-task",
- "futures-util",
-]
-
-[[package]]
-name = "futures-channel"
-version = "0.3.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba3dda0b6588335f360afc675d0564c17a77a2bda81ca178a4b6081bd86c7f0b"
-dependencies = [
- "futures-core",
- "futures-sink",
-]
-
-[[package]]
-name = "futures-core"
-version = "0.3.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d0c8ff0461b82559810cdccfde3215c3f373807f5e5232b71479bff7bb2583d7"
-
-[[package]]
-name = "futures-executor"
-version = "0.3.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "29d6d2ff5bb10fb95c85b8ce46538a2e5f5e7fdc755623a7d4529ab8a4ed9d2a"
-dependencies = [
- "futures-core",
- "futures-task",
- "futures-util",
-]
-
-[[package]]
-name = "futures-io"
-version = "0.3.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1f9d34af5a1aac6fb380f735fe510746c38067c5bf16c7fd250280503c971b2"
-
-[[package]]
-name = "futures-macro"
-version = "0.3.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6dbd947adfffb0efc70599b3ddcf7b5597bb5fa9e245eb99f62b3a5f7bb8bd3c"
-dependencies = [
- "proc-macro2 1.0.36",
- "quote 1.0.14",
- "syn 1.0.85",
-]
-
-[[package]]
-name = "futures-sink"
-version = "0.3.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3055baccb68d74ff6480350f8d6eb8fcfa3aa11bdc1a1ae3afdd0514617d508"
-
-[[package]]
-name = "futures-task"
-version = "0.3.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ee7c6485c30167ce4dfb83ac568a849fe53274c831081476ee13e0dce1aad72"
-
-[[package]]
-name = "futures-util"
-version = "0.3.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d9b5cf40b47a271f77a8b1bec03ca09044d99d2372c0de244e66430761127164"
-dependencies = [
- "futures-channel",
- "futures-core",
- "futures-io",
- "futures-macro",
- "futures-sink",
- "futures-task",
- "memchr",
- "pin-project-lite",
- "pin-utils",
- "slab",
-]
-
-[[package]]
-name = "generic-array"
-version = "0.12.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd"
-dependencies = [
- "typenum",
-]
-
-[[package]]
-name = "generic-array"
-version = "0.14.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803"
-dependencies = [
- "serde",
- "typenum",
- "version_check",
-]
-
-[[package]]
-name = "gethostname"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e692e296bfac1d2533ef168d0b60ff5897b8b70a4009276834014dd8924cc028"
-dependencies = [
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "getrandom"
-version = "0.1.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce"
-dependencies = [
- "cfg-if",
- "js-sys",
- "libc",
- "wasi 0.9.0+wasi-snapshot-preview1",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "getrandom"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753"
-dependencies = [
- "cfg-if",
- "libc",
- "wasi 0.10.2+wasi-snapshot-preview1",
-]
-
-[[package]]
-name = "gimli"
-version = "0.26.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4"
-
-[[package]]
-name = "h2"
-version = "0.3.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0c9de88456263e249e241fcd211d3954e2c9b0ef7ccfc235a444eb367cae3689"
-dependencies = [
- "bytes",
- "fnv",
- "futures-core",
- "futures-sink",
- "futures-util",
- "http",
- "indexmap",
- "slab",
- "tokio",
- "tokio-util",
- "tracing",
-]
-
-[[package]]
-name = "hashbrown"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04"
-dependencies = [
- "ahash",
-]
-
-[[package]]
-name = "hashbrown"
-version = "0.11.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
-
-[[package]]
-name = "hermit-abi"
-version = "0.1.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "hex"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
-
-[[package]]
-name = "hex-literal"
-version = "0.3.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0"
-
-[[package]]
-name = "hidapi"
-version = "1.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e6c4cc7279df8353788ac551186920e44959d5948aec404be02b28544a598bce"
-dependencies = [
- "cc",
- "libc",
- "pkg-config",
-]
-
-[[package]]
-name = "hmac"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5dcb5e64cda4c23119ab41ba960d1e170a774c8e4b9d9e6a9bc18aabf5e59695"
-dependencies = [
- "crypto-mac 0.7.0",
- "digest 0.8.1",
-]
-
-[[package]]
-name = "hmac"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840"
-dependencies = [
- "crypto-mac 0.8.0",
- "digest 0.9.0",
-]
-
-[[package]]
-name = "hmac"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "deae6d9dbb35ec2c502d62b8f7b1c000a0822c3b0794ba36b3149c0a1c840dff"
-dependencies = [
- "crypto-mac 0.9.1",
- "digest 0.9.0",
-]
-
-[[package]]
-name = "hmac"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b"
-dependencies = [
- "crypto-mac 0.11.1",
- "digest 0.9.0",
-]
-
-[[package]]
-name = "hmac-drbg"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c6e570451493f10f6581b48cdd530413b63ea9e780f544bfd3bdcaa0d89d1a7b"
-dependencies = [
- "digest 0.8.1",
- "generic-array 0.12.4",
- "hmac 0.7.1",
-]
-
-[[package]]
-name = "hmac-drbg"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1"
-dependencies = [
- "digest 0.9.0",
- "generic-array 0.14.5",
- "hmac 0.8.1",
-]
-
-[[package]]
-name = "http"
-version = "0.2.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "31f4c6746584866f0feabcc69893c5b51beef3831656a968ed7ae254cdc4fd03"
-dependencies = [
- "bytes",
- "fnv",
- "itoa 1.0.1",
-]
-
-[[package]]
-name = "http-body"
-version = "0.4.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6"
-dependencies = [
- "bytes",
- "http",
- "pin-project-lite",
-]
-
-[[package]]
-name = "httparse"
-version = "1.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "acd94fdbe1d4ff688b67b04eee2e17bd50995534a61539e45adfefb45e5e5503"
-
-[[package]]
-name = "httpdate"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421"
-
-[[package]]
-name = "humantime"
-version = "2.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
-
-[[package]]
-name = "hyper"
-version = "0.14.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b7ec3e62bdc98a2f0393a5048e4c30ef659440ea6e0e572965103e72bd836f55"
-dependencies = [
- "bytes",
- "futures-channel",
- "futures-core",
- "futures-util",
- "h2",
- "http",
- "http-body",
- "httparse",
- "httpdate",
- "itoa 0.4.8",
- "pin-project-lite",
- "socket2",
- "tokio",
- "tower-service",
- "tracing",
- "want",
-]
-
-[[package]]
-name = "hyper-rustls"
-version = "0.23.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d87c48c02e0dc5e3b849a2041db3029fd066650f8f717c07bf8ed78ccb895cac"
-dependencies = [
- "http",
- "hyper",
- "rustls",
- "tokio",
- "tokio-rustls",
-]
-
-[[package]]
-name = "idna"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8"
-dependencies = [
- "matches",
- "unicode-bidi",
- "unicode-normalization",
-]
-
-[[package]]
-name = "indexmap"
-version = "1.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223"
-dependencies = [
- "autocfg",
- "hashbrown 0.11.2",
-]
-
-[[package]]
-name = "indicatif"
-version = "0.16.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2d207dc617c7a380ab07ff572a6e52fa202a2a8f355860ac9c38e23f8196be1b"
-dependencies = [
- "console",
- "lazy_static",
- "number_prefix",
- "regex",
-]
-
-[[package]]
-name = "instant"
-version = "0.1.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
-dependencies = [
- "cfg-if",
-]
-
-[[package]]
-name = "ipnet"
-version = "2.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "68f2d64f2edebec4ce84ad108148e67e1064789bee435edc5b60ad398714a3a9"
-
-[[package]]
-name = "itertools"
-version = "0.10.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3"
-dependencies = [
- "either",
-]
-
-[[package]]
-name = "itoa"
-version = "0.4.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4"
-
-[[package]]
-name = "itoa"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35"
-
-[[package]]
-name = "jobserver"
-version = "0.1.24"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "js-sys"
-version = "0.3.55"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84"
-dependencies = [
- "wasm-bindgen",
-]
-
-[[package]]
-name = "jsonrpc-core"
-version = "18.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "14f7f76aef2d054868398427f6c54943cf3d1caa9a7ec7d0c38d69df97a965eb"
-dependencies = [
- "futures",
- "futures-executor",
- "futures-util",
- "log",
- "serde",
- "serde_derive",
- "serde_json",
-]
-
-[[package]]
-name = "keccak"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7"
-
-[[package]]
-name = "lazy_static"
-version = "1.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
-
-[[package]]
-name = "libc"
-version = "0.2.112"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125"
-
-[[package]]
-name = "libloading"
-version = "0.7.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "afe203d669ec979b7128619bae5a63b7b42e9203c1b29146079ee05e2f604b52"
-dependencies = [
- "cfg-if",
- "winapi",
-]
-
-[[package]]
-name = "libsecp256k1"
-version = "0.3.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1fc1e2c808481a63dc6da2074752fdd4336a3c8fcc68b83db6f1fd5224ae7962"
-dependencies = [
- "arrayref",
- "crunchy",
- "digest 0.8.1",
- "hmac-drbg 0.2.0",
- "rand 0.7.3",
- "sha2 0.8.2",
- "subtle 2.4.1",
- "typenum",
-]
-
-[[package]]
-name = "libsecp256k1"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c9d220bc1feda2ac231cb78c3d26f27676b8cf82c96971f7aeef3d0cf2797c73"
-dependencies = [
- "arrayref",
- "base64 0.12.3",
- "digest 0.9.0",
- "hmac-drbg 0.3.0",
- "libsecp256k1-core",
- "libsecp256k1-gen-ecmult",
- "libsecp256k1-gen-genmult",
- "rand 0.7.3",
- "serde",
- "sha2 0.9.9",
- "typenum",
-]
-
-[[package]]
-name = "libsecp256k1-core"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d0f6ab710cec28cef759c5f18671a27dae2a5f952cdaaee1d8e2908cb2478a80"
-dependencies = [
- "crunchy",
- "digest 0.9.0",
- "subtle 2.4.1",
-]
-
-[[package]]
-name = "libsecp256k1-gen-ecmult"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ccab96b584d38fac86a83f07e659f0deafd0253dc096dab5a36d53efe653c5c3"
-dependencies = [
- "libsecp256k1-core",
-]
-
-[[package]]
-name = "libsecp256k1-gen-genmult"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67abfe149395e3aa1c48a2beb32b068e2334402df8181f818d3aee2b304c4f5d"
-dependencies = [
- "libsecp256k1-core",
-]
-
-[[package]]
-name = "linked-hash-map"
-version = "0.5.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3"
-
-[[package]]
-name = "lock_api"
-version = "0.4.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109"
-dependencies = [
- "scopeguard",
-]
-
-[[package]]
-name = "log"
-version = "0.4.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
-dependencies = [
- "cfg-if",
-]
-
-[[package]]
-name = "matches"
-version = "0.1.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
-
-[[package]]
-name = "memchr"
-version = "2.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
-
-[[package]]
-name = "memmap2"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe3179b85e1fd8b14447cbebadb75e45a1002f541b925f0bfec366d56a81c56d"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "memoffset"
-version = "0.6.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce"
-dependencies = [
- "autocfg",
-]
-
-[[package]]
-name = "mime"
-version = "0.3.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d"
-
-[[package]]
-name = "miniz_oxide"
-version = "0.4.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b"
-dependencies = [
- "adler",
- "autocfg",
-]
-
-[[package]]
-name = "mio"
-version = "0.7.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc"
-dependencies = [
- "libc",
- "log",
- "miow",
- "ntapi",
- "winapi",
-]
-
-[[package]]
-name = "miow"
-version = "0.3.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21"
-dependencies = [
- "winapi",
-]
-
-[[package]]
-name = "nix"
-version = "0.23.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9f866317acbd3a240710c63f065ffb1e4fd466259045ccb504130b7f668f35c6"
-dependencies = [
- "bitflags",
- "cc",
- "cfg-if",
- "libc",
- "memoffset",
-]
-
-[[package]]
-name = "ntapi"
-version = "0.3.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44"
-dependencies = [
- "winapi",
-]
-
-[[package]]
-name = "num-derive"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d"
-dependencies = [
- "proc-macro2 1.0.36",
- "quote 1.0.14",
- "syn 1.0.85",
-]
-
-[[package]]
-name = "num-integer"
-version = "0.1.44"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db"
-dependencies = [
- "autocfg",
- "num-traits",
-]
-
-[[package]]
-name = "num-traits"
-version = "0.2.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290"
-dependencies = [
- "autocfg",
-]
-
-[[package]]
-name = "num_cpus"
-version = "1.13.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1"
-dependencies = [
- "hermit-abi",
- "libc",
-]
-
-[[package]]
-name = "num_enum"
-version = "0.5.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "720d3ea1055e4e4574c0c0b0f8c3fd4f24c4cdaf465948206dea090b57b526ad"
-dependencies = [
- "num_enum_derive",
-]
-
-[[package]]
-name = "num_enum_derive"
-version = "0.5.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0d992b768490d7fe0d8586d9b5745f6c49f557da6d81dc982b1d167ad4edbb21"
-dependencies = [
- "proc-macro-crate 1.1.0",
- "proc-macro2 1.0.36",
- "quote 1.0.14",
- "syn 1.0.85",
-]
-
-[[package]]
-name = "number_prefix"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3"
-
-[[package]]
-name = "object"
-version = "0.27.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67ac1d3f9a1d3616fd9a60c8d74296f22406a238b6a72f5cc1e6f314df4ffbf9"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "once_cell"
-version = "1.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5"
-
-[[package]]
-name = "opaque-debug"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c"
-
-[[package]]
-name = "opaque-debug"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
-
-[[package]]
-name = "ouroboros"
-version = "0.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f357ef82d1b4db66fbed0b8d542cbd3c22d0bf5b393b3c257b9ba4568e70c9c3"
-dependencies = [
- "aliasable",
- "ouroboros_macro",
- "stable_deref_trait",
-]
-
-[[package]]
-name = "ouroboros_macro"
-version = "0.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "44a0b52c2cbaef7dffa5fec1a43274afe8bd2a644fa9fc50a9ef4ff0269b1257"
-dependencies = [
- "Inflector",
- "proc-macro-error",
- "proc-macro2 1.0.36",
- "quote 1.0.14",
- "syn 1.0.85",
-]
-
-[[package]]
-name = "parking_lot"
-version = "0.11.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99"
-dependencies = [
- "instant",
- "lock_api",
- "parking_lot_core",
-]
-
-[[package]]
-name = "parking_lot_core"
-version = "0.8.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216"
-dependencies = [
- "cfg-if",
- "instant",
- "libc",
- "redox_syscall",
- "smallvec",
- "winapi",
-]
-
-[[package]]
-name = "pbkdf2"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbd"
-dependencies = [
- "crypto-mac 0.8.0",
-]
-
-[[package]]
-name = "pbkdf2"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f05894bce6a1ba4be299d0c5f29563e08af2bc18bb7d48313113bed71e904739"
-dependencies = [
- "crypto-mac 0.11.1",
-]
-
-[[package]]
-name = "percent-encoding"
-version = "2.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
-
-[[package]]
-name = "pin-project-lite"
-version = "0.2.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c"
-
-[[package]]
-name = "pin-utils"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
-
-[[package]]
-name = "pkg-config"
-version = "0.3.24"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe"
-
-[[package]]
-name = "ppv-lite86"
-version = "0.2.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872"
-
-[[package]]
-name = "proc-macro-crate"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785"
-dependencies = [
- "toml",
-]
-
-[[package]]
-name = "proc-macro-crate"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ebace6889caf889b4d3f76becee12e90353f2b8c7d875534a71e5742f8f6f83"
-dependencies = [
- "thiserror",
- "toml",
-]
-
-[[package]]
-name = "proc-macro-error"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
-dependencies = [
- "proc-macro-error-attr",
- "proc-macro2 1.0.36",
- "quote 1.0.14",
- "syn 1.0.85",
- "version_check",
-]
-
-[[package]]
-name = "proc-macro-error-attr"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
-dependencies = [
- "proc-macro2 1.0.36",
- "quote 1.0.14",
- "version_check",
-]
-
-[[package]]
-name = "proc-macro2"
-version = "0.4.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759"
-dependencies = [
- "unicode-xid 0.1.0",
-]
-
-[[package]]
-name = "proc-macro2"
-version = "1.0.36"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029"
-dependencies = [
- "unicode-xid 0.2.2",
-]
-
-[[package]]
-name = "qstring"
-version = "0.7.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d464fae65fff2680baf48019211ce37aaec0c78e9264c84a3e484717f965104e"
-dependencies = [
- "percent-encoding",
-]
-
-[[package]]
-name = "quote"
-version = "0.6.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1"
-dependencies = [
- "proc-macro2 0.4.30",
-]
-
-[[package]]
-name = "quote"
-version = "1.0.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "47aa80447ce4daf1717500037052af176af5d38cc3e571d9ec1c7353fc10c87d"
-dependencies = [
- "proc-macro2 1.0.36",
-]
-
-[[package]]
-name = "rand"
-version = "0.7.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
-dependencies = [
- "getrandom 0.1.16",
- "libc",
- "rand_chacha 0.2.2",
- "rand_core 0.5.1",
- "rand_hc 0.2.0",
-]
-
-[[package]]
-name = "rand"
-version = "0.8.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8"
-dependencies = [
- "libc",
- "rand_chacha 0.3.1",
- "rand_core 0.6.3",
- "rand_hc 0.3.1",
-]
-
-[[package]]
-name = "rand_chacha"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
-dependencies = [
- "ppv-lite86",
- "rand_core 0.5.1",
-]
-
-[[package]]
-name = "rand_chacha"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
-dependencies = [
- "ppv-lite86",
- "rand_core 0.6.3",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
-dependencies = [
- "getrandom 0.1.16",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.6.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7"
-dependencies = [
- "getrandom 0.2.3",
-]
-
-[[package]]
-name = "rand_hc"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
-dependencies = [
- "rand_core 0.5.1",
-]
-
-[[package]]
-name = "rand_hc"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7"
-dependencies = [
- "rand_core 0.6.3",
-]
-
-[[package]]
-name = "rayon"
-version = "1.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90"
-dependencies = [
- "autocfg",
- "crossbeam-deque",
- "either",
- "rayon-core",
-]
-
-[[package]]
-name = "rayon-core"
-version = "1.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e"
-dependencies = [
- "crossbeam-channel",
- "crossbeam-deque",
- "crossbeam-utils",
- "lazy_static",
- "num_cpus",
-]
-
-[[package]]
-name = "redox_syscall"
-version = "0.2.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff"
-dependencies = [
- "bitflags",
-]
-
-[[package]]
-name = "redox_users"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64"
-dependencies = [
- "getrandom 0.2.3",
- "redox_syscall",
-]
-
-[[package]]
-name = "regex"
-version = "1.5.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461"
-dependencies = [
- "aho-corasick",
- "memchr",
- "regex-syntax",
-]
-
-[[package]]
-name = "regex-syntax"
-version = "0.6.25"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
-
-[[package]]
-name = "remove_dir_all"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
-dependencies = [
- "winapi",
-]
-
-[[package]]
-name = "reqwest"
-version = "0.11.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87f242f1488a539a79bac6dbe7c8609ae43b7914b7736210f239a37cccb32525"
-dependencies = [
- "base64 0.13.0",
- "bytes",
- "encoding_rs",
- "futures-core",
- "futures-util",
- "h2",
- "http",
- "http-body",
- "hyper",
- "hyper-rustls",
- "ipnet",
- "js-sys",
- "lazy_static",
- "log",
- "mime",
- "percent-encoding",
- "pin-project-lite",
- "rustls",
- "rustls-pemfile",
- "serde",
- "serde_json",
- "serde_urlencoded",
- "tokio",
- "tokio-rustls",
- "url",
- "wasm-bindgen",
- "wasm-bindgen-futures",
- "web-sys",
- "webpki-roots",
- "winreg",
-]
-
-[[package]]
-name = "ring"
-version = "0.16.20"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc"
-dependencies = [
- "cc",
- "libc",
- "once_cell",
- "spin",
- "untrusted",
- "web-sys",
- "winapi",
-]
-
-[[package]]
-name = "rocksalt"
-version = "0.1.0"
-dependencies = [
- "byteorder",
- "proc-macro2 1.0.36",
- "quote 1.0.14",
- "sha3",
- "solana-program",
- "syn 1.0.85",
-]
-
-[[package]]
-name = "rpassword"
-version = "5.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ffc936cf8a7ea60c58f030fd36a612a48f440610214dc54bc36431f9ea0c3efb"
-dependencies = [
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "rustc-demangle"
-version = "0.1.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342"
-
-[[package]]
-name = "rustc-hash"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
-
-[[package]]
-name = "rustc_version"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
-dependencies = [
- "semver",
-]
-
-[[package]]
-name = "rustls"
-version = "0.20.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d37e5e2290f3e040b594b1a9e04377c2c671f1a1cfd9bfdef82106ac1c113f84"
-dependencies = [
- "log",
- "ring",
- "sct",
- "webpki",
-]
-
-[[package]]
-name = "rustls-pemfile"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9"
-dependencies = [
- "base64 0.13.0",
-]
-
-[[package]]
-name = "rustversion"
-version = "1.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f"
-
-[[package]]
-name = "ryu"
-version = "1.0.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f"
-
-[[package]]
-name = "same-file"
-version = "1.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
-dependencies = [
- "winapi-util",
-]
-
-[[package]]
-name = "scopeguard"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
-
-[[package]]
-name = "sct"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4"
-dependencies = [
- "ring",
- "untrusted",
-]
-
-[[package]]
-name = "semver"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012"
-
-[[package]]
-name = "serde"
-version = "1.0.133"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97565067517b60e2d1ea8b268e59ce036de907ac523ad83a0475da04e818989a"
-dependencies = [
- "serde_derive",
-]
-
-[[package]]
-name = "serde_bytes"
-version = "0.11.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "16ae07dd2f88a366f15bd0632ba725227018c69a1c8550a927324f8eb8368bb9"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "serde_derive"
-version = "1.0.133"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed201699328568d8d08208fdd080e3ff594e6c422e438b6705905da01005d537"
-dependencies = [
- "proc-macro2 1.0.36",
- "quote 1.0.14",
- "syn 1.0.85",
-]
-
-[[package]]
-name = "serde_json"
-version = "1.0.74"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ee2bb9cd061c5865d345bb02ca49fcef1391741b672b54a0bf7b679badec3142"
-dependencies = [
- "itoa 1.0.1",
- "ryu",
- "serde",
-]
-
-[[package]]
-name = "serde_urlencoded"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "edfa57a7f8d9c1d260a549e7224100f6c43d43f9103e06dd8b4095a9b2b43ce9"
-dependencies = [
- "form_urlencoded",
- "itoa 0.4.8",
- "ryu",
- "serde",
-]
-
-[[package]]
-name = "serde_yaml"
-version = "0.8.23"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4a521f2940385c165a24ee286aa8599633d162077a54bdcae2a6fd5a7bfa7a0"
-dependencies = [
- "indexmap",
- "ryu",
- "serde",
- "yaml-rust",
-]
-
-[[package]]
-name = "sha-1"
-version = "0.9.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6"
-dependencies = [
- "block-buffer 0.9.0",
- "cfg-if",
- "cpufeatures",
- "digest 0.9.0",
- "opaque-debug 0.3.0",
-]
-
-[[package]]
-name = "sha2"
-version = "0.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69"
-dependencies = [
- "block-buffer 0.7.3",
- "digest 0.8.1",
- "fake-simd",
- "opaque-debug 0.2.3",
-]
-
-[[package]]
-name = "sha2"
-version = "0.9.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800"
-dependencies = [
- "block-buffer 0.9.0",
- "cfg-if",
- "cpufeatures",
- "digest 0.9.0",
- "opaque-debug 0.3.0",
-]
-
-[[package]]
-name = "sha3"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809"
-dependencies = [
- "block-buffer 0.9.0",
- "digest 0.9.0",
- "keccak",
- "opaque-debug 0.3.0",
-]
-
-[[package]]
-name = "signal-hook-registry"
-version = "1.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "signature"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f054c6c1a6e95179d6f23ed974060dcefb2d9388bb7256900badad682c499de4"
-
-[[package]]
-name = "slab"
-version = "0.4.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5"
-
-[[package]]
-name = "smallvec"
-version = "1.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309"
-
-[[package]]
-name = "socket2"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5dc90fe6c7be1a323296982db1836d1ea9e47b6839496dde9a541bc496df3516"
-dependencies = [
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "solana-account-decoder"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b73dbbe43a11077d2207740a4044d653130aa06c437fc0481753ff0753f5be5f"
-dependencies = [
- "Inflector",
- "base64 0.12.3",
- "bincode",
- "bs58",
- "bv",
- "lazy_static",
- "serde",
- "serde_derive",
- "serde_json",
- "solana-config-program",
- "solana-sdk",
- "solana-vote-program",
- "spl-token",
- "thiserror",
- "zstd",
-]
-
-[[package]]
-name = "solana-address-lookup-table-program"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "545979985b604cf5c0c3f45cf465790a62b5109cce14edb6e1d839281fb71d41"
-dependencies = [
- "bincode",
- "bytemuck",
- "log",
- "num-derive",
- "num-traits",
- "rustc_version",
- "serde",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
- "solana-program-runtime",
- "solana-sdk",
- "thiserror",
-]
-
-[[package]]
-name = "solana-bucket-map"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "47427a1fce977163be8df0c889e6574c0724eac310a6f90553e3c36b8d4e0692"
-dependencies = [
- "fs_extra",
- "log",
- "memmap2",
- "rand 0.7.3",
- "rayon",
- "solana-logger",
- "solana-measure",
- "solana-sdk",
- "tempfile",
-]
-
-[[package]]
-name = "solana-clap-utils"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "670c0fddeaf1b64d1175f1a6221dc66c5f6b4c763cb9cb1bf65ee3ac9fef2e89"
-dependencies = [
- "chrono",
- "clap",
- "rpassword",
- "solana-perf",
- "solana-remote-wallet",
- "solana-sdk",
- "thiserror",
- "tiny-bip39",
- "uriparse",
- "url",
-]
-
-[[package]]
-name = "solana-cli-config"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4d0912423440feef8b93a6a94c0d807c890dbc407a5bc23187eed491fb3897d7"
-dependencies = [
- "dirs-next",
- "lazy_static",
- "serde",
- "serde_derive",
- "serde_yaml",
- "url",
-]
-
-[[package]]
-name = "solana-client"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d8ec26e0d31f3a317b56a33ac3c6704c53f3edb4a81ba46d32ca71ba37198aa7"
-dependencies = [
- "base64 0.13.0",
- "bincode",
- "bs58",
- "clap",
- "indicatif",
- "jsonrpc-core",
- "log",
- "rayon",
- "reqwest",
- "semver",
- "serde",
- "serde_derive",
- "serde_json",
- "solana-account-decoder",
- "solana-clap-utils",
- "solana-faucet",
- "solana-measure",
- "solana-net-utils",
- "solana-sdk",
- "solana-transaction-status",
- "solana-version",
- "solana-vote-program",
- "thiserror",
- "tokio",
- "tungstenite",
- "url",
-]
-
-[[package]]
-name = "solana-compute-budget-program"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c275dde46baa7b1c1a100aa5a82a4dddd27e8cf643cbbdcf27f8d94a843091d"
-dependencies = [
- "solana-program-runtime",
- "solana-sdk",
-]
-
-[[package]]
-name = "solana-config-program"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4aa938b89aed5fc51b6ff1ff6d0b3099daf2b873380491b4d1b2c4ba0096313c"
-dependencies = [
- "bincode",
- "chrono",
- "serde",
- "serde_derive",
- "solana-program-runtime",
- "solana-sdk",
-]
-
-[[package]]
-name = "solana-faucet"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "021064348145bfd31ac1a7fc87e3de2948b63529c3bc873740f15fbe9fe9843a"
-dependencies = [
- "bincode",
- "byteorder",
- "clap",
- "log",
- "serde",
- "serde_derive",
- "solana-clap-utils",
- "solana-cli-config",
- "solana-logger",
- "solana-metrics",
- "solana-sdk",
- "solana-version",
- "spl-memo",
- "thiserror",
- "tokio",
-]
-
-[[package]]
-name = "solana-frozen-abi"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c89bcde59ac3e8d4dbf7c4d990b0627b8ca0d25394c4ce17896dde7a1452e40c"
-dependencies = [
- "bs58",
- "bv",
- "generic-array 0.14.5",
- "log",
- "memmap2",
- "rustc_version",
- "serde",
- "serde_derive",
- "sha2 0.9.9",
- "solana-frozen-abi-macro",
- "solana-logger",
- "thiserror",
-]
-
-[[package]]
-name = "solana-frozen-abi-macro"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "56a7d630da35993631ecc4dd155f92d0d58000cdde3d5e2764fe9fd49d20a3a8"
-dependencies = [
- "proc-macro2 1.0.36",
- "quote 1.0.14",
- "rustc_version",
- "syn 1.0.85",
-]
-
-[[package]]
-name = "solana-logger"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6eaf925bb665de46f96fcea2c8a900d0d870a96fd1f50cf2bad16e22a1da71c4"
-dependencies = [
- "env_logger",
- "lazy_static",
- "log",
-]
-
-[[package]]
-name = "solana-measure"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ccdb4297b195811bdc95be328fb74e1547ea1d16f2600a200e66bfc2e32eb54"
-dependencies = [
- "log",
- "solana-sdk",
-]
-
-[[package]]
-name = "solana-metrics"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1d7d103dd77acc8cbb39b85c170548bd4f51f19e0931d22f9621c5a1bb57b94c"
-dependencies = [
- "env_logger",
- "gethostname",
- "lazy_static",
- "log",
- "reqwest",
- "solana-sdk",
-]
-
-[[package]]
-name = "solana-net-utils"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "93819a9cb345a8960c8e886811be3dda59f9759f6add8a99d983016a9d06686d"
-dependencies = [
- "bincode",
- "clap",
- "log",
- "nix",
- "rand 0.7.3",
- "serde",
- "serde_derive",
- "socket2",
- "solana-logger",
- "solana-sdk",
- "solana-version",
- "tokio",
- "url",
-]
-
-[[package]]
-name = "solana-perf"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b056da9866e14547ebdccb7a4948c75e9650e3ce8832965b58996f8bee32bea"
-dependencies = [
- "bincode",
- "caps",
- "curve25519-dalek",
- "dlopen",
- "dlopen_derive",
- "lazy_static",
- "libc",
- "log",
- "nix",
- "rand 0.7.3",
- "rayon",
- "serde",
- "solana-logger",
- "solana-metrics",
- "solana-rayon-threadlimit",
- "solana-sdk",
- "solana-vote-program",
-]
-
-[[package]]
-name = "solana-program"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2fc4d7a0baa649a3bda06d6a1cc30bd3d8ac692702a75fa8e76369cf7b3f6329"
-dependencies = [
- "base64 0.13.0",
- "bincode",
- "bitflags",
- "blake3",
- "borsh",
- "borsh-derive",
- "bs58",
- "bv",
- "bytemuck",
- "console_error_panic_hook",
- "console_log",
- "curve25519-dalek",
- "getrandom 0.1.16",
- "itertools",
- "js-sys",
- "lazy_static",
- "libsecp256k1 0.6.0",
- "log",
- "num-derive",
- "num-traits",
- "parking_lot",
- "rand 0.7.3",
- "rustc_version",
- "rustversion",
- "serde",
- "serde_bytes",
- "serde_derive",
- "sha2 0.9.9",
- "sha3",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
- "solana-logger",
- "solana-sdk-macro",
- "thiserror",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "solana-program-runtime"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "012304a7ccc59ed153ebc26470c070371651af22ea06554f4298e2ca60c74028"
-dependencies = [
- "base64 0.13.0",
- "bincode",
- "itertools",
- "libc",
- "libloading",
- "log",
- "num-derive",
- "num-traits",
- "rustc_version",
- "serde",
- "solana-logger",
- "solana-measure",
- "solana-sdk",
- "thiserror",
-]
-
-[[package]]
-name = "solana-rayon-threadlimit"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6248a0a230cd45af4c9f81ea468b95cab1bf163f57219ddce4cf8d062537578e"
-dependencies = [
- "lazy_static",
- "num_cpus",
-]
-
-[[package]]
-name = "solana-remote-wallet"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a03587d5bf5f7bc9302385f9ada8412662cdb93b5e3d40fee2a02553a932277c"
-dependencies = [
- "base32",
- "console",
- "dialoguer",
- "hidapi",
- "log",
- "num-derive",
- "num-traits",
- "parking_lot",
- "qstring",
- "semver",
- "solana-sdk",
- "thiserror",
- "uriparse",
-]
-
-[[package]]
-name = "solana-runtime"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09941a801d47848cf4840be37f1a00ef1dd823e5ab38485c4b3d57a1c3effe10"
-dependencies = [
- "arrayref",
- "bincode",
- "blake3",
- "bv",
- "byteorder",
- "bzip2",
- "crossbeam-channel",
- "dashmap",
- "dir-diff",
- "flate2",
- "fnv",
- "itertools",
- "lazy_static",
- "log",
- "memmap2",
- "num-derive",
- "num-traits",
- "num_cpus",
- "ouroboros",
- "rand 0.7.3",
- "rayon",
- "regex",
- "rustc_version",
- "serde",
- "serde_derive",
- "solana-address-lookup-table-program",
- "solana-bucket-map",
- "solana-compute-budget-program",
- "solana-config-program",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
- "solana-logger",
- "solana-measure",
- "solana-metrics",
- "solana-program-runtime",
- "solana-rayon-threadlimit",
- "solana-sdk",
- "solana-stake-program",
- "solana-vote-program",
- "symlink",
- "tar",
- "tempfile",
- "thiserror",
- "zstd",
-]
-
-[[package]]
-name = "solana-sdk"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "10932f74eeff6804d15e48a1546e40ad14b17ae8a335f9c1c331f94ab40cf3ad"
-dependencies = [
- "assert_matches",
- "base64 0.13.0",
- "bincode",
- "bitflags",
- "borsh",
- "bs58",
- "bytemuck",
- "byteorder",
- "chrono",
- "derivation-path",
- "digest 0.9.0",
- "ed25519-dalek",
- "ed25519-dalek-bip32",
- "generic-array 0.14.5",
- "hmac 0.11.0",
- "itertools",
- "js-sys",
- "lazy_static",
- "libsecp256k1 0.6.0",
- "log",
- "memmap2",
- "num-derive",
- "num-traits",
- "pbkdf2 0.9.0",
- "qstring",
- "rand 0.7.3",
- "rand_chacha 0.2.2",
- "rustc_version",
- "rustversion",
- "serde",
- "serde_bytes",
- "serde_derive",
- "serde_json",
- "sha2 0.9.9",
- "sha3",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
- "solana-logger",
- "solana-program",
- "solana-sdk-macro",
- "thiserror",
- "uriparse",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "solana-sdk-macro"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec22a924c73abe3376a2046715a2f6a9ae4094095b8ea08e8e56e8de198264ad"
-dependencies = [
- "bs58",
- "proc-macro2 1.0.36",
- "quote 1.0.14",
- "rustversion",
- "syn 1.0.85",
-]
-
-[[package]]
-name = "solana-stake-program"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "574fd1a039d44c341e297307b483d56899f94bc399da828f89c164da980f735e"
-dependencies = [
- "bincode",
- "log",
- "num-derive",
- "num-traits",
- "rustc_version",
- "serde",
- "serde_derive",
- "solana-config-program",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
- "solana-metrics",
- "solana-program-runtime",
- "solana-sdk",
- "solana-vote-program",
- "thiserror",
-]
-
-[[package]]
-name = "solana-transaction-status"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d6ab72a2e93a45b8582c839bffa3e8a90ccfa35acfe3677633d43a56b7180b05"
-dependencies = [
- "Inflector",
- "base64 0.12.3",
- "bincode",
- "bs58",
- "lazy_static",
- "log",
- "serde",
- "serde_derive",
- "serde_json",
- "solana-account-decoder",
- "solana-measure",
- "solana-metrics",
- "solana-runtime",
- "solana-sdk",
- "solana-vote-program",
- "spl-associated-token-account",
- "spl-memo",
- "spl-token",
- "thiserror",
-]
-
-[[package]]
-name = "solana-version"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4003c93007332afdee7ea64bddd2fa2dc8f12dccd158bba0d51d442c5bc9e5b8"
-dependencies = [
- "log",
- "rustc_version",
- "serde",
- "serde_derive",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
- "solana-sdk",
-]
-
-[[package]]
-name = "solana-vote-program"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "729763e7fd2d77a2a0053c5e9a978560cbc8849e6f9ebf274ebb5f864867d886"
-dependencies = [
- "bincode",
- "log",
- "num-derive",
- "num-traits",
- "rustc_version",
- "serde",
- "serde_derive",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
- "solana-logger",
- "solana-metrics",
- "solana-program-runtime",
- "solana-sdk",
- "thiserror",
-]
-
-[[package]]
-name = "solitaire"
-version = "0.1.0"
-dependencies = [
- "borsh",
- "byteorder",
- "rocksalt",
- "sha3",
- "solana-program",
-]
-
-[[package]]
-name = "solitaire-client"
-version = "0.1.0"
-dependencies = [
- "borsh",
- "solana-program",
- "solana-sdk",
- "solitaire",
-]
-
-[[package]]
-name = "spin"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
-
-[[package]]
-name = "spl-associated-token-account"
-version = "1.0.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "393e2240d521c3dd770806bff25c2c00d761ac962be106e14e22dd912007f428"
-dependencies = [
- "solana-program",
- "spl-token",
-]
-
-[[package]]
-name = "spl-memo"
-version = "3.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bd0dc6f70db6bacea7ff25870b016a65ba1d1b6013536f08e4fd79a8f9005325"
-dependencies = [
- "solana-program",
-]
-
-[[package]]
-name = "spl-token"
-version = "3.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "93bfdd5bd7c869cb565c7d7635c4fafe189b988a0bdef81063cd9585c6b8dc01"
-dependencies = [
- "arrayref",
- "num-derive",
- "num-traits",
- "num_enum",
- "solana-program",
- "thiserror",
-]
-
-[[package]]
-name = "stable_deref_trait"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
-
-[[package]]
-name = "strsim"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
-
-[[package]]
-name = "subtle"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee"
-
-[[package]]
-name = "subtle"
-version = "2.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601"
-
-[[package]]
-name = "symlink"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a7973cce6668464ea31f176d85b13c7ab3bba2cb3b77a2ed26abd7801688010a"
-
-[[package]]
-name = "syn"
-version = "0.15.44"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5"
-dependencies = [
- "proc-macro2 0.4.30",
- "quote 0.6.13",
- "unicode-xid 0.1.0",
-]
-
-[[package]]
-name = "syn"
-version = "1.0.85"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a684ac3dcd8913827e18cd09a68384ee66c1de24157e3c556c9ab16d85695fb7"
-dependencies = [
- "proc-macro2 1.0.36",
- "quote 1.0.14",
- "unicode-xid 0.2.2",
-]
-
-[[package]]
-name = "synstructure"
-version = "0.12.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f"
-dependencies = [
- "proc-macro2 1.0.36",
- "quote 1.0.14",
- "syn 1.0.85",
- "unicode-xid 0.2.2",
-]
-
-[[package]]
-name = "tar"
-version = "0.4.38"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4b55807c0344e1e6c04d7c965f5289c39a8d94ae23ed5c0b57aabac549f871c6"
-dependencies = [
- "filetime",
- "libc",
- "xattr",
-]
-
-[[package]]
-name = "tempfile"
-version = "3.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4"
-dependencies = [
- "cfg-if",
- "fastrand",
- "libc",
- "redox_syscall",
- "remove_dir_all",
- "winapi",
-]
-
-[[package]]
-name = "termcolor"
-version = "1.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4"
-dependencies = [
- "winapi-util",
-]
-
-[[package]]
-name = "terminal_size"
-version = "0.1.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df"
-dependencies = [
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "textwrap"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
-dependencies = [
- "unicode-width",
-]
-
-[[package]]
-name = "thiserror"
-version = "1.0.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417"
-dependencies = [
- "thiserror-impl",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "1.0.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b"
-dependencies = [
- "proc-macro2 1.0.36",
- "quote 1.0.14",
- "syn 1.0.85",
-]
-
-[[package]]
-name = "time"
-version = "0.1.43"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438"
-dependencies = [
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "tiny-bip39"
-version = "0.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ffc59cb9dfc85bb312c3a78fd6aa8a8582e310b0fa885d5bb877f6dcc601839d"
-dependencies = [
- "anyhow",
- "hmac 0.8.1",
- "once_cell",
- "pbkdf2 0.4.0",
- "rand 0.7.3",
- "rustc-hash",
- "sha2 0.9.9",
- "thiserror",
- "unicode-normalization",
- "wasm-bindgen",
- "zeroize",
-]
-
-[[package]]
-name = "tinyvec"
-version = "1.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2"
-dependencies = [
- "tinyvec_macros",
-]
-
-[[package]]
-name = "tinyvec_macros"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
-
-[[package]]
-name = "tokio"
-version = "1.15.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fbbf1c778ec206785635ce8ad57fe52b3009ae9e0c9f574a728f3049d3e55838"
-dependencies = [
- "bytes",
- "libc",
- "memchr",
- "mio",
- "num_cpus",
- "once_cell",
- "parking_lot",
- "pin-project-lite",
- "signal-hook-registry",
- "tokio-macros",
- "winapi",
-]
-
-[[package]]
-name = "tokio-macros"
-version = "1.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7"
-dependencies = [
- "proc-macro2 1.0.36",
- "quote 1.0.14",
- "syn 1.0.85",
-]
-
-[[package]]
-name = "tokio-rustls"
-version = "0.23.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a27d5f2b839802bd8267fa19b0530f5a08b9c08cd417976be2a65d130fe1c11b"
-dependencies = [
- "rustls",
- "tokio",
- "webpki",
-]
-
-[[package]]
-name = "tokio-util"
-version = "0.6.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0"
-dependencies = [
- "bytes",
- "futures-core",
- "futures-sink",
- "log",
- "pin-project-lite",
- "tokio",
-]
-
-[[package]]
-name = "toml"
-version = "0.5.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "tower-service"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6"
-
-[[package]]
-name = "tracing"
-version = "0.1.29"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105"
-dependencies = [
- "cfg-if",
- "pin-project-lite",
- "tracing-core",
-]
-
-[[package]]
-name = "tracing-core"
-version = "0.1.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4"
-dependencies = [
- "lazy_static",
-]
-
-[[package]]
-name = "try-lock"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642"
-
-[[package]]
-name = "tungstenite"
-version = "0.16.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ad3713a14ae247f22a728a0456a545df14acf3867f905adff84be99e23b3ad1"
-dependencies = [
- "base64 0.13.0",
- "byteorder",
- "bytes",
- "http",
- "httparse",
- "log",
- "rand 0.8.4",
- "rustls",
- "sha-1",
- "thiserror",
- "url",
- "utf-8",
- "webpki",
- "webpki-roots",
-]
-
-[[package]]
-name = "typenum"
-version = "1.15.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987"
-
-[[package]]
-name = "unicode-bidi"
-version = "0.3.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f"
-
-[[package]]
-name = "unicode-normalization"
-version = "0.1.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9"
-dependencies = [
- "tinyvec",
-]
-
-[[package]]
-name = "unicode-width"
-version = "0.1.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973"
-
-[[package]]
-name = "unicode-xid"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
-
-[[package]]
-name = "unicode-xid"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
-
-[[package]]
-name = "untrusted"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a"
-
-[[package]]
-name = "uriparse"
-version = "0.6.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e515b1ada404168e145ac55afba3c42f04cf972201a8552d42e2abb17c1b7221"
-dependencies = [
- "fnv",
- "lazy_static",
-]
-
-[[package]]
-name = "url"
-version = "2.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c"
-dependencies = [
- "form_urlencoded",
- "idna",
- "matches",
- "percent-encoding",
-]
-
-[[package]]
-name = "utf-8"
-version = "0.7.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9"
-
-[[package]]
-name = "vec_map"
-version = "0.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
-
-[[package]]
-name = "version_check"
-version = "0.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
-
-[[package]]
-name = "walkdir"
-version = "2.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56"
-dependencies = [
- "same-file",
- "winapi",
- "winapi-util",
-]
-
-[[package]]
-name = "want"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0"
-dependencies = [
- "log",
- "try-lock",
-]
-
-[[package]]
-name = "wasi"
-version = "0.9.0+wasi-snapshot-preview1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
-
-[[package]]
-name = "wasi"
-version = "0.10.2+wasi-snapshot-preview1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
-
-[[package]]
-name = "wasm-bindgen"
-version = "0.2.78"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce"
-dependencies = [
- "cfg-if",
- "serde",
- "serde_json",
- "wasm-bindgen-macro",
-]
-
-[[package]]
-name = "wasm-bindgen-backend"
-version = "0.2.78"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b"
-dependencies = [
- "bumpalo",
- "lazy_static",
- "log",
- "proc-macro2 1.0.36",
- "quote 1.0.14",
- "syn 1.0.85",
- "wasm-bindgen-shared",
-]
-
-[[package]]
-name = "wasm-bindgen-futures"
-version = "0.4.28"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e8d7523cb1f2a4c96c1317ca690031b714a51cc14e05f712446691f413f5d39"
-dependencies = [
- "cfg-if",
- "js-sys",
- "wasm-bindgen",
- "web-sys",
-]
-
-[[package]]
-name = "wasm-bindgen-macro"
-version = "0.2.78"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9"
-dependencies = [
- "quote 1.0.14",
- "wasm-bindgen-macro-support",
-]
-
-[[package]]
-name = "wasm-bindgen-macro-support"
-version = "0.2.78"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab"
-dependencies = [
- "proc-macro2 1.0.36",
- "quote 1.0.14",
- "syn 1.0.85",
- "wasm-bindgen-backend",
- "wasm-bindgen-shared",
-]
-
-[[package]]
-name = "wasm-bindgen-shared"
-version = "0.2.78"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc"
-
-[[package]]
-name = "web-sys"
-version = "0.3.55"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb"
-dependencies = [
- "js-sys",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "webpki"
-version = "0.22.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd"
-dependencies = [
- "ring",
- "untrusted",
-]
-
-[[package]]
-name = "webpki-roots"
-version = "0.22.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "552ceb903e957524388c4d3475725ff2c8b7960922063af6ce53c9a43da07449"
-dependencies = [
- "webpki",
-]
-
-[[package]]
-name = "winapi"
-version = "0.3.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
-dependencies = [
- "winapi-i686-pc-windows-gnu",
- "winapi-x86_64-pc-windows-gnu",
-]
-
-[[package]]
-name = "winapi-i686-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
-
-[[package]]
-name = "winapi-util"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
-dependencies = [
- "winapi",
-]
-
-[[package]]
-name = "winapi-x86_64-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
-
-[[package]]
-name = "winreg"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69"
-dependencies = [
- "winapi",
-]
-
-[[package]]
-name = "wormhole-migration"
-version = "0.1.0"
-dependencies = [
- "borsh",
- "byteorder",
- "hex",
- "hex-literal",
- "libsecp256k1 0.3.5",
- "rand 0.7.3",
- "rocksalt",
- "serde",
- "sha3",
- "solana-client",
- "solana-program",
- "solana-sdk",
- "solitaire",
- "solitaire-client",
- "spl-token",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "xattr"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "244c3741f4240ef46274860397c7c74e50eb23624996930e484c16679633a54c"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "yaml-rust"
-version = "0.4.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85"
-dependencies = [
- "linked-hash-map",
-]
-
-[[package]]
-name = "zeroize"
-version = "1.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d68d9dcec5f9b43a30d38c49f91dfedfaac384cb8f085faca366c26207dd1619"
-dependencies = [
- "zeroize_derive",
-]
-
-[[package]]
-name = "zeroize_derive"
-version = "1.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "65f1a51723ec88c66d5d1fe80c841f17f63587d6691901d66be9bec6c3b51f73"
-dependencies = [
- "proc-macro2 1.0.36",
- "quote 1.0.14",
- "syn 1.0.85",
- "synstructure",
-]
-
-[[package]]
-name = "zstd"
-version = "0.9.2+zstd.1.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2390ea1bf6c038c39674f22d95f0564725fc06034a47129179810b2fc58caa54"
-dependencies = [
- "zstd-safe",
-]
-
-[[package]]
-name = "zstd-safe"
-version = "4.1.3+zstd.1.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e99d81b99fb3c2c2c794e3fe56c305c63d5173a16a46b5850b07c935ffc7db79"
-dependencies = [
- "libc",
- "zstd-sys",
-]
-
-[[package]]
-name = "zstd-sys"
-version = "1.6.2+zstd.1.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2daf2f248d9ea44454bfcb2516534e8b8ad2fc91bf818a1885495fc42bc8ac9f"
-dependencies = [
- "cc",
- "libc",
-]
-
-[[patch.unused]]
-name = "memmap2"
-version = "0.1.0"

+ 0 - 41
solana/migration/Cargo.toml

@@ -1,41 +0,0 @@
-[package]
-name = "wormhole-migration"
-version = "0.1.0"
-description = "Created with Rocksalt"
-edition = "2018"
-
-[lib]
-crate-type = ["cdylib", "lib"]
-name = "wormhole_migration"
-
-[features]
-no-entrypoint = ["solitaire/no-entrypoint", "rand"]
-trace = ["solitaire/trace"]
-wasm = ["no-entrypoint", "wasm-bindgen"]
-client = ["solitaire-client", "solitaire/client", "no-entrypoint"]
-cpi = ["no-entrypoint"]
-default = []
-
-[dependencies]
-borsh = "=0.9.1"
-byteorder = "1.4.3"
-rocksalt = { path = "../solitaire/rocksalt" }
-solitaire = { path = "../solitaire/program" }
-sha3 = "0.9.1"
-solana-program = "*"
-spl-token = { version = "=3.2.0", features = ["no-entrypoint"] }
-solitaire-client = { path = "../solitaire/client", optional = true }
-wasm-bindgen = { version = "0.2.74", features = ["serde-serialize"], optional = true }
-serde = { version = "1.0", features = ["derive"] }
-rand = { version = "0.7.3", optional = true }
-
-[dev-dependencies]
-hex = "*"
-hex-literal = "0.3.1"
-libsecp256k1 = { version = "0.3.5", features = [] }
-solana-client = "=1.9.4"
-solana-sdk = "=1.9.4"
-spl-token = { version = "=3.2.0", features = ["no-entrypoint"] }
-
-[patch.crates-io]
-memmap2 = { path = "../bridge/memmap2-rs" }

+ 0 - 11
solana/migration/rustfmt.toml

@@ -1,11 +0,0 @@
-# Merge similar crates together to avoid multiple use statements.
-imports_granularity = "Crate"
-
-# Consistency in formatting makes tool based searching/editing better.
-empty_item_single_line = false
-
-# Easier editing when arbitrary mixed use statements do not collapse.
-imports_layout = "Vertical"
-
-# Default rustfmt formatting of match arms with branches is awful.
-match_arm_leading_pipes = "Preserve"

+ 0 - 84
solana/migration/src/accounts.rs

@@ -1,84 +0,0 @@
-use crate::types::{
-    PoolData,
-    SplAccount,
-    SplMint,
-};
-use solana_program::pubkey::Pubkey;
-use solitaire::{
-    processors::seeded::Seeded,
-    AccountState,
-    Data,
-    Derive,
-    Info,
-};
-
-pub type ShareMint<'a, const STATE: AccountState> = Data<'a, SplMint, { STATE }>;
-
-pub struct ShareMintDerivationData {
-    pub pool: Pubkey,
-}
-
-impl<'b, const STATE: AccountState> Seeded<&ShareMintDerivationData> for ShareMint<'b, { STATE }> {
-    fn seeds(accs: &ShareMintDerivationData) -> Vec<Vec<u8>> {
-        vec![
-            String::from("share_mint").as_bytes().to_vec(),
-            accs.pool.to_bytes().to_vec(),
-        ]
-    }
-}
-
-pub type FromCustodyTokenAccount<'a, const STATE: AccountState> = Data<'a, SplAccount, { STATE }>;
-
-pub struct FromCustodyTokenAccountDerivationData {
-    pub pool: Pubkey,
-}
-
-impl<'b, const STATE: AccountState> Seeded<&FromCustodyTokenAccountDerivationData>
-    for FromCustodyTokenAccount<'b, { STATE }>
-{
-    fn seeds(accs: &FromCustodyTokenAccountDerivationData) -> Vec<Vec<u8>> {
-        vec![
-            String::from("from_custody").as_bytes().to_vec(),
-            accs.pool.to_bytes().to_vec(),
-        ]
-    }
-}
-
-pub type ToCustodyTokenAccount<'a, const STATE: AccountState> = Data<'a, SplAccount, { STATE }>;
-
-pub struct ToCustodyTokenAccountDerivationData {
-    pub pool: Pubkey,
-}
-
-impl<'b, const STATE: AccountState> Seeded<&ToCustodyTokenAccountDerivationData>
-    for ToCustodyTokenAccount<'b, { STATE }>
-{
-    fn seeds(accs: &ToCustodyTokenAccountDerivationData) -> Vec<Vec<u8>> {
-        vec![
-            String::from("to_custody").as_bytes().to_vec(),
-            accs.pool.to_bytes().to_vec(),
-        ]
-    }
-}
-
-pub type MigrationPool<'a, const STATE: AccountState> = Data<'a, PoolData, { STATE }>;
-
-pub struct MigrationPoolDerivationData {
-    pub from: Pubkey,
-    pub to: Pubkey,
-}
-
-impl<'b, const STATE: AccountState> Seeded<&MigrationPoolDerivationData>
-    for MigrationPool<'b, { STATE }>
-{
-    fn seeds(accs: &MigrationPoolDerivationData) -> Vec<Vec<u8>> {
-        vec![
-            String::from("pool").as_bytes().to_vec(),
-            accs.from.to_bytes().to_vec(),
-            accs.to.to_bytes().to_vec(),
-        ]
-    }
-}
-
-pub type CustodySigner<'a> = Derive<Info<'a>, "custody_signer">;
-pub type AuthoritySigner<'a> = Derive<Info<'a>, "authority_signer">;

+ 0 - 5
solana/migration/src/api.rs

@@ -1,5 +0,0 @@
-pub mod add_liquidity;
-pub mod claim_shares;
-pub mod create_pool;
-pub mod migrate_tokens;
-pub mod remove_liquidity;

+ 0 - 119
solana/migration/src/api/add_liquidity.rs

@@ -1,119 +0,0 @@
-use crate::{
-    accounts::{
-        AuthoritySigner,
-        CustodySigner,
-        MigrationPool,
-        ShareMint,
-        ShareMintDerivationData,
-        ToCustodyTokenAccount,
-        ToCustodyTokenAccountDerivationData,
-    },
-    types::{
-        SplAccount,
-        SplMint,
-    },
-    MigrationError::WrongMint,
-};
-use borsh::{
-    BorshDeserialize,
-    BorshSerialize,
-};
-
-use crate::accounts::MigrationPoolDerivationData;
-use solitaire::*;
-
-#[derive(FromAccounts)]
-pub struct AddLiquidity<'b> {
-    pub pool: Mut<MigrationPool<'b, { AccountState::Initialized }>>,
-    pub from_mint: Data<'b, SplMint, { AccountState::Initialized }>,
-    pub to_mint: Data<'b, SplMint, { AccountState::Initialized }>,
-    pub to_token_custody: Mut<ToCustodyTokenAccount<'b, { AccountState::Initialized }>>,
-    pub share_mint: Mut<ShareMint<'b, { AccountState::Initialized }>>,
-
-    pub to_lp_acc: Mut<Data<'b, SplAccount, { AccountState::Initialized }>>,
-    pub lp_share_acc: Mut<Data<'b, SplAccount, { AccountState::Initialized }>>,
-    pub custody_signer: CustodySigner<'b>,
-    pub authority_signer: AuthoritySigner<'b>,
-}
-
-#[derive(BorshDeserialize, BorshSerialize, Default)]
-pub struct AddLiquidityData {
-    pub amount: u64,
-}
-
-pub fn add_liquidity(
-    ctx: &ExecutionContext,
-    accs: &mut AddLiquidity,
-    data: AddLiquidityData,
-) -> Result<()> {
-    if *accs.from_mint.info().key != accs.pool.from {
-        return Err(WrongMint.into());
-    }
-    if *accs.to_mint.info().key != accs.pool.to {
-        return Err(WrongMint.into());
-    }
-    if accs.lp_share_acc.mint != *accs.share_mint.info().key {
-        return Err(WrongMint.into());
-    }
-    accs.to_token_custody.verify_derivation(
-        ctx.program_id,
-        &ToCustodyTokenAccountDerivationData {
-            pool: *accs.pool.info().key,
-        },
-    )?;
-    accs.share_mint.verify_derivation(
-        ctx.program_id,
-        &ShareMintDerivationData {
-            pool: *accs.pool.info().key,
-        },
-    )?;
-    accs.pool.verify_derivation(
-        ctx.program_id,
-        &MigrationPoolDerivationData {
-            from: accs.pool.from,
-            to: accs.pool.to,
-        },
-    )?;
-
-    let to_tokens_in = if accs.from_mint.decimals > accs.to_mint.decimals {
-        data.amount
-    } else {
-        data.amount
-            - (data.amount % 10u64.pow((accs.to_mint.decimals - accs.from_mint.decimals) as u32))
-    };
-
-    // Transfer out-tokens in
-    let transfer_ix = spl_token::instruction::transfer(
-        &spl_token::id(),
-        accs.to_lp_acc.info().key,
-        accs.to_token_custody.info().key,
-        accs.authority_signer.key,
-        &[],
-        to_tokens_in,
-    )?;
-    invoke_seeded(&transfer_ix, ctx, &accs.authority_signer, None)?;
-
-    // The share amount should be equal to the amount of from tokens an lp would be getting
-    let share_amount = if accs.from_mint.decimals > accs.to_mint.decimals {
-        data.amount
-            .checked_mul(10u64.pow((accs.from_mint.decimals - accs.to_mint.decimals) as u32))
-            .unwrap()
-    } else {
-        data.amount
-            .checked_div(10u64.pow((accs.to_mint.decimals - accs.from_mint.decimals) as u32))
-            .unwrap()
-    };
-
-    // Mint LP shares
-    let mint_ix = spl_token::instruction::mint_to(
-        &spl_token::id(),
-        accs.share_mint.info().key,
-        accs.lp_share_acc.info().key,
-        accs.custody_signer.key,
-        &[],
-        share_amount,
-    )?;
-    invoke_seeded(&mint_ix, ctx, &accs.custody_signer, None)?;
-
-    Ok(())
-}

+ 0 - 96
solana/migration/src/api/claim_shares.rs

@@ -1,96 +0,0 @@
-use crate::{
-    accounts::{
-        AuthoritySigner,
-        CustodySigner,
-        FromCustodyTokenAccountDerivationData,
-        MigrationPool,
-        ShareMint,
-        ShareMintDerivationData,
-        ToCustodyTokenAccount,
-    },
-    types::SplAccount,
-    MigrationError::WrongMint,
-};
-use borsh::{
-    BorshDeserialize,
-    BorshSerialize,
-};
-
-use crate::accounts::MigrationPoolDerivationData;
-use solitaire::{
-    processors::seeded::{
-        invoke_seeded,
-        Seeded,
-    },
-    *,
-};
-
-#[derive(FromAccounts)]
-pub struct ClaimShares<'b> {
-    pub pool: Mut<MigrationPool<'b, { AccountState::Initialized }>>,
-    pub from_token_custody: Mut<ToCustodyTokenAccount<'b, { AccountState::Initialized }>>,
-    pub share_mint: Mut<ShareMint<'b, { AccountState::Initialized }>>,
-
-    pub from_lp_acc: Mut<Data<'b, SplAccount, { AccountState::Initialized }>>,
-    pub lp_share_acc: Mut<Data<'b, SplAccount, { AccountState::Initialized }>>,
-    pub custody_signer: CustodySigner<'b>,
-    pub authority_signer: AuthoritySigner<'b>,
-}
-
-#[derive(BorshDeserialize, BorshSerialize, Default)]
-pub struct ClaimSharesData {
-    pub amount: u64,
-}
-
-pub fn claim_shares(
-    ctx: &ExecutionContext,
-    accs: &mut ClaimShares,
-    data: ClaimSharesData,
-) -> Result<()> {
-    if accs.lp_share_acc.mint != *accs.share_mint.info().key {
-        return Err(WrongMint.into());
-    }
-    accs.from_token_custody.verify_derivation(
-        ctx.program_id,
-        &FromCustodyTokenAccountDerivationData {
-            pool: *accs.pool.info().key,
-        },
-    )?;
-    accs.share_mint.verify_derivation(
-        ctx.program_id,
-        &ShareMintDerivationData {
-            pool: *accs.pool.info().key,
-        },
-    )?;
-    accs.pool.verify_derivation(
-        ctx.program_id,
-        &MigrationPoolDerivationData {
-            from: accs.pool.from,
-            to: accs.pool.to,
-        },
-    )?;
-
-    // Transfer claimed tokens to LP
-    let transfer_ix = spl_token::instruction::transfer(
-        &spl_token::id(),
-        accs.from_token_custody.info().key,
-        accs.from_lp_acc.info().key,
-        accs.custody_signer.key,
-        &[],
-        data.amount,
-    )?;
-    invoke_seeded(&transfer_ix, ctx, &accs.custody_signer, None)?;
-
-    // Burn LP shares
-    let mint_ix = spl_token::instruction::burn(
-        &spl_token::id(),
-        accs.lp_share_acc.info().key,
-        accs.share_mint.info().key,
-        accs.authority_signer.key,
-        &[],
-        data.amount,
-    )?;
-    invoke_seeded(&mint_ix, ctx, &accs.authority_signer, None)?;
-
-    Ok(())
-}

+ 0 - 118
solana/migration/src/api/create_pool.rs

@@ -1,118 +0,0 @@
-use crate::{
-    accounts::{
-        CustodySigner,
-        FromCustodyTokenAccount,
-        FromCustodyTokenAccountDerivationData,
-        MigrationPool,
-        MigrationPoolDerivationData,
-        ShareMint,
-        ShareMintDerivationData,
-        ToCustodyTokenAccount,
-        ToCustodyTokenAccountDerivationData,
-    },
-    types::SplMint,
-};
-use borsh::{
-    BorshDeserialize,
-    BorshSerialize,
-};
-use solana_program::program::invoke_signed;
-use solitaire::{
-    CreationLamports::Exempt,
-    *,
-};
-
-#[derive(FromAccounts)]
-pub struct CreatePool<'b> {
-    pub payer: Mut<Signer<Info<'b>>>,
-
-    pub pool: Mut<MigrationPool<'b, { AccountState::Uninitialized }>>,
-    pub from_mint: Data<'b, SplMint, { AccountState::Initialized }>,
-    pub to_mint: Data<'b, SplMint, { AccountState::Initialized }>,
-    pub from_token_custody: Mut<FromCustodyTokenAccount<'b, { AccountState::Uninitialized }>>,
-    pub to_token_custody: Mut<ToCustodyTokenAccount<'b, { AccountState::Uninitialized }>>,
-    pub pool_mint: Mut<ShareMint<'b, { AccountState::Uninitialized }>>,
-
-    pub custody_signer: CustodySigner<'b>,
-}
-
-#[derive(BorshDeserialize, BorshSerialize, Default)]
-pub struct CreatePoolData {}
-
-pub fn create_pool(
-    ctx: &ExecutionContext,
-    accs: &mut CreatePool,
-    _data: CreatePoolData,
-) -> Result<()> {
-    // Create from custody account
-    accs.from_token_custody.create(
-        &FromCustodyTokenAccountDerivationData {
-            pool: *accs.pool.info().key,
-        },
-        ctx,
-        accs.payer.key,
-        Exempt,
-    )?;
-
-    let init_ix = spl_token::instruction::initialize_account(
-        &spl_token::id(),
-        accs.from_token_custody.info().key,
-        accs.from_mint.info().key,
-        accs.custody_signer.info().key,
-    )?;
-    invoke_signed(&init_ix, ctx.accounts, &[])?;
-
-    // Create to custody account
-    accs.to_token_custody.create(
-        &ToCustodyTokenAccountDerivationData {
-            pool: *accs.pool.info().key,
-        },
-        ctx,
-        accs.payer.key,
-        Exempt,
-    )?;
-
-    let init_ix = spl_token::instruction::initialize_account(
-        &spl_token::id(),
-        accs.to_token_custody.info().key,
-        accs.to_mint.info().key,
-        accs.custody_signer.info().key,
-    )?;
-    invoke_signed(&init_ix, ctx.accounts, &[])?;
-
-    // Create to pool mint
-    accs.pool_mint.create(
-        &ShareMintDerivationData {
-            pool: *accs.pool.info().key,
-        },
-        ctx,
-        accs.payer.key,
-        Exempt,
-    )?;
-
-    let init_ix = spl_token::instruction::initialize_mint(
-        &spl_token::id(),
-        accs.pool_mint.info().key,
-        accs.custody_signer.info().key,
-        None,
-        accs.from_mint.decimals,
-    )?;
-    invoke_signed(&init_ix, ctx.accounts, &[])?;
-
-    // Set fields on pool
-    accs.pool.from = *accs.from_mint.info().key;
-    accs.pool.to = *accs.to_mint.info().key;
-
-    // Create pool
-    accs.pool.create(
-        &MigrationPoolDerivationData {
-            from: *accs.from_mint.info().key,
-            to: *accs.to_mint.info().key,
-        },
-        ctx,
-        accs.payer.key,
-        Exempt,
-    )?;
-
-    Ok(())
-}

+ 0 - 121
solana/migration/src/api/migrate_tokens.rs

@@ -1,121 +0,0 @@
-use crate::{
-    accounts::{
-        AuthoritySigner,
-        CustodySigner,
-        FromCustodyTokenAccount,
-        FromCustodyTokenAccountDerivationData,
-        MigrationPool,
-        ToCustodyTokenAccount,
-        ToCustodyTokenAccountDerivationData,
-    },
-    types::{
-        SplAccount,
-        SplMint,
-    },
-    MigrationError::WrongMint,
-};
-use borsh::{
-    BorshDeserialize,
-    BorshSerialize,
-};
-
-use crate::accounts::MigrationPoolDerivationData;
-use solitaire::{
-    processors::seeded::{
-        invoke_seeded,
-        Seeded,
-    },
-    *,
-};
-
-#[derive(FromAccounts)]
-pub struct MigrateTokens<'b> {
-    pub pool: Mut<MigrationPool<'b, { AccountState::Initialized }>>,
-    pub from_mint: Data<'b, SplMint, { AccountState::Initialized }>,
-    pub to_mint: Data<'b, SplMint, { AccountState::Initialized }>,
-    pub to_token_custody: Mut<ToCustodyTokenAccount<'b, { AccountState::Initialized }>>,
-    pub from_token_custody: Mut<FromCustodyTokenAccount<'b, { AccountState::Initialized }>>,
-
-    pub user_from_acc: Mut<Data<'b, SplAccount, { AccountState::Initialized }>>,
-    pub user_to_acc: Mut<Data<'b, SplAccount, { AccountState::Initialized }>>,
-    pub custody_signer: CustodySigner<'b>,
-    pub authority_signer: AuthoritySigner<'b>,
-}
-
-#[derive(BorshDeserialize, BorshSerialize, Default)]
-pub struct MigrateTokensData {
-    pub amount: u64,
-}
-
-pub fn migrate_tokens(
-    ctx: &ExecutionContext,
-    accs: &mut MigrateTokens,
-    data: MigrateTokensData,
-) -> Result<()> {
-    if *accs.from_mint.info().key != accs.pool.from {
-        return Err(WrongMint.into());
-    }
-    if *accs.to_mint.info().key != accs.pool.to {
-        return Err(WrongMint.into());
-    }
-    if accs.user_from_acc.mint != accs.pool.from {
-        return Err(WrongMint.into());
-    }
-    if accs.user_to_acc.mint != accs.pool.to {
-        return Err(WrongMint.into());
-    }
-    accs.to_token_custody.verify_derivation(
-        ctx.program_id,
-        &ToCustodyTokenAccountDerivationData {
-            pool: *accs.pool.info().key,
-        },
-    )?;
-    accs.from_token_custody.verify_derivation(
-        ctx.program_id,
-        &FromCustodyTokenAccountDerivationData {
-            pool: *accs.pool.info().key,
-        },
-    )?;
-    accs.pool.verify_derivation(
-        ctx.program_id,
-        &MigrationPoolDerivationData {
-            from: accs.pool.from,
-            to: accs.pool.to,
-        },
-    )?;
-
-    // Transfer in-tokens in
-    let transfer_ix = spl_token::instruction::transfer(
-        &spl_token::id(),
-        accs.user_from_acc.info().key,
-        accs.from_token_custody.info().key,
-        accs.authority_signer.key,
-        &[],
-        data.amount,
-    )?;
-    invoke_seeded(&transfer_ix, ctx, &accs.authority_signer, None)?;
-
-    // The out amount needs to be decimal adjusted
-    let out_amount = if accs.from_mint.decimals > accs.to_mint.decimals {
-        data.amount
-            .checked_div(10u64.pow((accs.from_mint.decimals - accs.to_mint.decimals) as u32))
-            .unwrap()
-    } else {
-        data.amount
-            .checked_mul(10u64.pow((accs.to_mint.decimals - accs.from_mint.decimals) as u32))
-            .unwrap()
-    };
-
-    // Transfer out-tokens to user
-    let transfer_ix = spl_token::instruction::transfer(
-        &spl_token::id(),
-        accs.to_token_custody.info().key,
-        accs.user_to_acc.info().key,
-        accs.custody_signer.key,
-        &[],
-        out_amount,
-    )?;
-    invoke_seeded(&transfer_ix, ctx, &accs.custody_signer, None)?;
-
-    Ok(())
-}

+ 0 - 117
solana/migration/src/api/remove_liquidity.rs

@@ -1,117 +0,0 @@
-use crate::{
-    accounts::{
-        AuthoritySigner,
-        CustodySigner,
-        MigrationPool,
-        MigrationPoolDerivationData,
-        ShareMint,
-        ShareMintDerivationData,
-        ToCustodyTokenAccount,
-        ToCustodyTokenAccountDerivationData,
-    },
-    types::{
-        SplAccount,
-        SplMint,
-    },
-    MigrationError::WrongMint,
-};
-use borsh::{
-    BorshDeserialize,
-    BorshSerialize,
-};
-use solitaire::{
-    processors::seeded::{
-        invoke_seeded,
-        Seeded,
-    },
-    *,
-};
-
-#[derive(FromAccounts)]
-pub struct RemoveLiquidity<'b> {
-    pub pool: Mut<MigrationPool<'b, { AccountState::Initialized }>>,
-    pub from_mint: Data<'b, SplMint, { AccountState::Initialized }>,
-    pub to_mint: Data<'b, SplMint, { AccountState::Initialized }>,
-    pub to_token_custody: Mut<ToCustodyTokenAccount<'b, { AccountState::Initialized }>>,
-    pub share_mint: Mut<ShareMint<'b, { AccountState::Initialized }>>,
-
-    pub to_lp_acc: Mut<Data<'b, SplAccount, { AccountState::Initialized }>>,
-    pub lp_share_acc: Mut<Data<'b, SplAccount, { AccountState::Initialized }>>,
-    pub custody_signer: CustodySigner<'b>,
-    pub authority_signer: AuthoritySigner<'b>,
-}
-
-#[derive(BorshDeserialize, BorshSerialize, Default)]
-pub struct RemoveLiquidityData {
-    pub amount: u64,
-}
-
-pub fn remove_liquidity(
-    ctx: &ExecutionContext,
-    accs: &mut RemoveLiquidity,
-    data: RemoveLiquidityData,
-) -> Result<()> {
-    if *accs.from_mint.info().key != accs.pool.from {
-        return Err(WrongMint.into());
-    }
-    if *accs.to_mint.info().key != accs.pool.to {
-        return Err(WrongMint.into());
-    }
-    if accs.lp_share_acc.mint != *accs.share_mint.info().key {
-        return Err(WrongMint.into());
-    }
-    accs.to_token_custody.verify_derivation(
-        ctx.program_id,
-        &ToCustodyTokenAccountDerivationData {
-            pool: *accs.pool.info().key,
-        },
-    )?;
-    accs.share_mint.verify_derivation(
-        ctx.program_id,
-        &ShareMintDerivationData {
-            pool: *accs.pool.info().key,
-        },
-    )?;
-    accs.pool.verify_derivation(
-        ctx.program_id,
-        &MigrationPoolDerivationData {
-            from: accs.pool.from,
-            to: accs.pool.to,
-        },
-    )?;
-
-    // The out amount needs to be decimal adjusted
-    let out_amount = if accs.from_mint.decimals > accs.to_mint.decimals {
-        data.amount
-            .checked_div(10u64.pow((accs.from_mint.decimals - accs.to_mint.decimals) as u32))
-            .unwrap()
-    } else {
-        data.amount
-            .checked_mul(10u64.pow((accs.to_mint.decimals - accs.from_mint.decimals) as u32))
-            .unwrap()
-    };
-
-    // Transfer removed liquidity to LP
-    let transfer_ix = spl_token::instruction::transfer(
-        &spl_token::id(),
-        accs.to_token_custody.info().key,
-        accs.to_lp_acc.info().key,
-        accs.custody_signer.key,
-        &[],
-        out_amount,
-    )?;
-    invoke_seeded(&transfer_ix, ctx, &accs.custody_signer, None)?;
-
-    // Burn LP shares
-    let mint_ix = spl_token::instruction::burn(
-        &spl_token::id(),
-        accs.lp_share_acc.info().key,
-        accs.share_mint.info().key,
-        accs.authority_signer.key,
-        &[],
-        data.amount,
-    )?;
-    invoke_seeded(&mint_ix, ctx, &accs.authority_signer, None)?;
-
-    Ok(())
-}

+ 0 - 294
solana/migration/src/instructions.rs

@@ -1,294 +0,0 @@
-use crate::{
-    accounts::{
-        AuthoritySigner,
-        CustodySigner,
-        FromCustodyTokenAccount,
-        FromCustodyTokenAccountDerivationData,
-        MigrationPool,
-        MigrationPoolDerivationData,
-        ShareMint,
-        ShareMintDerivationData,
-        ToCustodyTokenAccount,
-        ToCustodyTokenAccountDerivationData,
-    },
-    api::{
-        add_liquidity::AddLiquidityData,
-        claim_shares::ClaimSharesData,
-        create_pool::CreatePoolData,
-        migrate_tokens::MigrateTokensData,
-        remove_liquidity::RemoveLiquidityData,
-    },
-};
-use borsh::BorshSerialize;
-use solana_program::{
-    instruction::{
-        AccountMeta,
-        Instruction,
-    },
-    pubkey::Pubkey,
-};
-use solitaire::{
-    processors::seeded::Seeded,
-    AccountState,
-};
-
-pub fn add_liquidity(
-    program_id: Pubkey,
-    from_mint: Pubkey,
-    to_mint: Pubkey,
-    liquidity_token_account: Pubkey,
-    lp_share_token_account: Pubkey,
-    amount: u64,
-) -> solitaire::Result<Instruction> {
-    let pool = MigrationPool::<'_, { AccountState::Initialized }>::key(
-        &MigrationPoolDerivationData {
-            from: from_mint,
-            to: to_mint,
-        },
-        &program_id,
-    );
-    Ok(Instruction {
-        program_id,
-        accounts: vec![
-            AccountMeta::new(pool, false),
-            AccountMeta::new_readonly(from_mint, false),
-            AccountMeta::new_readonly(to_mint, false),
-            AccountMeta::new(
-                ToCustodyTokenAccount::<'_, { AccountState::Uninitialized }>::key(
-                    &ToCustodyTokenAccountDerivationData { pool },
-                    &program_id,
-                ),
-                false,
-            ),
-            AccountMeta::new(
-                ShareMint::<'_, { AccountState::Uninitialized }>::key(
-                    &ShareMintDerivationData { pool },
-                    &program_id,
-                ),
-                false,
-            ),
-            AccountMeta::new(liquidity_token_account, false),
-            AccountMeta::new(lp_share_token_account, false),
-            AccountMeta::new_readonly(CustodySigner::key(None, &program_id), false),
-            AccountMeta::new_readonly(AuthoritySigner::key(None, &program_id), false),
-            // Dependencies
-            AccountMeta::new(solana_program::sysvar::rent::id(), false),
-            AccountMeta::new(solana_program::system_program::id(), false),
-            AccountMeta::new_readonly(spl_token::id(), false),
-        ],
-        data: (
-            crate::instruction::Instruction::AddLiquidity,
-            AddLiquidityData { amount },
-        )
-            .try_to_vec()?,
-    })
-}
-
-pub fn remove_liquidity(
-    program_id: Pubkey,
-    from_mint: Pubkey,
-    to_mint: Pubkey,
-    liquidity_token_account: Pubkey,
-    lp_share_token_account: Pubkey,
-    amount: u64,
-) -> solitaire::Result<Instruction> {
-    let pool = MigrationPool::<'_, { AccountState::Initialized }>::key(
-        &MigrationPoolDerivationData {
-            from: from_mint,
-            to: to_mint,
-        },
-        &program_id,
-    );
-    Ok(Instruction {
-        program_id,
-        accounts: vec![
-            AccountMeta::new(pool, false),
-            AccountMeta::new_readonly(from_mint, false),
-            AccountMeta::new_readonly(to_mint, false),
-            AccountMeta::new(
-                ToCustodyTokenAccount::<'_, { AccountState::Uninitialized }>::key(
-                    &ToCustodyTokenAccountDerivationData { pool },
-                    &program_id,
-                ),
-                false,
-            ),
-            AccountMeta::new(
-                ShareMint::<'_, { AccountState::Uninitialized }>::key(
-                    &ShareMintDerivationData { pool },
-                    &program_id,
-                ),
-                false,
-            ),
-            AccountMeta::new(liquidity_token_account, false),
-            AccountMeta::new(lp_share_token_account, false),
-            AccountMeta::new_readonly(CustodySigner::key(None, &program_id), false),
-            AccountMeta::new_readonly(AuthoritySigner::key(None, &program_id), false),
-            // Dependencies
-            AccountMeta::new(solana_program::sysvar::rent::id(), false),
-            AccountMeta::new(solana_program::system_program::id(), false),
-            AccountMeta::new_readonly(spl_token::id(), false),
-        ],
-        data: (
-            crate::instruction::Instruction::RemoveLiquidity,
-            RemoveLiquidityData { amount },
-        )
-            .try_to_vec()?,
-    })
-}
-
-pub fn claim_shares(
-    program_id: Pubkey,
-    from_mint: Pubkey,
-    to_mint: Pubkey,
-    output_token_account: Pubkey,
-    lp_share_token_account: Pubkey,
-    amount: u64,
-) -> solitaire::Result<Instruction> {
-    let pool = MigrationPool::<'_, { AccountState::Initialized }>::key(
-        &MigrationPoolDerivationData {
-            from: from_mint,
-            to: to_mint,
-        },
-        &program_id,
-    );
-    Ok(Instruction {
-        program_id,
-        accounts: vec![
-            AccountMeta::new(pool, false),
-            AccountMeta::new(
-                FromCustodyTokenAccount::<'_, { AccountState::Uninitialized }>::key(
-                    &FromCustodyTokenAccountDerivationData { pool },
-                    &program_id,
-                ),
-                false,
-            ),
-            AccountMeta::new(
-                ShareMint::<'_, { AccountState::Uninitialized }>::key(
-                    &ShareMintDerivationData { pool },
-                    &program_id,
-                ),
-                false,
-            ),
-            AccountMeta::new(output_token_account, false),
-            AccountMeta::new(lp_share_token_account, false),
-            AccountMeta::new_readonly(CustodySigner::key(None, &program_id), false),
-            AccountMeta::new_readonly(AuthoritySigner::key(None, &program_id), false),
-            // Dependencies
-            AccountMeta::new(solana_program::sysvar::rent::id(), false),
-            AccountMeta::new(solana_program::system_program::id(), false),
-            AccountMeta::new_readonly(spl_token::id(), false),
-        ],
-        data: (
-            crate::instruction::Instruction::ClaimShares,
-            ClaimSharesData { amount },
-        )
-            .try_to_vec()?,
-    })
-}
-
-pub fn create_pool(
-    program_id: Pubkey,
-    payer: Pubkey,
-    from_mint: Pubkey,
-    to_mint: Pubkey,
-) -> solitaire::Result<Instruction> {
-    let pool = MigrationPool::<'_, { AccountState::Initialized }>::key(
-        &MigrationPoolDerivationData {
-            from: from_mint,
-            to: to_mint,
-        },
-        &program_id,
-    );
-    Ok(Instruction {
-        program_id,
-        accounts: vec![
-            AccountMeta::new(payer, true),
-            AccountMeta::new(pool, false),
-            AccountMeta::new_readonly(from_mint, false),
-            AccountMeta::new_readonly(to_mint, false),
-            AccountMeta::new(
-                FromCustodyTokenAccount::<'_, { AccountState::Uninitialized }>::key(
-                    &FromCustodyTokenAccountDerivationData { pool },
-                    &program_id,
-                ),
-                false,
-            ),
-            AccountMeta::new(
-                ToCustodyTokenAccount::<'_, { AccountState::Uninitialized }>::key(
-                    &ToCustodyTokenAccountDerivationData { pool },
-                    &program_id,
-                ),
-                false,
-            ),
-            AccountMeta::new(
-                ShareMint::<'_, { AccountState::Uninitialized }>::key(
-                    &ShareMintDerivationData { pool },
-                    &program_id,
-                ),
-                false,
-            ),
-            AccountMeta::new_readonly(CustodySigner::key(None, &program_id), false),
-            // Dependencies
-            AccountMeta::new(solana_program::sysvar::rent::id(), false),
-            AccountMeta::new(solana_program::system_program::id(), false),
-            AccountMeta::new_readonly(spl_token::id(), false),
-        ],
-        data: (
-            crate::instruction::Instruction::CreatePool,
-            CreatePoolData {},
-        )
-            .try_to_vec()?,
-    })
-}
-
-pub fn migrate_tokens(
-    program_id: Pubkey,
-    from_mint: Pubkey,
-    to_mint: Pubkey,
-    input_token_account: Pubkey,
-    output_token_account: Pubkey,
-    amount: u64,
-) -> solitaire::Result<Instruction> {
-    let pool = MigrationPool::<'_, { AccountState::Initialized }>::key(
-        &MigrationPoolDerivationData {
-            from: from_mint,
-            to: to_mint,
-        },
-        &program_id,
-    );
-    Ok(Instruction {
-        program_id,
-        accounts: vec![
-            AccountMeta::new(pool, false),
-            AccountMeta::new_readonly(from_mint, false),
-            AccountMeta::new_readonly(to_mint, false),
-            AccountMeta::new(
-                ToCustodyTokenAccount::<'_, { AccountState::Uninitialized }>::key(
-                    &ToCustodyTokenAccountDerivationData { pool },
-                    &program_id,
-                ),
-                false,
-            ),
-            AccountMeta::new(
-                FromCustodyTokenAccount::<'_, { AccountState::Uninitialized }>::key(
-                    &FromCustodyTokenAccountDerivationData { pool },
-                    &program_id,
-                ),
-                false,
-            ),
-            AccountMeta::new(input_token_account, false),
-            AccountMeta::new(output_token_account, false),
-            AccountMeta::new_readonly(CustodySigner::key(None, &program_id), false),
-            AccountMeta::new_readonly(AuthoritySigner::key(None, &program_id), false),
-            // Dependencies
-            AccountMeta::new(solana_program::sysvar::rent::id(), false),
-            AccountMeta::new(solana_program::system_program::id(), false),
-            AccountMeta::new_readonly(spl_token::id(), false),
-        ],
-        data: (
-            crate::instruction::Instruction::MigrateTokens,
-            MigrateTokensData { amount },
-        )
-            .try_to_vec()?,
-    })
-}

+ 0 - 48
solana/migration/src/lib.rs

@@ -1,48 +0,0 @@
-#![allow(incomplete_features)]
-
-#![feature(adt_const_params)]
-
-use api::{
-    add_liquidity::*,
-    claim_shares::*,
-    create_pool::*,
-    migrate_tokens::*,
-    remove_liquidity::*,
-};
-use solitaire::{
-    solitaire,
-    SolitaireError,
-};
-
-pub mod accounts;
-pub mod api;
-pub mod types;
-
-#[cfg(feature = "no-entrypoint")]
-pub mod instructions;
-
-#[cfg(feature = "wasm")]
-#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
-extern crate wasm_bindgen;
-
-#[cfg(feature = "wasm")]
-#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
-pub mod wasm;
-
-pub enum MigrationError {
-    WrongMint,
-}
-
-impl From<MigrationError> for SolitaireError {
-    fn from(t: MigrationError) -> SolitaireError {
-        SolitaireError::Custom(t as u64)
-    }
-}
-
-solitaire! {
-    AddLiquidity(AddLiquidityData) => add_liquidity,
-    RemoveLiquidity(RemoveLiquidityData) => remove_liquidity,
-    ClaimShares(ClaimSharesData) => claim_shares,
-    CreatePool(CreatePoolData) => create_pool,
-    MigrateTokens(MigrateTokensData) => migrate_tokens,
-}

+ 0 - 35
solana/migration/src/types.rs

@@ -1,35 +0,0 @@
-use borsh::{
-    BorshDeserialize,
-    BorshSerialize,
-};
-use serde::{
-    Deserialize,
-    Serialize,
-};
-use solana_program::pubkey::Pubkey;
-use solitaire::{
-    pack_type,
-    processors::seeded::{
-        AccountOwner,
-        Owned,
-    },
-};
-use spl_token::state::{
-    Account,
-    Mint,
-};
-
-#[derive(Default, Clone, Copy, BorshDeserialize, BorshSerialize, Serialize, Deserialize)]
-pub struct PoolData {
-    pub from: Pubkey,
-    pub to: Pubkey,
-}
-
-impl Owned for PoolData {
-    fn owner(&self) -> AccountOwner {
-        AccountOwner::This
-    }
-}
-
-pack_type!(SplMint, Mint, AccountOwner::Other(spl_token::id()));
-pack_type!(SplAccount, Account, AccountOwner::Other(spl_token::id()));

+ 0 - 222
solana/migration/src/wasm.rs

@@ -1,222 +0,0 @@
-use crate::{
-    accounts::{
-        AuthoritySigner,
-        FromCustodyTokenAccount,
-        FromCustodyTokenAccountDerivationData,
-        MigrationPool,
-        MigrationPoolDerivationData,
-        ShareMint,
-        ShareMintDerivationData,
-        ToCustodyTokenAccount,
-        ToCustodyTokenAccountDerivationData,
-    },
-    instructions,
-    types::PoolData,
-};
-use borsh::BorshDeserialize;
-use solana_program::pubkey::Pubkey;
-use solitaire::{
-    processors::seeded::Seeded,
-    AccountState,
-};
-use std::str::FromStr;
-use wasm_bindgen::prelude::*;
-
-#[wasm_bindgen]
-pub fn add_liquidity(
-    program_id: String,
-    from_mint: String,
-    to_mint: String,
-    liquidity_token_account: String,
-    lp_share_token_account: String,
-    amount: u64,
-) -> JsValue {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let from_mint = Pubkey::from_str(from_mint.as_str()).unwrap();
-    let to_mint = Pubkey::from_str(to_mint.as_str()).unwrap();
-    let liquidity_token_account = Pubkey::from_str(liquidity_token_account.as_str()).unwrap();
-    let lp_share_token_account = Pubkey::from_str(lp_share_token_account.as_str()).unwrap();
-
-    let ix = instructions::add_liquidity(
-        program_id,
-        from_mint,
-        to_mint,
-        liquidity_token_account,
-        lp_share_token_account,
-        amount,
-    )
-    .unwrap();
-
-    JsValue::from_serde(&ix).unwrap()
-}
-
-#[wasm_bindgen]
-pub fn remove_liquidity(
-    program_id: String,
-    from_mint: String,
-    to_mint: String,
-    liquidity_token_account: String,
-    lp_share_token_account: String,
-    amount: u64,
-) -> JsValue {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let from_mint = Pubkey::from_str(from_mint.as_str()).unwrap();
-    let to_mint = Pubkey::from_str(to_mint.as_str()).unwrap();
-    let liquidity_token_account = Pubkey::from_str(liquidity_token_account.as_str()).unwrap();
-    let lp_share_token_account = Pubkey::from_str(lp_share_token_account.as_str()).unwrap();
-
-    let ix = instructions::remove_liquidity(
-        program_id,
-        from_mint,
-        to_mint,
-        liquidity_token_account,
-        lp_share_token_account,
-        amount,
-    )
-    .unwrap();
-
-    JsValue::from_serde(&ix).unwrap()
-}
-
-#[wasm_bindgen]
-pub fn claim_shares(
-    program_id: String,
-    from_mint: String,
-    to_mint: String,
-    output_token_account: String,
-    lp_share_token_account: String,
-    amount: u64,
-) -> JsValue {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let from_mint = Pubkey::from_str(from_mint.as_str()).unwrap();
-    let to_mint = Pubkey::from_str(to_mint.as_str()).unwrap();
-    let output_token_account = Pubkey::from_str(output_token_account.as_str()).unwrap();
-    let lp_share_token_account = Pubkey::from_str(lp_share_token_account.as_str()).unwrap();
-
-    let ix = instructions::claim_shares(
-        program_id,
-        from_mint,
-        to_mint,
-        output_token_account,
-        lp_share_token_account,
-        amount,
-    )
-    .unwrap();
-
-    JsValue::from_serde(&ix).unwrap()
-}
-
-#[wasm_bindgen]
-pub fn create_pool(
-    program_id: String,
-    payer: String,
-    from_mint: String,
-    to_mint: String,
-) -> JsValue {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let payer = Pubkey::from_str(payer.as_str()).unwrap();
-    let from_mint = Pubkey::from_str(from_mint.as_str()).unwrap();
-    let to_mint = Pubkey::from_str(to_mint.as_str()).unwrap();
-
-    let ix = instructions::create_pool(program_id, payer, from_mint, to_mint).unwrap();
-
-    JsValue::from_serde(&ix).unwrap()
-}
-
-#[wasm_bindgen]
-pub fn migrate_tokens(
-    program_id: String,
-    from_mint: String,
-    to_mint: String,
-    input_token_account: String,
-    output_token_account: String,
-    amount: u64,
-) -> JsValue {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let from_mint = Pubkey::from_str(from_mint.as_str()).unwrap();
-    let to_mint = Pubkey::from_str(to_mint.as_str()).unwrap();
-    let input_token_account = Pubkey::from_str(input_token_account.as_str()).unwrap();
-    let output_token_account = Pubkey::from_str(output_token_account.as_str()).unwrap();
-
-    let ix = instructions::migrate_tokens(
-        program_id,
-        from_mint,
-        to_mint,
-        input_token_account,
-        output_token_account,
-        amount,
-    )
-    .unwrap();
-
-    JsValue::from_serde(&ix).unwrap()
-}
-
-#[wasm_bindgen]
-pub fn pool_address(program_id: String, from_mint: String, to_mint: String) -> Vec<u8> {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let from_mint_key = Pubkey::from_str(from_mint.as_str()).unwrap();
-    let to_mint_key = Pubkey::from_str(to_mint.as_str()).unwrap();
-
-    let pool_addr = MigrationPool::<'_, { AccountState::Initialized }>::key(
-        &MigrationPoolDerivationData {
-            from: from_mint_key,
-            to: to_mint_key,
-        },
-        &program_id,
-    );
-
-    pool_addr.to_bytes().to_vec()
-}
-
-#[wasm_bindgen]
-pub fn authority_address(program_id: String) -> Vec<u8> {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-
-    let authority_addr = AuthoritySigner::key(None, &program_id);
-
-    authority_addr.to_bytes().to_vec()
-}
-
-#[wasm_bindgen]
-pub fn share_mint_address(program_id: String, pool: String) -> Vec<u8> {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let pool_key = Pubkey::from_str(pool.as_str()).unwrap();
-
-    let share_mint_addr = ShareMint::<'_, { AccountState::Initialized }>::key(
-        &ShareMintDerivationData { pool: pool_key },
-        &program_id,
-    );
-
-    share_mint_addr.to_bytes().to_vec()
-}
-
-#[wasm_bindgen]
-pub fn from_custody_address(program_id: String, pool: String) -> Vec<u8> {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let pool_key = Pubkey::from_str(pool.as_str()).unwrap();
-
-    let from_custody_addr = FromCustodyTokenAccount::<'_, { AccountState::Initialized }>::key(
-        &FromCustodyTokenAccountDerivationData { pool: pool_key },
-        &program_id,
-    );
-
-    from_custody_addr.to_bytes().to_vec()
-}
-
-#[wasm_bindgen]
-pub fn to_custody_address(program_id: String, pool: String) -> Vec<u8> {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let pool_key = Pubkey::from_str(pool.as_str()).unwrap();
-
-    let to_custody_addr = ToCustodyTokenAccount::<'_, { AccountState::Initialized }>::key(
-        &ToCustodyTokenAccountDerivationData { pool: pool_key },
-        &program_id,
-    );
-
-    to_custody_addr.to_bytes().to_vec()
-}
-
-#[wasm_bindgen]
-pub fn parse_pool(data: Vec<u8>) -> JsValue {
-    JsValue::from_serde(&PoolData::try_from_slice(data.as_slice()).unwrap()).unwrap()
-}

+ 0 - 3665
solana/modules/nft_bridge/Cargo.lock

@@ -1,3665 +0,0 @@
-# This file is automatically @generated by Cargo.
-# It is not intended for manual editing.
-version = 3
-
-[[package]]
-name = "Inflector"
-version = "0.11.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3"
-dependencies = [
- "lazy_static",
- "regex",
-]
-
-[[package]]
-name = "addr2line"
-version = "0.16.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3e61f2b7f93d2c7d2b08263acaa4a363b3e276806c68af6134c44f523bf1aacd"
-dependencies = [
- "gimli",
-]
-
-[[package]]
-name = "adler"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
-
-[[package]]
-name = "ahash"
-version = "0.4.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e"
-
-[[package]]
-name = "aho-corasick"
-version = "0.7.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "aliasable"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd"
-
-[[package]]
-name = "ansi_term"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
-dependencies = [
- "winapi",
-]
-
-[[package]]
-name = "anyhow"
-version = "1.0.43"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "28ae2b3dec75a406790005a200b1bd89785afc02517a00ca99ecfe093ee9e6cf"
-
-[[package]]
-name = "arrayref"
-version = "0.3.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544"
-
-[[package]]
-name = "arrayvec"
-version = "0.7.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6"
-
-[[package]]
-name = "assert_matches"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9"
-
-[[package]]
-name = "atty"
-version = "0.2.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
-dependencies = [
- "hermit-abi",
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "autocfg"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
-
-[[package]]
-name = "backtrace"
-version = "0.3.61"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e7a905d892734eea339e896738c14b9afce22b5318f64b951e70bf3844419b01"
-dependencies = [
- "addr2line",
- "cc",
- "cfg-if",
- "libc",
- "miniz_oxide",
- "object",
- "rustc-demangle",
-]
-
-[[package]]
-name = "base32"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "23ce669cd6c8588f79e15cf450314f9638f967fc5770ff1c7c1deb0925ea7cfa"
-
-[[package]]
-name = "base64"
-version = "0.12.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff"
-
-[[package]]
-name = "base64"
-version = "0.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
-
-[[package]]
-name = "bincode"
-version = "1.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "bitflags"
-version = "1.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
-
-[[package]]
-name = "blake3"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "882e99e4a0cb2ae6cb6e442102e8e6b7131718d94110e64c3e6a34ea9b106f37"
-dependencies = [
- "arrayref",
- "arrayvec",
- "cc",
- "cfg-if",
- "constant_time_eq",
- "digest 0.10.1",
-]
-
-[[package]]
-name = "block-buffer"
-version = "0.7.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b"
-dependencies = [
- "block-padding 0.1.5",
- "byte-tools",
- "byteorder",
- "generic-array 0.12.4",
-]
-
-[[package]]
-name = "block-buffer"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4"
-dependencies = [
- "block-padding 0.2.1",
- "generic-array 0.14.4",
-]
-
-[[package]]
-name = "block-buffer"
-version = "0.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1d36a02058e76b040de25a4464ba1c80935655595b661505c8b39b664828b95"
-dependencies = [
- "generic-array 0.14.4",
-]
-
-[[package]]
-name = "block-padding"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5"
-dependencies = [
- "byte-tools",
-]
-
-[[package]]
-name = "block-padding"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae"
-
-[[package]]
-name = "borsh"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "18dda7dc709193c0d86a1a51050a926dc3df1cf262ec46a23a25dba421ea1924"
-dependencies = [
- "borsh-derive",
- "hashbrown 0.9.1",
-]
-
-[[package]]
-name = "borsh-derive"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "684155372435f578c0fa1acd13ebbb182cc19d6b38b64ae7901da4393217d264"
-dependencies = [
- "borsh-derive-internal",
- "borsh-schema-derive-internal",
- "proc-macro-crate 0.1.5",
- "proc-macro2 1.0.28",
- "syn 1.0.75",
-]
-
-[[package]]
-name = "borsh-derive-internal"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2102f62f8b6d3edeab871830782285b64cc1830168094db05c8e458f209bc5c3"
-dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
-]
-
-[[package]]
-name = "borsh-schema-derive-internal"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "196c978c4c9b0b142d446ef3240690bf5a8a33497074a113ff9a337ccb750483"
-dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
-]
-
-[[package]]
-name = "bs58"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3"
-
-[[package]]
-name = "bstr"
-version = "0.2.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90682c8d613ad3373e66de8c6411e0ae2ab2571e879d2efbf73558cc66f21279"
-dependencies = [
- "lazy_static",
- "memchr",
- "regex-automata",
-]
-
-[[package]]
-name = "bumpalo"
-version = "3.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c59e7af012c713f529e7a3ee57ce9b31ddd858d4b512923602f74608b009631"
-
-[[package]]
-name = "bv"
-version = "0.11.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8834bb1d8ee5dc048ee3124f2c7c1afcc6bc9aed03f11e9dfd8c69470a5db340"
-dependencies = [
- "feature-probe",
- "serde",
-]
-
-[[package]]
-name = "byte-tools"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7"
-
-[[package]]
-name = "bytemuck"
-version = "1.7.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "439989e6b8c38d1b6570a384ef1e49c8848128f5a97f3914baef02920842712f"
-dependencies = [
- "bytemuck_derive",
-]
-
-[[package]]
-name = "bytemuck_derive"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e215f8c2f9f79cb53c8335e687ffd07d5bfcb6fe5fc80723762d0be46e7cc54"
-dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
-]
-
-[[package]]
-name = "byteorder"
-version = "1.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
-
-[[package]]
-name = "bytes"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040"
-
-[[package]]
-name = "bzip2"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6afcd980b5f3a45017c57e57a2fcccbb351cc43a356ce117ef760ef8052b89b0"
-dependencies = [
- "bzip2-sys",
- "libc",
-]
-
-[[package]]
-name = "bzip2-sys"
-version = "0.1.11+1.0.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc"
-dependencies = [
- "cc",
- "libc",
- "pkg-config",
-]
-
-[[package]]
-name = "caps"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "61bf7211aad104ce2769ec05efcdfabf85ee84ac92461d142f22cf8badd0e54c"
-dependencies = [
- "errno",
- "libc",
- "thiserror",
-]
-
-[[package]]
-name = "cc"
-version = "1.0.69"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2"
-dependencies = [
- "jobserver",
-]
-
-[[package]]
-name = "cfg-if"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
-
-[[package]]
-name = "chrono"
-version = "0.4.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73"
-dependencies = [
- "libc",
- "num-integer",
- "num-traits",
- "serde",
- "time",
- "winapi",
-]
-
-[[package]]
-name = "clap"
-version = "2.33.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002"
-dependencies = [
- "ansi_term",
- "atty",
- "bitflags",
- "strsim",
- "textwrap",
- "unicode-width",
- "vec_map",
-]
-
-[[package]]
-name = "console"
-version = "0.14.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3993e6445baa160675931ec041a5e03ca84b9c6e32a056150d3aa2bdda0a1f45"
-dependencies = [
- "encode_unicode",
- "lazy_static",
- "libc",
- "terminal_size",
- "winapi",
-]
-
-[[package]]
-name = "console"
-version = "0.15.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a28b32d32ca44b70c3e4acd7db1babf555fa026e385fb95f18028f88848b3c31"
-dependencies = [
- "encode_unicode",
- "libc",
- "once_cell",
- "regex",
- "terminal_size",
- "unicode-width",
- "winapi",
-]
-
-[[package]]
-name = "console_error_panic_hook"
-version = "0.1.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc"
-dependencies = [
- "cfg-if",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "console_log"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "501a375961cef1a0d44767200e66e4a559283097e91d0730b1d75dfb2f8a1494"
-dependencies = [
- "log",
- "web-sys",
-]
-
-[[package]]
-name = "constant_time_eq"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc"
-
-[[package]]
-name = "cpufeatures"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "crc32fast"
-version = "1.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a"
-dependencies = [
- "cfg-if",
-]
-
-[[package]]
-name = "crossbeam-channel"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4"
-dependencies = [
- "cfg-if",
- "crossbeam-utils",
-]
-
-[[package]]
-name = "crossbeam-deque"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e"
-dependencies = [
- "cfg-if",
- "crossbeam-epoch",
- "crossbeam-utils",
-]
-
-[[package]]
-name = "crossbeam-epoch"
-version = "0.9.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd"
-dependencies = [
- "cfg-if",
- "crossbeam-utils",
- "lazy_static",
- "memoffset",
- "scopeguard",
-]
-
-[[package]]
-name = "crossbeam-utils"
-version = "0.8.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db"
-dependencies = [
- "cfg-if",
- "lazy_static",
-]
-
-[[package]]
-name = "crunchy"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7"
-
-[[package]]
-name = "crypto-common"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "683d6b536309245c849479fba3da410962a43ed8e51c26b729208ec0ac2798d0"
-dependencies = [
- "generic-array 0.14.4",
-]
-
-[[package]]
-name = "crypto-mac"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5"
-dependencies = [
- "generic-array 0.12.4",
- "subtle 1.0.0",
-]
-
-[[package]]
-name = "crypto-mac"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab"
-dependencies = [
- "generic-array 0.14.4",
- "subtle 2.4.1",
-]
-
-[[package]]
-name = "crypto-mac"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "58bcd97a54c7ca5ce2f6eb16f6bede5b0ab5f0055fedc17d2f0b4466e21671ca"
-dependencies = [
- "generic-array 0.14.4",
- "subtle 2.4.1",
-]
-
-[[package]]
-name = "crypto-mac"
-version = "0.11.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714"
-dependencies = [
- "generic-array 0.14.4",
- "subtle 2.4.1",
-]
-
-[[package]]
-name = "curve25519-dalek"
-version = "3.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61"
-dependencies = [
- "byteorder",
- "digest 0.9.0",
- "rand_core 0.5.1",
- "subtle 2.4.1",
- "zeroize",
-]
-
-[[package]]
-name = "dashmap"
-version = "4.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e77a43b28d0668df09411cb0bc9a8c2adc40f9a048afe863e05fd43251e8e39c"
-dependencies = [
- "cfg-if",
- "num_cpus",
- "rayon",
-]
-
-[[package]]
-name = "derivation-path"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "193388a8c8c75a490b604ff61775e236541b8975e98e5ca1f6ea97d122b7e2db"
-dependencies = [
- "failure",
-]
-
-[[package]]
-name = "derivative"
-version = "2.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b"
-dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
-]
-
-[[package]]
-name = "dialoguer"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "61579ada4ec0c6031cfac3f86fdba0d195a7ebeb5e36693bd53cb5999a25beeb"
-dependencies = [
- "console 0.15.0",
- "lazy_static",
- "tempfile",
- "zeroize",
-]
-
-[[package]]
-name = "digest"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5"
-dependencies = [
- "generic-array 0.12.4",
-]
-
-[[package]]
-name = "digest"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066"
-dependencies = [
- "generic-array 0.14.4",
-]
-
-[[package]]
-name = "digest"
-version = "0.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b697d66081d42af4fba142d56918a3cb21dc8eb63372c6b85d14f44fb9c5979b"
-dependencies = [
- "block-buffer 0.10.0",
- "crypto-common",
- "generic-array 0.14.4",
- "subtle 2.4.1",
-]
-
-[[package]]
-name = "dir-diff"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2860407d7d7e2e004bb2128510ad9e8d669e76fa005ccf567977b5d71b8b4a0b"
-dependencies = [
- "walkdir",
-]
-
-[[package]]
-name = "dirs-next"
-version = "2.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1"
-dependencies = [
- "cfg-if",
- "dirs-sys-next",
-]
-
-[[package]]
-name = "dirs-sys-next"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d"
-dependencies = [
- "libc",
- "redox_users",
- "winapi",
-]
-
-[[package]]
-name = "dlopen"
-version = "0.1.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "71e80ad39f814a9abe68583cd50a2d45c8a67561c3361ab8da240587dda80937"
-dependencies = [
- "dlopen_derive",
- "lazy_static",
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "dlopen_derive"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f236d9e1b1fbd81cea0f9cbdc8dcc7e8ebcd80e6659cd7cb2ad5f6c05946c581"
-dependencies = [
- "libc",
- "quote 0.6.13",
- "syn 0.15.44",
-]
-
-[[package]]
-name = "ed25519"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4620d40f6d2601794401d6dd95a5cf69b6c157852539470eeda433a99b3c0efc"
-dependencies = [
- "signature",
-]
-
-[[package]]
-name = "ed25519-dalek"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d"
-dependencies = [
- "curve25519-dalek",
- "ed25519",
- "rand 0.7.3",
- "serde",
- "sha2 0.9.9",
- "zeroize",
-]
-
-[[package]]
-name = "ed25519-dalek-bip32"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "057f328f31294b5ab432e6c39642f54afd1531677d6d4ba2905932844cc242f3"
-dependencies = [
- "derivation-path",
- "ed25519-dalek",
- "failure",
- "hmac 0.9.0",
- "sha2 0.9.9",
-]
-
-[[package]]
-name = "either"
-version = "1.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
-
-[[package]]
-name = "encode_unicode"
-version = "0.3.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f"
-
-[[package]]
-name = "encoding_rs"
-version = "0.8.28"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "80df024fbc5ac80f87dfef0d9f5209a252f2a497f7f42944cff24d8253cac065"
-dependencies = [
- "cfg-if",
-]
-
-[[package]]
-name = "env_logger"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3"
-dependencies = [
- "atty",
- "humantime",
- "log",
- "regex",
- "termcolor",
-]
-
-[[package]]
-name = "errno"
-version = "0.2.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1"
-dependencies = [
- "errno-dragonfly",
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "errno-dragonfly"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf"
-dependencies = [
- "cc",
- "libc",
-]
-
-[[package]]
-name = "failure"
-version = "0.1.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86"
-dependencies = [
- "backtrace",
- "failure_derive",
-]
-
-[[package]]
-name = "failure_derive"
-version = "0.1.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4"
-dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
- "synstructure",
-]
-
-[[package]]
-name = "fake-simd"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed"
-
-[[package]]
-name = "feature-probe"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da"
-
-[[package]]
-name = "filetime"
-version = "0.2.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "975ccf83d8d9d0d84682850a38c8169027be83368805971cc4f238c2b245bc98"
-dependencies = [
- "cfg-if",
- "libc",
- "redox_syscall",
- "winapi",
-]
-
-[[package]]
-name = "fixed-hash"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c"
-dependencies = [
- "static_assertions",
-]
-
-[[package]]
-name = "flate2"
-version = "1.0.22"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e6988e897c1c9c485f43b47a529cef42fde0547f9d8d41a7062518f1d8fc53f"
-dependencies = [
- "cfg-if",
- "crc32fast",
- "libc",
- "miniz_oxide",
-]
-
-[[package]]
-name = "fnv"
-version = "1.0.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
-
-[[package]]
-name = "form_urlencoded"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191"
-dependencies = [
- "matches",
- "percent-encoding",
-]
-
-[[package]]
-name = "fs_extra"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394"
-
-[[package]]
-name = "futures"
-version = "0.3.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1adc00f486adfc9ce99f77d717836f0c5aa84965eb0b4f051f4e83f7cab53f8b"
-dependencies = [
- "futures-channel",
- "futures-core",
- "futures-executor",
- "futures-io",
- "futures-sink",
- "futures-task",
- "futures-util",
-]
-
-[[package]]
-name = "futures-channel"
-version = "0.3.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "74ed2411805f6e4e3d9bc904c95d5d423b89b3b25dc0250aa74729de20629ff9"
-dependencies = [
- "futures-core",
- "futures-sink",
-]
-
-[[package]]
-name = "futures-core"
-version = "0.3.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af51b1b4a7fdff033703db39de8802c673eb91855f2e0d47dcf3bf2c0ef01f99"
-
-[[package]]
-name = "futures-executor"
-version = "0.3.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4d0d535a57b87e1ae31437b892713aee90cd2d7b0ee48727cd11fc72ef54761c"
-dependencies = [
- "futures-core",
- "futures-task",
- "futures-util",
-]
-
-[[package]]
-name = "futures-io"
-version = "0.3.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b0e06c393068f3a6ef246c75cdca793d6a46347e75286933e5e75fd2fd11582"
-
-[[package]]
-name = "futures-macro"
-version = "0.3.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c54913bae956fb8df7f4dc6fc90362aa72e69148e3f39041fbe8742d21e0ac57"
-dependencies = [
- "autocfg",
- "proc-macro-hack",
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
-]
-
-[[package]]
-name = "futures-sink"
-version = "0.3.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c0f30aaa67363d119812743aa5f33c201a7a66329f97d1a887022971feea4b53"
-
-[[package]]
-name = "futures-task"
-version = "0.3.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bbe54a98670017f3be909561f6ad13e810d9a51f3f061b902062ca3da80799f2"
-
-[[package]]
-name = "futures-util"
-version = "0.3.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67eb846bfd58e44a8481a00049e82c43e0ccb5d61f8dc071057cb19249dd4d78"
-dependencies = [
- "autocfg",
- "futures-channel",
- "futures-core",
- "futures-io",
- "futures-macro",
- "futures-sink",
- "futures-task",
- "memchr",
- "pin-project-lite",
- "pin-utils",
- "proc-macro-hack",
- "proc-macro-nested",
- "slab",
-]
-
-[[package]]
-name = "generic-array"
-version = "0.12.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd"
-dependencies = [
- "typenum",
-]
-
-[[package]]
-name = "generic-array"
-version = "0.14.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817"
-dependencies = [
- "serde",
- "typenum",
- "version_check",
-]
-
-[[package]]
-name = "gethostname"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e692e296bfac1d2533ef168d0b60ff5897b8b70a4009276834014dd8924cc028"
-dependencies = [
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "getrandom"
-version = "0.1.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce"
-dependencies = [
- "cfg-if",
- "js-sys",
- "libc",
- "wasi 0.9.0+wasi-snapshot-preview1",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "getrandom"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753"
-dependencies = [
- "cfg-if",
- "libc",
- "wasi 0.10.2+wasi-snapshot-preview1",
-]
-
-[[package]]
-name = "gimli"
-version = "0.25.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0a01e0497841a3b2db4f8afa483cce65f7e96a3498bd6c541734792aeac8fe7"
-
-[[package]]
-name = "h2"
-version = "0.3.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0c9de88456263e249e241fcd211d3954e2c9b0ef7ccfc235a444eb367cae3689"
-dependencies = [
- "bytes",
- "fnv",
- "futures-core",
- "futures-sink",
- "futures-util",
- "http",
- "indexmap",
- "slab",
- "tokio",
- "tokio-util",
- "tracing",
-]
-
-[[package]]
-name = "hashbrown"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04"
-dependencies = [
- "ahash",
-]
-
-[[package]]
-name = "hashbrown"
-version = "0.11.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
-
-[[package]]
-name = "hermit-abi"
-version = "0.1.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "hex"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
-
-[[package]]
-name = "hex-literal"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "21e4590e13640f19f249fe3e4eca5113bc4289f2497710378190e7f4bd96f45b"
-
-[[package]]
-name = "hidapi"
-version = "1.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e6c4cc7279df8353788ac551186920e44959d5948aec404be02b28544a598bce"
-dependencies = [
- "cc",
- "libc",
- "pkg-config",
-]
-
-[[package]]
-name = "hmac"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5dcb5e64cda4c23119ab41ba960d1e170a774c8e4b9d9e6a9bc18aabf5e59695"
-dependencies = [
- "crypto-mac 0.7.0",
- "digest 0.8.1",
-]
-
-[[package]]
-name = "hmac"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840"
-dependencies = [
- "crypto-mac 0.8.0",
- "digest 0.9.0",
-]
-
-[[package]]
-name = "hmac"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "deae6d9dbb35ec2c502d62b8f7b1c000a0822c3b0794ba36b3149c0a1c840dff"
-dependencies = [
- "crypto-mac 0.9.1",
- "digest 0.9.0",
-]
-
-[[package]]
-name = "hmac"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b"
-dependencies = [
- "crypto-mac 0.11.1",
- "digest 0.9.0",
-]
-
-[[package]]
-name = "hmac-drbg"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c6e570451493f10f6581b48cdd530413b63ea9e780f544bfd3bdcaa0d89d1a7b"
-dependencies = [
- "digest 0.8.1",
- "generic-array 0.12.4",
- "hmac 0.7.1",
-]
-
-[[package]]
-name = "hmac-drbg"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1"
-dependencies = [
- "digest 0.9.0",
- "generic-array 0.14.4",
- "hmac 0.8.1",
-]
-
-[[package]]
-name = "http"
-version = "0.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "527e8c9ac747e28542699a951517aa9a6945af506cd1f2e1b53a576c17b6cc11"
-dependencies = [
- "bytes",
- "fnv",
- "itoa 0.4.8",
-]
-
-[[package]]
-name = "http-body"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "399c583b2979440c60be0821a6199eca73bc3c8dcd9d070d75ac726e2c6186e5"
-dependencies = [
- "bytes",
- "http",
- "pin-project-lite",
-]
-
-[[package]]
-name = "httparse"
-version = "1.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "acd94fdbe1d4ff688b67b04eee2e17bd50995534a61539e45adfefb45e5e5503"
-
-[[package]]
-name = "httpdate"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440"
-
-[[package]]
-name = "humantime"
-version = "2.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
-
-[[package]]
-name = "hyper"
-version = "0.14.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b61cf2d1aebcf6e6352c97b81dc2244ca29194be1b276f5d8ad5c6330fffb11"
-dependencies = [
- "bytes",
- "futures-channel",
- "futures-core",
- "futures-util",
- "h2",
- "http",
- "http-body",
- "httparse",
- "httpdate",
- "itoa 0.4.8",
- "pin-project-lite",
- "socket2",
- "tokio",
- "tower-service",
- "tracing",
- "want",
-]
-
-[[package]]
-name = "hyper-rustls"
-version = "0.23.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d87c48c02e0dc5e3b849a2041db3029fd066650f8f717c07bf8ed78ccb895cac"
-dependencies = [
- "http",
- "hyper",
- "rustls",
- "tokio",
- "tokio-rustls",
-]
-
-[[package]]
-name = "idna"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8"
-dependencies = [
- "matches",
- "unicode-bidi",
- "unicode-normalization",
-]
-
-[[package]]
-name = "indexmap"
-version = "1.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5"
-dependencies = [
- "autocfg",
- "hashbrown 0.11.2",
-]
-
-[[package]]
-name = "indicatif"
-version = "0.16.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2d207dc617c7a380ab07ff572a6e52fa202a2a8f355860ac9c38e23f8196be1b"
-dependencies = [
- "console 0.14.1",
- "lazy_static",
- "number_prefix",
- "regex",
-]
-
-[[package]]
-name = "instant"
-version = "0.1.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bee0328b1209d157ef001c94dd85b4f8f64139adb0eac2659f4b08382b2f474d"
-dependencies = [
- "cfg-if",
-]
-
-[[package]]
-name = "ipnet"
-version = "2.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "68f2d64f2edebec4ce84ad108148e67e1064789bee435edc5b60ad398714a3a9"
-
-[[package]]
-name = "itertools"
-version = "0.10.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3"
-dependencies = [
- "either",
-]
-
-[[package]]
-name = "itoa"
-version = "0.4.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4"
-
-[[package]]
-name = "itoa"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35"
-
-[[package]]
-name = "jobserver"
-version = "0.1.24"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "js-sys"
-version = "0.3.55"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84"
-dependencies = [
- "wasm-bindgen",
-]
-
-[[package]]
-name = "jsonrpc-core"
-version = "18.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "14f7f76aef2d054868398427f6c54943cf3d1caa9a7ec7d0c38d69df97a965eb"
-dependencies = [
- "futures",
- "futures-executor",
- "futures-util",
- "log",
- "serde",
- "serde_derive",
- "serde_json",
-]
-
-[[package]]
-name = "keccak"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7"
-
-[[package]]
-name = "lazy_static"
-version = "1.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
-
-[[package]]
-name = "libc"
-version = "0.2.112"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125"
-
-[[package]]
-name = "libloading"
-version = "0.7.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "afe203d669ec979b7128619bae5a63b7b42e9203c1b29146079ee05e2f604b52"
-dependencies = [
- "cfg-if",
- "winapi",
-]
-
-[[package]]
-name = "libsecp256k1"
-version = "0.3.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1fc1e2c808481a63dc6da2074752fdd4336a3c8fcc68b83db6f1fd5224ae7962"
-dependencies = [
- "arrayref",
- "crunchy",
- "digest 0.8.1",
- "hmac-drbg 0.2.0",
- "rand 0.7.3",
- "sha2 0.8.2",
- "subtle 2.4.1",
- "typenum",
-]
-
-[[package]]
-name = "libsecp256k1"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c9d220bc1feda2ac231cb78c3d26f27676b8cf82c96971f7aeef3d0cf2797c73"
-dependencies = [
- "arrayref",
- "base64 0.12.3",
- "digest 0.9.0",
- "hmac-drbg 0.3.0",
- "libsecp256k1-core",
- "libsecp256k1-gen-ecmult",
- "libsecp256k1-gen-genmult",
- "rand 0.7.3",
- "serde",
- "sha2 0.9.9",
- "typenum",
-]
-
-[[package]]
-name = "libsecp256k1-core"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d0f6ab710cec28cef759c5f18671a27dae2a5f952cdaaee1d8e2908cb2478a80"
-dependencies = [
- "crunchy",
- "digest 0.9.0",
- "subtle 2.4.1",
-]
-
-[[package]]
-name = "libsecp256k1-gen-ecmult"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ccab96b584d38fac86a83f07e659f0deafd0253dc096dab5a36d53efe653c5c3"
-dependencies = [
- "libsecp256k1-core",
-]
-
-[[package]]
-name = "libsecp256k1-gen-genmult"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67abfe149395e3aa1c48a2beb32b068e2334402df8181f818d3aee2b304c4f5d"
-dependencies = [
- "libsecp256k1-core",
-]
-
-[[package]]
-name = "linked-hash-map"
-version = "0.5.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3"
-
-[[package]]
-name = "lock_api"
-version = "0.4.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0382880606dff6d15c9476c416d18690b72742aa7b605bb6dd6ec9030fbf07eb"
-dependencies = [
- "scopeguard",
-]
-
-[[package]]
-name = "log"
-version = "0.4.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
-dependencies = [
- "cfg-if",
-]
-
-[[package]]
-name = "matches"
-version = "0.1.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
-
-[[package]]
-name = "memchr"
-version = "2.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
-
-[[package]]
-name = "memmap2"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe3179b85e1fd8b14447cbebadb75e45a1002f541b925f0bfec366d56a81c56d"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "memoffset"
-version = "0.6.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9"
-dependencies = [
- "autocfg",
-]
-
-[[package]]
-name = "mime"
-version = "0.3.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d"
-
-[[package]]
-name = "miniz_oxide"
-version = "0.4.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b"
-dependencies = [
- "adler",
- "autocfg",
-]
-
-[[package]]
-name = "mio"
-version = "0.7.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16"
-dependencies = [
- "libc",
- "log",
- "miow",
- "ntapi",
- "winapi",
-]
-
-[[package]]
-name = "miow"
-version = "0.3.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21"
-dependencies = [
- "winapi",
-]
-
-[[package]]
-name = "nft-bridge"
-version = "0.1.0"
-dependencies = [
- "borsh",
- "bstr",
- "byteorder",
- "hex",
- "hex-literal",
- "libsecp256k1 0.3.5",
- "primitive-types",
- "rand 0.7.3",
- "rocksalt",
- "serde",
- "sha3",
- "solana-client",
- "solana-program",
- "solana-sdk",
- "solitaire",
- "solitaire-client",
- "spl-associated-token-account",
- "spl-token",
- "spl-token-metadata",
- "wasm-bindgen",
- "wormhole-bridge-solana",
-]
-
-[[package]]
-name = "nix"
-version = "0.23.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9f866317acbd3a240710c63f065ffb1e4fd466259045ccb504130b7f668f35c6"
-dependencies = [
- "bitflags",
- "cc",
- "cfg-if",
- "libc",
- "memoffset",
-]
-
-[[package]]
-name = "ntapi"
-version = "0.3.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44"
-dependencies = [
- "winapi",
-]
-
-[[package]]
-name = "num-derive"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d"
-dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
-]
-
-[[package]]
-name = "num-integer"
-version = "0.1.44"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db"
-dependencies = [
- "autocfg",
- "num-traits",
-]
-
-[[package]]
-name = "num-traits"
-version = "0.2.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290"
-dependencies = [
- "autocfg",
-]
-
-[[package]]
-name = "num_cpus"
-version = "1.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3"
-dependencies = [
- "hermit-abi",
- "libc",
-]
-
-[[package]]
-name = "num_enum"
-version = "0.5.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f9bd055fb730c4f8f4f57d45d35cd6b3f0980535b056dc7ff119cee6a66ed6f"
-dependencies = [
- "derivative",
- "num_enum_derive",
-]
-
-[[package]]
-name = "num_enum_derive"
-version = "0.5.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "486ea01961c4a818096de679a8b740b26d9033146ac5291b1c98557658f8cdd9"
-dependencies = [
- "proc-macro-crate 1.0.0",
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
-]
-
-[[package]]
-name = "number_prefix"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3"
-
-[[package]]
-name = "object"
-version = "0.26.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ee2766204889d09937d00bfbb7fec56bb2a199e2ade963cab19185d8a6104c7c"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "once_cell"
-version = "1.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56"
-
-[[package]]
-name = "opaque-debug"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c"
-
-[[package]]
-name = "opaque-debug"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
-
-[[package]]
-name = "ouroboros"
-version = "0.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f357ef82d1b4db66fbed0b8d542cbd3c22d0bf5b393b3c257b9ba4568e70c9c3"
-dependencies = [
- "aliasable",
- "ouroboros_macro",
- "stable_deref_trait",
-]
-
-[[package]]
-name = "ouroboros_macro"
-version = "0.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "44a0b52c2cbaef7dffa5fec1a43274afe8bd2a644fa9fc50a9ef4ff0269b1257"
-dependencies = [
- "Inflector",
- "proc-macro-error",
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
-]
-
-[[package]]
-name = "parking_lot"
-version = "0.11.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb"
-dependencies = [
- "instant",
- "lock_api",
- "parking_lot_core",
-]
-
-[[package]]
-name = "parking_lot_core"
-version = "0.8.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018"
-dependencies = [
- "cfg-if",
- "instant",
- "libc",
- "redox_syscall",
- "smallvec",
- "winapi",
-]
-
-[[package]]
-name = "pbkdf2"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbd"
-dependencies = [
- "crypto-mac 0.8.0",
-]
-
-[[package]]
-name = "pbkdf2"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f05894bce6a1ba4be299d0c5f29563e08af2bc18bb7d48313113bed71e904739"
-dependencies = [
- "crypto-mac 0.11.1",
-]
-
-[[package]]
-name = "percent-encoding"
-version = "2.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
-
-[[package]]
-name = "pin-project-lite"
-version = "0.2.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443"
-
-[[package]]
-name = "pin-utils"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
-
-[[package]]
-name = "pkg-config"
-version = "0.3.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c"
-
-[[package]]
-name = "ppv-lite86"
-version = "0.2.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857"
-
-[[package]]
-name = "primitive-types"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "06345ee39fbccfb06ab45f3a1a5798d9dafa04cb8921a76d227040003a234b0e"
-dependencies = [
- "fixed-hash",
- "uint",
-]
-
-[[package]]
-name = "proc-macro-crate"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785"
-dependencies = [
- "toml",
-]
-
-[[package]]
-name = "proc-macro-crate"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41fdbd1df62156fbc5945f4762632564d7d038153091c3fcf1067f6aef7cff92"
-dependencies = [
- "thiserror",
- "toml",
-]
-
-[[package]]
-name = "proc-macro-error"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
-dependencies = [
- "proc-macro-error-attr",
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
- "version_check",
-]
-
-[[package]]
-name = "proc-macro-error-attr"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
-dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "version_check",
-]
-
-[[package]]
-name = "proc-macro-hack"
-version = "0.5.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
-
-[[package]]
-name = "proc-macro-nested"
-version = "0.1.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086"
-
-[[package]]
-name = "proc-macro2"
-version = "0.4.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759"
-dependencies = [
- "unicode-xid 0.1.0",
-]
-
-[[package]]
-name = "proc-macro2"
-version = "1.0.28"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c7ed8b8c7b886ea3ed7dde405212185f423ab44682667c8c6dd14aa1d9f6612"
-dependencies = [
- "unicode-xid 0.2.2",
-]
-
-[[package]]
-name = "qstring"
-version = "0.7.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d464fae65fff2680baf48019211ce37aaec0c78e9264c84a3e484717f965104e"
-dependencies = [
- "percent-encoding",
-]
-
-[[package]]
-name = "quote"
-version = "0.6.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1"
-dependencies = [
- "proc-macro2 0.4.30",
-]
-
-[[package]]
-name = "quote"
-version = "1.0.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7"
-dependencies = [
- "proc-macro2 1.0.28",
-]
-
-[[package]]
-name = "rand"
-version = "0.7.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
-dependencies = [
- "getrandom 0.1.16",
- "libc",
- "rand_chacha 0.2.2",
- "rand_core 0.5.1",
- "rand_hc 0.2.0",
-]
-
-[[package]]
-name = "rand"
-version = "0.8.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8"
-dependencies = [
- "libc",
- "rand_chacha 0.3.1",
- "rand_core 0.6.3",
- "rand_hc 0.3.1",
-]
-
-[[package]]
-name = "rand_chacha"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
-dependencies = [
- "ppv-lite86",
- "rand_core 0.5.1",
-]
-
-[[package]]
-name = "rand_chacha"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
-dependencies = [
- "ppv-lite86",
- "rand_core 0.6.3",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
-dependencies = [
- "getrandom 0.1.16",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.6.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7"
-dependencies = [
- "getrandom 0.2.3",
-]
-
-[[package]]
-name = "rand_hc"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
-dependencies = [
- "rand_core 0.5.1",
-]
-
-[[package]]
-name = "rand_hc"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7"
-dependencies = [
- "rand_core 0.6.3",
-]
-
-[[package]]
-name = "rayon"
-version = "1.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90"
-dependencies = [
- "autocfg",
- "crossbeam-deque",
- "either",
- "rayon-core",
-]
-
-[[package]]
-name = "rayon-core"
-version = "1.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e"
-dependencies = [
- "crossbeam-channel",
- "crossbeam-deque",
- "crossbeam-utils",
- "lazy_static",
- "num_cpus",
-]
-
-[[package]]
-name = "redox_syscall"
-version = "0.2.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff"
-dependencies = [
- "bitflags",
-]
-
-[[package]]
-name = "redox_users"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64"
-dependencies = [
- "getrandom 0.2.3",
- "redox_syscall",
-]
-
-[[package]]
-name = "regex"
-version = "1.5.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461"
-dependencies = [
- "aho-corasick",
- "memchr",
- "regex-syntax",
-]
-
-[[package]]
-name = "regex-automata"
-version = "0.1.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132"
-
-[[package]]
-name = "regex-syntax"
-version = "0.6.25"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
-
-[[package]]
-name = "remove_dir_all"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
-dependencies = [
- "winapi",
-]
-
-[[package]]
-name = "reqwest"
-version = "0.11.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87f242f1488a539a79bac6dbe7c8609ae43b7914b7736210f239a37cccb32525"
-dependencies = [
- "base64 0.13.0",
- "bytes",
- "encoding_rs",
- "futures-core",
- "futures-util",
- "h2",
- "http",
- "http-body",
- "hyper",
- "hyper-rustls",
- "ipnet",
- "js-sys",
- "lazy_static",
- "log",
- "mime",
- "percent-encoding",
- "pin-project-lite",
- "rustls",
- "rustls-pemfile",
- "serde",
- "serde_json",
- "serde_urlencoded",
- "tokio",
- "tokio-rustls",
- "url",
- "wasm-bindgen",
- "wasm-bindgen-futures",
- "web-sys",
- "webpki-roots",
- "winreg",
-]
-
-[[package]]
-name = "ring"
-version = "0.16.20"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc"
-dependencies = [
- "cc",
- "libc",
- "once_cell",
- "spin",
- "untrusted",
- "web-sys",
- "winapi",
-]
-
-[[package]]
-name = "rocksalt"
-version = "0.1.0"
-dependencies = [
- "byteorder",
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "sha3",
- "solana-program",
- "syn 1.0.75",
-]
-
-[[package]]
-name = "rpassword"
-version = "5.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ffc936cf8a7ea60c58f030fd36a612a48f440610214dc54bc36431f9ea0c3efb"
-dependencies = [
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "rustc-demangle"
-version = "0.1.20"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dead70b0b5e03e9c814bcb6b01e03e68f7c57a80aa48c72ec92152ab3e818d49"
-
-[[package]]
-name = "rustc-hash"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
-
-[[package]]
-name = "rustc_version"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
-dependencies = [
- "semver",
-]
-
-[[package]]
-name = "rustls"
-version = "0.20.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d37e5e2290f3e040b594b1a9e04377c2c671f1a1cfd9bfdef82106ac1c113f84"
-dependencies = [
- "log",
- "ring",
- "sct",
- "webpki",
-]
-
-[[package]]
-name = "rustls-pemfile"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9"
-dependencies = [
- "base64 0.13.0",
-]
-
-[[package]]
-name = "rustversion"
-version = "1.0.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088"
-
-[[package]]
-name = "ryu"
-version = "1.0.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"
-
-[[package]]
-name = "same-file"
-version = "1.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
-dependencies = [
- "winapi-util",
-]
-
-[[package]]
-name = "scopeguard"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
-
-[[package]]
-name = "sct"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4"
-dependencies = [
- "ring",
- "untrusted",
-]
-
-[[package]]
-name = "semver"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012"
-
-[[package]]
-name = "serde"
-version = "1.0.133"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97565067517b60e2d1ea8b268e59ce036de907ac523ad83a0475da04e818989a"
-dependencies = [
- "serde_derive",
-]
-
-[[package]]
-name = "serde_bytes"
-version = "0.11.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "16ae07dd2f88a366f15bd0632ba725227018c69a1c8550a927324f8eb8368bb9"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "serde_derive"
-version = "1.0.133"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed201699328568d8d08208fdd080e3ff594e6c422e438b6705905da01005d537"
-dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
-]
-
-[[package]]
-name = "serde_json"
-version = "1.0.74"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ee2bb9cd061c5865d345bb02ca49fcef1391741b672b54a0bf7b679badec3142"
-dependencies = [
- "itoa 1.0.1",
- "ryu",
- "serde",
-]
-
-[[package]]
-name = "serde_urlencoded"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "edfa57a7f8d9c1d260a549e7224100f6c43d43f9103e06dd8b4095a9b2b43ce9"
-dependencies = [
- "form_urlencoded",
- "itoa 0.4.8",
- "ryu",
- "serde",
-]
-
-[[package]]
-name = "serde_yaml"
-version = "0.8.23"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4a521f2940385c165a24ee286aa8599633d162077a54bdcae2a6fd5a7bfa7a0"
-dependencies = [
- "indexmap",
- "ryu",
- "serde",
- "yaml-rust",
-]
-
-[[package]]
-name = "sha-1"
-version = "0.9.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6"
-dependencies = [
- "block-buffer 0.9.0",
- "cfg-if",
- "cpufeatures",
- "digest 0.9.0",
- "opaque-debug 0.3.0",
-]
-
-[[package]]
-name = "sha2"
-version = "0.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69"
-dependencies = [
- "block-buffer 0.7.3",
- "digest 0.8.1",
- "fake-simd",
- "opaque-debug 0.2.3",
-]
-
-[[package]]
-name = "sha2"
-version = "0.9.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800"
-dependencies = [
- "block-buffer 0.9.0",
- "cfg-if",
- "cpufeatures",
- "digest 0.9.0",
- "opaque-debug 0.3.0",
-]
-
-[[package]]
-name = "sha3"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809"
-dependencies = [
- "block-buffer 0.9.0",
- "digest 0.9.0",
- "keccak",
- "opaque-debug 0.3.0",
-]
-
-[[package]]
-name = "signal-hook-registry"
-version = "1.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "signature"
-version = "1.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c19772be3c4dd2ceaacf03cb41d5885f2a02c4d8804884918e3a258480803335"
-
-[[package]]
-name = "slab"
-version = "0.4.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c307a32c1c5c437f38c7fd45d753050587732ba8628319fbdf12a7e289ccc590"
-
-[[package]]
-name = "smallvec"
-version = "1.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e"
-
-[[package]]
-name = "socket2"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5dc90fe6c7be1a323296982db1836d1ea9e47b6839496dde9a541bc496df3516"
-dependencies = [
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "solana-account-decoder"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b73dbbe43a11077d2207740a4044d653130aa06c437fc0481753ff0753f5be5f"
-dependencies = [
- "Inflector",
- "base64 0.12.3",
- "bincode",
- "bs58",
- "bv",
- "lazy_static",
- "serde",
- "serde_derive",
- "serde_json",
- "solana-config-program",
- "solana-sdk",
- "solana-vote-program",
- "spl-token",
- "thiserror",
- "zstd",
-]
-
-[[package]]
-name = "solana-address-lookup-table-program"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "545979985b604cf5c0c3f45cf465790a62b5109cce14edb6e1d839281fb71d41"
-dependencies = [
- "bincode",
- "bytemuck",
- "log",
- "num-derive",
- "num-traits",
- "rustc_version",
- "serde",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
- "solana-program-runtime",
- "solana-sdk",
- "thiserror",
-]
-
-[[package]]
-name = "solana-bucket-map"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "47427a1fce977163be8df0c889e6574c0724eac310a6f90553e3c36b8d4e0692"
-dependencies = [
- "fs_extra",
- "log",
- "memmap2",
- "rand 0.7.3",
- "rayon",
- "solana-logger",
- "solana-measure",
- "solana-sdk",
- "tempfile",
-]
-
-[[package]]
-name = "solana-clap-utils"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "670c0fddeaf1b64d1175f1a6221dc66c5f6b4c763cb9cb1bf65ee3ac9fef2e89"
-dependencies = [
- "chrono",
- "clap",
- "rpassword",
- "solana-perf",
- "solana-remote-wallet",
- "solana-sdk",
- "thiserror",
- "tiny-bip39",
- "uriparse",
- "url",
-]
-
-[[package]]
-name = "solana-cli-config"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4d0912423440feef8b93a6a94c0d807c890dbc407a5bc23187eed491fb3897d7"
-dependencies = [
- "dirs-next",
- "lazy_static",
- "serde",
- "serde_derive",
- "serde_yaml",
- "url",
-]
-
-[[package]]
-name = "solana-client"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d8ec26e0d31f3a317b56a33ac3c6704c53f3edb4a81ba46d32ca71ba37198aa7"
-dependencies = [
- "base64 0.13.0",
- "bincode",
- "bs58",
- "clap",
- "indicatif",
- "jsonrpc-core",
- "log",
- "rayon",
- "reqwest",
- "semver",
- "serde",
- "serde_derive",
- "serde_json",
- "solana-account-decoder",
- "solana-clap-utils",
- "solana-faucet",
- "solana-measure",
- "solana-net-utils",
- "solana-sdk",
- "solana-transaction-status",
- "solana-version",
- "solana-vote-program",
- "thiserror",
- "tokio",
- "tungstenite",
- "url",
-]
-
-[[package]]
-name = "solana-compute-budget-program"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c275dde46baa7b1c1a100aa5a82a4dddd27e8cf643cbbdcf27f8d94a843091d"
-dependencies = [
- "solana-program-runtime",
- "solana-sdk",
-]
-
-[[package]]
-name = "solana-config-program"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4aa938b89aed5fc51b6ff1ff6d0b3099daf2b873380491b4d1b2c4ba0096313c"
-dependencies = [
- "bincode",
- "chrono",
- "serde",
- "serde_derive",
- "solana-program-runtime",
- "solana-sdk",
-]
-
-[[package]]
-name = "solana-faucet"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "021064348145bfd31ac1a7fc87e3de2948b63529c3bc873740f15fbe9fe9843a"
-dependencies = [
- "bincode",
- "byteorder",
- "clap",
- "log",
- "serde",
- "serde_derive",
- "solana-clap-utils",
- "solana-cli-config",
- "solana-logger",
- "solana-metrics",
- "solana-sdk",
- "solana-version",
- "spl-memo",
- "thiserror",
- "tokio",
-]
-
-[[package]]
-name = "solana-frozen-abi"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c89bcde59ac3e8d4dbf7c4d990b0627b8ca0d25394c4ce17896dde7a1452e40c"
-dependencies = [
- "bs58",
- "bv",
- "generic-array 0.14.4",
- "log",
- "memmap2",
- "rustc_version",
- "serde",
- "serde_derive",
- "sha2 0.9.9",
- "solana-frozen-abi-macro",
- "solana-logger",
- "thiserror",
-]
-
-[[package]]
-name = "solana-frozen-abi-macro"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "56a7d630da35993631ecc4dd155f92d0d58000cdde3d5e2764fe9fd49d20a3a8"
-dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "rustc_version",
- "syn 1.0.75",
-]
-
-[[package]]
-name = "solana-logger"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6eaf925bb665de46f96fcea2c8a900d0d870a96fd1f50cf2bad16e22a1da71c4"
-dependencies = [
- "env_logger",
- "lazy_static",
- "log",
-]
-
-[[package]]
-name = "solana-measure"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ccdb4297b195811bdc95be328fb74e1547ea1d16f2600a200e66bfc2e32eb54"
-dependencies = [
- "log",
- "solana-sdk",
-]
-
-[[package]]
-name = "solana-metrics"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1d7d103dd77acc8cbb39b85c170548bd4f51f19e0931d22f9621c5a1bb57b94c"
-dependencies = [
- "env_logger",
- "gethostname",
- "lazy_static",
- "log",
- "reqwest",
- "solana-sdk",
-]
-
-[[package]]
-name = "solana-net-utils"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "93819a9cb345a8960c8e886811be3dda59f9759f6add8a99d983016a9d06686d"
-dependencies = [
- "bincode",
- "clap",
- "log",
- "nix",
- "rand 0.7.3",
- "serde",
- "serde_derive",
- "socket2",
- "solana-logger",
- "solana-sdk",
- "solana-version",
- "tokio",
- "url",
-]
-
-[[package]]
-name = "solana-perf"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b056da9866e14547ebdccb7a4948c75e9650e3ce8832965b58996f8bee32bea"
-dependencies = [
- "bincode",
- "caps",
- "curve25519-dalek",
- "dlopen",
- "dlopen_derive",
- "lazy_static",
- "libc",
- "log",
- "nix",
- "rand 0.7.3",
- "rayon",
- "serde",
- "solana-logger",
- "solana-metrics",
- "solana-rayon-threadlimit",
- "solana-sdk",
- "solana-vote-program",
-]
-
-[[package]]
-name = "solana-program"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2fc4d7a0baa649a3bda06d6a1cc30bd3d8ac692702a75fa8e76369cf7b3f6329"
-dependencies = [
- "base64 0.13.0",
- "bincode",
- "bitflags",
- "blake3",
- "borsh",
- "borsh-derive",
- "bs58",
- "bv",
- "bytemuck",
- "console_error_panic_hook",
- "console_log",
- "curve25519-dalek",
- "getrandom 0.1.16",
- "itertools",
- "js-sys",
- "lazy_static",
- "libsecp256k1 0.6.0",
- "log",
- "num-derive",
- "num-traits",
- "parking_lot",
- "rand 0.7.3",
- "rustc_version",
- "rustversion",
- "serde",
- "serde_bytes",
- "serde_derive",
- "sha2 0.9.9",
- "sha3",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
- "solana-logger",
- "solana-sdk-macro",
- "thiserror",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "solana-program-runtime"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "012304a7ccc59ed153ebc26470c070371651af22ea06554f4298e2ca60c74028"
-dependencies = [
- "base64 0.13.0",
- "bincode",
- "itertools",
- "libc",
- "libloading",
- "log",
- "num-derive",
- "num-traits",
- "rustc_version",
- "serde",
- "solana-logger",
- "solana-measure",
- "solana-sdk",
- "thiserror",
-]
-
-[[package]]
-name = "solana-rayon-threadlimit"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6248a0a230cd45af4c9f81ea468b95cab1bf163f57219ddce4cf8d062537578e"
-dependencies = [
- "lazy_static",
- "num_cpus",
-]
-
-[[package]]
-name = "solana-remote-wallet"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a03587d5bf5f7bc9302385f9ada8412662cdb93b5e3d40fee2a02553a932277c"
-dependencies = [
- "base32",
- "console 0.15.0",
- "dialoguer",
- "hidapi",
- "log",
- "num-derive",
- "num-traits",
- "parking_lot",
- "qstring",
- "semver",
- "solana-sdk",
- "thiserror",
- "uriparse",
-]
-
-[[package]]
-name = "solana-runtime"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09941a801d47848cf4840be37f1a00ef1dd823e5ab38485c4b3d57a1c3effe10"
-dependencies = [
- "arrayref",
- "bincode",
- "blake3",
- "bv",
- "byteorder",
- "bzip2",
- "crossbeam-channel",
- "dashmap",
- "dir-diff",
- "flate2",
- "fnv",
- "itertools",
- "lazy_static",
- "log",
- "memmap2",
- "num-derive",
- "num-traits",
- "num_cpus",
- "ouroboros",
- "rand 0.7.3",
- "rayon",
- "regex",
- "rustc_version",
- "serde",
- "serde_derive",
- "solana-address-lookup-table-program",
- "solana-bucket-map",
- "solana-compute-budget-program",
- "solana-config-program",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
- "solana-logger",
- "solana-measure",
- "solana-metrics",
- "solana-program-runtime",
- "solana-rayon-threadlimit",
- "solana-sdk",
- "solana-stake-program",
- "solana-vote-program",
- "symlink",
- "tar",
- "tempfile",
- "thiserror",
- "zstd",
-]
-
-[[package]]
-name = "solana-sdk"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "10932f74eeff6804d15e48a1546e40ad14b17ae8a335f9c1c331f94ab40cf3ad"
-dependencies = [
- "assert_matches",
- "base64 0.13.0",
- "bincode",
- "bitflags",
- "borsh",
- "bs58",
- "bytemuck",
- "byteorder",
- "chrono",
- "derivation-path",
- "digest 0.9.0",
- "ed25519-dalek",
- "ed25519-dalek-bip32",
- "generic-array 0.14.4",
- "hmac 0.11.0",
- "itertools",
- "js-sys",
- "lazy_static",
- "libsecp256k1 0.6.0",
- "log",
- "memmap2",
- "num-derive",
- "num-traits",
- "pbkdf2 0.9.0",
- "qstring",
- "rand 0.7.3",
- "rand_chacha 0.2.2",
- "rustc_version",
- "rustversion",
- "serde",
- "serde_bytes",
- "serde_derive",
- "serde_json",
- "sha2 0.9.9",
- "sha3",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
- "solana-logger",
- "solana-program",
- "solana-sdk-macro",
- "thiserror",
- "uriparse",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "solana-sdk-macro"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec22a924c73abe3376a2046715a2f6a9ae4094095b8ea08e8e56e8de198264ad"
-dependencies = [
- "bs58",
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "rustversion",
- "syn 1.0.75",
-]
-
-[[package]]
-name = "solana-stake-program"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "574fd1a039d44c341e297307b483d56899f94bc399da828f89c164da980f735e"
-dependencies = [
- "bincode",
- "log",
- "num-derive",
- "num-traits",
- "rustc_version",
- "serde",
- "serde_derive",
- "solana-config-program",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
- "solana-metrics",
- "solana-program-runtime",
- "solana-sdk",
- "solana-vote-program",
- "thiserror",
-]
-
-[[package]]
-name = "solana-transaction-status"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d6ab72a2e93a45b8582c839bffa3e8a90ccfa35acfe3677633d43a56b7180b05"
-dependencies = [
- "Inflector",
- "base64 0.12.3",
- "bincode",
- "bs58",
- "lazy_static",
- "log",
- "serde",
- "serde_derive",
- "serde_json",
- "solana-account-decoder",
- "solana-measure",
- "solana-metrics",
- "solana-runtime",
- "solana-sdk",
- "solana-vote-program",
- "spl-associated-token-account",
- "spl-memo",
- "spl-token",
- "thiserror",
-]
-
-[[package]]
-name = "solana-version"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4003c93007332afdee7ea64bddd2fa2dc8f12dccd158bba0d51d442c5bc9e5b8"
-dependencies = [
- "log",
- "rustc_version",
- "serde",
- "serde_derive",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
- "solana-sdk",
-]
-
-[[package]]
-name = "solana-vote-program"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "729763e7fd2d77a2a0053c5e9a978560cbc8849e6f9ebf274ebb5f864867d886"
-dependencies = [
- "bincode",
- "log",
- "num-derive",
- "num-traits",
- "rustc_version",
- "serde",
- "serde_derive",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
- "solana-logger",
- "solana-metrics",
- "solana-program-runtime",
- "solana-sdk",
- "thiserror",
-]
-
-[[package]]
-name = "solitaire"
-version = "0.1.0"
-dependencies = [
- "borsh",
- "byteorder",
- "rocksalt",
- "sha3",
- "solana-program",
-]
-
-[[package]]
-name = "solitaire-client"
-version = "0.1.0"
-dependencies = [
- "borsh",
- "solana-program",
- "solana-sdk",
- "solitaire",
-]
-
-[[package]]
-name = "spin"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
-
-[[package]]
-name = "spl-associated-token-account"
-version = "1.0.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "393e2240d521c3dd770806bff25c2c00d761ac962be106e14e22dd912007f428"
-dependencies = [
- "solana-program",
- "spl-token",
-]
-
-[[package]]
-name = "spl-memo"
-version = "3.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bd0dc6f70db6bacea7ff25870b016a65ba1d1b6013536f08e4fd79a8f9005325"
-dependencies = [
- "solana-program",
-]
-
-[[package]]
-name = "spl-token"
-version = "3.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "93bfdd5bd7c869cb565c7d7635c4fafe189b988a0bdef81063cd9585c6b8dc01"
-dependencies = [
- "arrayref",
- "num-derive",
- "num-traits",
- "num_enum",
- "solana-program",
- "thiserror",
-]
-
-[[package]]
-name = "spl-token-metadata"
-version = "0.0.1"
-dependencies = [
- "borsh",
- "solana-program",
- "spl-token",
-]
-
-[[package]]
-name = "stable_deref_trait"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
-
-[[package]]
-name = "static_assertions"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
-
-[[package]]
-name = "strsim"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
-
-[[package]]
-name = "subtle"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee"
-
-[[package]]
-name = "subtle"
-version = "2.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601"
-
-[[package]]
-name = "symlink"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a7973cce6668464ea31f176d85b13c7ab3bba2cb3b77a2ed26abd7801688010a"
-
-[[package]]
-name = "syn"
-version = "0.15.44"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5"
-dependencies = [
- "proc-macro2 0.4.30",
- "quote 0.6.13",
- "unicode-xid 0.1.0",
-]
-
-[[package]]
-name = "syn"
-version = "1.0.75"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b7f58f7e8eaa0009c5fec437aabf511bd9933e4b2d7407bd05273c01a8906ea7"
-dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "unicode-xid 0.2.2",
-]
-
-[[package]]
-name = "synstructure"
-version = "0.12.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "474aaa926faa1603c40b7885a9eaea29b444d1cb2850cb7c0e37bb1a4182f4fa"
-dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
- "unicode-xid 0.2.2",
-]
-
-[[package]]
-name = "tar"
-version = "0.4.37"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d6f5515d3add52e0bbdcad7b83c388bb36ba7b754dda3b5f5bc2d38640cdba5c"
-dependencies = [
- "filetime",
- "libc",
- "xattr",
-]
-
-[[package]]
-name = "tempfile"
-version = "3.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22"
-dependencies = [
- "cfg-if",
- "libc",
- "rand 0.8.4",
- "redox_syscall",
- "remove_dir_all",
- "winapi",
-]
-
-[[package]]
-name = "termcolor"
-version = "1.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4"
-dependencies = [
- "winapi-util",
-]
-
-[[package]]
-name = "terminal_size"
-version = "0.1.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df"
-dependencies = [
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "textwrap"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
-dependencies = [
- "unicode-width",
-]
-
-[[package]]
-name = "thiserror"
-version = "1.0.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417"
-dependencies = [
- "thiserror-impl",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "1.0.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b"
-dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
-]
-
-[[package]]
-name = "time"
-version = "0.1.43"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438"
-dependencies = [
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "tiny-bip39"
-version = "0.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ffc59cb9dfc85bb312c3a78fd6aa8a8582e310b0fa885d5bb877f6dcc601839d"
-dependencies = [
- "anyhow",
- "hmac 0.8.1",
- "once_cell",
- "pbkdf2 0.4.0",
- "rand 0.7.3",
- "rustc-hash",
- "sha2 0.9.9",
- "thiserror",
- "unicode-normalization",
- "wasm-bindgen",
- "zeroize",
-]
-
-[[package]]
-name = "tinyvec"
-version = "1.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "848a1e1181b9f6753b5e96a092749e29b11d19ede67dfbbd6c7dc7e0f49b5338"
-dependencies = [
- "tinyvec_macros",
-]
-
-[[package]]
-name = "tinyvec_macros"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
-
-[[package]]
-name = "tokio"
-version = "1.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "01cf844b23c6131f624accf65ce0e4e9956a8bb329400ea5bcc26ae3a5c20b0b"
-dependencies = [
- "autocfg",
- "bytes",
- "libc",
- "memchr",
- "mio",
- "num_cpus",
- "once_cell",
- "parking_lot",
- "pin-project-lite",
- "signal-hook-registry",
- "tokio-macros",
- "winapi",
-]
-
-[[package]]
-name = "tokio-macros"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "54473be61f4ebe4efd09cec9bd5d16fa51d70ea0192213d754d2d500457db110"
-dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
-]
-
-[[package]]
-name = "tokio-rustls"
-version = "0.23.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a27d5f2b839802bd8267fa19b0530f5a08b9c08cd417976be2a65d130fe1c11b"
-dependencies = [
- "rustls",
- "tokio",
- "webpki",
-]
-
-[[package]]
-name = "tokio-util"
-version = "0.6.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1caa0b0c8d94a049db56b5acf8cba99dc0623aab1b26d5b5f5e2d945846b3592"
-dependencies = [
- "bytes",
- "futures-core",
- "futures-sink",
- "log",
- "pin-project-lite",
- "tokio",
-]
-
-[[package]]
-name = "toml"
-version = "0.5.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "tower-service"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6"
-
-[[package]]
-name = "tracing"
-version = "0.1.26"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d"
-dependencies = [
- "cfg-if",
- "pin-project-lite",
- "tracing-core",
-]
-
-[[package]]
-name = "tracing-core"
-version = "0.1.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2ca517f43f0fb96e0c3072ed5c275fe5eece87e8cb52f4a77b69226d3b1c9df8"
-dependencies = [
- "lazy_static",
-]
-
-[[package]]
-name = "try-lock"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642"
-
-[[package]]
-name = "tungstenite"
-version = "0.16.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ad3713a14ae247f22a728a0456a545df14acf3867f905adff84be99e23b3ad1"
-dependencies = [
- "base64 0.13.0",
- "byteorder",
- "bytes",
- "http",
- "httparse",
- "log",
- "rand 0.8.4",
- "rustls",
- "sha-1",
- "thiserror",
- "url",
- "utf-8",
- "webpki",
- "webpki-roots",
-]
-
-[[package]]
-name = "typenum"
-version = "1.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06"
-
-[[package]]
-name = "uint"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6470ab50f482bde894a037a57064480a246dbfdd5960bd65a44824693f08da5f"
-dependencies = [
- "byteorder",
- "crunchy",
- "hex",
- "static_assertions",
-]
-
-[[package]]
-name = "unicode-bidi"
-version = "0.3.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "246f4c42e67e7a4e3c6106ff716a5d067d4132a642840b242e357e468a2a0085"
-
-[[package]]
-name = "unicode-normalization"
-version = "0.1.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9"
-dependencies = [
- "tinyvec",
-]
-
-[[package]]
-name = "unicode-width"
-version = "0.1.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
-
-[[package]]
-name = "unicode-xid"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
-
-[[package]]
-name = "unicode-xid"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
-
-[[package]]
-name = "untrusted"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a"
-
-[[package]]
-name = "uriparse"
-version = "0.6.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e515b1ada404168e145ac55afba3c42f04cf972201a8552d42e2abb17c1b7221"
-dependencies = [
- "fnv",
- "lazy_static",
-]
-
-[[package]]
-name = "url"
-version = "2.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c"
-dependencies = [
- "form_urlencoded",
- "idna",
- "matches",
- "percent-encoding",
-]
-
-[[package]]
-name = "utf-8"
-version = "0.7.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9"
-
-[[package]]
-name = "vec_map"
-version = "0.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
-
-[[package]]
-name = "version_check"
-version = "0.9.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe"
-
-[[package]]
-name = "walkdir"
-version = "2.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56"
-dependencies = [
- "same-file",
- "winapi",
- "winapi-util",
-]
-
-[[package]]
-name = "want"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0"
-dependencies = [
- "log",
- "try-lock",
-]
-
-[[package]]
-name = "wasi"
-version = "0.9.0+wasi-snapshot-preview1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
-
-[[package]]
-name = "wasi"
-version = "0.10.2+wasi-snapshot-preview1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
-
-[[package]]
-name = "wasm-bindgen"
-version = "0.2.78"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce"
-dependencies = [
- "cfg-if",
- "serde",
- "serde_json",
- "wasm-bindgen-macro",
-]
-
-[[package]]
-name = "wasm-bindgen-backend"
-version = "0.2.78"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b"
-dependencies = [
- "bumpalo",
- "lazy_static",
- "log",
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
- "wasm-bindgen-shared",
-]
-
-[[package]]
-name = "wasm-bindgen-futures"
-version = "0.4.26"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "95fded345a6559c2cfee778d562300c581f7d4ff3edb9b0d230d69800d213972"
-dependencies = [
- "cfg-if",
- "js-sys",
- "wasm-bindgen",
- "web-sys",
-]
-
-[[package]]
-name = "wasm-bindgen-macro"
-version = "0.2.78"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9"
-dependencies = [
- "quote 1.0.9",
- "wasm-bindgen-macro-support",
-]
-
-[[package]]
-name = "wasm-bindgen-macro-support"
-version = "0.2.78"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab"
-dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
- "wasm-bindgen-backend",
- "wasm-bindgen-shared",
-]
-
-[[package]]
-name = "wasm-bindgen-shared"
-version = "0.2.78"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc"
-
-[[package]]
-name = "web-sys"
-version = "0.3.53"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "224b2f6b67919060055ef1a67807367c2066ed520c3862cc013d26cf893a783c"
-dependencies = [
- "js-sys",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "webpki"
-version = "0.22.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd"
-dependencies = [
- "ring",
- "untrusted",
-]
-
-[[package]]
-name = "webpki-roots"
-version = "0.22.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "552ceb903e957524388c4d3475725ff2c8b7960922063af6ce53c9a43da07449"
-dependencies = [
- "webpki",
-]
-
-[[package]]
-name = "winapi"
-version = "0.3.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
-dependencies = [
- "winapi-i686-pc-windows-gnu",
- "winapi-x86_64-pc-windows-gnu",
-]
-
-[[package]]
-name = "winapi-i686-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
-
-[[package]]
-name = "winapi-util"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
-dependencies = [
- "winapi",
-]
-
-[[package]]
-name = "winapi-x86_64-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
-
-[[package]]
-name = "winreg"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69"
-dependencies = [
- "winapi",
-]
-
-[[package]]
-name = "wormhole-bridge-solana"
-version = "0.1.0"
-dependencies = [
- "borsh",
- "byteorder",
- "primitive-types",
- "serde",
- "sha3",
- "solana-program",
- "solitaire",
-]
-
-[[package]]
-name = "xattr"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "244c3741f4240ef46274860397c7c74e50eb23624996930e484c16679633a54c"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "yaml-rust"
-version = "0.4.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85"
-dependencies = [
- "linked-hash-map",
-]
-
-[[package]]
-name = "zeroize"
-version = "1.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "377db0846015f7ae377174787dd452e1c5f5a9050bc6f954911d01f116daa0cd"
-dependencies = [
- "zeroize_derive",
-]
-
-[[package]]
-name = "zeroize_derive"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a2c1e130bebaeab2f23886bf9acbaca14b092408c452543c857f66399cd6dab1"
-dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
- "synstructure",
-]
-
-[[package]]
-name = "zstd"
-version = "0.9.2+zstd.1.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2390ea1bf6c038c39674f22d95f0564725fc06034a47129179810b2fc58caa54"
-dependencies = [
- "zstd-safe",
-]
-
-[[package]]
-name = "zstd-safe"
-version = "4.1.3+zstd.1.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e99d81b99fb3c2c2c794e3fe56c305c63d5173a16a46b5850b07c935ffc7db79"
-dependencies = [
- "libc",
- "zstd-sys",
-]
-
-[[package]]
-name = "zstd-sys"
-version = "1.6.2+zstd.1.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2daf2f248d9ea44454bfcb2516534e8b8ad2fc91bf818a1885495fc42bc8ac9f"
-dependencies = [
- "cc",
- "libc",
-]
-
-[[patch.unused]]
-name = "memmap2"
-version = "0.1.0"

+ 0 - 5
solana/modules/nft_bridge/Cargo.toml

@@ -1,5 +0,0 @@
-[workspace]
-members = ["program"]
-
-[patch.crates-io]
-memmap2 = { path = "../../bridge/memmap2-rs" }

+ 0 - 44
solana/modules/nft_bridge/program/Cargo.toml

@@ -1,44 +0,0 @@
-[package]
-name = "nft-bridge"
-version = "0.1.0"
-description = "Created with Rocksalt"
-edition = "2018"
-
-[lib]
-crate-type = ["cdylib", "lib"]
-name = "nft_bridge"
-
-[features]
-no-entrypoint = ["solitaire/no-entrypoint", "rand"]
-trace = ["solitaire/trace"]
-wasm = ["no-entrypoint", "wasm-bindgen"]
-client = ["solitaire-client", "solitaire/client", "no-entrypoint"]
-cpi = ["no-entrypoint"]
-default = []
-
-[dependencies]
-wormhole-bridge-solana = { path = "../../../bridge/program", features = ["no-entrypoint", "cpi"] }
-borsh = "=0.9.1"
-bstr = "0.2.16"
-byteorder = "1.4.3"
-rocksalt = { path = "../../../solitaire/rocksalt" }
-solitaire = { path = "../../../solitaire/program" }
-sha3 = "0.9.1"
-solana-program = "*"
-spl-token = { version = "=3.2.0", features = ["no-entrypoint"] }
-spl-associated-token-account = { version = "1.0.2" }
-primitive-types = { version = "0.9.0", default-features = false }
-solitaire-client = { path = "../../../solitaire/client", optional = true }
-spl-token-metadata = { path = "../../token_bridge/token-metadata" }
-wasm-bindgen = { version = "0.2.74", features = ["serde-serialize"], optional = true }
-serde = { version = "1.0", features = ["derive"] }
-rand = { version = "0.7.3", optional = true }
-
-[dev-dependencies]
-hex = "*"
-hex-literal = "0.3.1"
-libsecp256k1 = { version = "0.3.5", features = [] }
-solana-client = "=1.9.4"
-solana-sdk = "=1.9.4"
-spl-token = { version = "=3.2.0", features = ["no-entrypoint"] }
-spl-token-metadata = { path = "../../token_bridge/token-metadata" }

+ 0 - 2
solana/modules/nft_bridge/program/Xargo.toml

@@ -1,2 +0,0 @@
-[target.bpfel-unknown-unknown.dependencies.std]
-features = []

+ 0 - 108
solana/modules/nft_bridge/program/src/accounts.rs

@@ -1,108 +0,0 @@
-use crate::types::*;
-use bridge::{
-    accounts::BridgeData,
-    api::ForeignAddress,
-};
-use primitive_types::U256;
-use solana_program::pubkey::Pubkey;
-use solitaire::{
-    processors::seeded::Seeded,
-    *,
-};
-
-pub type AuthoritySigner<'b> = Derive<Info<'b>, "authority_signer">;
-pub type CustodySigner<'b> = Derive<Info<'b>, "custody_signer">;
-pub type MintSigner<'b> = Derive<Info<'b>, "mint_signer">;
-
-pub type CoreBridge<'a, const STATE: AccountState> = Data<'a, BridgeData, { STATE }>;
-
-pub type EmitterAccount<'b> = Derive<Info<'b>, "emitter">;
-
-pub type ConfigAccount<'b, const STATE: AccountState> =
-    Derive<Data<'b, Config, { STATE }>, "config">;
-
-pub type CustodyAccount<'b, const STATE: AccountState> = Data<'b, SplAccount, { STATE }>;
-
-pub struct CustodyAccountDerivationData {
-    pub mint: Pubkey,
-}
-
-impl<'b, const STATE: AccountState> Seeded<&CustodyAccountDerivationData>
-    for CustodyAccount<'b, { STATE }>
-{
-    fn seeds(accs: &CustodyAccountDerivationData) -> Vec<Vec<u8>> {
-        vec![accs.mint.to_bytes().to_vec()]
-    }
-}
-
-pub type WrappedMint<'b, const STATE: AccountState> = Data<'b, SplMint, { STATE }>;
-
-pub struct WrappedDerivationData {
-    pub token_chain: ChainID,
-    pub token_address: ForeignAddress,
-    pub token_id: U256,
-}
-
-impl<'b, const STATE: AccountState> Seeded<&WrappedDerivationData> for WrappedMint<'b, { STATE }> {
-    fn seeds(data: &WrappedDerivationData) -> Vec<Vec<u8>> {
-        let mut token_id = vec![0u8; 32];
-        data.token_id.to_big_endian(&mut token_id);
-        vec![
-            String::from("wrapped").as_bytes().to_vec(),
-            data.token_chain.to_be_bytes().to_vec(),
-            data.token_address.to_vec(),
-            token_id,
-        ]
-    }
-}
-
-pub type WrappedTokenMeta<'b, const STATE: AccountState> = Data<'b, WrappedMeta, { STATE }>;
-
-pub struct WrappedMetaDerivationData {
-    pub mint_key: Pubkey,
-}
-
-impl<'b, const STATE: AccountState> Seeded<&WrappedMetaDerivationData>
-    for WrappedTokenMeta<'b, { STATE }>
-{
-    fn seeds(data: &WrappedMetaDerivationData) -> Vec<Vec<u8>> {
-        vec![
-            String::from("meta").as_bytes().to_vec(),
-            data.mint_key.to_bytes().to_vec(),
-        ]
-    }
-}
-
-/// Registered chain endpoint
-pub type Endpoint<'b, const STATE: AccountState> = Data<'b, EndpointRegistration, { STATE }>;
-
-pub struct EndpointDerivationData {
-    pub emitter_chain: u16,
-    pub emitter_address: ForeignAddress,
-}
-
-/// Seeded implementation based on an incoming VAA
-impl<'b, const STATE: AccountState> Seeded<&EndpointDerivationData> for Endpoint<'b, { STATE }> {
-    fn seeds(data: &EndpointDerivationData) -> Vec<Vec<u8>> {
-        vec![
-            data.emitter_chain.to_be_bytes().to_vec(),
-            data.emitter_address.to_vec(),
-        ]
-    }
-}
-
-pub type SplTokenMeta<'b> = Info<'b>;
-
-pub struct SplTokenMetaDerivationData {
-    pub mint: Pubkey,
-}
-
-impl<'b> Seeded<&SplTokenMetaDerivationData> for SplTokenMeta<'b> {
-    fn seeds(data: &SplTokenMetaDerivationData) -> Vec<Vec<u8>> {
-        vec![
-            "metadata".as_bytes().to_vec(),
-            spl_token_metadata::id().as_ref().to_vec(),
-            data.mint.as_ref().to_vec(),
-        ]
-    }
-}

+ 0 - 9
solana/modules/nft_bridge/program/src/api.rs

@@ -1,9 +0,0 @@
-pub mod complete_transfer;
-pub mod governance;
-pub mod initialize;
-pub mod transfer;
-
-pub use complete_transfer::*;
-pub use governance::*;
-pub use initialize::*;
-pub use transfer::*;

+ 0 - 411
solana/modules/nft_bridge/program/src/api/complete_transfer.rs

@@ -1,411 +0,0 @@
-use crate::{
-    accounts::{
-        ConfigAccount,
-        CustodyAccount,
-        CustodyAccountDerivationData,
-        CustodySigner,
-        Endpoint,
-        EndpointDerivationData,
-        MintSigner,
-        SplTokenMeta,
-        SplTokenMetaDerivationData,
-        WrappedDerivationData,
-        WrappedMetaDerivationData,
-        WrappedMint,
-        WrappedTokenMeta,
-    },
-    messages::PayloadTransfer,
-    types::*,
-    TokenBridgeError::*,
-};
-use bridge::{
-    vaa::ClaimableVAA,
-    PayloadMessage,
-    CHAIN_ID_SOLANA,
-};
-use solana_program::{
-    account_info::AccountInfo,
-    program::{
-        invoke,
-        invoke_signed,
-    },
-};
-use solitaire::{
-    processors::seeded::{
-        invoke_seeded,
-        Seeded,
-    },
-    CreationLamports::Exempt,
-    *,
-};
-
-#[derive(FromAccounts)]
-pub struct CompleteNative<'b> {
-    pub payer: Mut<Signer<AccountInfo<'b>>>,
-    pub config: ConfigAccount<'b, { AccountState::Initialized }>,
-
-    pub vaa: ClaimableVAA<'b, PayloadTransfer>,
-    pub chain_registration: Endpoint<'b, { AccountState::Initialized }>,
-
-    pub to: Mut<Data<'b, SplAccount, { AccountState::MaybeInitialized }>>,
-    pub to_authority: MaybeMut<Info<'b>>,
-    pub custody: Mut<CustodyAccount<'b, { AccountState::Initialized }>>,
-    pub mint: Data<'b, SplMint, { AccountState::Initialized }>,
-
-    pub custody_signer: CustodySigner<'b>,
-}
-
-impl<'a> From<&CompleteNative<'a>> for EndpointDerivationData {
-    fn from(accs: &CompleteNative<'a>) -> Self {
-        EndpointDerivationData {
-            emitter_chain: accs.vaa.meta().emitter_chain,
-            emitter_address: accs.vaa.meta().emitter_address,
-        }
-    }
-}
-
-impl<'a> From<&CompleteNative<'a>> for CustodyAccountDerivationData {
-    fn from(accs: &CompleteNative<'a>) -> Self {
-        CustodyAccountDerivationData {
-            mint: *accs.mint.info().key,
-        }
-    }
-}
-
-impl<'b> InstructionContext<'b> for CompleteNative<'b> {
-}
-
-#[derive(BorshDeserialize, BorshSerialize, Default)]
-pub struct CompleteNativeData {}
-
-pub fn complete_native(
-    ctx: &ExecutionContext,
-    accs: &mut CompleteNative,
-    _data: CompleteNativeData,
-) -> Result<()> {
-    // Verify the chain registration
-    let derivation_data: EndpointDerivationData = (&*accs).into();
-    accs.chain_registration
-        .verify_derivation(ctx.program_id, &derivation_data)?;
-
-    // Verify that the custody account is derived correctly
-    let derivation_data: CustodyAccountDerivationData = (&*accs).into();
-    accs.custody
-        .verify_derivation(ctx.program_id, &derivation_data)?;
-
-    // Verify mints
-    if *accs.mint.info().key != accs.custody.mint {
-        return Err(InvalidMint.into());
-    }
-    if *accs.custody_signer.key != accs.custody.owner {
-        return Err(WrongAccountOwner.into());
-    }
-
-    // Verify VAA
-    // Please refer to transfer.rs for why the token id is used to store the mint
-    if accs.vaa.token_address != [1u8; 32] {
-        return Err(InvalidMint.into());
-    }
-    let mut token_id_bytes = [0u8; 32];
-    accs.vaa.token_id.to_big_endian(&mut token_id_bytes);
-    if token_id_bytes != accs.mint.info().key.to_bytes() {
-        return Err(InvalidMint.into());
-    }
-    if accs.vaa.token_chain != CHAIN_ID_SOLANA {
-        return Err(InvalidChain.into());
-    }
-    if accs.vaa.to_chain != CHAIN_ID_SOLANA {
-        return Err(InvalidChain.into());
-    }
-    if accs.vaa.to != accs.to.info().key.to_bytes() {
-        return Err(InvalidRecipient.into());
-    }
-
-    // Prevent vaa double signing
-    accs.vaa.verify(ctx.program_id)?;
-    accs.vaa.claim(ctx, accs.payer.key)?;
-
-    if !accs.to.is_initialized() {
-        let associated_addr = spl_associated_token_account::get_associated_token_address(
-            accs.to_authority.info().key,
-            accs.mint.info().key,
-        );
-        if *accs.to.info().key != associated_addr {
-            return Err(InvalidAssociatedAccount.into());
-        }
-        // Create associated token account
-        let ix = spl_associated_token_account::create_associated_token_account(
-            accs.payer.info().key,
-            accs.to_authority.info().key,
-            accs.mint.info().key,
-        );
-        invoke(&ix, ctx.accounts)?;
-    } else if *accs.mint.info().key != accs.to.mint {
-        return Err(InvalidMint.into());
-    }
-
-    // Transfer tokens
-    let transfer_ix = spl_token::instruction::transfer(
-        &spl_token::id(),
-        accs.custody.info().key,
-        accs.to.info().key,
-        accs.custody_signer.key,
-        &[],
-        1,
-    )?;
-    invoke_seeded(&transfer_ix, ctx, &accs.custody_signer, None)?;
-
-    Ok(())
-}
-
-#[derive(FromAccounts)]
-pub struct CompleteWrapped<'b> {
-    pub payer: Mut<Signer<AccountInfo<'b>>>,
-    pub config: ConfigAccount<'b, { AccountState::Initialized }>,
-
-    // Signed message for the transfer
-    pub vaa: ClaimableVAA<'b, PayloadTransfer>,
-
-    pub chain_registration: Endpoint<'b, { AccountState::Initialized }>,
-
-    pub to: Mut<Data<'b, SplAccount, { AccountState::MaybeInitialized }>>,
-    pub to_authority: MaybeMut<Info<'b>>,
-    pub mint: Mut<WrappedMint<'b, { AccountState::MaybeInitialized }>>,
-    pub meta: Mut<WrappedTokenMeta<'b, { AccountState::MaybeInitialized }>>,
-
-    pub mint_authority: MintSigner<'b>,
-}
-
-impl<'a> From<&CompleteWrapped<'a>> for EndpointDerivationData {
-    fn from(accs: &CompleteWrapped<'a>) -> Self {
-        EndpointDerivationData {
-            emitter_chain: accs.vaa.meta().emitter_chain,
-            emitter_address: accs.vaa.meta().emitter_address,
-        }
-    }
-}
-
-impl<'a> From<&CompleteWrapped<'a>> for WrappedDerivationData {
-    fn from(accs: &CompleteWrapped<'a>) -> Self {
-        WrappedDerivationData {
-            token_chain: accs.vaa.token_chain,
-            token_address: accs.vaa.token_address,
-            token_id: accs.vaa.token_id,
-        }
-    }
-}
-
-impl<'a> From<&CompleteWrapped<'a>> for WrappedMetaDerivationData {
-    fn from(accs: &CompleteWrapped<'a>) -> Self {
-        WrappedMetaDerivationData {
-            mint_key: *accs.mint.info().key,
-        }
-    }
-}
-
-impl<'b> InstructionContext<'b> for CompleteWrapped<'b> {
-}
-
-#[derive(BorshDeserialize, BorshSerialize, Default)]
-pub struct CompleteWrappedData {}
-
-pub fn complete_wrapped(
-    ctx: &ExecutionContext,
-    accs: &mut CompleteWrapped,
-    _data: CompleteWrappedData,
-) -> Result<()> {
-    use bstr::ByteSlice;
-
-    // Verify the chain registration
-    let derivation_data: EndpointDerivationData = (&*accs).into();
-    accs.chain_registration
-        .verify_derivation(ctx.program_id, &derivation_data)?;
-
-    // Verify mint
-    let derivation_data: WrappedDerivationData = (&*accs).into();
-    accs.mint
-        .verify_derivation(ctx.program_id, &derivation_data)?;
-
-    // Verify VAA
-    if accs.vaa.to_chain != CHAIN_ID_SOLANA {
-        return Err(InvalidChain.into());
-    }
-    if accs.vaa.to != accs.to.info().key.to_bytes() {
-        return Err(InvalidRecipient.into());
-    }
-
-    accs.vaa.verify(ctx.program_id)?;
-    accs.vaa.claim(ctx, accs.payer.key)?;
-
-    // Initialize the NFT if it doesn't already exist
-    if !accs.meta.is_initialized() {
-        // Create mint account
-        accs.mint
-            .create(&((&*accs).into()), ctx, accs.payer.key, Exempt)?;
-
-        // Initialize mint
-        let init_ix = spl_token::instruction::initialize_mint(
-            &spl_token::id(),
-            accs.mint.info().key,
-            accs.mint_authority.key,
-            None,
-            0,
-        )?;
-        invoke_signed(&init_ix, ctx.accounts, &[])?;
-
-        // Create meta account
-        accs.meta
-            .create(&((&*accs).into()), ctx, accs.payer.key, Exempt)?;
-
-        // Populate meta account
-        accs.meta.chain = accs.vaa.token_chain;
-        accs.meta.token_address = accs.vaa.token_address;
-        accs.meta.token_id = accs.vaa.token_id.0;
-    }
-
-    if !accs.to.is_initialized() {
-        let associated_addr = spl_associated_token_account::get_associated_token_address(
-            accs.to_authority.info().key,
-            accs.mint.info().key,
-        );
-        if *accs.to.info().key != associated_addr {
-            return Err(InvalidAssociatedAccount.into());
-        }
-        // Create associated token account
-        let ix = spl_associated_token_account::create_associated_token_account(
-            accs.payer.info().key,
-            accs.to_authority.info().key,
-            accs.mint.info().key,
-        );
-        invoke_signed(&ix, ctx.accounts, &[])?;
-    } else if *accs.mint.info().key != accs.to.mint {
-        return Err(InvalidMint.into());
-    }
-
-    // Mint tokens
-    let mint_ix = spl_token::instruction::mint_to(
-        &spl_token::id(),
-        accs.mint.info().key,
-        accs.to.info().key,
-        accs.mint_authority.key,
-        &[],
-        1,
-    )?;
-    invoke_seeded(&mint_ix, ctx, &accs.mint_authority, None)?;
-
-    Ok(())
-}
-
-#[derive(FromAccounts)]
-pub struct CompleteWrappedMeta<'b> {
-    pub payer: Mut<Signer<AccountInfo<'b>>>,
-    pub config: ConfigAccount<'b, { AccountState::Initialized }>,
-
-    // VAA for the transfer; this does not need to get claimed
-    pub vaa: PayloadMessage<'b, PayloadTransfer>,
-
-    pub chain_registration: Endpoint<'b, { AccountState::Initialized }>,
-
-    pub mint: WrappedMint<'b, { AccountState::Initialized }>,
-    pub meta: WrappedTokenMeta<'b, { AccountState::Initialized }>,
-
-    /// SPL Metadata for the associated Mint
-    pub spl_metadata: Mut<SplTokenMeta<'b>>,
-
-    pub mint_authority: MintSigner<'b>,
-}
-
-impl<'a> From<&CompleteWrappedMeta<'a>> for EndpointDerivationData {
-    fn from(accs: &CompleteWrappedMeta<'a>) -> Self {
-        EndpointDerivationData {
-            emitter_chain: accs.vaa.meta().emitter_chain,
-            emitter_address: accs.vaa.meta().emitter_address,
-        }
-    }
-}
-
-impl<'a> From<&CompleteWrappedMeta<'a>> for WrappedDerivationData {
-    fn from(accs: &CompleteWrappedMeta<'a>) -> Self {
-        WrappedDerivationData {
-            token_chain: accs.vaa.token_chain,
-            token_address: accs.vaa.token_address,
-            token_id: accs.vaa.token_id,
-        }
-    }
-}
-
-impl<'a> From<&CompleteWrappedMeta<'a>> for WrappedMetaDerivationData {
-    fn from(accs: &CompleteWrappedMeta<'a>) -> Self {
-        WrappedMetaDerivationData {
-            mint_key: *accs.mint.info().key,
-        }
-    }
-}
-
-impl<'b> InstructionContext<'b> for CompleteWrappedMeta<'b> {
-}
-
-#[derive(BorshDeserialize, BorshSerialize, Default)]
-pub struct CompleteWrappedMetaData {}
-
-pub fn complete_wrapped_meta(
-    ctx: &ExecutionContext,
-    accs: &mut CompleteWrappedMeta,
-    _data: CompleteWrappedMetaData,
-) -> Result<()> {
-    use bstr::ByteSlice;
-
-    // Verify the chain registration
-    let derivation_data: EndpointDerivationData = (&*accs).into();
-    accs.chain_registration
-        .verify_derivation(ctx.program_id, &derivation_data)?;
-
-    // Verify mint
-    let derivation_data: WrappedDerivationData = (&*accs).into();
-    accs.mint
-        .verify_derivation(ctx.program_id, &derivation_data)?;
-
-    // Verify VAA
-    if accs.vaa.to_chain != CHAIN_ID_SOLANA {
-        return Err(InvalidChain.into());
-    }
-
-    // Make sure the metadata hasn't been initialized yet
-    if !accs.spl_metadata.data_is_empty() {
-        return Err(AlreadyExecuted.into());
-    }
-
-    // Initialize spl meta
-    accs.spl_metadata.verify_derivation(
-        &spl_token_metadata::id(),
-        &SplTokenMetaDerivationData {
-            mint: *accs.mint.info().key,
-        },
-    )?;
-
-    let name = accs.vaa.name.clone();
-    let mut symbol: Vec<u8> = accs.vaa.symbol.clone().as_bytes().to_vec();
-    symbol.truncate(10);
-    let mut symbol: Vec<char> = symbol.chars().collect();
-    symbol.retain(|&c| c != '\u{FFFD}');
-    let symbol: String = symbol.iter().collect();
-
-    let spl_token_metadata_ix = spl_token_metadata::instruction::create_metadata_accounts(
-        spl_token_metadata::id(),
-        *accs.spl_metadata.key,
-        *accs.mint.info().key,
-        *accs.mint_authority.info().key,
-        *accs.payer.info().key,
-        *accs.mint_authority.info().key,
-        name,
-        symbol,
-        accs.vaa.uri.clone(),
-        None,
-        0,
-        false,
-        true,
-    );
-    invoke_seeded(&spl_token_metadata_ix, ctx, &accs.mint_authority, None)?;
-
-    Ok(())
-}

+ 0 - 170
solana/modules/nft_bridge/program/src/api/governance.rs

@@ -1,170 +0,0 @@
-use crate::{
-    accounts::{
-        ConfigAccount,
-        Endpoint,
-        EndpointDerivationData,
-    },
-    messages::{
-        GovernancePayloadUpgrade,
-        PayloadGovernanceRegisterChain,
-    },
-    TokenBridgeError::{
-        InvalidChain,
-        InvalidGovernanceKey,
-    },
-};
-use bridge::{
-    vaa::{
-        ClaimableVAA,
-        DeserializePayload,
-    },
-    CHAIN_ID_SOLANA,
-};
-use solana_program::{
-    account_info::AccountInfo,
-    program::invoke_signed,
-    pubkey::Pubkey,
-    sysvar::{
-        clock::Clock,
-        rent::Rent,
-    },
-};
-use solitaire::{
-    processors::seeded::Seeded,
-    CreationLamports::Exempt,
-    *,
-};
-
-// Confirm that a ClaimableVAA came from the correct chain, signed by the right emitter.
-fn verify_governance<'a, T>(vaa: &ClaimableVAA<'a, T>) -> Result<()>
-where
-    T: DeserializePayload,
-{
-    let expected_emitter = std::env!("EMITTER_ADDRESS");
-    let current_emitter = format!(
-        "{}",
-        Pubkey::new_from_array(vaa.message.meta().emitter_address)
-    );
-    // Fail if the emitter is not the known governance key, or the emitting chain is not Solana.
-    if expected_emitter != current_emitter || vaa.message.meta().emitter_chain != CHAIN_ID_SOLANA {
-        Err(InvalidGovernanceKey.into())
-    } else {
-        Ok(())
-    }
-}
-
-#[derive(FromAccounts)]
-pub struct UpgradeContract<'b> {
-    /// Payer for account creation (vaa-claim)
-    pub payer: Mut<Signer<Info<'b>>>,
-
-    /// GuardianSet change VAA
-    pub vaa: ClaimableVAA<'b, GovernancePayloadUpgrade>,
-
-    /// PDA authority for the loader
-    pub upgrade_authority: Derive<Info<'b>, "upgrade">,
-
-    /// Spill address for the upgrade excess lamports
-    pub spill: Mut<Info<'b>>,
-
-    /// New contract address.
-    pub buffer: Mut<Info<'b>>,
-
-    /// Required by the upgradeable uploader.
-    pub program_data: Mut<Info<'b>>,
-
-    /// Our own address, required by the upgradeable loader.
-    pub own_address: Mut<Info<'b>>,
-
-    // Various sysvar/program accounts needed for the upgradeable loader.
-    pub rent: Sysvar<'b, Rent>,
-    pub clock: Sysvar<'b, Clock>,
-    pub bpf_loader: Info<'b>,
-    pub system: Info<'b>,
-}
-
-impl<'b> InstructionContext<'b> for UpgradeContract<'b> {
-}
-
-#[derive(BorshDeserialize, BorshSerialize, Default)]
-pub struct UpgradeContractData {}
-
-pub fn upgrade_contract(
-    ctx: &ExecutionContext,
-    accs: &mut UpgradeContract,
-    _data: UpgradeContractData,
-) -> Result<()> {
-    verify_governance(&accs.vaa)?;
-    accs.vaa.verify(&ctx.program_id)?;
-
-    accs.vaa.claim(ctx, accs.payer.key)?;
-
-    let upgrade_ix = solana_program::bpf_loader_upgradeable::upgrade(
-        ctx.program_id,
-        &accs.vaa.message.new_contract,
-        accs.upgrade_authority.key,
-        accs.spill.key,
-    );
-
-    let seeds = accs
-        .upgrade_authority
-        .self_bumped_seeds(None, ctx.program_id);
-    let seeds: Vec<&[u8]> = seeds.iter().map(|item| item.as_slice()).collect();
-    let seeds = seeds.as_slice();
-    invoke_signed(&upgrade_ix, ctx.accounts, &[seeds])?;
-
-    Ok(())
-}
-
-#[derive(FromAccounts)]
-pub struct RegisterChain<'b> {
-    pub payer: Mut<Signer<AccountInfo<'b>>>,
-    pub config: ConfigAccount<'b, { AccountState::Initialized }>,
-
-    pub endpoint: Mut<Endpoint<'b, { AccountState::Uninitialized }>>,
-
-    pub vaa: ClaimableVAA<'b, PayloadGovernanceRegisterChain>,
-}
-
-impl<'a> From<&RegisterChain<'a>> for EndpointDerivationData {
-    fn from(accs: &RegisterChain<'a>) -> Self {
-        EndpointDerivationData {
-            emitter_chain: accs.vaa.chain,
-            emitter_address: accs.vaa.endpoint_address,
-        }
-    }
-}
-
-impl<'b> InstructionContext<'b> for RegisterChain<'b> {
-}
-
-#[derive(BorshDeserialize, BorshSerialize, Default)]
-pub struct RegisterChainData {}
-
-pub fn register_chain(
-    ctx: &ExecutionContext,
-    accs: &mut RegisterChain,
-    _data: RegisterChainData,
-) -> Result<()> {
-    let derivation_data: EndpointDerivationData = (&*accs).into();
-    accs.endpoint
-        .verify_derivation(ctx.program_id, &derivation_data)?;
-
-    // Claim VAA
-    verify_governance(&accs.vaa)?;
-    accs.vaa.verify(&ctx.program_id)?;
-    accs.vaa.claim(ctx, accs.payer.key)?;
-
-    if accs.vaa.chain == CHAIN_ID_SOLANA {
-        return Err(InvalidChain.into());
-    }
-
-    // Create endpoint
-    accs.endpoint
-        .create(&((&*accs).into()), ctx, accs.payer.key, Exempt)?;
-
-    accs.endpoint.chain = accs.vaa.chain;
-    accs.endpoint.contract = accs.vaa.endpoint_address;
-
-    Ok(())
-}

+ 0 - 35
solana/modules/nft_bridge/program/src/api/initialize.rs

@@ -1,35 +0,0 @@
-use crate::accounts::ConfigAccount;
-use solana_program::{
-    account_info::AccountInfo,
-    pubkey::Pubkey,
-};
-use solitaire::{
-    CreationLamports::Exempt,
-    *,
-};
-
-#[derive(FromAccounts)]
-pub struct Initialize<'b> {
-    pub payer: Mut<Signer<AccountInfo<'b>>>,
-
-    pub config: Mut<ConfigAccount<'b, { AccountState::Uninitialized }>>,
-}
-
-#[derive(BorshDeserialize, BorshSerialize, Default)]
-pub struct InitializeData {
-    pub bridge: Pubkey,
-}
-
-impl<'b> InstructionContext<'b> for Initialize<'b> {
-}
-
-pub fn initialize(
-    ctx: &ExecutionContext,
-    accs: &mut Initialize,
-    data: InitializeData,
-) -> Result<()> {
-    // Create the config account
-    accs.config.create(ctx, accs.payer.key, Exempt)?;
-    accs.config.wormhole_bridge = data.bridge;
-    Ok(())
-}

+ 0 - 389
solana/modules/nft_bridge/program/src/api/transfer.rs

@@ -1,389 +0,0 @@
-use crate::{
-    accounts::{
-        AuthoritySigner,
-        ConfigAccount,
-        CoreBridge,
-        CustodyAccount,
-        CustodyAccountDerivationData,
-        CustodySigner,
-        EmitterAccount,
-        MintSigner,
-        SplTokenMeta,
-        SplTokenMetaDerivationData,
-        WrappedMetaDerivationData,
-        WrappedMint,
-        WrappedTokenMeta,
-    },
-    messages::PayloadTransfer,
-    types::*,
-    TokenBridgeError,
-    TokenBridgeError::{
-        InvalidMetadata,
-        TokenNotNFT,
-        WrongAccountOwner,
-    },
-};
-use bridge::{
-    api::PostMessageData,
-    types::ConsistencyLevel,
-    vaa::SerializePayload,
-};
-use primitive_types::U256;
-use solana_program::{
-    account_info::AccountInfo,
-    instruction::{
-        AccountMeta,
-        Instruction,
-    },
-    program::{
-        invoke,
-        invoke_signed,
-    },
-    program_option::COption,
-    sysvar::clock::Clock,
-};
-use solitaire::{
-    processors::seeded::{
-        invoke_seeded,
-        Seeded,
-    },
-    CreationLamports::Exempt,
-    *,
-};
-use spl_token_metadata::state::Metadata;
-
-#[derive(FromAccounts)]
-pub struct TransferNative<'b> {
-    pub payer: Mut<Signer<AccountInfo<'b>>>,
-
-    pub config: ConfigAccount<'b, { AccountState::Initialized }>,
-
-    pub from: Mut<Data<'b, SplAccount, { AccountState::Initialized }>>,
-
-    pub mint: Mut<Data<'b, SplMint, { AccountState::Initialized }>>,
-    /// SPL Metadata for the associated Mint
-    pub spl_metadata: SplTokenMeta<'b>,
-
-    pub custody: Mut<CustodyAccount<'b, { AccountState::MaybeInitialized }>>,
-
-    // This could allow someone to race someone else's tx if they do the approval in a separate tx.
-    // Therefore the approval must be set in the same tx.
-    pub authority_signer: AuthoritySigner<'b>,
-
-    pub custody_signer: CustodySigner<'b>,
-
-    /// CPI Context
-    pub bridge: Mut<CoreBridge<'b, { AccountState::Initialized }>>,
-
-    /// Account to store the posted message
-    pub message: Signer<Mut<Info<'b>>>,
-
-    /// Emitter of the VAA
-    pub emitter: EmitterAccount<'b>,
-
-    /// Tracker for the emitter sequence
-    pub sequence: Mut<Info<'b>>,
-
-    /// Account to collect tx fee
-    pub fee_collector: Mut<Info<'b>>,
-
-    pub clock: Sysvar<'b, Clock>,
-}
-
-impl<'a> From<&TransferNative<'a>> for CustodyAccountDerivationData {
-    fn from(accs: &TransferNative<'a>) -> Self {
-        CustodyAccountDerivationData {
-            mint: *accs.mint.info().key,
-        }
-    }
-}
-
-impl<'a> From<&TransferNative<'a>> for SplTokenMetaDerivationData {
-    fn from(accs: &TransferNative<'a>) -> Self {
-        SplTokenMetaDerivationData {
-            mint: *accs.mint.info().key,
-        }
-    }
-}
-
-impl<'b> InstructionContext<'b> for TransferNative<'b> {
-}
-
-#[derive(BorshDeserialize, BorshSerialize, Default)]
-pub struct TransferNativeData {
-    pub nonce: u32,
-    pub target_address: Address,
-    pub target_chain: ChainID,
-}
-
-pub fn transfer_native(
-    ctx: &ExecutionContext,
-    accs: &mut TransferNative,
-    data: TransferNativeData,
-) -> Result<()> {
-    // Verify that the custody account is derived correctly
-    let derivation_data: CustodyAccountDerivationData = (&*accs).into();
-    accs.custody
-        .verify_derivation(ctx.program_id, &derivation_data)?;
-
-    let derivation_data: SplTokenMetaDerivationData = (&*accs).into();
-    accs.spl_metadata
-        .verify_derivation(&spl_token_metadata::id(), &derivation_data)?;
-
-    // Verify mints
-    if accs.from.mint != *accs.mint.info().key {
-        return Err(TokenBridgeError::InvalidMint.into());
-    }
-
-    // Token must have metadata
-    if accs.spl_metadata.data_is_empty() {
-        return Err(TokenNotNFT.into());
-    }
-
-    if *accs.spl_metadata.owner != spl_token_metadata::id() {
-        return Err(WrongAccountOwner.into());
-    }
-
-    // Verify that the token is not a wrapped token
-    if let COption::Some(mint_authority) = accs.mint.mint_authority {
-        if mint_authority == MintSigner::key(None, ctx.program_id) {
-            return Err(TokenBridgeError::TokenNotNative.into());
-        }
-    }
-
-    if !accs.custody.is_initialized() {
-        accs.custody
-            .create(&(&*accs).into(), ctx, accs.payer.key, Exempt)?;
-
-        let init_ix = spl_token::instruction::initialize_account(
-            &spl_token::id(),
-            accs.custody.info().key,
-            accs.mint.info().key,
-            accs.custody_signer.key,
-        )?;
-        invoke_signed(&init_ix, ctx.accounts, &[])?;
-    }
-
-    // Transfer tokens
-    let transfer_ix = spl_token::instruction::transfer(
-        &spl_token::id(),
-        accs.from.info().key,
-        accs.custody.info().key,
-        accs.authority_signer.key,
-        &[],
-        1,
-    )?;
-    invoke_seeded(&transfer_ix, ctx, &accs.authority_signer, None)?;
-
-    // Pay fee
-    let transfer_ix = solana_program::system_instruction::transfer(
-        accs.payer.key,
-        accs.fee_collector.key,
-        accs.bridge.config.fee,
-    );
-    invoke(&transfer_ix, ctx.accounts)?;
-
-    let metadata: Metadata =
-        Metadata::from_account_info(accs.spl_metadata.info()).ok_or(InvalidMetadata)?;
-
-    // Post message
-    // Given there is no tokenID equivalent on Solana and each distinct token address is translated
-    // into a new contract on EVM based chains (which is costly), we use a static token_address
-    // and encode the mint in the token_id.
-    let payload = PayloadTransfer {
-        token_address: [1u8; 32],
-        token_chain: 1,
-        to: data.target_address,
-        to_chain: data.target_chain,
-        symbol: metadata.data.symbol,
-        name: metadata.data.name,
-        uri: metadata.data.uri,
-        token_id: U256::from_big_endian(&accs.mint.info().key.to_bytes()),
-    };
-    let params = (
-        bridge::instruction::Instruction::PostMessage,
-        PostMessageData {
-            nonce: data.nonce,
-            payload: payload.try_to_vec()?,
-            consistency_level: ConsistencyLevel::Finalized,
-        },
-    );
-
-    let ix = Instruction::new_with_bytes(
-        accs.config.wormhole_bridge,
-        params.try_to_vec()?.as_slice(),
-        vec![
-            AccountMeta::new(*accs.bridge.info().key, false),
-            AccountMeta::new(*accs.message.key, true),
-            AccountMeta::new_readonly(*accs.emitter.key, true),
-            AccountMeta::new(*accs.sequence.key, false),
-            AccountMeta::new(*accs.payer.key, true),
-            AccountMeta::new(*accs.fee_collector.key, false),
-            AccountMeta::new_readonly(*accs.clock.info().key, false),
-            AccountMeta::new_readonly(solana_program::system_program::id(), false),
-            AccountMeta::new_readonly(solana_program::sysvar::rent::ID, false),
-        ],
-    );
-    invoke_seeded(&ix, ctx, &accs.emitter, None)?;
-
-    Ok(())
-}
-
-#[derive(FromAccounts)]
-pub struct TransferWrapped<'b> {
-    pub payer: Mut<Signer<AccountInfo<'b>>>,
-    pub config: ConfigAccount<'b, { AccountState::Initialized }>,
-
-    pub from: Mut<Data<'b, SplAccount, { AccountState::Initialized }>>,
-    pub from_owner: MaybeMut<Signer<Info<'b>>>,
-    pub mint: Mut<WrappedMint<'b, { AccountState::Initialized }>>,
-    pub wrapped_meta: WrappedTokenMeta<'b, { AccountState::Initialized }>,
-    /// SPL Metadata for the associated Mint
-    pub spl_metadata: SplTokenMeta<'b>,
-
-    pub authority_signer: AuthoritySigner<'b>,
-
-    /// CPI Context
-    pub bridge: Mut<CoreBridge<'b, { AccountState::Initialized }>>,
-
-    /// Account to store the posted message
-    pub message: Signer<Mut<Info<'b>>>,
-
-    /// Emitter of the VAA
-    pub emitter: EmitterAccount<'b>,
-
-    /// Tracker for the emitter sequence
-    pub sequence: Mut<Info<'b>>,
-
-    /// Account to collect tx fee
-    pub fee_collector: Mut<Info<'b>>,
-
-    pub clock: Sysvar<'b, Clock>,
-}
-
-impl<'a> From<&TransferWrapped<'a>> for WrappedMetaDerivationData {
-    fn from(accs: &TransferWrapped<'a>) -> Self {
-        WrappedMetaDerivationData {
-            mint_key: *accs.mint.info().key,
-        }
-    }
-}
-
-impl<'a> From<&TransferWrapped<'a>> for SplTokenMetaDerivationData {
-    fn from(accs: &TransferWrapped<'a>) -> Self {
-        SplTokenMetaDerivationData {
-            mint: *accs.mint.info().key,
-        }
-    }
-}
-
-impl<'b> InstructionContext<'b> for TransferWrapped<'b> {
-}
-
-#[derive(BorshDeserialize, BorshSerialize, Default)]
-pub struct TransferWrappedData {
-    pub nonce: u32,
-    pub target_address: Address,
-    pub target_chain: ChainID,
-}
-
-pub fn transfer_wrapped(
-    ctx: &ExecutionContext,
-    accs: &mut TransferWrapped,
-    data: TransferWrappedData,
-) -> Result<()> {
-    // Verify that the from account is owned by the from_owner
-    if &accs.from.owner != accs.from_owner.key {
-        return Err(WrongAccountOwner.into());
-    }
-
-    // Verify mints
-    if accs.mint.info().key != &accs.from.mint {
-        return Err(TokenBridgeError::InvalidMint.into());
-    }
-
-    // Verify that meta is correct
-    let derivation_data: WrappedMetaDerivationData = (&*accs).into();
-    accs.wrapped_meta
-        .verify_derivation(ctx.program_id, &derivation_data)?;
-
-    // Burn tokens
-    let burn_ix = spl_token::instruction::burn(
-        &spl_token::id(),
-        accs.from.info().key,
-        accs.mint.info().key,
-        accs.authority_signer.key,
-        &[],
-        1,
-    )?;
-    invoke_seeded(&burn_ix, ctx, &accs.authority_signer, None)?;
-
-    // Pay fee
-    let transfer_ix = solana_program::system_instruction::transfer(
-        accs.payer.key,
-        accs.fee_collector.key,
-        accs.bridge.config.fee,
-    );
-
-    invoke(&transfer_ix, ctx.accounts)?;
-
-    // Enfoce wrapped meta to be uninitialized.
-    let derivation_data: WrappedMetaDerivationData = (&*accs).into();
-    accs.wrapped_meta
-        .verify_derivation(ctx.program_id, &derivation_data)?;
-
-    // Token must have metadata
-    if accs.spl_metadata.data_is_empty() {
-        return Err(TokenNotNFT.into());
-    }
-
-    let derivation_data: SplTokenMetaDerivationData = (&*accs).into();
-    accs.spl_metadata
-        .verify_derivation(&spl_token_metadata::id(), &derivation_data)?;
-
-    if *accs.spl_metadata.owner != spl_token_metadata::id() {
-        return Err(WrongAccountOwner.into());
-    }
-
-    let metadata: Metadata =
-        Metadata::from_account_info(accs.spl_metadata.info()).ok_or(InvalidMetadata)?;
-
-    // Post message
-    let payload = PayloadTransfer {
-        token_address: accs.wrapped_meta.token_address,
-        token_chain: accs.wrapped_meta.chain,
-        token_id: U256(accs.wrapped_meta.token_id),
-        to: data.target_address,
-        to_chain: data.target_chain,
-        symbol: metadata.data.symbol,
-        name: metadata.data.name,
-        uri: metadata.data.uri,
-    };
-    let params = (
-        bridge::instruction::Instruction::PostMessage,
-        PostMessageData {
-            nonce: data.nonce,
-            payload: payload.try_to_vec()?,
-            consistency_level: ConsistencyLevel::Finalized,
-        },
-    );
-
-    let ix = Instruction::new_with_bytes(
-        accs.config.wormhole_bridge,
-        params.try_to_vec()?.as_slice(),
-        vec![
-            AccountMeta::new(*accs.bridge.info().key, false),
-            AccountMeta::new(*accs.message.key, true),
-            AccountMeta::new_readonly(*accs.emitter.key, true),
-            AccountMeta::new(*accs.sequence.key, false),
-            AccountMeta::new(*accs.payer.key, true),
-            AccountMeta::new(*accs.fee_collector.key, false),
-            AccountMeta::new_readonly(*accs.clock.info().key, false),
-            AccountMeta::new_readonly(solana_program::system_program::id(), false),
-            AccountMeta::new_readonly(solana_program::sysvar::rent::ID, false),
-        ],
-    );
-    invoke_seeded(&ix, ctx, &accs.emitter, None)?;
-
-    Ok(())
-}

+ 0 - 518
solana/modules/nft_bridge/program/src/instructions.rs

@@ -1,518 +0,0 @@
-use crate::{
-    accounts::{
-        AuthoritySigner,
-        ConfigAccount,
-        CustodyAccount,
-        CustodyAccountDerivationData,
-        CustodySigner,
-        EmitterAccount,
-        Endpoint,
-        EndpointDerivationData,
-        MintSigner,
-        SplTokenMeta,
-        SplTokenMetaDerivationData,
-        WrappedDerivationData,
-        WrappedMetaDerivationData,
-        WrappedMint,
-        WrappedTokenMeta,
-    },
-    api::{
-        complete_transfer::{
-            CompleteNativeData,
-            CompleteWrappedData,
-        },
-        RegisterChainData,
-        TransferNativeData,
-        TransferWrappedData,
-        UpgradeContractData,
-    },
-    messages::{
-        PayloadGovernanceRegisterChain,
-        PayloadTransfer,
-    },
-    CompleteWrappedMetaData,
-};
-use borsh::BorshSerialize;
-use bridge::{
-    accounts::{
-        Bridge,
-        BridgeConfig,
-        Claim,
-        ClaimDerivationData,
-        FeeCollector,
-        PostedVAA,
-        PostedVAAData,
-        PostedVAADerivationData,
-        Sequence,
-        SequenceDerivationData,
-    },
-    api::ForeignAddress,
-    instructions::hash_vaa,
-    vaa::{
-        ClaimableVAA,
-        PayloadMessage,
-        SerializePayload,
-    },
-    PostVAA,
-    PostVAAData,
-    CHAIN_ID_SOLANA,
-};
-use primitive_types::U256;
-use solana_program::{
-    instruction::{
-        AccountMeta,
-        Instruction,
-    },
-    pubkey::Pubkey,
-};
-use solitaire::{
-    processors::seeded::Seeded,
-    AccountState,
-};
-use spl_token::state::Mint;
-use std::str::FromStr;
-
-pub fn initialize(
-    program_id: Pubkey,
-    payer: Pubkey,
-    bridge: Pubkey,
-) -> solitaire::Result<Instruction> {
-    let config_key = ConfigAccount::<'_, { AccountState::Uninitialized }>::key(None, &program_id);
-    Ok(Instruction {
-        program_id,
-        accounts: vec![
-            AccountMeta::new(payer, true),
-            AccountMeta::new(config_key, false),
-            // Dependencies
-            AccountMeta::new(solana_program::sysvar::rent::id(), false),
-            AccountMeta::new(solana_program::system_program::id(), false),
-        ],
-        data: (crate::instruction::Instruction::Initialize, bridge).try_to_vec()?,
-    })
-}
-
-pub fn complete_native(
-    program_id: Pubkey,
-    bridge_id: Pubkey,
-    payer: Pubkey,
-    message_key: Pubkey,
-    vaa: PostVAAData,
-    to_authority: Pubkey,
-    mint: Pubkey,
-    data: CompleteNativeData,
-) -> solitaire::Result<Instruction> {
-    let config_key = ConfigAccount::<'_, { AccountState::Uninitialized }>::key(None, &program_id);
-    let (message_acc, claim_acc) = claimable_vaa(program_id, message_key, vaa.clone());
-    let endpoint = Endpoint::<'_, { AccountState::Initialized }>::key(
-        &EndpointDerivationData {
-            emitter_chain: vaa.emitter_chain,
-            emitter_address: vaa.emitter_address,
-        },
-        &program_id,
-    );
-    let custody_key = CustodyAccount::<'_, { AccountState::Initialized }>::key(
-        &CustodyAccountDerivationData { mint },
-        &program_id,
-    );
-    let custody_signer_key = CustodySigner::key(None, &program_id);
-    let associated_addr =
-        spl_associated_token_account::get_associated_token_address(&to_authority, &mint);
-
-    Ok(Instruction {
-        program_id,
-        accounts: vec![
-            AccountMeta::new(payer, true),
-            AccountMeta::new_readonly(config_key, false),
-            message_acc,
-            claim_acc,
-            AccountMeta::new_readonly(endpoint, false),
-            AccountMeta::new(associated_addr, false),
-            AccountMeta::new_readonly(to_authority, false),
-            AccountMeta::new(custody_key, false),
-            AccountMeta::new_readonly(mint, false),
-            AccountMeta::new_readonly(custody_signer_key, false),
-            // Dependencies
-            AccountMeta::new_readonly(solana_program::sysvar::rent::id(), false),
-            AccountMeta::new_readonly(solana_program::system_program::id(), false),
-            // Program
-            AccountMeta::new_readonly(bridge_id, false),
-            AccountMeta::new_readonly(spl_token::id(), false),
-            AccountMeta::new_readonly(spl_associated_token_account::id(), false),
-        ],
-        data: (crate::instruction::Instruction::CompleteNative, data).try_to_vec()?,
-    })
-}
-
-pub fn complete_wrapped(
-    program_id: Pubkey,
-    bridge_id: Pubkey,
-    payer: Pubkey,
-    message_key: Pubkey,
-    vaa: PostVAAData,
-    payload: PayloadTransfer,
-    to_authority: Pubkey,
-    data: CompleteWrappedData,
-) -> solitaire::Result<Instruction> {
-    let config_key = ConfigAccount::<'_, { AccountState::Uninitialized }>::key(None, &program_id);
-    let (message_acc, claim_acc) = claimable_vaa(program_id, message_key, vaa.clone());
-    let endpoint = Endpoint::<'_, { AccountState::Initialized }>::key(
-        &EndpointDerivationData {
-            emitter_chain: vaa.emitter_chain,
-            emitter_address: vaa.emitter_address,
-        },
-        &program_id,
-    );
-    let mint_key = WrappedMint::<'_, { AccountState::Uninitialized }>::key(
-        &WrappedDerivationData {
-            token_chain: payload.token_chain,
-            token_address: payload.token_address,
-            token_id: payload.token_id,
-        },
-        &program_id,
-    );
-    let mint_authority_key = MintSigner::key(None, &program_id);
-
-    let mint_meta_key = WrappedTokenMeta::<'_, { AccountState::Uninitialized }>::key(
-        &WrappedMetaDerivationData { mint_key },
-        &program_id,
-    );
-    let associated_addr =
-        spl_associated_token_account::get_associated_token_address(&to_authority, &mint_key);
-
-    Ok(Instruction {
-        program_id,
-        accounts: vec![
-            AccountMeta::new(payer, true),
-            AccountMeta::new_readonly(config_key, false),
-            message_acc,
-            claim_acc,
-            AccountMeta::new_readonly(endpoint, false),
-            AccountMeta::new(associated_addr, false),
-            AccountMeta::new_readonly(to_authority, false),
-            AccountMeta::new(mint_key, false),
-            AccountMeta::new(mint_meta_key, false),
-            AccountMeta::new_readonly(mint_authority_key, false),
-            // Dependencies
-            AccountMeta::new_readonly(solana_program::sysvar::rent::id(), false),
-            AccountMeta::new_readonly(solana_program::system_program::id(), false),
-            // Program
-            AccountMeta::new_readonly(bridge_id, false),
-            AccountMeta::new_readonly(spl_token::id(), false),
-            AccountMeta::new_readonly(spl_associated_token_account::id(), false),
-            AccountMeta::new_readonly(spl_token_metadata::id(), false),
-        ],
-        data: (crate::instruction::Instruction::CompleteWrapped, data).try_to_vec()?,
-    })
-}
-
-pub fn complete_wrapped_meta(
-    program_id: Pubkey,
-    bridge_id: Pubkey,
-    payer: Pubkey,
-    message_key: Pubkey,
-    vaa: PostVAAData,
-    payload: PayloadTransfer,
-    data: CompleteWrappedMetaData,
-) -> solitaire::Result<Instruction> {
-    let config_key = ConfigAccount::<'_, { AccountState::Uninitialized }>::key(None, &program_id);
-    let (message_acc, claim_acc) = claimable_vaa(program_id, message_key, vaa.clone());
-    let endpoint = Endpoint::<'_, { AccountState::Initialized }>::key(
-        &EndpointDerivationData {
-            emitter_chain: vaa.emitter_chain,
-            emitter_address: vaa.emitter_address,
-        },
-        &program_id,
-    );
-    let mint_key = WrappedMint::<'_, { AccountState::Uninitialized }>::key(
-        &WrappedDerivationData {
-            token_chain: payload.token_chain,
-            token_address: payload.token_address,
-            token_id: payload.token_id,
-        },
-        &program_id,
-    );
-    let mint_authority_key = MintSigner::key(None, &program_id);
-
-    let mint_meta_key = WrappedTokenMeta::<'_, { AccountState::Uninitialized }>::key(
-        &WrappedMetaDerivationData { mint_key },
-        &program_id,
-    );
-    // SPL Metadata
-    let spl_metadata = SplTokenMeta::key(
-        &SplTokenMetaDerivationData { mint: mint_key },
-        &spl_token_metadata::id(),
-    );
-
-    Ok(Instruction {
-        program_id,
-        accounts: vec![
-            AccountMeta::new(payer, true),
-            AccountMeta::new_readonly(config_key, false),
-            message_acc,
-            AccountMeta::new_readonly(endpoint, false),
-            AccountMeta::new_readonly(mint_key, false),
-            AccountMeta::new_readonly(mint_meta_key, false),
-            AccountMeta::new(spl_metadata, false),
-            AccountMeta::new_readonly(mint_authority_key, false),
-            // Dependencies
-            AccountMeta::new_readonly(solana_program::sysvar::rent::id(), false),
-            AccountMeta::new_readonly(solana_program::system_program::id(), false),
-            // Program
-            AccountMeta::new_readonly(bridge_id, false),
-            AccountMeta::new_readonly(spl_token::id(), false),
-            AccountMeta::new_readonly(spl_associated_token_account::id(), false),
-            AccountMeta::new_readonly(spl_token_metadata::id(), false),
-        ],
-        data: (crate::instruction::Instruction::CompleteWrappedMeta, data).try_to_vec()?,
-    })
-}
-
-pub fn register_chain(
-    program_id: Pubkey,
-    bridge_id: Pubkey,
-    payer: Pubkey,
-    message_key: Pubkey,
-    vaa: PostVAAData,
-    payload: PayloadGovernanceRegisterChain,
-    data: RegisterChainData,
-) -> solitaire::Result<Instruction> {
-    let config_key = ConfigAccount::<'_, { AccountState::Uninitialized }>::key(None, &program_id);
-    let (message_acc, claim_acc) = claimable_vaa(program_id, message_key, vaa);
-    let endpoint = Endpoint::<'_, { AccountState::Initialized }>::key(
-        &EndpointDerivationData {
-            emitter_chain: payload.chain,
-            emitter_address: payload.endpoint_address,
-        },
-        &program_id,
-    );
-
-    Ok(Instruction {
-        program_id,
-        accounts: vec![
-            AccountMeta::new(payer, true),
-            AccountMeta::new_readonly(config_key, false),
-            AccountMeta::new(endpoint, false),
-            message_acc,
-            claim_acc,
-            // Dependencies
-            AccountMeta::new(solana_program::sysvar::rent::id(), false),
-            AccountMeta::new(solana_program::system_program::id(), false),
-            // Program
-            AccountMeta::new_readonly(bridge_id, false),
-        ],
-        data: (crate::instruction::Instruction::RegisterChain, data).try_to_vec()?,
-    })
-}
-
-fn claimable_vaa(
-    bridge_id: Pubkey,
-    message_key: Pubkey,
-    vaa: PostVAAData,
-) -> (AccountMeta, AccountMeta) {
-    let claim_key = Claim::<'_, { AccountState::Initialized }>::key(
-        &ClaimDerivationData {
-            emitter_address: vaa.emitter_address,
-            emitter_chain: vaa.emitter_chain,
-            sequence: vaa.sequence,
-        },
-        &bridge_id,
-    );
-
-    (
-        AccountMeta::new_readonly(message_key, false),
-        AccountMeta::new(claim_key, false),
-    )
-}
-
-pub fn transfer_native(
-    program_id: Pubkey,
-    bridge_id: Pubkey,
-    payer: Pubkey,
-    message_key: Pubkey,
-    from: Pubkey,
-    mint: Pubkey,
-    data: TransferNativeData,
-) -> solitaire::Result<Instruction> {
-    let config_key = ConfigAccount::<'_, { AccountState::Uninitialized }>::key(None, &program_id);
-    let custody_key = CustodyAccount::<'_, { AccountState::Initialized }>::key(
-        &CustodyAccountDerivationData { mint },
-        &program_id,
-    );
-
-    let authority_signer_key = AuthoritySigner::key(None, &program_id);
-    let custody_signer_key = CustodySigner::key(None, &program_id);
-    let emitter_key = EmitterAccount::key(None, &program_id);
-
-    // SPL Metadata
-    let spl_metadata = SplTokenMeta::key(
-        &SplTokenMetaDerivationData { mint: mint },
-        &spl_token_metadata::id(),
-    );
-
-    // Bridge keys
-    let bridge_config = Bridge::<'_, { AccountState::Uninitialized }>::key(None, &bridge_id);
-    let sequence_key = Sequence::key(
-        &SequenceDerivationData {
-            emitter_key: &emitter_key,
-        },
-        &bridge_id,
-    );
-    let fee_collector_key = FeeCollector::key(None, &bridge_id);
-
-    Ok(Instruction {
-        program_id,
-        accounts: vec![
-            AccountMeta::new(payer, true),
-            AccountMeta::new_readonly(config_key, false),
-            AccountMeta::new(from, false),
-            AccountMeta::new(mint, false),
-            AccountMeta::new_readonly(spl_metadata, false),
-            AccountMeta::new(custody_key, false),
-            AccountMeta::new_readonly(authority_signer_key, false),
-            AccountMeta::new_readonly(custody_signer_key, false),
-            AccountMeta::new(bridge_config, false),
-            AccountMeta::new(message_key, true),
-            AccountMeta::new_readonly(emitter_key, false),
-            AccountMeta::new(sequence_key, false),
-            AccountMeta::new(fee_collector_key, false),
-            AccountMeta::new_readonly(solana_program::sysvar::clock::id(), false),
-            // Dependencies
-            AccountMeta::new_readonly(solana_program::sysvar::rent::id(), false),
-            AccountMeta::new_readonly(solana_program::system_program::id(), false),
-            // Program
-            AccountMeta::new_readonly(bridge_id, false),
-            AccountMeta::new_readonly(spl_token::id(), false),
-        ],
-        data: (crate::instruction::Instruction::TransferNative, data).try_to_vec()?,
-    })
-}
-
-pub fn transfer_wrapped(
-    program_id: Pubkey,
-    bridge_id: Pubkey,
-    payer: Pubkey,
-    message_key: Pubkey,
-    from: Pubkey,
-    from_owner: Pubkey,
-    token_chain: u16,
-    token_address: ForeignAddress,
-    token_id: U256,
-    data: TransferWrappedData,
-) -> solitaire::Result<Instruction> {
-    let config_key = ConfigAccount::<'_, { AccountState::Uninitialized }>::key(None, &program_id);
-
-    let wrapped_mint_key = WrappedMint::<'_, { AccountState::Uninitialized }>::key(
-        &WrappedDerivationData {
-            token_chain,
-            token_address,
-            token_id,
-        },
-        &program_id,
-    );
-    let wrapped_meta_key = WrappedTokenMeta::<'_, { AccountState::Uninitialized }>::key(
-        &WrappedMetaDerivationData {
-            mint_key: wrapped_mint_key,
-        },
-        &program_id,
-    );
-
-    let authority_signer = AuthoritySigner::key(None, &program_id);
-    let emitter_key = EmitterAccount::key(None, &program_id);
-
-    // SPL Metadata
-    let spl_metadata = SplTokenMeta::key(
-        &SplTokenMetaDerivationData {
-            mint: wrapped_mint_key,
-        },
-        &spl_token_metadata::id(),
-    );
-
-    // Bridge keys
-    let bridge_config = Bridge::<'_, { AccountState::Uninitialized }>::key(None, &bridge_id);
-    let sequence_key = Sequence::key(
-        &SequenceDerivationData {
-            emitter_key: &emitter_key,
-        },
-        &bridge_id,
-    );
-    let fee_collector_key = FeeCollector::key(None, &bridge_id);
-
-    Ok(Instruction {
-        program_id,
-        accounts: vec![
-            AccountMeta::new(payer, true),
-            AccountMeta::new_readonly(config_key, false),
-            AccountMeta::new(from, false),
-            AccountMeta::new_readonly(from_owner, true),
-            AccountMeta::new(wrapped_mint_key, false),
-            AccountMeta::new_readonly(wrapped_meta_key, false),
-            AccountMeta::new_readonly(spl_metadata, false),
-            AccountMeta::new_readonly(authority_signer, false),
-            AccountMeta::new(bridge_config, false),
-            AccountMeta::new(message_key, true),
-            AccountMeta::new_readonly(emitter_key, false),
-            AccountMeta::new(sequence_key, false),
-            AccountMeta::new(fee_collector_key, false),
-            AccountMeta::new_readonly(solana_program::sysvar::clock::id(), false),
-            // Dependencies
-            AccountMeta::new_readonly(solana_program::sysvar::rent::id(), false),
-            AccountMeta::new_readonly(solana_program::system_program::id(), false),
-            // Program
-            AccountMeta::new_readonly(bridge_id, false),
-            AccountMeta::new_readonly(spl_token::id(), false),
-        ],
-        data: (crate::instruction::Instruction::TransferWrapped, data).try_to_vec()?,
-    })
-}
-
-pub fn upgrade_contract(
-    program_id: Pubkey,
-    payer: Pubkey,
-    payload_message: Pubkey,
-    emitter: Pubkey,
-    new_contract: Pubkey,
-    spill: Pubkey,
-    sequence: u64,
-) -> Instruction {
-    let claim = Claim::<'_, { AccountState::Uninitialized }>::key(
-        &ClaimDerivationData {
-            emitter_address: emitter.to_bytes(),
-            emitter_chain: CHAIN_ID_SOLANA,
-            sequence,
-        },
-        &program_id,
-    );
-
-    let (upgrade_authority, _) = Pubkey::find_program_address(&["upgrade".as_bytes()], &program_id);
-
-    let (program_data, _) = Pubkey::find_program_address(
-        &[program_id.as_ref()],
-        &solana_program::bpf_loader_upgradeable::id(),
-    );
-
-    Instruction {
-        program_id,
-
-        accounts: vec![
-            AccountMeta::new(payer, true),
-            AccountMeta::new_readonly(payload_message, false),
-            AccountMeta::new(claim, false),
-            AccountMeta::new_readonly(upgrade_authority, false),
-            AccountMeta::new(spill, false),
-            AccountMeta::new(new_contract, false),
-            AccountMeta::new(program_data, false),
-            AccountMeta::new(program_id, false),
-            AccountMeta::new_readonly(solana_program::sysvar::rent::id(), false),
-            AccountMeta::new_readonly(solana_program::sysvar::clock::id(), false),
-            AccountMeta::new_readonly(solana_program::bpf_loader_upgradeable::id(), false),
-            AccountMeta::new_readonly(solana_program::system_program::id(), false),
-        ],
-
-        data: (
-            crate::instruction::Instruction::UpgradeContract,
-            UpgradeContractData {},
-        )
-            .try_to_vec()
-            .unwrap(),
-    }
-}

+ 0 - 83
solana/modules/nft_bridge/program/src/lib.rs

@@ -1,83 +0,0 @@
-
-#![feature(adt_const_params)]
-#![allow(incomplete_features)]
-#![deny(unused_must_use)]
-// #![cfg(all(target_arch = "bpf", not(feature = "no-entrypoint")))]
-
-#[cfg(feature = "no-entrypoint")]
-pub mod instructions;
-
-#[cfg(feature = "wasm")]
-#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
-extern crate wasm_bindgen;
-
-#[cfg(feature = "wasm")]
-#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
-pub mod wasm;
-
-pub mod accounts;
-pub mod api;
-pub mod messages;
-pub mod types;
-
-pub use api::{
-    complete_native,
-    complete_wrapped,
-    complete_wrapped_meta,
-    initialize,
-    register_chain,
-    transfer_native,
-    transfer_wrapped,
-    upgrade_contract,
-    CompleteNative,
-    CompleteNativeData,
-    CompleteWrapped,
-    CompleteWrappedData,
-    CompleteWrappedMeta,
-    CompleteWrappedMetaData,
-    Initialize,
-    InitializeData,
-    RegisterChain,
-    RegisterChainData,
-    TransferNative,
-    TransferNativeData,
-    TransferWrapped,
-    TransferWrappedData,
-    UpgradeContract,
-    UpgradeContractData,
-};
-
-use solitaire::*;
-
-pub enum TokenBridgeError {
-    AlreadyExecuted,
-    InvalidChain,
-    InvalidGovernanceKey,
-    InvalidMetadata,
-    InvalidMint,
-    InvalidPayload,
-    InvalidUTF8String,
-    TokenNotNative,
-    UninitializedMint,
-    WrongAccountOwner,
-    TokenNotNFT,
-    InvalidAssociatedAccount,
-    InvalidRecipient,
-}
-
-impl From<TokenBridgeError> for SolitaireError {
-    fn from(t: TokenBridgeError) -> SolitaireError {
-        SolitaireError::Custom(t as u64)
-    }
-}
-
-solitaire! {
-    Initialize(InitializeData) => initialize,
-    CompleteNative(CompleteNativeData) => complete_native,
-    CompleteWrapped(CompleteWrappedData) => complete_wrapped,
-    CompleteWrappedMeta(CompleteWrappedMetaData) => complete_wrapped_meta,
-    TransferWrapped(TransferWrappedData) => transfer_wrapped,
-    TransferNative(TransferNativeData) => transfer_native,
-    RegisterChain(RegisterChainData) => register_chain,
-    UpgradeContract(UpgradeContractData) => upgrade_contract,
-}

+ 0 - 311
solana/modules/nft_bridge/program/src/messages.rs

@@ -1,311 +0,0 @@
-use crate::types::{
-    Address,
-    ChainID,
-};
-use bridge::{
-    vaa::{
-        DeserializePayload,
-        SerializePayload,
-    },
-    DeserializeGovernancePayload,
-    SerializeGovernancePayload,
-};
-use byteorder::{
-    BigEndian,
-    ReadBytesExt,
-    WriteBytesExt,
-};
-use primitive_types::U256;
-use solana_program::{
-    program_error::ProgramError::InvalidAccountData,
-    pubkey::Pubkey,
-};
-use solitaire::SolitaireError;
-use std::io::{
-    Cursor,
-    Read,
-    Write,
-};
-
-pub const MODULE: &str = "NFTBridge";
-
-#[derive(PartialEq, Debug, Clone)]
-pub struct PayloadTransfer {
-    // Address of the token. Left-zero-padded if shorter than 32 bytes
-    pub token_address: Address,
-    // Chain ID of the token
-    pub token_chain: ChainID,
-    // Symbol of the token
-    pub symbol: String,
-    // Name of the token
-    pub name: String,
-    // TokenID of the token (big-endian uint256)
-    pub token_id: U256,
-    // URI of the token metadata
-    pub uri: String,
-    // Address of the recipient. Left-zero-padded if shorter than 32 bytes
-    pub to: Address,
-    // Chain ID of the recipient
-    pub to_chain: ChainID,
-}
-
-impl DeserializePayload for PayloadTransfer {
-    fn deserialize(buf: &mut &[u8]) -> Result<Self, SolitaireError> {
-        use bstr::ByteSlice;
-        let mut v = Cursor::new(buf);
-
-        if v.read_u8()? != 1 {
-            return Err(SolitaireError::Custom(0));
-        };
-
-        let mut token_address = Address::default();
-        v.read_exact(&mut token_address)?;
-
-        let token_chain = v.read_u16::<BigEndian>()?;
-
-        // We may receive invalid UTF-8 over the bridge, especially if truncated. To compensate for
-        // this we rely on the bstr libraries ability to parse invalid UTF-8, and strip out the
-        // "Invalid Unicode Codepoint" (FFFD) characters. This becomes the canonical representation
-        // on Solana.
-        let mut symbol_data = vec![0u8; 32];
-        v.read_exact(&mut symbol_data)?;
-        symbol_data.retain(|&c| c != 0);
-        let mut symbol: Vec<char> = symbol_data.chars().collect();
-        symbol.retain(|&c| c != '\u{FFFD}');
-        let symbol: String = symbol.iter().collect();
-
-        let mut name_data = vec![0u8; 32];
-        v.read_exact(&mut name_data)?;
-        name_data.retain(|&c| c != 0);
-        let mut name: Vec<char> = name_data.chars().collect();
-        name.retain(|&c| c != '\u{FFFD}');
-        let name: String = name.iter().collect();
-
-        let mut id_data: [u8; 32] = [0; 32];
-        v.read_exact(&mut id_data)?;
-        let token_id = U256::from_big_endian(&id_data);
-
-        let uri_len = v.read_u8()?;
-        let mut uri_bytes = vec![0u8; uri_len as usize];
-        v.read_exact(uri_bytes.as_mut_slice())?;
-        let uri = String::from_utf8(uri_bytes).unwrap();
-
-        let mut to = Address::default();
-        v.read_exact(&mut to)?;
-
-        let to_chain = v.read_u16::<BigEndian>()?;
-
-        if v.position() != v.into_inner().len() as u64 {
-            return Err(InvalidAccountData.into());
-        }
-
-        Ok(PayloadTransfer {
-            token_address,
-            token_chain,
-            to,
-            to_chain,
-            symbol,
-            name,
-            token_id,
-            uri,
-        })
-    }
-}
-
-impl SerializePayload for PayloadTransfer {
-    fn serialize<W: Write>(&self, writer: &mut W) -> Result<(), SolitaireError> {
-        // Payload ID
-        writer.write_u8(1)?;
-
-        writer.write(&self.token_address)?;
-        writer.write_u16::<BigEndian>(self.token_chain)?;
-
-        let mut symbol: [u8; 32] = [0; 32];
-        for i in 0..self.symbol.len() {
-            symbol[i] = self.symbol.as_bytes()[i];
-        }
-        writer.write(&symbol)?;
-
-        let mut name: [u8; 32] = [0; 32];
-        for i in 0..self.name.len() {
-            name[i] = self.name.as_bytes()[i];
-        }
-        writer.write(&name)?;
-
-        let mut id_data: [u8; 32] = [0; 32];
-        self.token_id.to_big_endian(&mut id_data);
-        writer.write(&id_data)?;
-
-        writer.write_u8(self.uri.len() as u8)?;
-        writer.write(self.uri.as_bytes())?;
-
-        writer.write(&self.to)?;
-        writer.write_u16::<BigEndian>(self.to_chain)?;
-
-        Ok(())
-    }
-}
-
-#[derive(PartialEq, Debug)]
-pub struct PayloadGovernanceRegisterChain {
-    // Chain ID of the chain to be registered
-    pub chain: ChainID,
-    // Address of the endpoint on the chain
-    pub endpoint_address: Address,
-}
-
-impl SerializeGovernancePayload for PayloadGovernanceRegisterChain {
-    const MODULE: &'static str = MODULE;
-    const ACTION: u8 = 1;
-}
-
-impl DeserializeGovernancePayload for PayloadGovernanceRegisterChain {
-}
-
-impl DeserializePayload for PayloadGovernanceRegisterChain
-where
-    Self: DeserializeGovernancePayload,
-{
-    fn deserialize(buf: &mut &[u8]) -> Result<Self, SolitaireError> {
-        let mut v = Cursor::new(buf);
-        Self::check_governance_header(&mut v)?;
-
-        let chain = v.read_u16::<BigEndian>()?;
-        let mut endpoint_address = [0u8; 32];
-        v.read_exact(&mut endpoint_address)?;
-
-        if v.position() != v.into_inner().len() as u64 {
-            return Err(InvalidAccountData.into());
-        }
-
-        Ok(PayloadGovernanceRegisterChain {
-            chain,
-            endpoint_address,
-        })
-    }
-}
-
-impl SerializePayload for PayloadGovernanceRegisterChain
-where
-    Self: SerializeGovernancePayload,
-{
-    fn serialize<W: Write>(&self, writer: &mut W) -> Result<(), SolitaireError> {
-        self.write_governance_header(writer)?;
-        // Payload ID
-        writer.write_u16::<BigEndian>(self.chain)?;
-        writer.write(&self.endpoint_address[..])?;
-
-        Ok(())
-    }
-}
-
-#[derive(PartialEq, Debug)]
-pub struct GovernancePayloadUpgrade {
-    // Address of the new Implementation
-    pub new_contract: Pubkey,
-}
-
-impl SerializePayload for GovernancePayloadUpgrade {
-    fn serialize<W: Write>(&self, v: &mut W) -> std::result::Result<(), SolitaireError> {
-        self.write_governance_header(v)?;
-        v.write(&self.new_contract.to_bytes())?;
-        Ok(())
-    }
-}
-
-impl DeserializePayload for GovernancePayloadUpgrade
-where
-    Self: DeserializeGovernancePayload,
-{
-    fn deserialize(buf: &mut &[u8]) -> Result<Self, SolitaireError> {
-        let mut c = Cursor::new(buf);
-        Self::check_governance_header(&mut c)?;
-
-        let mut addr = [0u8; 32];
-        c.read_exact(&mut addr)?;
-
-        if c.position() != c.into_inner().len() as u64 {
-            return Err(InvalidAccountData.into());
-        }
-
-        Ok(GovernancePayloadUpgrade {
-            new_contract: Pubkey::new(&addr[..]),
-        })
-    }
-}
-
-impl SerializeGovernancePayload for GovernancePayloadUpgrade {
-    const MODULE: &'static str = MODULE;
-    const ACTION: u8 = 2;
-}
-
-impl DeserializeGovernancePayload for GovernancePayloadUpgrade {
-}
-
-#[cfg(feature = "no-entrypoint")]
-mod tests {
-    use crate::messages::{
-        GovernancePayloadUpgrade,
-        PayloadGovernanceRegisterChain,
-        PayloadTransfer,
-    };
-    use bridge::{
-        DeserializePayload,
-        SerializePayload,
-    };
-    use primitive_types::U256;
-    use rand::RngCore;
-    use solana_program::pubkey::Pubkey;
-
-    #[test]
-    pub fn test_serde_transfer() {
-        let mut token_address = [0u8; 32];
-        rand::thread_rng().fill_bytes(&mut token_address);
-        let mut to = [0u8; 32];
-        rand::thread_rng().fill_bytes(&mut to);
-
-        let transfer_original = PayloadTransfer {
-            token_address,
-            token_chain: 8,
-            to,
-            to_chain: 1,
-            name: String::from("Token Token"),
-            symbol: String::from("TEST"),
-            uri: String::from("https://abc.abc.abc.com"),
-            token_id: U256::from(1234),
-        };
-
-        let mut data = transfer_original.try_to_vec().unwrap();
-        let transfer_deser = PayloadTransfer::deserialize(&mut data.as_slice()).unwrap();
-
-        assert_eq!(transfer_original, transfer_deser);
-    }
-
-    #[test]
-    pub fn test_serde_gov_upgrade() {
-        let original = GovernancePayloadUpgrade {
-            new_contract: Pubkey::new_unique(),
-        };
-
-        let mut data = original.try_to_vec().unwrap();
-        let deser = GovernancePayloadUpgrade::deserialize(&mut data.as_slice()).unwrap();
-
-        assert_eq!(original, deser);
-    }
-
-    #[test]
-    pub fn test_serde_gov_register_chain() {
-        let mut endpoint_address = [0u8; 32];
-        rand::thread_rng().fill_bytes(&mut endpoint_address);
-
-        let original = PayloadGovernanceRegisterChain {
-            chain: 8,
-            endpoint_address,
-        };
-
-        let mut data = original.try_to_vec().unwrap();
-        let deser = PayloadGovernanceRegisterChain::deserialize(&mut data.as_slice()).unwrap();
-
-        assert_eq!(original, deser);
-    }
-}

+ 0 - 62
solana/modules/nft_bridge/program/src/types.rs

@@ -1,62 +0,0 @@
-use borsh::{
-    BorshDeserialize,
-    BorshSerialize,
-};
-use serde::{
-    Deserialize,
-    Serialize,
-};
-use solana_program::pubkey::Pubkey;
-use solitaire::{
-    pack_type,
-    processors::seeded::{
-        AccountOwner,
-        Owned,
-    },
-};
-use spl_token::state::{
-    Account,
-    Mint,
-};
-
-pub type Address = [u8; 32];
-pub type ChainID = u16;
-
-#[derive(Default, Clone, Copy, BorshDeserialize, BorshSerialize, Serialize, Deserialize)]
-pub struct Config {
-    pub wormhole_bridge: Pubkey,
-}
-
-impl Owned for Config {
-    fn owner(&self) -> AccountOwner {
-        AccountOwner::This
-    }
-}
-
-#[derive(Default, Clone, Copy, BorshDeserialize, BorshSerialize, Serialize, Deserialize)]
-pub struct EndpointRegistration {
-    pub chain: ChainID,
-    pub contract: Address,
-}
-
-impl Owned for EndpointRegistration {
-    fn owner(&self) -> AccountOwner {
-        AccountOwner::This
-    }
-}
-
-#[derive(Default, Clone, Copy, BorshDeserialize, BorshSerialize, Serialize, Deserialize)]
-pub struct WrappedMeta {
-    pub chain: ChainID,
-    pub token_address: Address,
-    pub token_id: [u64; 4],
-}
-
-impl Owned for WrappedMeta {
-    fn owner(&self) -> AccountOwner {
-        AccountOwner::This
-    }
-}
-
-pack_type!(SplMint, Mint, AccountOwner::Other(spl_token::id()));
-pack_type!(SplAccount, Account, AccountOwner::Other(spl_token::id()));

+ 0 - 429
solana/modules/nft_bridge/program/src/wasm.rs

@@ -1,429 +0,0 @@
-use crate::{
-    accounts::{
-        AuthoritySigner,
-        EmitterAccount,
-        SplTokenMeta,
-        SplTokenMetaDerivationData,
-        WrappedDerivationData,
-        WrappedMetaDerivationData,
-        WrappedMint,
-        WrappedTokenMeta,
-    },
-    instructions::{
-        complete_native,
-        complete_wrapped,
-        complete_wrapped_meta,
-        register_chain,
-        transfer_native,
-        transfer_wrapped,
-        upgrade_contract,
-    },
-    messages::{
-        GovernancePayloadUpgrade,
-        PayloadGovernanceRegisterChain,
-        PayloadTransfer,
-    },
-    types::{
-        EndpointRegistration,
-        WrappedMeta,
-    },
-    CompleteNativeData,
-    CompleteWrappedData,
-    CompleteWrappedMetaData,
-    RegisterChainData,
-    TransferNativeData,
-    TransferWrappedData,
-};
-use borsh::BorshDeserialize;
-use bridge::{
-    accounts::PostedVAADerivationData,
-    instructions::hash_vaa,
-    vaa::VAA,
-    DeserializePayload,
-    PostVAAData,
-};
-use primitive_types::U256;
-use solana_program::pubkey::Pubkey;
-use solitaire::{
-    processors::seeded::Seeded,
-    AccountState,
-};
-use std::str::FromStr;
-use wasm_bindgen::prelude::*;
-
-#[wasm_bindgen]
-pub fn transfer_native_ix(
-    program_id: String,
-    bridge_id: String,
-    payer: String,
-    message: String,
-    from: String,
-    mint: String,
-    nonce: u32,
-    target_address: Vec<u8>,
-    target_chain: u16,
-) -> JsValue {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let bridge_id = Pubkey::from_str(bridge_id.as_str()).unwrap();
-    let payer = Pubkey::from_str(payer.as_str()).unwrap();
-    let message = Pubkey::from_str(message.as_str()).unwrap();
-    let from = Pubkey::from_str(from.as_str()).unwrap();
-    let mint = Pubkey::from_str(mint.as_str()).unwrap();
-
-    let mut target_addr = [0u8; 32];
-    target_addr.copy_from_slice(target_address.as_slice());
-
-    let ix = transfer_native(
-        program_id,
-        bridge_id,
-        payer,
-        message,
-        from,
-        mint,
-        TransferNativeData {
-            nonce,
-            target_address: target_addr,
-            target_chain,
-        },
-    )
-    .unwrap();
-
-    JsValue::from_serde(&ix).unwrap()
-}
-
-#[wasm_bindgen]
-pub fn transfer_wrapped_ix(
-    program_id: String,
-    bridge_id: String,
-    payer: String,
-    message: String,
-    from: String,
-    from_owner: String,
-    token_chain: u16,
-    token_address: Vec<u8>,
-    token_id: Vec<u8>,
-    nonce: u32,
-    target_address: Vec<u8>,
-    target_chain: u16,
-) -> JsValue {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let bridge_id = Pubkey::from_str(bridge_id.as_str()).unwrap();
-    let payer = Pubkey::from_str(payer.as_str()).unwrap();
-    let message = Pubkey::from_str(message.as_str()).unwrap();
-    let from = Pubkey::from_str(from.as_str()).unwrap();
-    let from_owner = Pubkey::from_str(from_owner.as_str()).unwrap();
-
-    let mut target_addr = [0u8; 32];
-    target_addr.copy_from_slice(target_address.as_slice());
-    let mut token_addr = [0u8; 32];
-    token_addr.copy_from_slice(token_address.as_slice());
-    let token_id = U256::from_big_endian(token_id.as_slice());
-
-    let ix = transfer_wrapped(
-        program_id,
-        bridge_id,
-        payer,
-        message,
-        from,
-        from_owner,
-        token_chain,
-        token_addr,
-        token_id,
-        TransferWrappedData {
-            nonce,
-            target_address: target_addr,
-            target_chain,
-        },
-    )
-    .unwrap();
-
-    JsValue::from_serde(&ix).unwrap()
-}
-
-#[wasm_bindgen]
-pub fn complete_transfer_native_ix(
-    program_id: String,
-    bridge_id: String,
-    payer: String,
-    to_authority: String,
-    vaa: Vec<u8>,
-) -> JsValue {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let bridge_id = Pubkey::from_str(bridge_id.as_str()).unwrap();
-    let payer = Pubkey::from_str(payer.as_str()).unwrap();
-    let to_authority = Pubkey::from_str(to_authority.as_str()).unwrap();
-    let vaa = VAA::deserialize(vaa.as_slice()).unwrap();
-    let payload = PayloadTransfer::deserialize(&mut vaa.payload.as_slice()).unwrap();
-    let message_key = bridge::accounts::PostedVAA::<'_, { AccountState::Uninitialized }>::key(
-        &PostedVAADerivationData {
-            payload_hash: hash_vaa(&vaa.clone().into()).to_vec(),
-        },
-        &bridge_id,
-    );
-    let post_vaa_data = PostVAAData {
-        version: vaa.version,
-        guardian_set_index: vaa.guardian_set_index,
-        timestamp: vaa.timestamp,
-        nonce: vaa.nonce,
-        emitter_chain: vaa.emitter_chain,
-        emitter_address: vaa.emitter_address,
-        sequence: vaa.sequence,
-        consistency_level: vaa.consistency_level,
-        payload: vaa.payload,
-    };
-
-    let mut mint_bytes = [0u8; 32];
-    payload.token_id.to_big_endian(&mut mint_bytes);
-    let ix = complete_native(
-        program_id,
-        bridge_id,
-        payer,
-        message_key,
-        post_vaa_data,
-        to_authority,
-        Pubkey::new(&mint_bytes),
-        CompleteNativeData {},
-    )
-    .unwrap();
-
-    JsValue::from_serde(&ix).unwrap()
-}
-
-#[wasm_bindgen]
-pub fn complete_transfer_wrapped_ix(
-    program_id: String,
-    bridge_id: String,
-    payer: String,
-    to_authority: String,
-    vaa: Vec<u8>,
-) -> JsValue {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let bridge_id = Pubkey::from_str(bridge_id.as_str()).unwrap();
-    let payer = Pubkey::from_str(payer.as_str()).unwrap();
-    let to_authority = Pubkey::from_str(to_authority.as_str()).unwrap();
-    let vaa = VAA::deserialize(vaa.as_slice()).unwrap();
-    let payload = PayloadTransfer::deserialize(&mut vaa.payload.as_slice()).unwrap();
-    let message_key = bridge::accounts::PostedVAA::<'_, { AccountState::Uninitialized }>::key(
-        &PostedVAADerivationData {
-            payload_hash: hash_vaa(&vaa.clone().into()).to_vec(),
-        },
-        &bridge_id,
-    );
-    let post_vaa_data = PostVAAData {
-        version: vaa.version,
-        guardian_set_index: vaa.guardian_set_index,
-        timestamp: vaa.timestamp,
-        nonce: vaa.nonce,
-        emitter_chain: vaa.emitter_chain,
-        emitter_address: vaa.emitter_address,
-        sequence: vaa.sequence,
-        consistency_level: vaa.consistency_level,
-        payload: vaa.payload,
-    };
-
-    let ix = complete_wrapped(
-        program_id,
-        bridge_id,
-        payer,
-        message_key,
-        post_vaa_data,
-        payload.clone(),
-        to_authority,
-        CompleteWrappedData {},
-    )
-    .unwrap();
-
-    JsValue::from_serde(&ix).unwrap()
-}
-
-#[wasm_bindgen]
-pub fn complete_transfer_wrapped_meta_ix(
-    program_id: String,
-    bridge_id: String,
-    payer: String,
-    vaa: Vec<u8>,
-) -> JsValue {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let bridge_id = Pubkey::from_str(bridge_id.as_str()).unwrap();
-    let payer = Pubkey::from_str(payer.as_str()).unwrap();
-    let vaa = VAA::deserialize(vaa.as_slice()).unwrap();
-    let payload = PayloadTransfer::deserialize(&mut vaa.payload.as_slice()).unwrap();
-    let message_key = bridge::accounts::PostedVAA::<'_, { AccountState::Uninitialized }>::key(
-        &PostedVAADerivationData {
-            payload_hash: hash_vaa(&vaa.clone().into()).to_vec(),
-        },
-        &bridge_id,
-    );
-    let post_vaa_data = PostVAAData {
-        version: vaa.version,
-        guardian_set_index: vaa.guardian_set_index,
-        timestamp: vaa.timestamp,
-        nonce: vaa.nonce,
-        emitter_chain: vaa.emitter_chain,
-        emitter_address: vaa.emitter_address,
-        sequence: vaa.sequence,
-        consistency_level: vaa.consistency_level,
-        payload: vaa.payload,
-    };
-
-    let ix = complete_wrapped_meta(
-        program_id,
-        bridge_id,
-        payer,
-        message_key,
-        post_vaa_data,
-        payload.clone(),
-        CompleteWrappedMetaData {},
-    )
-    .unwrap();
-
-    JsValue::from_serde(&ix).unwrap()
-}
-
-#[wasm_bindgen]
-pub fn upgrade_contract_ix(
-    program_id: String,
-    bridge_id: String,
-    payer: String,
-    spill: String,
-    vaa: Vec<u8>,
-) -> JsValue {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let bridge_id = Pubkey::from_str(bridge_id.as_str()).unwrap();
-    let spill = Pubkey::from_str(spill.as_str()).unwrap();
-    let vaa = VAA::deserialize(vaa.as_slice()).unwrap();
-    let payload = GovernancePayloadUpgrade::deserialize(&mut vaa.payload.as_slice()).unwrap();
-    let message_key = bridge::accounts::PostedVAA::<'_, { AccountState::Uninitialized }>::key(
-        &PostedVAADerivationData {
-            payload_hash: hash_vaa(&vaa.clone().into()).to_vec(),
-        },
-        &bridge_id,
-    );
-    let ix = upgrade_contract(
-        program_id,
-        Pubkey::from_str(payer.as_str()).unwrap(),
-        message_key,
-        Pubkey::new(&vaa.emitter_address),
-        payload.new_contract,
-        spill,
-        vaa.sequence,
-    );
-    return JsValue::from_serde(&ix).unwrap();
-}
-
-#[wasm_bindgen]
-pub fn register_chain_ix(
-    program_id: String,
-    bridge_id: String,
-    payer: String,
-    vaa: Vec<u8>,
-) -> JsValue {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let bridge_id = Pubkey::from_str(bridge_id.as_str()).unwrap();
-    let payer = Pubkey::from_str(payer.as_str()).unwrap();
-    let vaa = VAA::deserialize(vaa.as_slice()).unwrap();
-    let payload = PayloadGovernanceRegisterChain::deserialize(&mut vaa.payload.as_slice()).unwrap();
-    let message_key = bridge::accounts::PostedVAA::<'_, { AccountState::Uninitialized }>::key(
-        &PostedVAADerivationData {
-            payload_hash: hash_vaa(&vaa.clone().into()).to_vec(),
-        },
-        &bridge_id,
-    );
-    let post_vaa_data = PostVAAData {
-        version: vaa.version,
-        guardian_set_index: vaa.guardian_set_index,
-        timestamp: vaa.timestamp,
-        nonce: vaa.nonce,
-        emitter_chain: vaa.emitter_chain,
-        emitter_address: vaa.emitter_address,
-        sequence: vaa.sequence,
-        consistency_level: vaa.consistency_level,
-        payload: vaa.payload,
-    };
-    let ix = register_chain(
-        program_id,
-        bridge_id,
-        payer,
-        message_key,
-        post_vaa_data,
-        payload,
-        RegisterChainData {},
-    )
-    .unwrap();
-    return JsValue::from_serde(&ix).unwrap();
-}
-
-#[wasm_bindgen]
-pub fn emitter_address(program_id: String) -> Vec<u8> {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let emitter = EmitterAccount::key(None, &program_id);
-
-    emitter.to_bytes().to_vec()
-}
-
-#[wasm_bindgen]
-pub fn approval_authority_address(program_id: String) -> Vec<u8> {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let approval_authority = AuthoritySigner::key(None, &program_id);
-
-    approval_authority.to_bytes().to_vec()
-}
-
-#[wasm_bindgen]
-pub fn wrapped_address(
-    program_id: String,
-    token_address: Vec<u8>,
-    token_chain: u16,
-    token_id: Vec<u8>,
-) -> Vec<u8> {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let mut t_addr = [0u8; 32];
-    t_addr.copy_from_slice(&token_address);
-    let token_id = U256::from_big_endian(token_id.as_slice());
-
-    let wrapped_addr = WrappedMint::<'_, { AccountState::Initialized }>::key(
-        &WrappedDerivationData {
-            token_address: t_addr,
-            token_chain,
-            token_id,
-        },
-        &program_id,
-    );
-
-    wrapped_addr.to_bytes().to_vec()
-}
-
-#[wasm_bindgen]
-pub fn wrapped_meta_address(program_id: String, mint_address: Vec<u8>) -> Vec<u8> {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let mint_key = Pubkey::new(mint_address.as_slice());
-
-    let wrapped_meta_addr = WrappedTokenMeta::<'_, { AccountState::Initialized }>::key(
-        &WrappedMetaDerivationData { mint_key },
-        &program_id,
-    );
-
-    wrapped_meta_addr.to_bytes().to_vec()
-}
-
-#[wasm_bindgen]
-pub fn spl_meta_address(mint_address: Vec<u8>) -> Vec<u8> {
-    let mint_key = Pubkey::new(mint_address.as_slice());
-
-    let spl_metadata = SplTokenMeta::key(
-        &SplTokenMetaDerivationData { mint: mint_key },
-        &spl_token_metadata::id(),
-    );
-
-    spl_metadata.to_bytes().to_vec()
-}
-
-#[wasm_bindgen]
-pub fn parse_wrapped_meta(data: Vec<u8>) -> JsValue {
-    JsValue::from_serde(&WrappedMeta::try_from_slice(data.as_slice()).unwrap()).unwrap()
-}
-
-#[wasm_bindgen]
-pub fn parse_endpoint_registration(data: Vec<u8>) -> JsValue {
-    JsValue::from_serde(&EndpointRegistration::try_from_slice(data.as_slice()).unwrap()).unwrap()
-}

+ 0 - 767
solana/modules/nft_bridge/program/tests/common.rs

@@ -1,767 +0,0 @@
-#![allow(warnings)]
-
-use borsh::{
-    BorshDeserialize,
-    BorshSerialize,
-};
-use byteorder::{
-    BigEndian,
-    WriteBytesExt,
-};
-use hex_literal::hex;
-use secp256k1::{
-    Message as Secp256k1Message,
-    PublicKey,
-    SecretKey,
-};
-use sha3::Digest;
-use solana_client::{
-    client_error::ClientError,
-    rpc_client::RpcClient,
-    rpc_config::RpcSendTransactionConfig,
-};
-use solana_program::{
-    borsh::try_from_slice_unchecked,
-    hash,
-    instruction::{
-        AccountMeta,
-        Instruction,
-    },
-    program_pack::Pack,
-    pubkey::Pubkey,
-    system_instruction::{
-        self,
-        create_account,
-    },
-    system_program,
-    sysvar,
-};
-use solana_sdk::{
-    commitment_config::CommitmentConfig,
-    rent::Rent,
-    secp256k1_instruction::new_secp256k1_instruction,
-    signature::{
-        read_keypair_file,
-        Keypair,
-        Signature,
-        Signer,
-    },
-    transaction::Transaction,
-};
-use spl_token::state::Mint;
-use std::{
-    convert::TryInto,
-    env,
-    io::{
-        Cursor,
-        Write,
-    },
-    time::{
-        Duration,
-        SystemTime,
-    },
-};
-
-use token_bridge::{
-    accounts::*,
-    instruction,
-    instructions,
-    types::*,
-    Initialize,
-};
-
-use solitaire::{
-    processors::seeded::Seeded,
-    AccountState,
-};
-
-pub use helpers::*;
-
-/// Simple API wrapper for quickly preparing and sending transactions.
-pub fn execute(
-    client: &RpcClient,
-    payer: &Keypair,
-    signers: &[&Keypair],
-    instructions: &[Instruction],
-    commitment_level: CommitmentConfig,
-) -> Result<Signature, ClientError> {
-    let mut transaction = Transaction::new_with_payer(instructions, Some(&payer.pubkey()));
-    let recent_blockhash = client.get_recent_blockhash().unwrap().0;
-    transaction.sign(&signers.to_vec(), recent_blockhash);
-    client.send_and_confirm_transaction_with_spinner_and_config(
-        &transaction,
-        commitment_level,
-        RpcSendTransactionConfig {
-            skip_preflight: true,
-            preflight_commitment: None,
-            encoding: None,
-        },
-    )
-}
-
-mod helpers {
-    use bridge::types::{
-        ConsistencyLevel,
-        PostedVAAData,
-    };
-    use token_bridge::{
-        CompleteNativeData,
-        CompleteWrappedData,
-        CreateWrappedData,
-        RegisterChainData,
-        TransferNativeData,
-        TransferWrappedData,
-    };
-
-    use super::*;
-    use bridge::{
-        accounts::{
-            FeeCollector,
-            PostedVAADerivationData,
-        },
-        PostVAAData,
-    };
-    use std::ops::Add;
-    use token_bridge::messages::{
-        PayloadAssetMeta,
-        PayloadGovernanceRegisterChain,
-        PayloadTransfer,
-    };
-
-    /// Initialize the test environment, spins up a solana-test-validator in the background so that
-    /// each test has a fresh environment to work within.
-    pub fn setup() -> (Keypair, RpcClient, Pubkey, Pubkey) {
-        let payer = env::var("BRIDGE_PAYER").unwrap_or("./payer.json".to_string());
-        let rpc_address = env::var("BRIDGE_RPC").unwrap_or("http://127.0.0.1:8899".to_string());
-        let payer = read_keypair_file(payer).unwrap();
-        let rpc = RpcClient::new(rpc_address);
-
-        let (program, token_program) = (
-            env::var("BRIDGE_PROGRAM")
-                .unwrap_or("Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o".to_string())
-                .parse::<Pubkey>()
-                .unwrap(),
-            env::var("TOKEN_BRIDGE_PROGRAM")
-                .unwrap_or("B6RHG3mfcckmrYN1UhmJzyS1XX3fZKbkeUcpJe9Sy3FE".to_string())
-                .parse::<Pubkey>()
-                .unwrap(),
-        );
-
-        (payer, rpc, program, token_program)
-    }
-
-    /// Wait for a single transaction to fully finalize, guaranteeing chain state has been
-    /// confirmed. Useful for consistently fetching data during state checks.
-    pub fn sync(client: &RpcClient, payer: &Keypair) {
-        execute(
-            client,
-            payer,
-            &[payer],
-            &[system_instruction::transfer(
-                &payer.pubkey(),
-                &payer.pubkey(),
-                1,
-            )],
-            CommitmentConfig::finalized(),
-        )
-        .unwrap();
-    }
-
-    /// Fetch account data, the loop is there to re-attempt until data is available.
-    pub fn get_account_data<T: BorshDeserialize>(
-        client: &RpcClient,
-        account: &Pubkey,
-    ) -> Option<T> {
-        let account = client
-            .get_account_with_commitment(account, CommitmentConfig::processed())
-            .unwrap();
-        T::try_from_slice(&account.value.unwrap().data).ok()
-    }
-
-    pub fn initialize_bridge(
-        client: &RpcClient,
-        program: &Pubkey,
-        payer: &Keypair,
-    ) -> Result<Signature, ClientError> {
-        let initial_guardians = &[[1u8; 20]];
-        execute(
-            client,
-            payer,
-            &[payer],
-            &[bridge::instructions::initialize(
-                *program,
-                payer.pubkey(),
-                50,
-                2_000_000_000,
-                initial_guardians,
-            )
-            .unwrap()],
-            CommitmentConfig::processed(),
-        )
-    }
-
-    pub fn transfer(
-        client: &RpcClient,
-        from: &Keypair,
-        to: &Pubkey,
-        lamports: u64,
-    ) -> Result<Signature, ClientError> {
-        execute(
-            client,
-            from,
-            &[from],
-            &[system_instruction::transfer(&from.pubkey(), to, lamports)],
-            CommitmentConfig::processed(),
-        )
-    }
-
-    pub fn initialize(
-        client: &RpcClient,
-        program: &Pubkey,
-        payer: &Keypair,
-        bridge: &Pubkey,
-    ) -> Result<Signature, ClientError> {
-        let instruction = instructions::initialize(*program, payer.pubkey(), *bridge)
-            .expect("Could not create Initialize instruction");
-
-        for account in instruction.accounts.iter().enumerate() {
-            println!("{}: {}", account.0, account.1.pubkey);
-        }
-
-        execute(
-            client,
-            payer,
-            &[payer],
-            &[instruction],
-            CommitmentConfig::processed(),
-        )
-    }
-
-    pub fn attest(
-        client: &RpcClient,
-        program: &Pubkey,
-        bridge: &Pubkey,
-        payer: &Keypair,
-        message: &Keypair,
-        mint: Pubkey,
-        nonce: u32,
-    ) -> Result<Signature, ClientError> {
-        let mint_data = Mint::unpack(
-            &client
-                .get_account_with_commitment(&mint, CommitmentConfig::processed())?
-                .value
-                .unwrap()
-                .data,
-        )
-        .expect("Could not unpack Mint");
-
-        let instruction = instructions::attest(
-            *program,
-            *bridge,
-            payer.pubkey(),
-            message.pubkey(),
-            mint,
-            nonce,
-        )
-        .expect("Could not create Attest instruction");
-
-        for account in instruction.accounts.iter().enumerate() {
-            println!("{}: {}", account.0, account.1.pubkey);
-        }
-
-        execute(
-            client,
-            payer,
-            &[payer, message],
-            &[instruction],
-            CommitmentConfig::processed(),
-        )
-    }
-
-    pub fn transfer_native(
-        client: &RpcClient,
-        program: &Pubkey,
-        bridge: &Pubkey,
-        payer: &Keypair,
-        message: &Keypair,
-        from: &Keypair,
-        from_owner: &Keypair,
-        mint: Pubkey,
-        amount: u64,
-    ) -> Result<Signature, ClientError> {
-        let instruction = instructions::transfer_native(
-            *program,
-            *bridge,
-            payer.pubkey(),
-            message.pubkey(),
-            from.pubkey(),
-            mint,
-            TransferNativeData {
-                nonce: 0,
-                amount,
-                fee: 0,
-                target_address: [0u8; 32],
-                target_chain: 2,
-            },
-        )
-        .expect("Could not create Transfer Native");
-
-        for account in instruction.accounts.iter().enumerate() {
-            println!("{}: {}", account.0, account.1.pubkey);
-        }
-
-        execute(
-            client,
-            payer,
-            &[payer, from_owner, message],
-            &[
-                spl_token::instruction::approve(
-                    &spl_token::id(),
-                    &from.pubkey(),
-                    &token_bridge::accounts::AuthoritySigner::key(None, program),
-                    &from_owner.pubkey(),
-                    &[],
-                    amount,
-                )
-                .unwrap(),
-                instruction,
-            ],
-            CommitmentConfig::processed(),
-        )
-    }
-
-    pub fn transfer_wrapped(
-        client: &RpcClient,
-        program: &Pubkey,
-        bridge: &Pubkey,
-        payer: &Keypair,
-        message: &Keypair,
-        from: Pubkey,
-        from_owner: &Keypair,
-        token_chain: u16,
-        token_address: Address,
-        amount: u64,
-    ) -> Result<Signature, ClientError> {
-        let instruction = instructions::transfer_wrapped(
-            *program,
-            *bridge,
-            payer.pubkey(),
-            message.pubkey(),
-            from,
-            from_owner.pubkey(),
-            token_chain,
-            token_address,
-            TransferWrappedData {
-                nonce: 0,
-                amount,
-                fee: 0,
-                target_address: [5u8; 32],
-                target_chain: 2,
-            },
-        )
-        .expect("Could not create Transfer Native");
-
-        for account in instruction.accounts.iter().enumerate() {
-            println!("{}: {}", account.0, account.1.pubkey);
-        }
-
-        execute(
-            client,
-            payer,
-            &[payer, from_owner, message],
-            &[
-                spl_token::instruction::approve(
-                    &spl_token::id(),
-                    &from,
-                    &token_bridge::accounts::AuthoritySigner::key(None, program),
-                    &from_owner.pubkey(),
-                    &[],
-                    amount,
-                )
-                .unwrap(),
-                instruction,
-            ],
-            CommitmentConfig::processed(),
-        )
-    }
-
-    pub fn register_chain(
-        client: &RpcClient,
-        program: &Pubkey,
-        bridge: &Pubkey,
-        message_acc: &Pubkey,
-        vaa: PostVAAData,
-        payload: PayloadGovernanceRegisterChain,
-        payer: &Keypair,
-    ) -> Result<Signature, ClientError> {
-        let instruction = instructions::register_chain(
-            *program,
-            *bridge,
-            payer.pubkey(),
-            *message_acc,
-            vaa,
-            payload,
-            RegisterChainData {},
-        )
-        .expect("Could not create Transfer Native");
-
-        for account in instruction.accounts.iter().enumerate() {
-            println!("{}: {}", account.0, account.1.pubkey);
-        }
-
-        execute(
-            client,
-            payer,
-            &[payer],
-            &[instruction],
-            CommitmentConfig::processed(),
-        )
-    }
-
-    pub fn complete_native(
-        client: &RpcClient,
-        program: &Pubkey,
-        bridge: &Pubkey,
-        message_acc: &Pubkey,
-        vaa: PostVAAData,
-        payload: PayloadTransfer,
-        payer: &Keypair,
-    ) -> Result<Signature, ClientError> {
-        let instruction = instructions::complete_native(
-            *program,
-            *bridge,
-            payer.pubkey(),
-            *message_acc,
-            vaa,
-            Pubkey::new(&payload.to[..]),
-            None,
-            Pubkey::new(&payload.token_address[..]),
-            CompleteNativeData {},
-        )
-        .expect("Could not create Complete Native instruction");
-
-        for account in instruction.accounts.iter().enumerate() {
-            println!("{}: {}", account.0, account.1.pubkey);
-        }
-
-        execute(
-            client,
-            payer,
-            &[payer],
-            &[instruction],
-            CommitmentConfig::processed(),
-        )
-    }
-
-    pub fn complete_transfer_wrapped(
-        client: &RpcClient,
-        program: &Pubkey,
-        bridge: &Pubkey,
-        message_acc: &Pubkey,
-        vaa: PostVAAData,
-        payload: PayloadTransfer,
-        payer: &Keypair,
-    ) -> Result<Signature, ClientError> {
-        let to = Pubkey::new(&payload.to[..]);
-
-        let instruction = instructions::complete_wrapped(
-            *program,
-            *bridge,
-            payer.pubkey(),
-            *message_acc,
-            vaa,
-            payload,
-            to,
-            None,
-            CompleteWrappedData {},
-        )
-        .expect("Could not create Complete Wrapped instruction");
-
-        for account in instruction.accounts.iter().enumerate() {
-            println!("{}: {}", account.0, account.1.pubkey);
-        }
-
-        execute(
-            client,
-            payer,
-            &[payer],
-            &[instruction],
-            CommitmentConfig::processed(),
-        )
-    }
-
-    pub fn create_wrapped(
-        client: &RpcClient,
-        program: &Pubkey,
-        bridge: &Pubkey,
-        message_acc: &Pubkey,
-        vaa: PostVAAData,
-        payload: PayloadAssetMeta,
-        payer: &Keypair,
-    ) -> Result<Signature, ClientError> {
-        let instruction = instructions::create_wrapped(
-            *program,
-            *bridge,
-            payer.pubkey(),
-            *message_acc,
-            vaa,
-            payload,
-            CreateWrappedData {},
-        )
-        .expect("Could not create Create Wrapped instruction");
-
-        for account in instruction.accounts.iter().enumerate() {
-            println!("{}: {}", account.0, account.1.pubkey);
-        }
-
-        execute(
-            client,
-            payer,
-            &[payer],
-            &[instruction],
-            CommitmentConfig::processed(),
-        )
-    }
-
-    pub fn create_mint(
-        client: &RpcClient,
-        payer: &Keypair,
-        mint_authority: &Pubkey,
-        mint: &Keypair,
-    ) -> Result<Signature, ClientError> {
-        execute(
-            client,
-            payer,
-            &[payer, mint],
-            &[
-                solana_sdk::system_instruction::create_account(
-                    &payer.pubkey(),
-                    &mint.pubkey(),
-                    Rent::default().minimum_balance(spl_token::state::Mint::LEN),
-                    spl_token::state::Mint::LEN as u64,
-                    &spl_token::id(),
-                ),
-                spl_token::instruction::initialize_mint(
-                    &spl_token::id(),
-                    &mint.pubkey(),
-                    mint_authority,
-                    None,
-                    0,
-                )
-                .unwrap(),
-            ],
-            CommitmentConfig::processed(),
-        )
-    }
-
-    pub fn create_spl_metadata(
-        client: &RpcClient,
-        payer: &Keypair,
-        metadata_account: &Pubkey,
-        mint_authority: &Keypair,
-        mint: &Keypair,
-        update_authority: &Pubkey,
-        name: String,
-        symbol: String,
-    ) -> Result<Signature, ClientError> {
-        execute(
-            client,
-            payer,
-            &[payer, mint_authority],
-            &[spl_token_metadata::instruction::create_metadata_accounts(
-                spl_token_metadata::id(),
-                *metadata_account,
-                mint.pubkey(),
-                mint_authority.pubkey(),
-                payer.pubkey(),
-                *update_authority,
-                name,
-                symbol,
-                "https://token.org".to_string(),
-                None,
-                0,
-                false,
-                false,
-            )],
-            CommitmentConfig::processed(),
-        )
-    }
-
-    pub fn create_token_account(
-        client: &RpcClient,
-        payer: &Keypair,
-        token_acc: &Keypair,
-        token_authority: Pubkey,
-        mint: Pubkey,
-    ) -> Result<Signature, ClientError> {
-        execute(
-            client,
-            payer,
-            &[payer, token_acc],
-            &[
-                solana_sdk::system_instruction::create_account(
-                    &payer.pubkey(),
-                    &token_acc.pubkey(),
-                    Rent::default().minimum_balance(spl_token::state::Account::LEN),
-                    spl_token::state::Account::LEN as u64,
-                    &spl_token::id(),
-                ),
-                spl_token::instruction::initialize_account(
-                    &spl_token::id(),
-                    &token_acc.pubkey(),
-                    &mint,
-                    &token_authority,
-                )
-                .unwrap(),
-            ],
-            CommitmentConfig::processed(),
-        )
-    }
-
-    pub fn mint_tokens(
-        client: &RpcClient,
-        payer: &Keypair,
-        mint_authority: &Keypair,
-        mint: &Keypair,
-        token_account: &Pubkey,
-        amount: u64,
-    ) -> Result<Signature, ClientError> {
-        execute(
-            client,
-            payer,
-            &[payer, &mint_authority],
-            &[spl_token::instruction::mint_to(
-                &spl_token::id(),
-                &mint.pubkey(),
-                token_account,
-                &mint_authority.pubkey(),
-                &[],
-                amount,
-            )
-            .unwrap()],
-            CommitmentConfig::processed(),
-        )
-    }
-
-    /// Utility function for generating VAA's from message data.
-    pub fn generate_vaa(
-        emitter: Address,
-        emitter_chain: u16,
-        data: Vec<u8>,
-        nonce: u32,
-        sequence: u64,
-    ) -> (PostVAAData, [u8; 32], [u8; 32]) {
-        let mut vaa = PostVAAData {
-            version: 0,
-            guardian_set_index: 0,
-
-            // Body part
-            emitter_chain,
-            emitter_address: emitter,
-            sequence,
-            payload: data,
-            timestamp: SystemTime::now()
-                .duration_since(SystemTime::UNIX_EPOCH)
-                .unwrap()
-                .as_secs() as u32,
-            nonce,
-            consistency_level: ConsistencyLevel::Confirmed as u8,
-        };
-
-        // Hash data, the thing we wish to actually sign.
-        let body = {
-            let mut v = Cursor::new(Vec::new());
-            v.write_u32::<BigEndian>(vaa.timestamp).unwrap();
-            v.write_u32::<BigEndian>(vaa.nonce).unwrap();
-            v.write_u16::<BigEndian>(vaa.emitter_chain).unwrap();
-            v.write(&vaa.emitter_address).unwrap();
-            v.write_u64::<BigEndian>(vaa.sequence).unwrap();
-            v.write_u8(vaa.consistency_level).unwrap();
-            v.write(&vaa.payload).unwrap();
-            v.into_inner()
-        };
-
-        // Hash this body, which is expected to be the same as the hash currently stored in the
-        // signature account, binding that set of signatures to this VAA.
-        let body: [u8; 32] = {
-            let mut h = sha3::Keccak256::default();
-            h.write(body.as_slice()).unwrap();
-            h.finalize().into()
-        };
-
-        let body_hash: [u8; 32] = {
-            let mut h = sha3::Keccak256::default();
-            h.write(&body).unwrap();
-            h.finalize().into()
-        };
-
-        (vaa, body, body_hash)
-    }
-
-    pub fn post_vaa(
-        client: &RpcClient,
-        program: &Pubkey,
-        payer: &Keypair,
-        vaa: PostVAAData,
-    ) -> Result<(), ClientError> {
-        let instruction =
-            bridge::instructions::post_vaa(*program, payer.pubkey(), Pubkey::new_unique(), vaa);
-
-        for account in instruction.accounts.iter().enumerate() {
-            println!("{}: {}", account.0, account.1.pubkey);
-        }
-
-        execute(
-            client,
-            payer,
-            &[payer],
-            &[instruction],
-            CommitmentConfig::processed(),
-        )?;
-
-        Ok(())
-    }
-
-    pub fn post_message(
-        client: &RpcClient,
-        program: &Pubkey,
-        payer: &Keypair,
-        emitter: &Keypair,
-        message: &Keypair,
-        nonce: u32,
-        data: Vec<u8>,
-        fee: u64,
-    ) -> Result<(), ClientError> {
-        // Transfer money into the fee collector as it needs a balance/must exist.
-        let fee_collector = FeeCollector::<'_>::key(None, program);
-
-        // Capture the resulting message, later functions will need this.
-        let instruction = bridge::instructions::post_message(
-            *program,
-            payer.pubkey(),
-            emitter.pubkey(),
-            message.pubkey(),
-            nonce,
-            data,
-            ConsistencyLevel::Confirmed,
-        )
-        .unwrap();
-
-        for account in instruction.accounts.iter().enumerate() {
-            println!("{}: {}", account.0, account.1.pubkey);
-        }
-
-        execute(
-            client,
-            payer,
-            &[payer, emitter, message],
-            &[
-                system_instruction::transfer(&payer.pubkey(), &fee_collector, fee),
-                instruction,
-            ],
-            CommitmentConfig::processed(),
-        )?;
-
-        Ok(())
-    }
-}

+ 0 - 631
solana/modules/nft_bridge/program/tests/integration.rs

@@ -1,631 +0,0 @@
-#![allow(warnings)]
-
-use borsh::BorshSerialize;
-use byteorder::{
-    BigEndian,
-    WriteBytesExt,
-};
-use hex_literal::hex;
-use rand::Rng;
-use secp256k1::{
-    Message as Secp256k1Message,
-    PublicKey,
-    SecretKey,
-};
-use sha3::Digest;
-use solana_client::rpc_client::RpcClient;
-use solana_program::{
-    borsh::try_from_slice_unchecked,
-    hash,
-    instruction::{
-        AccountMeta,
-        Instruction,
-    },
-    program_pack::Pack,
-    pubkey::Pubkey,
-    system_instruction::{
-        self,
-        create_account,
-    },
-    system_program,
-    sysvar,
-};
-use solana_sdk::{
-    commitment_config::CommitmentConfig,
-    signature::{
-        read_keypair_file,
-        Keypair,
-        Signer,
-    },
-    transaction::Transaction,
-};
-use solitaire::{
-    processors::seeded::Seeded,
-    AccountState,
-};
-use spl_token::state::Mint;
-use std::{
-    convert::TryInto,
-    io::{
-        Cursor,
-        Write,
-    },
-    time::{
-        Duration,
-        SystemTime,
-    },
-};
-
-use bridge::{
-    accounts::{
-        Bridge,
-        FeeCollector,
-        GuardianSet,
-        GuardianSetDerivationData,
-        PostedVAA,
-        PostedVAADerivationData,
-        SignatureSet,
-    },
-    instruction,
-    types::{
-        BridgeConfig,
-        BridgeData,
-        GovernancePayloadGuardianSetChange,
-        GovernancePayloadSetMessageFee,
-        GovernancePayloadTransferFees,
-        GuardianSetData,
-        MessageData,
-        PostedVAAData,
-        SequenceTracker,
-        SignatureSet as SignatureSetData,
-    },
-    Initialize,
-    PostVAA,
-    PostVAAData,
-    SerializePayload,
-    Signature,
-};
-use primitive_types::U256;
-use std::{
-    collections::HashMap,
-    str::FromStr,
-    time::UNIX_EPOCH,
-};
-use token_bridge::{
-    accounts::{
-        EmitterAccount,
-        WrappedDerivationData,
-        WrappedMint,
-    },
-    messages::{
-        PayloadAssetMeta,
-        PayloadGovernanceRegisterChain,
-        PayloadTransfer,
-    },
-    types::Address,
-};
-
-mod common;
-
-const GOVERNANCE_KEY: [u8; 64] = [
-    240, 133, 120, 113, 30, 67, 38, 184, 197, 72, 234, 99, 241, 21, 58, 225, 41, 157, 171, 44, 196,
-    163, 134, 236, 92, 148, 110, 68, 127, 114, 177, 0, 173, 253, 199, 9, 242, 142, 201, 174, 108,
-    197, 18, 102, 115, 0, 31, 205, 127, 188, 191, 56, 171, 228, 20, 247, 149, 170, 141, 231, 147,
-    88, 97, 199,
-];
-
-struct Context {
-    /// Address of the core bridge contract.
-    bridge: Pubkey,
-
-    /// Shared RPC client for tests to make transactions with.
-    client: RpcClient,
-
-    /// Payer key with a ton of lamports to ease testing with.
-    payer: Keypair,
-
-    /// Track nonces throughout the tests.
-    seq: Sequencer,
-
-    /// Address of the token bridge itself that we wish to test.
-    token_bridge: Pubkey,
-
-    /// Keypairs for mint information, required in multiple tests.
-    mint_authority: Keypair,
-    mint: Keypair,
-    mint_meta: Pubkey,
-
-    /// Keypairs for test token accounts.
-    token_authority: Keypair,
-    token_account: Keypair,
-    metadata_account: Pubkey,
-}
-
-/// Small helper to track and provide sequences during tests. This is in particular needed for
-/// guardian operations that require them for derivations.
-struct Sequencer {
-    sequences: HashMap<[u8; 32], u64>,
-}
-
-impl Sequencer {
-    fn next(&mut self, emitter: [u8; 32]) -> u64 {
-        let entry = self.sequences.entry(emitter).or_insert(0);
-        *entry += 1;
-        *entry - 1
-    }
-
-    fn peek(&mut self, emitter: [u8; 32]) -> u64 {
-        *self.sequences.entry(emitter).or_insert(0)
-    }
-}
-
-#[test]
-fn run_integration_tests() {
-    let (payer, client, bridge, token_bridge) = common::setup();
-
-    // Setup a Bridge to test against.
-    println!("Bridge: {}", bridge);
-    common::initialize_bridge(&client, &bridge, &payer);
-
-    // Context for test environment.
-    let mint = Keypair::new();
-    let mint_pubkey = mint.pubkey();
-    let metadata_pubkey = Pubkey::from_str("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s").unwrap();
-
-    // SPL Token Meta
-    let metadata_seeds = &[
-        "metadata".as_bytes(),
-        metadata_pubkey.as_ref(),
-        mint_pubkey.as_ref(),
-    ];
-
-    let (metadata_key, metadata_bump_seed) = Pubkey::find_program_address(
-        metadata_seeds,
-        &Pubkey::from_str("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s").unwrap(),
-    );
-
-    // Token Bridge Meta
-    use token_bridge::accounts::WrappedTokenMeta;
-    let metadata_account = WrappedTokenMeta::<'_, { AccountState::Uninitialized }>::key(
-        &token_bridge::accounts::WrappedMetaDerivationData {
-            mint_key: mint_pubkey.clone(),
-        },
-        &token_bridge,
-    );
-
-    let mut context = Context {
-        seq: Sequencer {
-            sequences: HashMap::new(),
-        },
-        bridge,
-        client,
-        payer,
-        token_bridge,
-        mint_authority: Keypair::new(),
-        mint,
-        mint_meta: metadata_account,
-        token_account: Keypair::new(),
-        token_authority: Keypair::new(),
-        metadata_account: metadata_key,
-    };
-
-    // Create a mint for use within tests.
-    common::create_mint(
-        &context.client,
-        &context.payer,
-        &context.mint_authority.pubkey(),
-        &context.mint,
-    )
-    .unwrap();
-
-    // Create Token accounts for use within tests.
-    common::create_token_account(
-        &context.client,
-        &context.payer,
-        &context.token_account,
-        context.token_authority.pubkey(),
-        context.mint.pubkey(),
-    )
-    .unwrap();
-
-    // Mint tokens
-    common::mint_tokens(
-        &context.client,
-        &context.payer,
-        &context.mint_authority,
-        &context.mint,
-        &context.token_account.pubkey(),
-        1000,
-    )
-    .unwrap();
-
-    // Initialize the bridge and verify the bridges state.
-    test_initialize(&mut context);
-    test_transfer_native(&mut context);
-    test_attest(&mut context);
-    test_register_chain(&mut context);
-    test_transfer_native_in(&mut context);
-
-    // Create an SPL Metadata account to test attestations for wrapped tokens.
-    common::create_spl_metadata(
-        &context.client,
-        &context.payer,
-        &context.metadata_account,
-        &context.mint_authority,
-        &context.mint,
-        &context.payer.pubkey(),
-        "BTC".to_string(),
-        "Bitcoin".to_string(),
-    )
-    .unwrap();
-
-    let wrapped = test_create_wrapped(&mut context);
-    let wrapped_acc = Keypair::new();
-    common::create_token_account(
-        &context.client,
-        &context.payer,
-        &wrapped_acc,
-        context.token_authority.pubkey(),
-        wrapped,
-    )
-    .unwrap();
-    test_transfer_wrapped_in(&mut context, wrapped_acc.pubkey());
-    test_transfer_wrapped(&mut context, wrapped_acc.pubkey());
-}
-
-fn test_attest(context: &mut Context) -> () {
-    println!("Attest");
-    use token_bridge::{
-        accounts::ConfigAccount,
-        types::Config,
-    };
-
-    let Context {
-        ref payer,
-        ref client,
-        ref bridge,
-        ref token_bridge,
-        ref mint_authority,
-        ref mint,
-        ref mint_meta,
-        ref metadata_account,
-        ..
-    } = context;
-
-    let message = &Keypair::new();
-
-    common::attest(
-        client,
-        token_bridge,
-        bridge,
-        payer,
-        message,
-        mint.pubkey(),
-        0,
-    )
-    .unwrap();
-
-    let emitter_key = EmitterAccount::key(None, &token_bridge);
-    let mint_data = Mint::unpack(
-        &client
-            .get_account_with_commitment(&mint.pubkey(), CommitmentConfig::processed())
-            .unwrap()
-            .value
-            .unwrap()
-            .data,
-    )
-    .unwrap();
-    let payload = PayloadAssetMeta {
-        token_address: mint.pubkey().to_bytes(),
-        token_chain: 1,
-        decimals: mint_data.decimals,
-        symbol: "USD".to_string(),
-        name: "Bitcoin".to_string(),
-    };
-    let payload = payload.try_to_vec().unwrap();
-}
-
-fn test_transfer_native(context: &mut Context) -> () {
-    println!("Transfer Native");
-    use token_bridge::{
-        accounts::ConfigAccount,
-        types::Config,
-    };
-
-    let Context {
-        ref payer,
-        ref client,
-        ref bridge,
-        ref token_bridge,
-        ref mint_authority,
-        ref mint,
-        ref mint_meta,
-        ref token_account,
-        ref token_authority,
-        ..
-    } = context;
-
-    let message = &Keypair::new();
-
-    common::transfer_native(
-        client,
-        token_bridge,
-        bridge,
-        payer,
-        message,
-        token_account,
-        token_authority,
-        mint.pubkey(),
-        100,
-    )
-    .unwrap();
-}
-
-fn test_transfer_wrapped(context: &mut Context, token_account: Pubkey) -> () {
-    println!("TransferWrapped");
-    use token_bridge::{
-        accounts::ConfigAccount,
-        types::Config,
-    };
-
-    let Context {
-        ref payer,
-        ref client,
-        ref bridge,
-        ref token_bridge,
-        ref mint_authority,
-        ref token_authority,
-        ..
-    } = context;
-
-    let message = &Keypair::new();
-
-    common::transfer_wrapped(
-        client,
-        token_bridge,
-        bridge,
-        payer,
-        message,
-        token_account,
-        token_authority,
-        2,
-        [1u8; 32],
-        10000000,
-    )
-    .unwrap();
-}
-
-fn test_register_chain(context: &mut Context) -> () {
-    println!("Register Chain");
-    use token_bridge::{
-        accounts::ConfigAccount,
-        types::Config,
-    };
-
-    let Context {
-        ref payer,
-        ref client,
-        ref bridge,
-        ref token_bridge,
-        ref mint_authority,
-        ref mint,
-        ref mint_meta,
-        ref token_account,
-        ref token_authority,
-        ..
-    } = context;
-
-    let nonce = rand::thread_rng().gen();
-    let emitter = Keypair::from_bytes(&GOVERNANCE_KEY).unwrap();
-    let payload = PayloadGovernanceRegisterChain {
-        chain: 2,
-        endpoint_address: [0u8; 32],
-    };
-    let message = payload.try_to_vec().unwrap();
-
-    let (vaa, _, _) = common::generate_vaa(emitter.pubkey().to_bytes(), 1, message, nonce, 0);
-    common::post_vaa(client, bridge, payer, vaa.clone()).unwrap();
-
-    let mut msg_derivation_data = &PostedVAADerivationData {
-        payload_hash: bridge::instructions::hash_vaa(&vaa).to_vec(),
-    };
-    let message_key =
-        PostedVAA::<'_, { AccountState::MaybeInitialized }>::key(&msg_derivation_data, &bridge);
-
-    common::register_chain(
-        client,
-        token_bridge,
-        bridge,
-        &message_key,
-        vaa,
-        payload,
-        payer,
-    )
-    .unwrap();
-}
-
-fn test_transfer_native_in(context: &mut Context) -> () {
-    println!("TransferNativeIn");
-    use token_bridge::{
-        accounts::ConfigAccount,
-        types::Config,
-    };
-
-    let Context {
-        ref payer,
-        ref client,
-        ref bridge,
-        ref token_bridge,
-        ref mint_authority,
-        ref mint,
-        ref mint_meta,
-        ref token_account,
-        ref token_authority,
-        ..
-    } = context;
-
-    let nonce = rand::thread_rng().gen();
-
-    let payload = PayloadTransfer {
-        amount: U256::from(100),
-        token_address: mint.pubkey().to_bytes(),
-        token_chain: 1,
-        to: token_account.pubkey().to_bytes(),
-        to_chain: 1,
-        fee: U256::from(0),
-    };
-    let message = payload.try_to_vec().unwrap();
-
-    let (vaa, _, _) = common::generate_vaa([0u8; 32], 2, message, nonce, 1);
-    common::post_vaa(client, bridge, payer, vaa.clone()).unwrap();
-    let mut msg_derivation_data = &PostedVAADerivationData {
-        payload_hash: bridge::instructions::hash_vaa(&vaa).to_vec(),
-    };
-    let message_key =
-        PostedVAA::<'_, { AccountState::MaybeInitialized }>::key(&msg_derivation_data, &bridge);
-
-    common::complete_native(
-        client,
-        token_bridge,
-        bridge,
-        &message_key,
-        vaa,
-        payload,
-        payer,
-    )
-    .unwrap();
-}
-
-fn test_transfer_wrapped_in(context: &mut Context, to: Pubkey) -> () {
-    println!("TransferWrappedIn");
-    use token_bridge::{
-        accounts::ConfigAccount,
-        types::Config,
-    };
-
-    let Context {
-        ref payer,
-        ref client,
-        ref bridge,
-        ref token_bridge,
-        ref mint_authority,
-        ref mint,
-        ref mint_meta,
-        ref token_account,
-        ref token_authority,
-        ..
-    } = context;
-
-    let nonce = rand::thread_rng().gen();
-
-    let payload = PayloadTransfer {
-        amount: U256::from(100000000),
-        token_address: [1u8; 32],
-        token_chain: 2,
-        to: to.to_bytes(),
-        to_chain: 1,
-        fee: U256::from(0),
-    };
-    let message = payload.try_to_vec().unwrap();
-
-    let (vaa, _, _) = common::generate_vaa([0u8; 32], 2, message, nonce, rand::thread_rng().gen());
-    common::post_vaa(client, bridge, payer, vaa.clone()).unwrap();
-    let mut msg_derivation_data = &PostedVAADerivationData {
-        payload_hash: bridge::instructions::hash_vaa(&vaa).to_vec(),
-    };
-    let message_key =
-        PostedVAA::<'_, { AccountState::MaybeInitialized }>::key(&msg_derivation_data, &bridge);
-
-    common::complete_transfer_wrapped(
-        client,
-        token_bridge,
-        bridge,
-        &message_key,
-        vaa,
-        payload,
-        payer,
-    )
-    .unwrap();
-}
-
-fn test_create_wrapped(context: &mut Context) -> (Pubkey) {
-    println!("CreateWrapped");
-    use token_bridge::{
-        accounts::ConfigAccount,
-        types::Config,
-    };
-
-    let Context {
-        ref payer,
-        ref client,
-        ref bridge,
-        ref token_bridge,
-        ref mint_authority,
-        ref mint,
-        ref mint_meta,
-        ref token_account,
-        ref token_authority,
-        ..
-    } = context;
-
-    let nonce = rand::thread_rng().gen();
-
-    let payload = PayloadAssetMeta {
-        token_address: [1u8; 32],
-        token_chain: 2,
-        decimals: 7,
-        symbol: "".to_string(),
-        name: "".to_string(),
-    };
-    let message = payload.try_to_vec().unwrap();
-
-    let (vaa, _, _) = common::generate_vaa([0u8; 32], 2, message, nonce, 2);
-    common::post_vaa(client, bridge, payer, vaa.clone()).unwrap();
-    let mut msg_derivation_data = &PostedVAADerivationData {
-        payload_hash: bridge::instructions::hash_vaa(&vaa).to_vec(),
-    };
-    let message_key =
-        PostedVAA::<'_, { AccountState::MaybeInitialized }>::key(&msg_derivation_data, &bridge);
-
-    common::create_wrapped(
-        client,
-        token_bridge,
-        bridge,
-        &message_key,
-        vaa,
-        payload,
-        payer,
-    )
-    .unwrap();
-
-    return WrappedMint::<'_, { AccountState::Initialized }>::key(
-        &WrappedDerivationData {
-            token_chain: 2,
-            token_address: [1u8; 32],
-        },
-        token_bridge,
-    );
-}
-
-fn test_initialize(context: &mut Context) {
-    println!("Initialize");
-    use token_bridge::{
-        accounts::ConfigAccount,
-        types::Config,
-    };
-
-    let Context {
-        ref payer,
-        ref client,
-        ref bridge,
-        ref token_bridge,
-        ..
-    } = context;
-
-    common::initialize(client, token_bridge, payer, &bridge).unwrap();
-
-    // Verify Token Bridge State
-    let config_key = ConfigAccount::<'_, { AccountState::Uninitialized }>::key(None, &token_bridge);
-    let config: Config = common::get_account_data(client, &config_key).unwrap();
-    assert_eq!(config.wormhole_bridge, *bridge);
-}

+ 0 - 3694
solana/modules/token_bridge/Cargo.lock

@@ -1,3694 +0,0 @@
-# This file is automatically @generated by Cargo.
-# It is not intended for manual editing.
-version = 3
-
-[[package]]
-name = "Inflector"
-version = "0.11.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3"
-dependencies = [
- "lazy_static",
- "regex",
-]
-
-[[package]]
-name = "addr2line"
-version = "0.16.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3e61f2b7f93d2c7d2b08263acaa4a363b3e276806c68af6134c44f523bf1aacd"
-dependencies = [
- "gimli",
-]
-
-[[package]]
-name = "adler"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
-
-[[package]]
-name = "ahash"
-version = "0.4.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e"
-
-[[package]]
-name = "aho-corasick"
-version = "0.7.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "aliasable"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd"
-
-[[package]]
-name = "ansi_term"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
-dependencies = [
- "winapi",
-]
-
-[[package]]
-name = "anyhow"
-version = "1.0.43"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "28ae2b3dec75a406790005a200b1bd89785afc02517a00ca99ecfe093ee9e6cf"
-
-[[package]]
-name = "arrayref"
-version = "0.3.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544"
-
-[[package]]
-name = "arrayvec"
-version = "0.7.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6"
-
-[[package]]
-name = "assert_matches"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9"
-
-[[package]]
-name = "atty"
-version = "0.2.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
-dependencies = [
- "hermit-abi",
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "autocfg"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
-
-[[package]]
-name = "backtrace"
-version = "0.3.61"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e7a905d892734eea339e896738c14b9afce22b5318f64b951e70bf3844419b01"
-dependencies = [
- "addr2line",
- "cc",
- "cfg-if",
- "libc",
- "miniz_oxide",
- "object",
- "rustc-demangle",
-]
-
-[[package]]
-name = "base32"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "23ce669cd6c8588f79e15cf450314f9638f967fc5770ff1c7c1deb0925ea7cfa"
-
-[[package]]
-name = "base64"
-version = "0.12.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff"
-
-[[package]]
-name = "base64"
-version = "0.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
-
-[[package]]
-name = "bincode"
-version = "1.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "bitflags"
-version = "1.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
-
-[[package]]
-name = "blake3"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "882e99e4a0cb2ae6cb6e442102e8e6b7131718d94110e64c3e6a34ea9b106f37"
-dependencies = [
- "arrayref",
- "arrayvec",
- "cc",
- "cfg-if",
- "constant_time_eq",
- "digest 0.10.1",
-]
-
-[[package]]
-name = "block-buffer"
-version = "0.7.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b"
-dependencies = [
- "block-padding 0.1.5",
- "byte-tools",
- "byteorder",
- "generic-array 0.12.4",
-]
-
-[[package]]
-name = "block-buffer"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4"
-dependencies = [
- "block-padding 0.2.1",
- "generic-array 0.14.4",
-]
-
-[[package]]
-name = "block-buffer"
-version = "0.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1d36a02058e76b040de25a4464ba1c80935655595b661505c8b39b664828b95"
-dependencies = [
- "generic-array 0.14.4",
-]
-
-[[package]]
-name = "block-padding"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5"
-dependencies = [
- "byte-tools",
-]
-
-[[package]]
-name = "block-padding"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae"
-
-[[package]]
-name = "borsh"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "18dda7dc709193c0d86a1a51050a926dc3df1cf262ec46a23a25dba421ea1924"
-dependencies = [
- "borsh-derive",
- "hashbrown 0.9.1",
-]
-
-[[package]]
-name = "borsh-derive"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "684155372435f578c0fa1acd13ebbb182cc19d6b38b64ae7901da4393217d264"
-dependencies = [
- "borsh-derive-internal",
- "borsh-schema-derive-internal",
- "proc-macro-crate 0.1.5",
- "proc-macro2 1.0.28",
- "syn 1.0.75",
-]
-
-[[package]]
-name = "borsh-derive-internal"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2102f62f8b6d3edeab871830782285b64cc1830168094db05c8e458f209bc5c3"
-dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
-]
-
-[[package]]
-name = "borsh-schema-derive-internal"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "196c978c4c9b0b142d446ef3240690bf5a8a33497074a113ff9a337ccb750483"
-dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
-]
-
-[[package]]
-name = "bs58"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3"
-
-[[package]]
-name = "bstr"
-version = "0.2.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90682c8d613ad3373e66de8c6411e0ae2ab2571e879d2efbf73558cc66f21279"
-dependencies = [
- "lazy_static",
- "memchr",
- "regex-automata",
-]
-
-[[package]]
-name = "bumpalo"
-version = "3.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c59e7af012c713f529e7a3ee57ce9b31ddd858d4b512923602f74608b009631"
-
-[[package]]
-name = "bv"
-version = "0.11.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8834bb1d8ee5dc048ee3124f2c7c1afcc6bc9aed03f11e9dfd8c69470a5db340"
-dependencies = [
- "feature-probe",
- "serde",
-]
-
-[[package]]
-name = "byte-tools"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7"
-
-[[package]]
-name = "bytemuck"
-version = "1.7.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "439989e6b8c38d1b6570a384ef1e49c8848128f5a97f3914baef02920842712f"
-dependencies = [
- "bytemuck_derive",
-]
-
-[[package]]
-name = "bytemuck_derive"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e215f8c2f9f79cb53c8335e687ffd07d5bfcb6fe5fc80723762d0be46e7cc54"
-dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
-]
-
-[[package]]
-name = "byteorder"
-version = "1.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
-
-[[package]]
-name = "bytes"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040"
-
-[[package]]
-name = "bzip2"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6afcd980b5f3a45017c57e57a2fcccbb351cc43a356ce117ef760ef8052b89b0"
-dependencies = [
- "bzip2-sys",
- "libc",
-]
-
-[[package]]
-name = "bzip2-sys"
-version = "0.1.11+1.0.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc"
-dependencies = [
- "cc",
- "libc",
- "pkg-config",
-]
-
-[[package]]
-name = "caps"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "61bf7211aad104ce2769ec05efcdfabf85ee84ac92461d142f22cf8badd0e54c"
-dependencies = [
- "errno",
- "libc",
- "thiserror",
-]
-
-[[package]]
-name = "cc"
-version = "1.0.69"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2"
-dependencies = [
- "jobserver",
-]
-
-[[package]]
-name = "cfg-if"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
-
-[[package]]
-name = "chrono"
-version = "0.4.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73"
-dependencies = [
- "libc",
- "num-integer",
- "num-traits",
- "serde",
- "time",
- "winapi",
-]
-
-[[package]]
-name = "clap"
-version = "2.33.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002"
-dependencies = [
- "ansi_term",
- "atty",
- "bitflags",
- "strsim",
- "textwrap",
- "unicode-width",
- "vec_map",
-]
-
-[[package]]
-name = "client"
-version = "0.1.0"
-dependencies = [
- "anyhow",
- "borsh",
- "clap",
- "hex",
- "rand 0.7.3",
- "shellexpand",
- "solana-clap-utils",
- "solana-cli-config",
- "solana-client",
- "solana-program",
- "solana-sdk",
- "solitaire",
- "solitaire-client",
- "spl-token-metadata",
- "token-bridge",
-]
-
-[[package]]
-name = "console"
-version = "0.14.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3993e6445baa160675931ec041a5e03ca84b9c6e32a056150d3aa2bdda0a1f45"
-dependencies = [
- "encode_unicode",
- "lazy_static",
- "libc",
- "terminal_size",
- "winapi",
-]
-
-[[package]]
-name = "console"
-version = "0.15.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a28b32d32ca44b70c3e4acd7db1babf555fa026e385fb95f18028f88848b3c31"
-dependencies = [
- "encode_unicode",
- "libc",
- "once_cell",
- "regex",
- "terminal_size",
- "unicode-width",
- "winapi",
-]
-
-[[package]]
-name = "console_error_panic_hook"
-version = "0.1.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc"
-dependencies = [
- "cfg-if",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "console_log"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "501a375961cef1a0d44767200e66e4a559283097e91d0730b1d75dfb2f8a1494"
-dependencies = [
- "log",
- "web-sys",
-]
-
-[[package]]
-name = "constant_time_eq"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc"
-
-[[package]]
-name = "cpufeatures"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "crc32fast"
-version = "1.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a"
-dependencies = [
- "cfg-if",
-]
-
-[[package]]
-name = "crossbeam-channel"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4"
-dependencies = [
- "cfg-if",
- "crossbeam-utils",
-]
-
-[[package]]
-name = "crossbeam-deque"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e"
-dependencies = [
- "cfg-if",
- "crossbeam-epoch",
- "crossbeam-utils",
-]
-
-[[package]]
-name = "crossbeam-epoch"
-version = "0.9.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd"
-dependencies = [
- "cfg-if",
- "crossbeam-utils",
- "lazy_static",
- "memoffset",
- "scopeguard",
-]
-
-[[package]]
-name = "crossbeam-utils"
-version = "0.8.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db"
-dependencies = [
- "cfg-if",
- "lazy_static",
-]
-
-[[package]]
-name = "crunchy"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7"
-
-[[package]]
-name = "crypto-common"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "683d6b536309245c849479fba3da410962a43ed8e51c26b729208ec0ac2798d0"
-dependencies = [
- "generic-array 0.14.4",
-]
-
-[[package]]
-name = "crypto-mac"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5"
-dependencies = [
- "generic-array 0.12.4",
- "subtle 1.0.0",
-]
-
-[[package]]
-name = "crypto-mac"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab"
-dependencies = [
- "generic-array 0.14.4",
- "subtle 2.4.1",
-]
-
-[[package]]
-name = "crypto-mac"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "58bcd97a54c7ca5ce2f6eb16f6bede5b0ab5f0055fedc17d2f0b4466e21671ca"
-dependencies = [
- "generic-array 0.14.4",
- "subtle 2.4.1",
-]
-
-[[package]]
-name = "crypto-mac"
-version = "0.11.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714"
-dependencies = [
- "generic-array 0.14.4",
- "subtle 2.4.1",
-]
-
-[[package]]
-name = "curve25519-dalek"
-version = "3.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61"
-dependencies = [
- "byteorder",
- "digest 0.9.0",
- "rand_core 0.5.1",
- "subtle 2.4.1",
- "zeroize",
-]
-
-[[package]]
-name = "dashmap"
-version = "4.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e77a43b28d0668df09411cb0bc9a8c2adc40f9a048afe863e05fd43251e8e39c"
-dependencies = [
- "cfg-if",
- "num_cpus",
- "rayon",
-]
-
-[[package]]
-name = "derivation-path"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "193388a8c8c75a490b604ff61775e236541b8975e98e5ca1f6ea97d122b7e2db"
-dependencies = [
- "failure",
-]
-
-[[package]]
-name = "derivative"
-version = "2.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b"
-dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
-]
-
-[[package]]
-name = "dialoguer"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "61579ada4ec0c6031cfac3f86fdba0d195a7ebeb5e36693bd53cb5999a25beeb"
-dependencies = [
- "console 0.15.0",
- "lazy_static",
- "tempfile",
- "zeroize",
-]
-
-[[package]]
-name = "digest"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5"
-dependencies = [
- "generic-array 0.12.4",
-]
-
-[[package]]
-name = "digest"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066"
-dependencies = [
- "generic-array 0.14.4",
-]
-
-[[package]]
-name = "digest"
-version = "0.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b697d66081d42af4fba142d56918a3cb21dc8eb63372c6b85d14f44fb9c5979b"
-dependencies = [
- "block-buffer 0.10.0",
- "crypto-common",
- "generic-array 0.14.4",
- "subtle 2.4.1",
-]
-
-[[package]]
-name = "dir-diff"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2860407d7d7e2e004bb2128510ad9e8d669e76fa005ccf567977b5d71b8b4a0b"
-dependencies = [
- "walkdir",
-]
-
-[[package]]
-name = "dirs-next"
-version = "2.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1"
-dependencies = [
- "cfg-if",
- "dirs-sys-next",
-]
-
-[[package]]
-name = "dirs-sys-next"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d"
-dependencies = [
- "libc",
- "redox_users",
- "winapi",
-]
-
-[[package]]
-name = "dlopen"
-version = "0.1.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "71e80ad39f814a9abe68583cd50a2d45c8a67561c3361ab8da240587dda80937"
-dependencies = [
- "dlopen_derive",
- "lazy_static",
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "dlopen_derive"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f236d9e1b1fbd81cea0f9cbdc8dcc7e8ebcd80e6659cd7cb2ad5f6c05946c581"
-dependencies = [
- "libc",
- "quote 0.6.13",
- "syn 0.15.44",
-]
-
-[[package]]
-name = "ed25519"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4620d40f6d2601794401d6dd95a5cf69b6c157852539470eeda433a99b3c0efc"
-dependencies = [
- "signature",
-]
-
-[[package]]
-name = "ed25519-dalek"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d"
-dependencies = [
- "curve25519-dalek",
- "ed25519",
- "rand 0.7.3",
- "serde",
- "sha2 0.9.9",
- "zeroize",
-]
-
-[[package]]
-name = "ed25519-dalek-bip32"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "057f328f31294b5ab432e6c39642f54afd1531677d6d4ba2905932844cc242f3"
-dependencies = [
- "derivation-path",
- "ed25519-dalek",
- "failure",
- "hmac 0.9.0",
- "sha2 0.9.9",
-]
-
-[[package]]
-name = "either"
-version = "1.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
-
-[[package]]
-name = "encode_unicode"
-version = "0.3.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f"
-
-[[package]]
-name = "encoding_rs"
-version = "0.8.28"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "80df024fbc5ac80f87dfef0d9f5209a252f2a497f7f42944cff24d8253cac065"
-dependencies = [
- "cfg-if",
-]
-
-[[package]]
-name = "env_logger"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3"
-dependencies = [
- "atty",
- "humantime",
- "log",
- "regex",
- "termcolor",
-]
-
-[[package]]
-name = "errno"
-version = "0.2.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1"
-dependencies = [
- "errno-dragonfly",
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "errno-dragonfly"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf"
-dependencies = [
- "cc",
- "libc",
-]
-
-[[package]]
-name = "failure"
-version = "0.1.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86"
-dependencies = [
- "backtrace",
- "failure_derive",
-]
-
-[[package]]
-name = "failure_derive"
-version = "0.1.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4"
-dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
- "synstructure",
-]
-
-[[package]]
-name = "fake-simd"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed"
-
-[[package]]
-name = "feature-probe"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da"
-
-[[package]]
-name = "filetime"
-version = "0.2.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "975ccf83d8d9d0d84682850a38c8169027be83368805971cc4f238c2b245bc98"
-dependencies = [
- "cfg-if",
- "libc",
- "redox_syscall",
- "winapi",
-]
-
-[[package]]
-name = "fixed-hash"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c"
-dependencies = [
- "static_assertions",
-]
-
-[[package]]
-name = "flate2"
-version = "1.0.22"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e6988e897c1c9c485f43b47a529cef42fde0547f9d8d41a7062518f1d8fc53f"
-dependencies = [
- "cfg-if",
- "crc32fast",
- "libc",
- "miniz_oxide",
-]
-
-[[package]]
-name = "fnv"
-version = "1.0.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
-
-[[package]]
-name = "form_urlencoded"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191"
-dependencies = [
- "matches",
- "percent-encoding",
-]
-
-[[package]]
-name = "fs_extra"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394"
-
-[[package]]
-name = "futures"
-version = "0.3.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1adc00f486adfc9ce99f77d717836f0c5aa84965eb0b4f051f4e83f7cab53f8b"
-dependencies = [
- "futures-channel",
- "futures-core",
- "futures-executor",
- "futures-io",
- "futures-sink",
- "futures-task",
- "futures-util",
-]
-
-[[package]]
-name = "futures-channel"
-version = "0.3.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "74ed2411805f6e4e3d9bc904c95d5d423b89b3b25dc0250aa74729de20629ff9"
-dependencies = [
- "futures-core",
- "futures-sink",
-]
-
-[[package]]
-name = "futures-core"
-version = "0.3.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af51b1b4a7fdff033703db39de8802c673eb91855f2e0d47dcf3bf2c0ef01f99"
-
-[[package]]
-name = "futures-executor"
-version = "0.3.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4d0d535a57b87e1ae31437b892713aee90cd2d7b0ee48727cd11fc72ef54761c"
-dependencies = [
- "futures-core",
- "futures-task",
- "futures-util",
-]
-
-[[package]]
-name = "futures-io"
-version = "0.3.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b0e06c393068f3a6ef246c75cdca793d6a46347e75286933e5e75fd2fd11582"
-
-[[package]]
-name = "futures-macro"
-version = "0.3.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c54913bae956fb8df7f4dc6fc90362aa72e69148e3f39041fbe8742d21e0ac57"
-dependencies = [
- "autocfg",
- "proc-macro-hack",
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
-]
-
-[[package]]
-name = "futures-sink"
-version = "0.3.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c0f30aaa67363d119812743aa5f33c201a7a66329f97d1a887022971feea4b53"
-
-[[package]]
-name = "futures-task"
-version = "0.3.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bbe54a98670017f3be909561f6ad13e810d9a51f3f061b902062ca3da80799f2"
-
-[[package]]
-name = "futures-util"
-version = "0.3.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67eb846bfd58e44a8481a00049e82c43e0ccb5d61f8dc071057cb19249dd4d78"
-dependencies = [
- "autocfg",
- "futures-channel",
- "futures-core",
- "futures-io",
- "futures-macro",
- "futures-sink",
- "futures-task",
- "memchr",
- "pin-project-lite",
- "pin-utils",
- "proc-macro-hack",
- "proc-macro-nested",
- "slab",
-]
-
-[[package]]
-name = "generic-array"
-version = "0.12.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd"
-dependencies = [
- "typenum",
-]
-
-[[package]]
-name = "generic-array"
-version = "0.14.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817"
-dependencies = [
- "serde",
- "typenum",
- "version_check",
-]
-
-[[package]]
-name = "gethostname"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e692e296bfac1d2533ef168d0b60ff5897b8b70a4009276834014dd8924cc028"
-dependencies = [
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "getrandom"
-version = "0.1.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce"
-dependencies = [
- "cfg-if",
- "js-sys",
- "libc",
- "wasi 0.9.0+wasi-snapshot-preview1",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "getrandom"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753"
-dependencies = [
- "cfg-if",
- "libc",
- "wasi 0.10.2+wasi-snapshot-preview1",
-]
-
-[[package]]
-name = "gimli"
-version = "0.25.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0a01e0497841a3b2db4f8afa483cce65f7e96a3498bd6c541734792aeac8fe7"
-
-[[package]]
-name = "h2"
-version = "0.3.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0c9de88456263e249e241fcd211d3954e2c9b0ef7ccfc235a444eb367cae3689"
-dependencies = [
- "bytes",
- "fnv",
- "futures-core",
- "futures-sink",
- "futures-util",
- "http",
- "indexmap",
- "slab",
- "tokio",
- "tokio-util",
- "tracing",
-]
-
-[[package]]
-name = "hashbrown"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04"
-dependencies = [
- "ahash",
-]
-
-[[package]]
-name = "hashbrown"
-version = "0.11.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
-
-[[package]]
-name = "hermit-abi"
-version = "0.1.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "hex"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
-
-[[package]]
-name = "hex-literal"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "21e4590e13640f19f249fe3e4eca5113bc4289f2497710378190e7f4bd96f45b"
-
-[[package]]
-name = "hidapi"
-version = "1.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e6c4cc7279df8353788ac551186920e44959d5948aec404be02b28544a598bce"
-dependencies = [
- "cc",
- "libc",
- "pkg-config",
-]
-
-[[package]]
-name = "hmac"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5dcb5e64cda4c23119ab41ba960d1e170a774c8e4b9d9e6a9bc18aabf5e59695"
-dependencies = [
- "crypto-mac 0.7.0",
- "digest 0.8.1",
-]
-
-[[package]]
-name = "hmac"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840"
-dependencies = [
- "crypto-mac 0.8.0",
- "digest 0.9.0",
-]
-
-[[package]]
-name = "hmac"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "deae6d9dbb35ec2c502d62b8f7b1c000a0822c3b0794ba36b3149c0a1c840dff"
-dependencies = [
- "crypto-mac 0.9.1",
- "digest 0.9.0",
-]
-
-[[package]]
-name = "hmac"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b"
-dependencies = [
- "crypto-mac 0.11.1",
- "digest 0.9.0",
-]
-
-[[package]]
-name = "hmac-drbg"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c6e570451493f10f6581b48cdd530413b63ea9e780f544bfd3bdcaa0d89d1a7b"
-dependencies = [
- "digest 0.8.1",
- "generic-array 0.12.4",
- "hmac 0.7.1",
-]
-
-[[package]]
-name = "hmac-drbg"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1"
-dependencies = [
- "digest 0.9.0",
- "generic-array 0.14.4",
- "hmac 0.8.1",
-]
-
-[[package]]
-name = "http"
-version = "0.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "527e8c9ac747e28542699a951517aa9a6945af506cd1f2e1b53a576c17b6cc11"
-dependencies = [
- "bytes",
- "fnv",
- "itoa 0.4.8",
-]
-
-[[package]]
-name = "http-body"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "399c583b2979440c60be0821a6199eca73bc3c8dcd9d070d75ac726e2c6186e5"
-dependencies = [
- "bytes",
- "http",
- "pin-project-lite",
-]
-
-[[package]]
-name = "httparse"
-version = "1.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "acd94fdbe1d4ff688b67b04eee2e17bd50995534a61539e45adfefb45e5e5503"
-
-[[package]]
-name = "httpdate"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440"
-
-[[package]]
-name = "humantime"
-version = "2.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
-
-[[package]]
-name = "hyper"
-version = "0.14.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b61cf2d1aebcf6e6352c97b81dc2244ca29194be1b276f5d8ad5c6330fffb11"
-dependencies = [
- "bytes",
- "futures-channel",
- "futures-core",
- "futures-util",
- "h2",
- "http",
- "http-body",
- "httparse",
- "httpdate",
- "itoa 0.4.8",
- "pin-project-lite",
- "socket2",
- "tokio",
- "tower-service",
- "tracing",
- "want",
-]
-
-[[package]]
-name = "hyper-rustls"
-version = "0.23.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d87c48c02e0dc5e3b849a2041db3029fd066650f8f717c07bf8ed78ccb895cac"
-dependencies = [
- "http",
- "hyper",
- "rustls",
- "tokio",
- "tokio-rustls",
-]
-
-[[package]]
-name = "idna"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8"
-dependencies = [
- "matches",
- "unicode-bidi",
- "unicode-normalization",
-]
-
-[[package]]
-name = "indexmap"
-version = "1.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5"
-dependencies = [
- "autocfg",
- "hashbrown 0.11.2",
-]
-
-[[package]]
-name = "indicatif"
-version = "0.16.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2d207dc617c7a380ab07ff572a6e52fa202a2a8f355860ac9c38e23f8196be1b"
-dependencies = [
- "console 0.14.1",
- "lazy_static",
- "number_prefix",
- "regex",
-]
-
-[[package]]
-name = "instant"
-version = "0.1.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bee0328b1209d157ef001c94dd85b4f8f64139adb0eac2659f4b08382b2f474d"
-dependencies = [
- "cfg-if",
-]
-
-[[package]]
-name = "ipnet"
-version = "2.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "68f2d64f2edebec4ce84ad108148e67e1064789bee435edc5b60ad398714a3a9"
-
-[[package]]
-name = "itertools"
-version = "0.10.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3"
-dependencies = [
- "either",
-]
-
-[[package]]
-name = "itoa"
-version = "0.4.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4"
-
-[[package]]
-name = "itoa"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35"
-
-[[package]]
-name = "jobserver"
-version = "0.1.24"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "js-sys"
-version = "0.3.55"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84"
-dependencies = [
- "wasm-bindgen",
-]
-
-[[package]]
-name = "jsonrpc-core"
-version = "18.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "14f7f76aef2d054868398427f6c54943cf3d1caa9a7ec7d0c38d69df97a965eb"
-dependencies = [
- "futures",
- "futures-executor",
- "futures-util",
- "log",
- "serde",
- "serde_derive",
- "serde_json",
-]
-
-[[package]]
-name = "keccak"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7"
-
-[[package]]
-name = "lazy_static"
-version = "1.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
-
-[[package]]
-name = "libc"
-version = "0.2.112"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125"
-
-[[package]]
-name = "libloading"
-version = "0.7.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "afe203d669ec979b7128619bae5a63b7b42e9203c1b29146079ee05e2f604b52"
-dependencies = [
- "cfg-if",
- "winapi",
-]
-
-[[package]]
-name = "libsecp256k1"
-version = "0.3.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1fc1e2c808481a63dc6da2074752fdd4336a3c8fcc68b83db6f1fd5224ae7962"
-dependencies = [
- "arrayref",
- "crunchy",
- "digest 0.8.1",
- "hmac-drbg 0.2.0",
- "rand 0.7.3",
- "sha2 0.8.2",
- "subtle 2.4.1",
- "typenum",
-]
-
-[[package]]
-name = "libsecp256k1"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c9d220bc1feda2ac231cb78c3d26f27676b8cf82c96971f7aeef3d0cf2797c73"
-dependencies = [
- "arrayref",
- "base64 0.12.3",
- "digest 0.9.0",
- "hmac-drbg 0.3.0",
- "libsecp256k1-core",
- "libsecp256k1-gen-ecmult",
- "libsecp256k1-gen-genmult",
- "rand 0.7.3",
- "serde",
- "sha2 0.9.9",
- "typenum",
-]
-
-[[package]]
-name = "libsecp256k1-core"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d0f6ab710cec28cef759c5f18671a27dae2a5f952cdaaee1d8e2908cb2478a80"
-dependencies = [
- "crunchy",
- "digest 0.9.0",
- "subtle 2.4.1",
-]
-
-[[package]]
-name = "libsecp256k1-gen-ecmult"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ccab96b584d38fac86a83f07e659f0deafd0253dc096dab5a36d53efe653c5c3"
-dependencies = [
- "libsecp256k1-core",
-]
-
-[[package]]
-name = "libsecp256k1-gen-genmult"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67abfe149395e3aa1c48a2beb32b068e2334402df8181f818d3aee2b304c4f5d"
-dependencies = [
- "libsecp256k1-core",
-]
-
-[[package]]
-name = "linked-hash-map"
-version = "0.5.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3"
-
-[[package]]
-name = "lock_api"
-version = "0.4.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0382880606dff6d15c9476c416d18690b72742aa7b605bb6dd6ec9030fbf07eb"
-dependencies = [
- "scopeguard",
-]
-
-[[package]]
-name = "log"
-version = "0.4.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
-dependencies = [
- "cfg-if",
-]
-
-[[package]]
-name = "matches"
-version = "0.1.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
-
-[[package]]
-name = "memchr"
-version = "2.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
-
-[[package]]
-name = "memmap2"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe3179b85e1fd8b14447cbebadb75e45a1002f541b925f0bfec366d56a81c56d"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "memoffset"
-version = "0.6.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9"
-dependencies = [
- "autocfg",
-]
-
-[[package]]
-name = "mime"
-version = "0.3.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d"
-
-[[package]]
-name = "miniz_oxide"
-version = "0.4.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b"
-dependencies = [
- "adler",
- "autocfg",
-]
-
-[[package]]
-name = "mio"
-version = "0.7.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16"
-dependencies = [
- "libc",
- "log",
- "miow",
- "ntapi",
- "winapi",
-]
-
-[[package]]
-name = "miow"
-version = "0.3.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21"
-dependencies = [
- "winapi",
-]
-
-[[package]]
-name = "nix"
-version = "0.23.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9f866317acbd3a240710c63f065ffb1e4fd466259045ccb504130b7f668f35c6"
-dependencies = [
- "bitflags",
- "cc",
- "cfg-if",
- "libc",
- "memoffset",
-]
-
-[[package]]
-name = "ntapi"
-version = "0.3.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44"
-dependencies = [
- "winapi",
-]
-
-[[package]]
-name = "num-derive"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d"
-dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
-]
-
-[[package]]
-name = "num-integer"
-version = "0.1.44"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db"
-dependencies = [
- "autocfg",
- "num-traits",
-]
-
-[[package]]
-name = "num-traits"
-version = "0.2.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290"
-dependencies = [
- "autocfg",
-]
-
-[[package]]
-name = "num_cpus"
-version = "1.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3"
-dependencies = [
- "hermit-abi",
- "libc",
-]
-
-[[package]]
-name = "num_enum"
-version = "0.5.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f9bd055fb730c4f8f4f57d45d35cd6b3f0980535b056dc7ff119cee6a66ed6f"
-dependencies = [
- "derivative",
- "num_enum_derive",
-]
-
-[[package]]
-name = "num_enum_derive"
-version = "0.5.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "486ea01961c4a818096de679a8b740b26d9033146ac5291b1c98557658f8cdd9"
-dependencies = [
- "proc-macro-crate 1.0.0",
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
-]
-
-[[package]]
-name = "number_prefix"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3"
-
-[[package]]
-name = "object"
-version = "0.26.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ee2766204889d09937d00bfbb7fec56bb2a199e2ade963cab19185d8a6104c7c"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "once_cell"
-version = "1.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56"
-
-[[package]]
-name = "opaque-debug"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c"
-
-[[package]]
-name = "opaque-debug"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
-
-[[package]]
-name = "ouroboros"
-version = "0.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f357ef82d1b4db66fbed0b8d542cbd3c22d0bf5b393b3c257b9ba4568e70c9c3"
-dependencies = [
- "aliasable",
- "ouroboros_macro",
- "stable_deref_trait",
-]
-
-[[package]]
-name = "ouroboros_macro"
-version = "0.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "44a0b52c2cbaef7dffa5fec1a43274afe8bd2a644fa9fc50a9ef4ff0269b1257"
-dependencies = [
- "Inflector",
- "proc-macro-error",
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
-]
-
-[[package]]
-name = "parking_lot"
-version = "0.11.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb"
-dependencies = [
- "instant",
- "lock_api",
- "parking_lot_core",
-]
-
-[[package]]
-name = "parking_lot_core"
-version = "0.8.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018"
-dependencies = [
- "cfg-if",
- "instant",
- "libc",
- "redox_syscall",
- "smallvec",
- "winapi",
-]
-
-[[package]]
-name = "pbkdf2"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbd"
-dependencies = [
- "crypto-mac 0.8.0",
-]
-
-[[package]]
-name = "pbkdf2"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f05894bce6a1ba4be299d0c5f29563e08af2bc18bb7d48313113bed71e904739"
-dependencies = [
- "crypto-mac 0.11.1",
-]
-
-[[package]]
-name = "percent-encoding"
-version = "2.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
-
-[[package]]
-name = "pin-project-lite"
-version = "0.2.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443"
-
-[[package]]
-name = "pin-utils"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
-
-[[package]]
-name = "pkg-config"
-version = "0.3.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c"
-
-[[package]]
-name = "ppv-lite86"
-version = "0.2.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857"
-
-[[package]]
-name = "primitive-types"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "06345ee39fbccfb06ab45f3a1a5798d9dafa04cb8921a76d227040003a234b0e"
-dependencies = [
- "fixed-hash",
- "uint",
-]
-
-[[package]]
-name = "proc-macro-crate"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785"
-dependencies = [
- "toml",
-]
-
-[[package]]
-name = "proc-macro-crate"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41fdbd1df62156fbc5945f4762632564d7d038153091c3fcf1067f6aef7cff92"
-dependencies = [
- "thiserror",
- "toml",
-]
-
-[[package]]
-name = "proc-macro-error"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
-dependencies = [
- "proc-macro-error-attr",
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
- "version_check",
-]
-
-[[package]]
-name = "proc-macro-error-attr"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
-dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "version_check",
-]
-
-[[package]]
-name = "proc-macro-hack"
-version = "0.5.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
-
-[[package]]
-name = "proc-macro-nested"
-version = "0.1.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086"
-
-[[package]]
-name = "proc-macro2"
-version = "0.4.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759"
-dependencies = [
- "unicode-xid 0.1.0",
-]
-
-[[package]]
-name = "proc-macro2"
-version = "1.0.28"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c7ed8b8c7b886ea3ed7dde405212185f423ab44682667c8c6dd14aa1d9f6612"
-dependencies = [
- "unicode-xid 0.2.2",
-]
-
-[[package]]
-name = "qstring"
-version = "0.7.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d464fae65fff2680baf48019211ce37aaec0c78e9264c84a3e484717f965104e"
-dependencies = [
- "percent-encoding",
-]
-
-[[package]]
-name = "quote"
-version = "0.6.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1"
-dependencies = [
- "proc-macro2 0.4.30",
-]
-
-[[package]]
-name = "quote"
-version = "1.0.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7"
-dependencies = [
- "proc-macro2 1.0.28",
-]
-
-[[package]]
-name = "rand"
-version = "0.7.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
-dependencies = [
- "getrandom 0.1.16",
- "libc",
- "rand_chacha 0.2.2",
- "rand_core 0.5.1",
- "rand_hc 0.2.0",
-]
-
-[[package]]
-name = "rand"
-version = "0.8.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8"
-dependencies = [
- "libc",
- "rand_chacha 0.3.1",
- "rand_core 0.6.3",
- "rand_hc 0.3.1",
-]
-
-[[package]]
-name = "rand_chacha"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
-dependencies = [
- "ppv-lite86",
- "rand_core 0.5.1",
-]
-
-[[package]]
-name = "rand_chacha"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
-dependencies = [
- "ppv-lite86",
- "rand_core 0.6.3",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
-dependencies = [
- "getrandom 0.1.16",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.6.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7"
-dependencies = [
- "getrandom 0.2.3",
-]
-
-[[package]]
-name = "rand_hc"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
-dependencies = [
- "rand_core 0.5.1",
-]
-
-[[package]]
-name = "rand_hc"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7"
-dependencies = [
- "rand_core 0.6.3",
-]
-
-[[package]]
-name = "rayon"
-version = "1.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90"
-dependencies = [
- "autocfg",
- "crossbeam-deque",
- "either",
- "rayon-core",
-]
-
-[[package]]
-name = "rayon-core"
-version = "1.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e"
-dependencies = [
- "crossbeam-channel",
- "crossbeam-deque",
- "crossbeam-utils",
- "lazy_static",
- "num_cpus",
-]
-
-[[package]]
-name = "redox_syscall"
-version = "0.2.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff"
-dependencies = [
- "bitflags",
-]
-
-[[package]]
-name = "redox_users"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64"
-dependencies = [
- "getrandom 0.2.3",
- "redox_syscall",
-]
-
-[[package]]
-name = "regex"
-version = "1.5.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461"
-dependencies = [
- "aho-corasick",
- "memchr",
- "regex-syntax",
-]
-
-[[package]]
-name = "regex-automata"
-version = "0.1.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132"
-
-[[package]]
-name = "regex-syntax"
-version = "0.6.25"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
-
-[[package]]
-name = "remove_dir_all"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
-dependencies = [
- "winapi",
-]
-
-[[package]]
-name = "reqwest"
-version = "0.11.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87f242f1488a539a79bac6dbe7c8609ae43b7914b7736210f239a37cccb32525"
-dependencies = [
- "base64 0.13.0",
- "bytes",
- "encoding_rs",
- "futures-core",
- "futures-util",
- "h2",
- "http",
- "http-body",
- "hyper",
- "hyper-rustls",
- "ipnet",
- "js-sys",
- "lazy_static",
- "log",
- "mime",
- "percent-encoding",
- "pin-project-lite",
- "rustls",
- "rustls-pemfile",
- "serde",
- "serde_json",
- "serde_urlencoded",
- "tokio",
- "tokio-rustls",
- "url",
- "wasm-bindgen",
- "wasm-bindgen-futures",
- "web-sys",
- "webpki-roots",
- "winreg",
-]
-
-[[package]]
-name = "ring"
-version = "0.16.20"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc"
-dependencies = [
- "cc",
- "libc",
- "once_cell",
- "spin",
- "untrusted",
- "web-sys",
- "winapi",
-]
-
-[[package]]
-name = "rocksalt"
-version = "0.1.0"
-dependencies = [
- "byteorder",
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "sha3",
- "solana-program",
- "syn 1.0.75",
-]
-
-[[package]]
-name = "rpassword"
-version = "5.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ffc936cf8a7ea60c58f030fd36a612a48f440610214dc54bc36431f9ea0c3efb"
-dependencies = [
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "rustc-demangle"
-version = "0.1.20"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dead70b0b5e03e9c814bcb6b01e03e68f7c57a80aa48c72ec92152ab3e818d49"
-
-[[package]]
-name = "rustc-hash"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
-
-[[package]]
-name = "rustc_version"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
-dependencies = [
- "semver",
-]
-
-[[package]]
-name = "rustls"
-version = "0.20.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d37e5e2290f3e040b594b1a9e04377c2c671f1a1cfd9bfdef82106ac1c113f84"
-dependencies = [
- "log",
- "ring",
- "sct",
- "webpki",
-]
-
-[[package]]
-name = "rustls-pemfile"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9"
-dependencies = [
- "base64 0.13.0",
-]
-
-[[package]]
-name = "rustversion"
-version = "1.0.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088"
-
-[[package]]
-name = "ryu"
-version = "1.0.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"
-
-[[package]]
-name = "same-file"
-version = "1.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
-dependencies = [
- "winapi-util",
-]
-
-[[package]]
-name = "scopeguard"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
-
-[[package]]
-name = "sct"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4"
-dependencies = [
- "ring",
- "untrusted",
-]
-
-[[package]]
-name = "semver"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012"
-
-[[package]]
-name = "serde"
-version = "1.0.133"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97565067517b60e2d1ea8b268e59ce036de907ac523ad83a0475da04e818989a"
-dependencies = [
- "serde_derive",
-]
-
-[[package]]
-name = "serde_bytes"
-version = "0.11.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "16ae07dd2f88a366f15bd0632ba725227018c69a1c8550a927324f8eb8368bb9"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "serde_derive"
-version = "1.0.133"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed201699328568d8d08208fdd080e3ff594e6c422e438b6705905da01005d537"
-dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
-]
-
-[[package]]
-name = "serde_json"
-version = "1.0.74"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ee2bb9cd061c5865d345bb02ca49fcef1391741b672b54a0bf7b679badec3142"
-dependencies = [
- "itoa 1.0.1",
- "ryu",
- "serde",
-]
-
-[[package]]
-name = "serde_urlencoded"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "edfa57a7f8d9c1d260a549e7224100f6c43d43f9103e06dd8b4095a9b2b43ce9"
-dependencies = [
- "form_urlencoded",
- "itoa 0.4.8",
- "ryu",
- "serde",
-]
-
-[[package]]
-name = "serde_yaml"
-version = "0.8.23"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4a521f2940385c165a24ee286aa8599633d162077a54bdcae2a6fd5a7bfa7a0"
-dependencies = [
- "indexmap",
- "ryu",
- "serde",
- "yaml-rust",
-]
-
-[[package]]
-name = "sha-1"
-version = "0.9.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6"
-dependencies = [
- "block-buffer 0.9.0",
- "cfg-if",
- "cpufeatures",
- "digest 0.9.0",
- "opaque-debug 0.3.0",
-]
-
-[[package]]
-name = "sha2"
-version = "0.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69"
-dependencies = [
- "block-buffer 0.7.3",
- "digest 0.8.1",
- "fake-simd",
- "opaque-debug 0.2.3",
-]
-
-[[package]]
-name = "sha2"
-version = "0.9.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800"
-dependencies = [
- "block-buffer 0.9.0",
- "cfg-if",
- "cpufeatures",
- "digest 0.9.0",
- "opaque-debug 0.3.0",
-]
-
-[[package]]
-name = "sha3"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809"
-dependencies = [
- "block-buffer 0.9.0",
- "digest 0.9.0",
- "keccak",
- "opaque-debug 0.3.0",
-]
-
-[[package]]
-name = "shellexpand"
-version = "2.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "83bdb7831b2d85ddf4a7b148aa19d0587eddbe8671a436b7bd1182eaad0f2829"
-dependencies = [
- "dirs-next",
-]
-
-[[package]]
-name = "signal-hook-registry"
-version = "1.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "signature"
-version = "1.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c19772be3c4dd2ceaacf03cb41d5885f2a02c4d8804884918e3a258480803335"
-
-[[package]]
-name = "slab"
-version = "0.4.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c307a32c1c5c437f38c7fd45d753050587732ba8628319fbdf12a7e289ccc590"
-
-[[package]]
-name = "smallvec"
-version = "1.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e"
-
-[[package]]
-name = "socket2"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5dc90fe6c7be1a323296982db1836d1ea9e47b6839496dde9a541bc496df3516"
-dependencies = [
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "solana-account-decoder"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b73dbbe43a11077d2207740a4044d653130aa06c437fc0481753ff0753f5be5f"
-dependencies = [
- "Inflector",
- "base64 0.12.3",
- "bincode",
- "bs58",
- "bv",
- "lazy_static",
- "serde",
- "serde_derive",
- "serde_json",
- "solana-config-program",
- "solana-sdk",
- "solana-vote-program",
- "spl-token",
- "thiserror",
- "zstd",
-]
-
-[[package]]
-name = "solana-address-lookup-table-program"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "545979985b604cf5c0c3f45cf465790a62b5109cce14edb6e1d839281fb71d41"
-dependencies = [
- "bincode",
- "bytemuck",
- "log",
- "num-derive",
- "num-traits",
- "rustc_version",
- "serde",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
- "solana-program-runtime",
- "solana-sdk",
- "thiserror",
-]
-
-[[package]]
-name = "solana-bucket-map"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "47427a1fce977163be8df0c889e6574c0724eac310a6f90553e3c36b8d4e0692"
-dependencies = [
- "fs_extra",
- "log",
- "memmap2",
- "rand 0.7.3",
- "rayon",
- "solana-logger",
- "solana-measure",
- "solana-sdk",
- "tempfile",
-]
-
-[[package]]
-name = "solana-clap-utils"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "670c0fddeaf1b64d1175f1a6221dc66c5f6b4c763cb9cb1bf65ee3ac9fef2e89"
-dependencies = [
- "chrono",
- "clap",
- "rpassword",
- "solana-perf",
- "solana-remote-wallet",
- "solana-sdk",
- "thiserror",
- "tiny-bip39",
- "uriparse",
- "url",
-]
-
-[[package]]
-name = "solana-cli-config"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4d0912423440feef8b93a6a94c0d807c890dbc407a5bc23187eed491fb3897d7"
-dependencies = [
- "dirs-next",
- "lazy_static",
- "serde",
- "serde_derive",
- "serde_yaml",
- "url",
-]
-
-[[package]]
-name = "solana-client"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d8ec26e0d31f3a317b56a33ac3c6704c53f3edb4a81ba46d32ca71ba37198aa7"
-dependencies = [
- "base64 0.13.0",
- "bincode",
- "bs58",
- "clap",
- "indicatif",
- "jsonrpc-core",
- "log",
- "rayon",
- "reqwest",
- "semver",
- "serde",
- "serde_derive",
- "serde_json",
- "solana-account-decoder",
- "solana-clap-utils",
- "solana-faucet",
- "solana-measure",
- "solana-net-utils",
- "solana-sdk",
- "solana-transaction-status",
- "solana-version",
- "solana-vote-program",
- "thiserror",
- "tokio",
- "tungstenite",
- "url",
-]
-
-[[package]]
-name = "solana-compute-budget-program"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c275dde46baa7b1c1a100aa5a82a4dddd27e8cf643cbbdcf27f8d94a843091d"
-dependencies = [
- "solana-program-runtime",
- "solana-sdk",
-]
-
-[[package]]
-name = "solana-config-program"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4aa938b89aed5fc51b6ff1ff6d0b3099daf2b873380491b4d1b2c4ba0096313c"
-dependencies = [
- "bincode",
- "chrono",
- "serde",
- "serde_derive",
- "solana-program-runtime",
- "solana-sdk",
-]
-
-[[package]]
-name = "solana-faucet"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "021064348145bfd31ac1a7fc87e3de2948b63529c3bc873740f15fbe9fe9843a"
-dependencies = [
- "bincode",
- "byteorder",
- "clap",
- "log",
- "serde",
- "serde_derive",
- "solana-clap-utils",
- "solana-cli-config",
- "solana-logger",
- "solana-metrics",
- "solana-sdk",
- "solana-version",
- "spl-memo",
- "thiserror",
- "tokio",
-]
-
-[[package]]
-name = "solana-frozen-abi"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c89bcde59ac3e8d4dbf7c4d990b0627b8ca0d25394c4ce17896dde7a1452e40c"
-dependencies = [
- "bs58",
- "bv",
- "generic-array 0.14.4",
- "log",
- "memmap2",
- "rustc_version",
- "serde",
- "serde_derive",
- "sha2 0.9.9",
- "solana-frozen-abi-macro",
- "solana-logger",
- "thiserror",
-]
-
-[[package]]
-name = "solana-frozen-abi-macro"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "56a7d630da35993631ecc4dd155f92d0d58000cdde3d5e2764fe9fd49d20a3a8"
-dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "rustc_version",
- "syn 1.0.75",
-]
-
-[[package]]
-name = "solana-logger"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6eaf925bb665de46f96fcea2c8a900d0d870a96fd1f50cf2bad16e22a1da71c4"
-dependencies = [
- "env_logger",
- "lazy_static",
- "log",
-]
-
-[[package]]
-name = "solana-measure"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ccdb4297b195811bdc95be328fb74e1547ea1d16f2600a200e66bfc2e32eb54"
-dependencies = [
- "log",
- "solana-sdk",
-]
-
-[[package]]
-name = "solana-metrics"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1d7d103dd77acc8cbb39b85c170548bd4f51f19e0931d22f9621c5a1bb57b94c"
-dependencies = [
- "env_logger",
- "gethostname",
- "lazy_static",
- "log",
- "reqwest",
- "solana-sdk",
-]
-
-[[package]]
-name = "solana-net-utils"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "93819a9cb345a8960c8e886811be3dda59f9759f6add8a99d983016a9d06686d"
-dependencies = [
- "bincode",
- "clap",
- "log",
- "nix",
- "rand 0.7.3",
- "serde",
- "serde_derive",
- "socket2",
- "solana-logger",
- "solana-sdk",
- "solana-version",
- "tokio",
- "url",
-]
-
-[[package]]
-name = "solana-perf"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b056da9866e14547ebdccb7a4948c75e9650e3ce8832965b58996f8bee32bea"
-dependencies = [
- "bincode",
- "caps",
- "curve25519-dalek",
- "dlopen",
- "dlopen_derive",
- "lazy_static",
- "libc",
- "log",
- "nix",
- "rand 0.7.3",
- "rayon",
- "serde",
- "solana-logger",
- "solana-metrics",
- "solana-rayon-threadlimit",
- "solana-sdk",
- "solana-vote-program",
-]
-
-[[package]]
-name = "solana-program"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2fc4d7a0baa649a3bda06d6a1cc30bd3d8ac692702a75fa8e76369cf7b3f6329"
-dependencies = [
- "base64 0.13.0",
- "bincode",
- "bitflags",
- "blake3",
- "borsh",
- "borsh-derive",
- "bs58",
- "bv",
- "bytemuck",
- "console_error_panic_hook",
- "console_log",
- "curve25519-dalek",
- "getrandom 0.1.16",
- "itertools",
- "js-sys",
- "lazy_static",
- "libsecp256k1 0.6.0",
- "log",
- "num-derive",
- "num-traits",
- "parking_lot",
- "rand 0.7.3",
- "rustc_version",
- "rustversion",
- "serde",
- "serde_bytes",
- "serde_derive",
- "sha2 0.9.9",
- "sha3",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
- "solana-logger",
- "solana-sdk-macro",
- "thiserror",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "solana-program-runtime"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "012304a7ccc59ed153ebc26470c070371651af22ea06554f4298e2ca60c74028"
-dependencies = [
- "base64 0.13.0",
- "bincode",
- "itertools",
- "libc",
- "libloading",
- "log",
- "num-derive",
- "num-traits",
- "rustc_version",
- "serde",
- "solana-logger",
- "solana-measure",
- "solana-sdk",
- "thiserror",
-]
-
-[[package]]
-name = "solana-rayon-threadlimit"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6248a0a230cd45af4c9f81ea468b95cab1bf163f57219ddce4cf8d062537578e"
-dependencies = [
- "lazy_static",
- "num_cpus",
-]
-
-[[package]]
-name = "solana-remote-wallet"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a03587d5bf5f7bc9302385f9ada8412662cdb93b5e3d40fee2a02553a932277c"
-dependencies = [
- "base32",
- "console 0.15.0",
- "dialoguer",
- "hidapi",
- "log",
- "num-derive",
- "num-traits",
- "parking_lot",
- "qstring",
- "semver",
- "solana-sdk",
- "thiserror",
- "uriparse",
-]
-
-[[package]]
-name = "solana-runtime"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09941a801d47848cf4840be37f1a00ef1dd823e5ab38485c4b3d57a1c3effe10"
-dependencies = [
- "arrayref",
- "bincode",
- "blake3",
- "bv",
- "byteorder",
- "bzip2",
- "crossbeam-channel",
- "dashmap",
- "dir-diff",
- "flate2",
- "fnv",
- "itertools",
- "lazy_static",
- "log",
- "memmap2",
- "num-derive",
- "num-traits",
- "num_cpus",
- "ouroboros",
- "rand 0.7.3",
- "rayon",
- "regex",
- "rustc_version",
- "serde",
- "serde_derive",
- "solana-address-lookup-table-program",
- "solana-bucket-map",
- "solana-compute-budget-program",
- "solana-config-program",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
- "solana-logger",
- "solana-measure",
- "solana-metrics",
- "solana-program-runtime",
- "solana-rayon-threadlimit",
- "solana-sdk",
- "solana-stake-program",
- "solana-vote-program",
- "symlink",
- "tar",
- "tempfile",
- "thiserror",
- "zstd",
-]
-
-[[package]]
-name = "solana-sdk"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "10932f74eeff6804d15e48a1546e40ad14b17ae8a335f9c1c331f94ab40cf3ad"
-dependencies = [
- "assert_matches",
- "base64 0.13.0",
- "bincode",
- "bitflags",
- "borsh",
- "bs58",
- "bytemuck",
- "byteorder",
- "chrono",
- "derivation-path",
- "digest 0.9.0",
- "ed25519-dalek",
- "ed25519-dalek-bip32",
- "generic-array 0.14.4",
- "hmac 0.11.0",
- "itertools",
- "js-sys",
- "lazy_static",
- "libsecp256k1 0.6.0",
- "log",
- "memmap2",
- "num-derive",
- "num-traits",
- "pbkdf2 0.9.0",
- "qstring",
- "rand 0.7.3",
- "rand_chacha 0.2.2",
- "rustc_version",
- "rustversion",
- "serde",
- "serde_bytes",
- "serde_derive",
- "serde_json",
- "sha2 0.9.9",
- "sha3",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
- "solana-logger",
- "solana-program",
- "solana-sdk-macro",
- "thiserror",
- "uriparse",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "solana-sdk-macro"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec22a924c73abe3376a2046715a2f6a9ae4094095b8ea08e8e56e8de198264ad"
-dependencies = [
- "bs58",
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "rustversion",
- "syn 1.0.75",
-]
-
-[[package]]
-name = "solana-stake-program"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "574fd1a039d44c341e297307b483d56899f94bc399da828f89c164da980f735e"
-dependencies = [
- "bincode",
- "log",
- "num-derive",
- "num-traits",
- "rustc_version",
- "serde",
- "serde_derive",
- "solana-config-program",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
- "solana-metrics",
- "solana-program-runtime",
- "solana-sdk",
- "solana-vote-program",
- "thiserror",
-]
-
-[[package]]
-name = "solana-transaction-status"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d6ab72a2e93a45b8582c839bffa3e8a90ccfa35acfe3677633d43a56b7180b05"
-dependencies = [
- "Inflector",
- "base64 0.12.3",
- "bincode",
- "bs58",
- "lazy_static",
- "log",
- "serde",
- "serde_derive",
- "serde_json",
- "solana-account-decoder",
- "solana-measure",
- "solana-metrics",
- "solana-runtime",
- "solana-sdk",
- "solana-vote-program",
- "spl-associated-token-account",
- "spl-memo",
- "spl-token",
- "thiserror",
-]
-
-[[package]]
-name = "solana-version"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4003c93007332afdee7ea64bddd2fa2dc8f12dccd158bba0d51d442c5bc9e5b8"
-dependencies = [
- "log",
- "rustc_version",
- "serde",
- "serde_derive",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
- "solana-sdk",
-]
-
-[[package]]
-name = "solana-vote-program"
-version = "1.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "729763e7fd2d77a2a0053c5e9a978560cbc8849e6f9ebf274ebb5f864867d886"
-dependencies = [
- "bincode",
- "log",
- "num-derive",
- "num-traits",
- "rustc_version",
- "serde",
- "serde_derive",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
- "solana-logger",
- "solana-metrics",
- "solana-program-runtime",
- "solana-sdk",
- "thiserror",
-]
-
-[[package]]
-name = "solitaire"
-version = "0.1.0"
-dependencies = [
- "borsh",
- "byteorder",
- "rocksalt",
- "sha3",
- "solana-program",
-]
-
-[[package]]
-name = "solitaire-client"
-version = "0.1.0"
-dependencies = [
- "borsh",
- "solana-program",
- "solana-sdk",
- "solitaire",
-]
-
-[[package]]
-name = "spin"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
-
-[[package]]
-name = "spl-associated-token-account"
-version = "1.0.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "393e2240d521c3dd770806bff25c2c00d761ac962be106e14e22dd912007f428"
-dependencies = [
- "solana-program",
- "spl-token",
-]
-
-[[package]]
-name = "spl-memo"
-version = "3.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bd0dc6f70db6bacea7ff25870b016a65ba1d1b6013536f08e4fd79a8f9005325"
-dependencies = [
- "solana-program",
-]
-
-[[package]]
-name = "spl-token"
-version = "3.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "93bfdd5bd7c869cb565c7d7635c4fafe189b988a0bdef81063cd9585c6b8dc01"
-dependencies = [
- "arrayref",
- "num-derive",
- "num-traits",
- "num_enum",
- "solana-program",
- "thiserror",
-]
-
-[[package]]
-name = "spl-token-metadata"
-version = "0.0.1"
-dependencies = [
- "borsh",
- "solana-program",
- "spl-token",
-]
-
-[[package]]
-name = "stable_deref_trait"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
-
-[[package]]
-name = "static_assertions"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
-
-[[package]]
-name = "strsim"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
-
-[[package]]
-name = "subtle"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee"
-
-[[package]]
-name = "subtle"
-version = "2.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601"
-
-[[package]]
-name = "symlink"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a7973cce6668464ea31f176d85b13c7ab3bba2cb3b77a2ed26abd7801688010a"
-
-[[package]]
-name = "syn"
-version = "0.15.44"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5"
-dependencies = [
- "proc-macro2 0.4.30",
- "quote 0.6.13",
- "unicode-xid 0.1.0",
-]
-
-[[package]]
-name = "syn"
-version = "1.0.75"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b7f58f7e8eaa0009c5fec437aabf511bd9933e4b2d7407bd05273c01a8906ea7"
-dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "unicode-xid 0.2.2",
-]
-
-[[package]]
-name = "synstructure"
-version = "0.12.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "474aaa926faa1603c40b7885a9eaea29b444d1cb2850cb7c0e37bb1a4182f4fa"
-dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
- "unicode-xid 0.2.2",
-]
-
-[[package]]
-name = "tar"
-version = "0.4.37"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d6f5515d3add52e0bbdcad7b83c388bb36ba7b754dda3b5f5bc2d38640cdba5c"
-dependencies = [
- "filetime",
- "libc",
- "xattr",
-]
-
-[[package]]
-name = "tempfile"
-version = "3.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22"
-dependencies = [
- "cfg-if",
- "libc",
- "rand 0.8.4",
- "redox_syscall",
- "remove_dir_all",
- "winapi",
-]
-
-[[package]]
-name = "termcolor"
-version = "1.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4"
-dependencies = [
- "winapi-util",
-]
-
-[[package]]
-name = "terminal_size"
-version = "0.1.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df"
-dependencies = [
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "textwrap"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
-dependencies = [
- "unicode-width",
-]
-
-[[package]]
-name = "thiserror"
-version = "1.0.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417"
-dependencies = [
- "thiserror-impl",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "1.0.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b"
-dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
-]
-
-[[package]]
-name = "time"
-version = "0.1.43"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438"
-dependencies = [
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "tiny-bip39"
-version = "0.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ffc59cb9dfc85bb312c3a78fd6aa8a8582e310b0fa885d5bb877f6dcc601839d"
-dependencies = [
- "anyhow",
- "hmac 0.8.1",
- "once_cell",
- "pbkdf2 0.4.0",
- "rand 0.7.3",
- "rustc-hash",
- "sha2 0.9.9",
- "thiserror",
- "unicode-normalization",
- "wasm-bindgen",
- "zeroize",
-]
-
-[[package]]
-name = "tinyvec"
-version = "1.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "848a1e1181b9f6753b5e96a092749e29b11d19ede67dfbbd6c7dc7e0f49b5338"
-dependencies = [
- "tinyvec_macros",
-]
-
-[[package]]
-name = "tinyvec_macros"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
-
-[[package]]
-name = "token-bridge"
-version = "0.1.0"
-dependencies = [
- "borsh",
- "bstr",
- "byteorder",
- "hex",
- "hex-literal",
- "libsecp256k1 0.3.5",
- "primitive-types",
- "rand 0.7.3",
- "rocksalt",
- "serde",
- "sha3",
- "solana-client",
- "solana-program",
- "solana-sdk",
- "solitaire",
- "solitaire-client",
- "spl-token",
- "spl-token-metadata",
- "wasm-bindgen",
- "wormhole-bridge-solana",
-]
-
-[[package]]
-name = "tokio"
-version = "1.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "01cf844b23c6131f624accf65ce0e4e9956a8bb329400ea5bcc26ae3a5c20b0b"
-dependencies = [
- "autocfg",
- "bytes",
- "libc",
- "memchr",
- "mio",
- "num_cpus",
- "once_cell",
- "parking_lot",
- "pin-project-lite",
- "signal-hook-registry",
- "tokio-macros",
- "winapi",
-]
-
-[[package]]
-name = "tokio-macros"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "54473be61f4ebe4efd09cec9bd5d16fa51d70ea0192213d754d2d500457db110"
-dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
-]
-
-[[package]]
-name = "tokio-rustls"
-version = "0.23.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a27d5f2b839802bd8267fa19b0530f5a08b9c08cd417976be2a65d130fe1c11b"
-dependencies = [
- "rustls",
- "tokio",
- "webpki",
-]
-
-[[package]]
-name = "tokio-util"
-version = "0.6.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1caa0b0c8d94a049db56b5acf8cba99dc0623aab1b26d5b5f5e2d945846b3592"
-dependencies = [
- "bytes",
- "futures-core",
- "futures-sink",
- "log",
- "pin-project-lite",
- "tokio",
-]
-
-[[package]]
-name = "toml"
-version = "0.5.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "tower-service"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6"
-
-[[package]]
-name = "tracing"
-version = "0.1.26"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d"
-dependencies = [
- "cfg-if",
- "pin-project-lite",
- "tracing-core",
-]
-
-[[package]]
-name = "tracing-core"
-version = "0.1.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2ca517f43f0fb96e0c3072ed5c275fe5eece87e8cb52f4a77b69226d3b1c9df8"
-dependencies = [
- "lazy_static",
-]
-
-[[package]]
-name = "try-lock"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642"
-
-[[package]]
-name = "tungstenite"
-version = "0.16.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ad3713a14ae247f22a728a0456a545df14acf3867f905adff84be99e23b3ad1"
-dependencies = [
- "base64 0.13.0",
- "byteorder",
- "bytes",
- "http",
- "httparse",
- "log",
- "rand 0.8.4",
- "rustls",
- "sha-1",
- "thiserror",
- "url",
- "utf-8",
- "webpki",
- "webpki-roots",
-]
-
-[[package]]
-name = "typenum"
-version = "1.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06"
-
-[[package]]
-name = "uint"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6470ab50f482bde894a037a57064480a246dbfdd5960bd65a44824693f08da5f"
-dependencies = [
- "byteorder",
- "crunchy",
- "hex",
- "static_assertions",
-]
-
-[[package]]
-name = "unicode-bidi"
-version = "0.3.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "246f4c42e67e7a4e3c6106ff716a5d067d4132a642840b242e357e468a2a0085"
-
-[[package]]
-name = "unicode-normalization"
-version = "0.1.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9"
-dependencies = [
- "tinyvec",
-]
-
-[[package]]
-name = "unicode-width"
-version = "0.1.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
-
-[[package]]
-name = "unicode-xid"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
-
-[[package]]
-name = "unicode-xid"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
-
-[[package]]
-name = "untrusted"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a"
-
-[[package]]
-name = "uriparse"
-version = "0.6.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e515b1ada404168e145ac55afba3c42f04cf972201a8552d42e2abb17c1b7221"
-dependencies = [
- "fnv",
- "lazy_static",
-]
-
-[[package]]
-name = "url"
-version = "2.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c"
-dependencies = [
- "form_urlencoded",
- "idna",
- "matches",
- "percent-encoding",
-]
-
-[[package]]
-name = "utf-8"
-version = "0.7.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9"
-
-[[package]]
-name = "vec_map"
-version = "0.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
-
-[[package]]
-name = "version_check"
-version = "0.9.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe"
-
-[[package]]
-name = "walkdir"
-version = "2.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56"
-dependencies = [
- "same-file",
- "winapi",
- "winapi-util",
-]
-
-[[package]]
-name = "want"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0"
-dependencies = [
- "log",
- "try-lock",
-]
-
-[[package]]
-name = "wasi"
-version = "0.9.0+wasi-snapshot-preview1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
-
-[[package]]
-name = "wasi"
-version = "0.10.2+wasi-snapshot-preview1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
-
-[[package]]
-name = "wasm-bindgen"
-version = "0.2.78"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce"
-dependencies = [
- "cfg-if",
- "serde",
- "serde_json",
- "wasm-bindgen-macro",
-]
-
-[[package]]
-name = "wasm-bindgen-backend"
-version = "0.2.78"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b"
-dependencies = [
- "bumpalo",
- "lazy_static",
- "log",
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
- "wasm-bindgen-shared",
-]
-
-[[package]]
-name = "wasm-bindgen-futures"
-version = "0.4.26"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "95fded345a6559c2cfee778d562300c581f7d4ff3edb9b0d230d69800d213972"
-dependencies = [
- "cfg-if",
- "js-sys",
- "wasm-bindgen",
- "web-sys",
-]
-
-[[package]]
-name = "wasm-bindgen-macro"
-version = "0.2.78"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9"
-dependencies = [
- "quote 1.0.9",
- "wasm-bindgen-macro-support",
-]
-
-[[package]]
-name = "wasm-bindgen-macro-support"
-version = "0.2.78"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab"
-dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
- "wasm-bindgen-backend",
- "wasm-bindgen-shared",
-]
-
-[[package]]
-name = "wasm-bindgen-shared"
-version = "0.2.78"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc"
-
-[[package]]
-name = "web-sys"
-version = "0.3.53"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "224b2f6b67919060055ef1a67807367c2066ed520c3862cc013d26cf893a783c"
-dependencies = [
- "js-sys",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "webpki"
-version = "0.22.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd"
-dependencies = [
- "ring",
- "untrusted",
-]
-
-[[package]]
-name = "webpki-roots"
-version = "0.22.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "552ceb903e957524388c4d3475725ff2c8b7960922063af6ce53c9a43da07449"
-dependencies = [
- "webpki",
-]
-
-[[package]]
-name = "winapi"
-version = "0.3.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
-dependencies = [
- "winapi-i686-pc-windows-gnu",
- "winapi-x86_64-pc-windows-gnu",
-]
-
-[[package]]
-name = "winapi-i686-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
-
-[[package]]
-name = "winapi-util"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
-dependencies = [
- "winapi",
-]
-
-[[package]]
-name = "winapi-x86_64-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
-
-[[package]]
-name = "winreg"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69"
-dependencies = [
- "winapi",
-]
-
-[[package]]
-name = "wormhole-bridge-solana"
-version = "0.1.0"
-dependencies = [
- "borsh",
- "byteorder",
- "primitive-types",
- "serde",
- "sha3",
- "solana-program",
- "solitaire",
-]
-
-[[package]]
-name = "xattr"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "244c3741f4240ef46274860397c7c74e50eb23624996930e484c16679633a54c"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "yaml-rust"
-version = "0.4.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85"
-dependencies = [
- "linked-hash-map",
-]
-
-[[package]]
-name = "zeroize"
-version = "1.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "377db0846015f7ae377174787dd452e1c5f5a9050bc6f954911d01f116daa0cd"
-dependencies = [
- "zeroize_derive",
-]
-
-[[package]]
-name = "zeroize_derive"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a2c1e130bebaeab2f23886bf9acbaca14b092408c452543c857f66399cd6dab1"
-dependencies = [
- "proc-macro2 1.0.28",
- "quote 1.0.9",
- "syn 1.0.75",
- "synstructure",
-]
-
-[[package]]
-name = "zstd"
-version = "0.9.2+zstd.1.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2390ea1bf6c038c39674f22d95f0564725fc06034a47129179810b2fc58caa54"
-dependencies = [
- "zstd-safe",
-]
-
-[[package]]
-name = "zstd-safe"
-version = "4.1.3+zstd.1.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e99d81b99fb3c2c2c794e3fe56c305c63d5173a16a46b5850b07c935ffc7db79"
-dependencies = [
- "libc",
- "zstd-sys",
-]
-
-[[package]]
-name = "zstd-sys"
-version = "1.6.2+zstd.1.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2daf2f248d9ea44454bfcb2516534e8b8ad2fc91bf818a1885495fc42bc8ac9f"
-dependencies = [
- "cc",
- "libc",
-]
-
-[[patch.unused]]
-name = "memmap2"
-version = "0.1.0"

+ 0 - 5
solana/modules/token_bridge/Cargo.toml

@@ -1,5 +0,0 @@
-[workspace]
-members = ["program", "client"]
-
-[patch.crates-io]
-memmap2 = { path = "../../bridge/memmap2-rs" }

+ 0 - 21
solana/modules/token_bridge/client/Cargo.toml

@@ -1,21 +0,0 @@
-[package]
-name = "client"
-version = "0.1.0"
-edition = "2018"
-
-[dependencies]
-anyhow = "1.0.40"
-borsh = "=0.9.1"
-token-bridge = { path = "../program", features = ["client"] }
-clap = "2.33.0"
-rand = "0.7.3"
-shellexpand = "2.1.0"
-solana-client = "=1.9.4"
-solana-program = "=1.9.4"
-solana-sdk = "=1.9.4"
-solana-cli-config = "=1.9.4"
-solitaire = { path = "../../../solitaire/program" }
-solitaire-client = { path = "../../../solitaire/client" }
-solana-clap-utils = "=1.9.4"
-hex = "0.4.3"
-spl-token-metadata = { path = "../token-metadata" }

+ 0 - 452
solana/modules/token_bridge/client/src/main.rs

@@ -1,452 +0,0 @@
-
-#![feature(adt_const_params)]
-#![allow(warnings)]
-
-use std::{
-    fmt::Display,
-    mem::size_of,
-    process::exit,
-};
-
-use borsh::BorshDeserialize;
-use clap::{
-    crate_description,
-    crate_name,
-    crate_version,
-    value_t,
-    App,
-    AppSettings,
-    Arg,
-    SubCommand,
-};
-use hex;
-use solana_clap_utils::{
-    input_parsers::{
-        keypair_of,
-        pubkey_of,
-        value_of,
-    },
-    input_validators::{
-        is_keypair,
-        is_pubkey_or_keypair,
-        is_url,
-    },
-};
-use solana_client::{
-    rpc_client::RpcClient,
-    rpc_config::RpcSendTransactionConfig,
-};
-use solana_program::account_info::AccountInfo;
-use solana_sdk::{
-    commitment_config::{
-        CommitmentConfig,
-        CommitmentLevel,
-    },
-    native_token::*,
-    program_error::ProgramError::AccountAlreadyInitialized,
-    pubkey::Pubkey,
-    signature::{
-        read_keypair_file,
-        Keypair,
-        Signer,
-    },
-    system_instruction::transfer,
-    transaction::Transaction,
-};
-use solitaire::{
-    processors::seeded::Seeded,
-    AccountState,
-    Info,
-};
-use solitaire_client::Derive;
-
-struct Config {
-    rpc_client: RpcClient,
-    owner: Keypair,
-    fee_payer: Keypair,
-    commitment_config: CommitmentConfig,
-}
-
-type Error = Box<dyn std::error::Error>;
-type CommmandResult = Result<Option<Transaction>, Error>;
-
-fn command_init_bridge(config: &Config, bridge: &Pubkey, core_bridge: &Pubkey) -> CommmandResult {
-    println!("Initializing Token bridge {}", bridge);
-
-    let minimum_balance_for_rent_exemption = config
-        .rpc_client
-        .get_minimum_balance_for_rent_exemption(size_of::<token_bridge::types::Config>())?;
-
-    let ix = token_bridge::instructions::initialize(*bridge, config.owner.pubkey(), *core_bridge)
-        .unwrap();
-    println!("config account: {}, ", ix.accounts[1].pubkey.to_string());
-    let mut transaction = Transaction::new_with_payer(&[ix], Some(&config.fee_payer.pubkey()));
-
-    let (recent_blockhash, fee_calculator) = config.rpc_client.get_recent_blockhash()?;
-    check_fee_payer_balance(
-        config,
-        minimum_balance_for_rent_exemption + fee_calculator.calculate_fee(&transaction.message()),
-    )?;
-    transaction.sign(&[&config.fee_payer, &config.owner], recent_blockhash);
-    Ok(Some(transaction))
-}
-
-fn command_create_meta(
-    config: &Config,
-    mint: &Pubkey,
-    name: String,
-    symbol: String,
-    uri: String,
-) -> CommmandResult {
-    println!("Creating meta for mint {}", mint);
-
-    let meta_acc = Pubkey::find_program_address(
-        &[
-            "metadata".as_bytes(),
-            spl_token_metadata::id().as_ref(),
-            mint.as_ref(),
-        ],
-        &spl_token_metadata::id(),
-    )
-    .0;
-    println!("Meta account: {}", meta_acc);
-    let ix = spl_token_metadata::instruction::create_metadata_accounts(
-        spl_token_metadata::id(),
-        meta_acc,
-        *mint,
-        config.owner.pubkey(),
-        config.owner.pubkey(),
-        config.owner.pubkey(),
-        name,
-        symbol,
-        uri,
-        None,
-        0,
-        false,
-        false,
-    );
-    let mut transaction = Transaction::new_with_payer(&[ix], Some(&config.fee_payer.pubkey()));
-
-    let (recent_blockhash, _) = config.rpc_client.get_recent_blockhash()?;
-    transaction.sign(&[&config.fee_payer, &config.owner], recent_blockhash);
-    Ok(Some(transaction))
-}
-
-fn main() {
-    let matches = App::new(crate_name!())
-        .about(crate_description!())
-        .version(crate_version!())
-        .setting(AppSettings::SubcommandRequiredElseHelp)
-        .arg({
-            let arg = Arg::with_name("config_file")
-                .short("C")
-                .long("config")
-                .value_name("PATH")
-                .takes_value(true)
-                .global(true)
-                .help("Configuration file to use");
-            if let Some(ref config_file) = *solana_cli_config::CONFIG_FILE {
-                arg.default_value(&config_file)
-            } else {
-                arg
-            }
-        })
-        .arg(
-            Arg::with_name("json_rpc_url")
-                .long("url")
-                .value_name("URL")
-                .takes_value(true)
-                .validator(is_url)
-                .help("JSON RPC URL for the cluster.  Default from the configuration file."),
-        )
-        .arg(
-            Arg::with_name("owner")
-                .long("owner")
-                .value_name("KEYPAIR")
-                .validator(is_keypair)
-                .takes_value(true)
-                .help(
-                    "Specify the contract payer account. \
-                     This may be a keypair file, the ASK keyword. \
-                     Defaults to the client keypair.",
-                ),
-        )
-        .arg(
-            Arg::with_name("fee_payer")
-                .long("fee-payer")
-                .value_name("KEYPAIR")
-                .validator(is_keypair)
-                .takes_value(true)
-                .help(
-                    "Specify the fee-payer account. \
-                     This may be a keypair file, the ASK keyword. \
-                     Defaults to the client keypair.",
-                ),
-        )
-        .subcommand(
-            SubCommand::with_name("create-bridge")
-                .about("Create a new bridge")
-                .arg(
-                    Arg::with_name("bridge")
-                        .long("bridge")
-                        .value_name("BRIDGE_KEY")
-                        .validator(is_pubkey_or_keypair)
-                        .takes_value(true)
-                        .index(1)
-                        .required(true)
-                        .help("Specify the token bridge program address"),
-                )
-                .arg(
-                    Arg::with_name("core-bridge")
-                        .validator(is_pubkey_or_keypair)
-                        .value_name("CORE_BRIDGE_KEY")
-                        .takes_value(true)
-                        .index(2)
-                        .required(true)
-                        .help("Address of the Wormhole core bridge program"),
-                ),
-        )
-        .subcommand(
-            SubCommand::with_name("emitter")
-                .about("Get the derived emitter used for contract messages")
-                .arg(
-                    Arg::with_name("bridge")
-                        .long("bridge")
-                        .value_name("BRIDGE_KEY")
-                        .validator(is_pubkey_or_keypair)
-                        .takes_value(true)
-                        .index(1)
-                        .required(true)
-                        .help("Specify the token bridge program address"),
-                ),
-        )
-        .subcommand(
-            SubCommand::with_name("metadata")
-                .about("Get the derived metadata associated with token mints")
-                .arg(
-                    Arg::with_name("mint")
-                        .long("mint")
-                        .value_name("MINT_KEY")
-                        .validator(is_pubkey_or_keypair)
-                        .takes_value(true)
-                        .index(1)
-                        .required(true)
-                        .help("Specify the token mint to derive metadata for"),
-                ),
-        )
-        .subcommand(
-            SubCommand::with_name("create-meta")
-                .about("Create token metadata")
-                .arg(
-                    Arg::with_name("mint")
-                        .long("mint")
-                        .value_name("MINT")
-                        .validator(is_pubkey_or_keypair)
-                        .takes_value(true)
-                        .index(1)
-                        .required(true)
-                        .help("Specify the mint address"),
-                )
-                .arg(
-                    Arg::with_name("name")
-                        .long("name")
-                        .value_name("NAME")
-                        .takes_value(true)
-                        .index(2)
-                        .required(true)
-                        .help("Name of the token"),
-                )
-                .arg(
-                    Arg::with_name("symbol")
-                        .long("symbol")
-                        .value_name("SYMBOL")
-                        .takes_value(true)
-                        .index(3)
-                        .required(true)
-                        .help("Symbol of the token"),
-                )
-                .arg(
-                    Arg::with_name("uri")
-                        .long("uri")
-                        .value_name("URI")
-                        .takes_value(true)
-                        .index(4)
-                        .required(true)
-                        .help("URI of the token metadata"),
-                ),
-        )
-        .get_matches();
-
-    let config = {
-        let cli_config = if let Some(config_file) = matches.value_of("config_file") {
-            solana_cli_config::Config::load(config_file).unwrap_or_default()
-        } else {
-            solana_cli_config::Config::default()
-        };
-        let json_rpc_url = value_t!(matches, "json_rpc_url", String)
-            .unwrap_or_else(|_| cli_config.json_rpc_url.clone());
-
-        let client_keypair = || {
-            read_keypair_file(&cli_config.keypair_path).unwrap_or_else(|err| {
-                eprintln!("Unable to read {}: {}", cli_config.keypair_path, err);
-                exit(1)
-            })
-        };
-
-        let owner = keypair_of(&matches, "owner").unwrap_or_else(client_keypair);
-        let fee_payer = keypair_of(&matches, "fee_payer").unwrap_or_else(client_keypair);
-
-        Config {
-            rpc_client: RpcClient::new(json_rpc_url),
-            owner,
-            fee_payer,
-            commitment_config: CommitmentConfig::processed(),
-        }
-    };
-
-    let _ = match matches.subcommand() {
-        ("create-bridge", Some(arg_matches)) => {
-            let bridge = pubkey_of(arg_matches, "bridge").unwrap();
-            let core_bridge = pubkey_of(arg_matches, "core-bridge").unwrap();
-
-            command_init_bridge(&config, &bridge, &core_bridge)
-        }
-        ("create-meta", Some(arg_matches)) => {
-            let mint = pubkey_of(arg_matches, "mint").unwrap();
-            let name: String = value_of(arg_matches, "name").unwrap();
-            let symbol: String = value_of(arg_matches, "symbol").unwrap();
-            let uri: String = value_of(arg_matches, "uri").unwrap();
-
-            command_create_meta(&config, &mint, name, symbol, uri)
-        }
-        ("emitter", Some(arg_matches)) => {
-            let bridge = pubkey_of(arg_matches, "bridge").unwrap();
-            let emitter = <Derive<Info<'_>, "emitter">>::key(None, &bridge);
-            println!("Emitter Key: {}", emitter);
-
-            Ok(None)
-        }
-        ("metadata", Some(arg_matches)) => {
-            let mint = pubkey_of(arg_matches, "mint").unwrap();
-            let meta_acc = Pubkey::find_program_address(
-                &[
-                    "metadata".as_bytes(),
-                    spl_token_metadata::id().as_ref(),
-                    mint.as_ref(),
-                ],
-                &spl_token_metadata::id(),
-            )
-            .0;
-            let meta_info = config.rpc_client.get_account(&meta_acc).unwrap();
-            let meta_info = spl_token_metadata::state::Metadata::from_bytes(&meta_info.data).unwrap();
-            println!("Key: {:?}", meta_info.key);
-            println!("Mint: {}", meta_info.mint);
-            println!("Metadata Key: {}", meta_acc);
-            println!("Update Authority: {}", meta_info.update_authority);
-            println!("Name: {}", meta_info.data.name);
-            println!("Symbol: {}", meta_info.data.symbol);
-            println!("URI: {}", meta_info.data.uri);
-            println!("Mutable: {}", meta_info.is_mutable);
-
-            Ok(None)
-        }
-
-        _ => unreachable!(),
-    }
-    .and_then(|transaction| {
-        if let Some(transaction) = transaction {
-            let signature = config
-                .rpc_client
-                .send_and_confirm_transaction_with_spinner_and_config(
-                    &transaction,
-                    config.commitment_config,
-                    RpcSendTransactionConfig {
-                        skip_preflight: true,
-                        preflight_commitment: None,
-                        encoding: None,
-                        max_retries: None,
-                    },
-                )?;
-            println!("Signature: {}", signature);
-        }
-        Ok(())
-    })
-    .map_err(|err| {
-        eprintln!("{}", err);
-        exit(1);
-    });
-}
-
-pub fn is_u8<T>(amount: T) -> Result<(), String>
-where
-    T: AsRef<str> + Display,
-{
-    if amount.as_ref().parse::<u8>().is_ok() {
-        Ok(())
-    } else {
-        Err(format!(
-            "Unable to parse input amount as integer, provided: {}",
-            amount
-        ))
-    }
-}
-
-pub fn is_u32<T>(amount: T) -> Result<(), String>
-where
-    T: AsRef<str> + Display,
-{
-    if amount.as_ref().parse::<u32>().is_ok() {
-        Ok(())
-    } else {
-        Err(format!(
-            "Unable to parse input amount as integer, provided: {}",
-            amount
-        ))
-    }
-}
-
-pub fn is_u64<T>(amount: T) -> Result<(), String>
-where
-    T: AsRef<str> + Display,
-{
-    if amount.as_ref().parse::<u64>().is_ok() {
-        Ok(())
-    } else {
-        Err(format!(
-            "Unable to parse input amount as integer, provided: {}",
-            amount
-        ))
-    }
-}
-
-pub fn is_hex<T>(value: T) -> Result<(), String>
-where
-    T: AsRef<str> + Display,
-{
-    hex::decode(value.to_string())
-        .map(|_| ())
-        .map_err(|e| format!("{}", e))
-}
-
-fn check_fee_payer_balance(config: &Config, required_balance: u64) -> Result<(), Error> {
-    let balance = config
-        .rpc_client
-        .get_balance_with_commitment(
-            &config.fee_payer.pubkey(),
-            CommitmentConfig {
-                commitment: CommitmentLevel::Processed,
-            },
-        )?
-        .value;
-    if balance < required_balance {
-        Err(format!(
-            "Fee payer, {}, has insufficient balance: {} required, {} available",
-            config.fee_payer.pubkey(),
-            lamports_to_sol(required_balance),
-            lamports_to_sol(balance)
-        )
-        .into())
-    } else {
-        Ok(())
-    }
-}

+ 0 - 43
solana/modules/token_bridge/program/Cargo.toml

@@ -1,43 +0,0 @@
-[package]
-name = "token-bridge"
-version = "0.1.0"
-description = "Created with Rocksalt"
-edition = "2018"
-
-[lib]
-crate-type = ["cdylib", "lib"]
-name = "token_bridge"
-
-[features]
-no-entrypoint = ["solitaire/no-entrypoint", "rand"]
-trace = ["solitaire/trace"]
-wasm = ["no-entrypoint", "wasm-bindgen"]
-client = ["solitaire-client", "solitaire/client", "no-entrypoint"]
-cpi = ["no-entrypoint"]
-default = []
-
-[dependencies]
-wormhole-bridge-solana = { path = "../../../bridge/program", features = ["no-entrypoint", "cpi"] }
-borsh = "=0.9.1"
-bstr = "0.2.16"
-byteorder = "1.4.3"
-rocksalt = { path = "../../../solitaire/rocksalt" }
-solitaire = { path = "../../../solitaire/program" }
-sha3 = "0.9.1"
-solana-program = "*"
-spl-token = { version = "=3.2.0", features = ["no-entrypoint"] }
-primitive-types = { version = "0.9.0", default-features = false }
-solitaire-client = { path = "../../../solitaire/client", optional = true }
-spl-token-metadata = { path = "../token-metadata" }
-wasm-bindgen = { version = "0.2.74", features = ["serde-serialize"], optional = true }
-serde = { version = "1.0", features = ["derive"] }
-rand = { version = "0.7.3", optional = true }
-
-[dev-dependencies]
-hex = "*"
-hex-literal = "0.3.1"
-libsecp256k1 = { version = "0.3.5", features = [] }
-solana-client = "=1.9.4"
-solana-sdk = "=1.9.4"
-spl-token = { version = "=3.2.0", features = ["no-entrypoint"] }
-spl-token-metadata = { path = "../token-metadata" }

+ 0 - 2
solana/modules/token_bridge/program/Xargo.toml

@@ -1,2 +0,0 @@
-[target.bpfel-unknown-unknown.dependencies.std]
-features = []

+ 0 - 107
solana/modules/token_bridge/program/src/accounts.rs

@@ -1,107 +0,0 @@
-use crate::types::*;
-use bridge::{
-    accounts::BridgeData,
-    api::ForeignAddress,
-    vaa::{
-        DeserializePayload,
-        PayloadMessage,
-    },
-};
-use solana_program::pubkey::Pubkey;
-use solitaire::{
-    processors::seeded::Seeded,
-    *,
-};
-
-pub type AuthoritySigner<'b> = Derive<Info<'b>, "authority_signer">;
-pub type CustodySigner<'b> = Derive<Info<'b>, "custody_signer">;
-pub type MintSigner<'b> = Derive<Info<'b>, "mint_signer">;
-
-pub type CoreBridge<'a, const State: AccountState> = Data<'a, BridgeData, { State }>;
-
-pub type EmitterAccount<'b> = Derive<Info<'b>, "emitter">;
-
-pub type ConfigAccount<'b, const State: AccountState> =
-    Derive<Data<'b, Config, { State }>, "config">;
-
-pub type CustodyAccount<'b, const State: AccountState> = Data<'b, SplAccount, { State }>;
-
-pub struct CustodyAccountDerivationData {
-    pub mint: Pubkey,
-}
-
-impl<'b, const State: AccountState> Seeded<&CustodyAccountDerivationData>
-    for CustodyAccount<'b, { State }>
-{
-    fn seeds(accs: &CustodyAccountDerivationData) -> Vec<Vec<u8>> {
-        vec![accs.mint.to_bytes().to_vec()]
-    }
-}
-
-pub type WrappedMint<'b, const State: AccountState> = Data<'b, SplMint, { State }>;
-
-pub struct WrappedDerivationData {
-    pub token_chain: ChainID,
-    pub token_address: ForeignAddress,
-}
-
-impl<'b, const State: AccountState> Seeded<&WrappedDerivationData> for WrappedMint<'b, { State }> {
-    fn seeds(data: &WrappedDerivationData) -> Vec<Vec<u8>> {
-        vec![
-            String::from("wrapped").as_bytes().to_vec(),
-            data.token_chain.to_be_bytes().to_vec(),
-            data.token_address.to_vec(),
-        ]
-    }
-}
-
-pub type WrappedTokenMeta<'b, const State: AccountState> = Data<'b, WrappedMeta, { State }>;
-
-pub struct WrappedMetaDerivationData {
-    pub mint_key: Pubkey,
-}
-
-impl<'b, const State: AccountState> Seeded<&WrappedMetaDerivationData>
-    for WrappedTokenMeta<'b, { State }>
-{
-    fn seeds(data: &WrappedMetaDerivationData) -> Vec<Vec<u8>> {
-        vec![
-            String::from("meta").as_bytes().to_vec(),
-            data.mint_key.to_bytes().to_vec(),
-        ]
-    }
-}
-
-/// Registered chain endpoint
-pub type Endpoint<'b, const State: AccountState> = Data<'b, EndpointRegistration, { State }>;
-
-pub struct EndpointDerivationData {
-    pub emitter_chain: u16,
-    pub emitter_address: ForeignAddress,
-}
-
-/// Seeded implementation based on an incoming VAA
-impl<'b, const State: AccountState> Seeded<&EndpointDerivationData> for Endpoint<'b, { State }> {
-    fn seeds(data: &EndpointDerivationData) -> Vec<Vec<u8>> {
-        vec![
-            data.emitter_chain.to_be_bytes().to_vec(),
-            data.emitter_address.to_vec(),
-        ]
-    }
-}
-
-pub type SplTokenMeta<'b> = Info<'b>;
-
-pub struct SplTokenMetaDerivationData {
-    pub mint: Pubkey,
-}
-
-impl<'b> Seeded<&SplTokenMetaDerivationData> for SplTokenMeta<'b> {
-    fn seeds(data: &SplTokenMetaDerivationData) -> Vec<Vec<u8>> {
-        vec![
-            "metadata".as_bytes().to_vec(),
-            spl_token_metadata::id().as_ref().to_vec(),
-            data.mint.as_ref().to_vec(),
-        ]
-    }
-}

+ 0 - 13
solana/modules/token_bridge/program/src/api.rs

@@ -1,13 +0,0 @@
-pub mod attest;
-pub mod complete_transfer;
-pub mod create_wrapped;
-pub mod governance;
-pub mod initialize;
-pub mod transfer;
-
-pub use attest::*;
-pub use complete_transfer::*;
-pub use create_wrapped::*;
-pub use governance::*;
-pub use initialize::*;
-pub use transfer::*;

+ 0 - 194
solana/modules/token_bridge/program/src/api/attest.rs

@@ -1,194 +0,0 @@
-use crate::{
-    accounts::{
-        ConfigAccount,
-        CoreBridge,
-        EmitterAccount,
-        SplTokenMeta,
-        SplTokenMetaDerivationData,
-        WrappedMetaDerivationData,
-        WrappedTokenMeta,
-    },
-    messages::{
-        PayloadAssetMeta,
-        PayloadTransfer,
-    },
-    types::*,
-    TokenBridgeError::{
-        self,
-        *,
-    },
-};
-use bridge::{
-    accounts::Bridge,
-    api::{
-        PostMessage,
-        PostMessageData,
-    },
-    types::ConsistencyLevel,
-    vaa::SerializePayload,
-    CHAIN_ID_SOLANA,
-};
-use primitive_types::U256;
-use solana_program::{
-    account_info::AccountInfo,
-    instruction::{
-        AccountMeta,
-        Instruction,
-    },
-    program::{
-        invoke,
-        invoke_signed,
-    },
-    program_error::ProgramError,
-    pubkey::Pubkey,
-    sysvar::clock::Clock,
-};
-use solitaire::{
-    processors::seeded::{
-        invoke_seeded,
-        Owned,
-        Seeded,
-    },
-    CreationLamports::Exempt,
-    *,
-};
-use spl_token::{
-    error::TokenError::OwnerMismatch,
-    state::{
-        Account,
-        Mint,
-    },
-};
-use spl_token_metadata::state::Metadata;
-use std::ops::{
-    Deref,
-    DerefMut,
-};
-
-#[derive(FromAccounts)]
-pub struct AttestToken<'b> {
-    pub payer: Mut<Signer<AccountInfo<'b>>>,
-
-    pub config: Mut<ConfigAccount<'b, { AccountState::Initialized }>>,
-
-    /// Mint to attest
-    pub mint: Data<'b, SplMint, { AccountState::Initialized }>,
-    pub wrapped_meta: WrappedTokenMeta<'b, { AccountState::Uninitialized }>,
-
-    /// SPL Metadata for the associated Mint
-    pub spl_metadata: SplTokenMeta<'b>,
-
-    /// CPI Context
-    pub bridge: Mut<CoreBridge<'b, { AccountState::Initialized }>>,
-
-    /// Account to store the posted message
-    pub message: Signer<Mut<Info<'b>>>,
-
-    /// Emitter of the VAA
-    pub emitter: EmitterAccount<'b>,
-
-    /// Tracker for the emitter sequence
-    pub sequence: Mut<Info<'b>>,
-
-    /// Account to collect tx fee
-    pub fee_collector: Mut<Info<'b>>,
-
-    pub clock: Sysvar<'b, Clock>,
-}
-
-impl<'b> InstructionContext<'b> for AttestToken<'b> {
-}
-
-impl<'a> From<&AttestToken<'a>> for WrappedMetaDerivationData {
-    fn from(accs: &AttestToken<'a>) -> Self {
-        WrappedMetaDerivationData {
-            mint_key: *accs.mint.info().key,
-        }
-    }
-}
-
-impl<'a> From<&AttestToken<'a>> for SplTokenMetaDerivationData {
-    fn from(accs: &AttestToken<'a>) -> Self {
-        SplTokenMetaDerivationData {
-            mint: *accs.mint.info().key,
-        }
-    }
-}
-
-#[derive(BorshDeserialize, BorshSerialize, Default)]
-pub struct AttestTokenData {
-    pub nonce: u32,
-}
-
-pub fn attest_token(
-    ctx: &ExecutionContext,
-    accs: &mut AttestToken,
-    data: AttestTokenData,
-) -> Result<()> {
-    // Pay fee
-    let transfer_ix = solana_program::system_instruction::transfer(
-        accs.payer.key,
-        accs.fee_collector.key,
-        accs.bridge.config.fee,
-    );
-
-    invoke(&transfer_ix, ctx.accounts)?;
-
-    // Enfoce wrapped meta to be uninitialized.
-    let derivation_data: WrappedMetaDerivationData = (&*accs).into();
-    accs.wrapped_meta
-        .verify_derivation(ctx.program_id, &derivation_data)?;
-
-    // Create Asset Metadata
-    let mut payload = PayloadAssetMeta {
-        token_address: accs.mint.info().key.to_bytes(),
-        token_chain: CHAIN_ID_SOLANA,
-        decimals: accs.mint.decimals,
-        symbol: "".to_string(),
-        name: "".to_string(),
-    };
-
-    // Assign metadata if an SPL Metadata account exists for the SPL token in question.
-    if !accs.spl_metadata.data_is_empty() {
-        let derivation_data: SplTokenMetaDerivationData = (&*accs).into();
-        accs.spl_metadata
-            .verify_derivation(&spl_token_metadata::id(), &derivation_data)?;
-
-        if *accs.spl_metadata.owner != spl_token_metadata::id() {
-            return Err(WrongAccountOwner.into());
-        }
-
-        let metadata: Metadata =
-            Metadata::from_account_info(accs.spl_metadata.info()).ok_or(InvalidMetadata)?;
-        payload.name = metadata.data.name.clone();
-        payload.symbol = metadata.data.symbol.clone();
-    }
-
-    let params = (
-        bridge::instruction::Instruction::PostMessage,
-        PostMessageData {
-            nonce: data.nonce,
-            payload: payload.try_to_vec()?,
-            consistency_level: ConsistencyLevel::Finalized,
-        },
-    );
-
-    let ix = Instruction::new_with_bytes(
-        accs.config.wormhole_bridge,
-        params.try_to_vec()?.as_slice(),
-        vec![
-            AccountMeta::new(*accs.bridge.info().key, false),
-            AccountMeta::new(*accs.message.key, true),
-            AccountMeta::new_readonly(*accs.emitter.key, true),
-            AccountMeta::new(*accs.sequence.key, false),
-            AccountMeta::new(*accs.payer.key, true),
-            AccountMeta::new(*accs.fee_collector.key, false),
-            AccountMeta::new_readonly(*accs.clock.info().key, false),
-            AccountMeta::new_readonly(solana_program::system_program::id(), false),
-            AccountMeta::new_readonly(solana_program::sysvar::rent::ID, false),
-        ],
-    );
-    invoke_seeded(&ix, ctx, &accs.emitter, None)?;
-
-    Ok(())
-}

+ 0 - 277
solana/modules/token_bridge/program/src/api/complete_transfer.rs

@@ -1,277 +0,0 @@
-use crate::{
-    accounts::{
-        ConfigAccount,
-        CustodyAccount,
-        CustodyAccountDerivationData,
-        CustodySigner,
-        Endpoint,
-        EndpointDerivationData,
-        MintSigner,
-        WrappedDerivationData,
-        WrappedMetaDerivationData,
-        WrappedMint,
-        WrappedTokenMeta,
-    },
-    messages::PayloadTransfer,
-    types::*,
-    TokenBridgeError::*,
-};
-use bridge::{
-    vaa::ClaimableVAA,
-    CHAIN_ID_SOLANA,
-};
-use solana_program::{
-    account_info::AccountInfo,
-    program::invoke_signed,
-    program_error::ProgramError,
-    pubkey::Pubkey,
-};
-use solitaire::{
-    processors::seeded::{
-        invoke_seeded,
-        Seeded,
-    },
-    CreationLamports::Exempt,
-    *,
-};
-use spl_token::state::{
-    Account,
-    Mint,
-};
-use std::ops::{
-    Deref,
-    DerefMut,
-};
-
-#[derive(FromAccounts)]
-pub struct CompleteNative<'b> {
-    pub payer: Mut<Signer<AccountInfo<'b>>>,
-    pub config: ConfigAccount<'b, { AccountState::Initialized }>,
-
-    pub vaa: ClaimableVAA<'b, PayloadTransfer>,
-    pub chain_registration: Endpoint<'b, { AccountState::Initialized }>,
-
-    pub to: Mut<Data<'b, SplAccount, { AccountState::Initialized }>>,
-    pub to_fees: Mut<Data<'b, SplAccount, { AccountState::Initialized }>>,
-    pub custody: Mut<CustodyAccount<'b, { AccountState::Initialized }>>,
-    pub mint: Data<'b, SplMint, { AccountState::Initialized }>,
-
-    pub custody_signer: CustodySigner<'b>,
-}
-
-impl<'a> From<&CompleteNative<'a>> for EndpointDerivationData {
-    fn from(accs: &CompleteNative<'a>) -> Self {
-        EndpointDerivationData {
-            emitter_chain: accs.vaa.meta().emitter_chain,
-            emitter_address: accs.vaa.meta().emitter_address,
-        }
-    }
-}
-
-impl<'a> From<&CompleteNative<'a>> for CustodyAccountDerivationData {
-    fn from(accs: &CompleteNative<'a>) -> Self {
-        CustodyAccountDerivationData {
-            mint: *accs.mint.info().key,
-        }
-    }
-}
-
-impl<'b> InstructionContext<'b> for CompleteNative<'b> {
-}
-
-#[derive(BorshDeserialize, BorshSerialize, Default)]
-pub struct CompleteNativeData {}
-
-pub fn complete_native(
-    ctx: &ExecutionContext,
-    accs: &mut CompleteNative,
-    data: CompleteNativeData,
-) -> Result<()> {
-    // Verify the chain registration
-    let derivation_data: EndpointDerivationData = (&*accs).into();
-    accs.chain_registration
-        .verify_derivation(ctx.program_id, &derivation_data)?;
-
-    // Verify that the custody account is derived correctly
-    let derivation_data: CustodyAccountDerivationData = (&*accs).into();
-    accs.custody
-        .verify_derivation(ctx.program_id, &derivation_data)?;
-
-    // Verify mints
-    if *accs.mint.info().key != accs.to.mint {
-        return Err(InvalidMint.into());
-    }
-    if *accs.mint.info().key != accs.to_fees.mint {
-        return Err(InvalidMint.into());
-    }
-    if *accs.mint.info().key != accs.custody.mint {
-        return Err(InvalidMint.into());
-    }
-    if *accs.custody_signer.key != accs.custody.owner {
-        return Err(WrongAccountOwner.into());
-    }
-
-    // Verify VAA
-    if accs.vaa.token_address != accs.mint.info().key.to_bytes() {
-        return Err(InvalidMint.into());
-    }
-    if accs.vaa.token_chain != 1 {
-        return Err(InvalidChain.into());
-    }
-    if accs.vaa.to_chain != CHAIN_ID_SOLANA {
-        return Err(InvalidChain.into());
-    }
-    if accs.vaa.to != accs.to.info().key.to_bytes() {
-        return Err(InvalidRecipient.into());
-    }
-
-    // Prevent vaa double signing
-    accs.vaa.verify(ctx.program_id)?;
-    accs.vaa.claim(ctx, accs.payer.key)?;
-
-    let mut amount = accs.vaa.amount.as_u64();
-    let mut fee = accs.vaa.fee.as_u64();
-
-    // Wormhole always caps transfers at 8 decimals; un-truncate if the local token has more
-    if accs.mint.decimals > 8 {
-        amount *= 10u64.pow((accs.mint.decimals - 8) as u32);
-        fee *= 10u64.pow((accs.mint.decimals - 8) as u32);
-    }
-
-    // Transfer tokens
-    let transfer_ix = spl_token::instruction::transfer(
-        &spl_token::id(),
-        accs.custody.info().key,
-        accs.to.info().key,
-        accs.custody_signer.key,
-        &[],
-        amount.checked_sub(fee).unwrap(),
-    )?;
-    invoke_seeded(&transfer_ix, ctx, &accs.custody_signer, None)?;
-
-    // Transfer fees
-    let transfer_ix = spl_token::instruction::transfer(
-        &spl_token::id(),
-        accs.custody.info().key,
-        accs.to_fees.info().key,
-        accs.custody_signer.key,
-        &[],
-        fee,
-    )?;
-    invoke_seeded(&transfer_ix, ctx, &accs.custody_signer, None)?;
-
-    Ok(())
-}
-
-#[derive(FromAccounts)]
-pub struct CompleteWrapped<'b> {
-    pub payer: Mut<Signer<AccountInfo<'b>>>,
-    pub config: ConfigAccount<'b, { AccountState::Initialized }>,
-
-    // Signed message for the transfer
-    pub vaa: ClaimableVAA<'b, PayloadTransfer>,
-
-    pub chain_registration: Endpoint<'b, { AccountState::Initialized }>,
-
-    pub to: Mut<Data<'b, SplAccount, { AccountState::Initialized }>>,
-    pub to_fees: Mut<Data<'b, SplAccount, { AccountState::Initialized }>>,
-    pub mint: Mut<WrappedMint<'b, { AccountState::Initialized }>>,
-    pub wrapped_meta: WrappedTokenMeta<'b, { AccountState::Initialized }>,
-
-    pub mint_authority: MintSigner<'b>,
-}
-
-impl<'a> From<&CompleteWrapped<'a>> for EndpointDerivationData {
-    fn from(accs: &CompleteWrapped<'a>) -> Self {
-        EndpointDerivationData {
-            emitter_chain: accs.vaa.meta().emitter_chain,
-            emitter_address: accs.vaa.meta().emitter_address,
-        }
-    }
-}
-
-impl<'a> From<&CompleteWrapped<'a>> for WrappedDerivationData {
-    fn from(accs: &CompleteWrapped<'a>) -> Self {
-        WrappedDerivationData {
-            token_chain: accs.vaa.token_chain,
-            token_address: accs.vaa.token_address,
-        }
-    }
-}
-
-impl<'b> InstructionContext<'b> for CompleteWrapped<'b> {
-}
-
-#[derive(BorshDeserialize, BorshSerialize, Default)]
-pub struct CompleteWrappedData {}
-
-pub fn complete_wrapped(
-    ctx: &ExecutionContext,
-    accs: &mut CompleteWrapped,
-    data: CompleteWrappedData,
-) -> Result<()> {
-    // Verify the chain registration
-    let derivation_data: EndpointDerivationData = (&*accs).into();
-    accs.chain_registration
-        .verify_derivation(ctx.program_id, &derivation_data)?;
-
-    // Verify mint
-    accs.wrapped_meta.verify_derivation(
-        ctx.program_id,
-        &WrappedMetaDerivationData {
-            mint_key: *accs.mint.info().key,
-        },
-    )?;
-    if accs.wrapped_meta.token_address != accs.vaa.token_address
-        || accs.wrapped_meta.chain != accs.vaa.token_chain
-    {
-        return Err(InvalidMint.into());
-    }
-
-    // Verify mints
-    if *accs.mint.info().key != accs.to.mint {
-        return Err(InvalidMint.into());
-    }
-    if *accs.mint.info().key != accs.to_fees.mint {
-        return Err(InvalidMint.into());
-    }
-
-    // Verify VAA
-    if accs.vaa.to_chain != CHAIN_ID_SOLANA {
-        return Err(InvalidChain.into());
-    }
-    if accs.vaa.to != accs.to.info().key.to_bytes() {
-        return Err(InvalidRecipient.into());
-    }
-
-    accs.vaa.verify(ctx.program_id)?;
-    accs.vaa.claim(ctx, accs.payer.key)?;
-
-    // Mint tokens
-    let mint_ix = spl_token::instruction::mint_to(
-        &spl_token::id(),
-        accs.mint.info().key,
-        accs.to.info().key,
-        accs.mint_authority.key,
-        &[],
-        accs.vaa
-            .amount
-            .as_u64()
-            .checked_sub(accs.vaa.fee.as_u64())
-            .unwrap(),
-    )?;
-    invoke_seeded(&mint_ix, ctx, &accs.mint_authority, None)?;
-
-    // Mint fees
-    let mint_ix = spl_token::instruction::mint_to(
-        &spl_token::id(),
-        accs.mint.info().key,
-        accs.to_fees.info().key,
-        accs.mint_authority.key,
-        &[],
-        accs.vaa.fee.as_u64(),
-    )?;
-    invoke_seeded(&mint_ix, ctx, &accs.mint_authority, None)?;
-
-    Ok(())
-}

+ 0 - 291
solana/modules/token_bridge/program/src/api/create_wrapped.rs

@@ -1,291 +0,0 @@
-use crate::{
-    accounts::{
-        ConfigAccount,
-        Endpoint,
-        EndpointDerivationData,
-        MintSigner,
-        SplTokenMeta,
-        SplTokenMetaDerivationData,
-        WrappedDerivationData,
-        WrappedMetaDerivationData,
-        WrappedMint,
-        WrappedTokenMeta,
-    },
-    messages::PayloadAssetMeta,
-    types::*,
-    TokenBridgeError::{
-        InvalidChain,
-        InvalidMetadata,
-    },
-};
-use bridge::{
-    vaa::ClaimableVAA,
-    CHAIN_ID_SOLANA,
-};
-use solana_program::{
-    account_info::AccountInfo,
-    program::invoke_signed,
-    program_error::ProgramError,
-    pubkey::Pubkey,
-};
-use solitaire::{
-    processors::seeded::{
-        invoke_seeded,
-        Seeded,
-    },
-    CreationLamports::Exempt,
-    *,
-};
-use spl_token::{
-    error::TokenError::OwnerMismatch,
-    state::{
-        Account,
-        Mint,
-    },
-};
-use spl_token_metadata::state::{
-    Data as SplData,
-    Metadata,
-};
-use std::{
-    cmp::min,
-    ops::{
-        Deref,
-        DerefMut,
-    },
-};
-
-#[derive(FromAccounts)]
-pub struct CreateWrapped<'b> {
-    pub payer: Mut<Signer<AccountInfo<'b>>>,
-    pub config: ConfigAccount<'b, { AccountState::Initialized }>,
-
-    pub chain_registration: Endpoint<'b, { AccountState::Initialized }>,
-    pub vaa: ClaimableVAA<'b, PayloadAssetMeta>,
-
-    // New Wrapped
-    pub mint: Mut<WrappedMint<'b, { AccountState::MaybeInitialized }>>,
-    pub meta: Mut<WrappedTokenMeta<'b, { AccountState::MaybeInitialized }>>,
-
-    /// SPL Metadata for the associated Mint
-    pub spl_metadata: Mut<SplTokenMeta<'b>>,
-
-    pub mint_authority: MintSigner<'b>,
-}
-
-impl<'a> From<&CreateWrapped<'a>> for EndpointDerivationData {
-    fn from(accs: &CreateWrapped<'a>) -> Self {
-        EndpointDerivationData {
-            emitter_chain: accs.vaa.meta().emitter_chain,
-            emitter_address: accs.vaa.meta().emitter_address,
-        }
-    }
-}
-
-impl<'a> From<&CreateWrapped<'a>> for WrappedDerivationData {
-    fn from(accs: &CreateWrapped<'a>) -> Self {
-        WrappedDerivationData {
-            token_chain: accs.vaa.token_chain,
-            token_address: accs.vaa.token_address,
-        }
-    }
-}
-
-impl<'a> From<&CreateWrapped<'a>> for WrappedMetaDerivationData {
-    fn from(accs: &CreateWrapped<'a>) -> Self {
-        WrappedMetaDerivationData {
-            mint_key: *accs.mint.info().key,
-        }
-    }
-}
-
-impl<'b> InstructionContext<'b> for CreateWrapped<'b> {
-}
-
-#[derive(BorshDeserialize, BorshSerialize, Default)]
-pub struct CreateWrappedData {}
-
-pub fn create_wrapped(
-    ctx: &ExecutionContext,
-    accs: &mut CreateWrapped,
-    data: CreateWrappedData,
-) -> Result<()> {
-    // Do not process attestations sourced from the current chain.
-    if accs.vaa.token_chain == CHAIN_ID_SOLANA {
-        return Err(InvalidChain.into());
-    }
-
-    let derivation_data: WrappedDerivationData = (&*accs).into();
-    accs.mint
-        .verify_derivation(ctx.program_id, &derivation_data)?;
-
-    let meta_derivation_data: WrappedMetaDerivationData = (&*accs).into();
-    accs.meta
-        .verify_derivation(ctx.program_id, &meta_derivation_data)?;
-
-    let derivation_data: EndpointDerivationData = (&*accs).into();
-    accs.chain_registration
-        .verify_derivation(ctx.program_id, &derivation_data)?;
-
-    accs.vaa.verify(ctx.program_id)?;
-    accs.vaa.claim(ctx, accs.payer.key)?;
-
-    if accs.mint.is_initialized() {
-        update_accounts(ctx, accs, data)
-    } else {
-        create_accounts(ctx, accs, data)
-    }
-}
-
-pub fn create_accounts(
-    ctx: &ExecutionContext,
-    accs: &mut CreateWrapped,
-    data: CreateWrappedData,
-) -> Result<()> {
-    // Create mint account
-    accs.mint
-        .create(&((&*accs).into()), ctx, accs.payer.key, Exempt)?;
-
-    // Initialize mint
-    let init_ix = spl_token::instruction::initialize_mint(
-        &spl_token::id(),
-        accs.mint.info().key,
-        accs.mint_authority.key,
-        None,
-        min(8, accs.vaa.decimals), // Limit to 8 decimals, truncation is handled on the other side
-    )?;
-    invoke_signed(&init_ix, ctx.accounts, &[])?;
-
-    // Create meta account
-    accs.meta
-        .create(&((&*accs).into()), ctx, accs.payer.key, Exempt)?;
-
-    // Initialize spl meta
-    accs.spl_metadata.verify_derivation(
-        &spl_token_metadata::id(),
-        &SplTokenMetaDerivationData {
-            mint: *accs.mint.info().key,
-        },
-    )?;
-
-    // Normalize Token Metadata.
-    let name = truncate_utf8(&accs.vaa.name, 32 - 11) + " (Wormhole)";
-    let symbol = truncate_utf8(&accs.vaa.symbol, 10);
-
-    let spl_token_metadata_ix = spl_token_metadata::instruction::create_metadata_accounts(
-        spl_token_metadata::id(),
-        *accs.spl_metadata.key,
-        *accs.mint.info().key,
-        *accs.mint_authority.info().key,
-        *accs.payer.info().key,
-        *accs.mint_authority.info().key,
-        name,
-        symbol,
-        String::from(""),
-        None,
-        0,
-        false,
-        true,
-    );
-    invoke_seeded(&spl_token_metadata_ix, ctx, &accs.mint_authority, None)?;
-
-    // Populate meta account
-    accs.meta.chain = accs.vaa.token_chain;
-    accs.meta.token_address = accs.vaa.token_address;
-    accs.meta.original_decimals = accs.vaa.decimals;
-
-    Ok(())
-}
-
-pub fn update_accounts(
-    ctx: &ExecutionContext,
-    accs: &mut CreateWrapped,
-    data: CreateWrappedData,
-) -> Result<()> {
-    accs.spl_metadata.verify_derivation(
-        &spl_token_metadata::id(),
-        &SplTokenMetaDerivationData {
-            mint: *accs.mint.info().key,
-        },
-    )?;
-
-    let mut metadata: SplData = Metadata::from_account_info(accs.spl_metadata.info())
-        .ok_or(InvalidMetadata)?
-        .data;
-
-    // Normalize token metadata.
-    metadata.name = truncate_utf8(&accs.vaa.name, 32 - 11) + " (Wormhole)";
-    metadata.symbol = truncate_utf8(&accs.vaa.symbol, 10);
-
-    // Update SPL Metadata
-    let spl_token_metadata_ix = spl_token_metadata::instruction::update_metadata_accounts(
-        spl_token_metadata::id(),
-        *accs.spl_metadata.key,
-        *accs.mint_authority.info().key,
-        None,
-        Some(metadata),
-        None,
-    );
-    invoke_seeded(&spl_token_metadata_ix, ctx, &accs.mint_authority, None)?;
-
-    Ok(())
-}
-
-// Byte-truncates potentially invalid UTF-8 encoded strings by converting to Unicode codepoints and
-// stripping unrecognised characters.
-pub fn truncate_utf8(data: impl AsRef<[u8]>, len: usize) -> String {
-    use bstr::ByteSlice;
-    let mut data = data.as_ref().to_vec();
-    data.truncate(len);
-    let mut data: Vec<char> = data.chars().collect();
-    data.retain(|&c| c != '\u{FFFD}');
-    data.iter().collect()
-}
-
-#[cfg(test)]
-mod tests {
-    fn extend_string(n: &str) -> Vec<u8> {
-        let mut bytes = vec![0u8; 32];
-        for i in 0..n.len() {
-            bytes[i] = n.as_bytes()[i];
-        }
-        bytes.to_vec()
-    }
-
-    #[test]
-    fn test_unicode_truncation() {
-        #[rustfmt::skip]
-        let pairs = [
-            // Empty string should not error or mutate.
-            (
-                "",
-                ""
-            ),
-            // Unicode < 32 should not be corrupted.
-            (
-                "🔥",
-                "🔥"
-            ),
-            // Unicode @ 32 should not be corrupted.
-            (
-                "🔥🔥🔥🔥🔥🔥🔥🔥",
-                "🔥🔥🔥🔥🔥🔥🔥🔥"
-            ),
-            // Unicode > 32 should be truncated correctly.
-            (
-                "🔥🔥🔥🔥🔥🔥🔥🔥🔥",
-                "🔥🔥🔥🔥🔥🔥🔥🔥"
-            ),
-            // Partially overflowing Unicode > 32 should be removed.
-            // Note: Expecting 31 bytes.
-            (
-                "0000000000000000000000000000000🔥",
-                "0000000000000000000000000000000"
-            ),
-        ];
-
-        for (input, expected) in pairs {
-            assert_eq!(expected, super::truncate_utf8(input, 32));
-        }
-    }
-}

+ 0 - 173
solana/modules/token_bridge/program/src/api/governance.rs

@@ -1,173 +0,0 @@
-use crate::{
-    accounts::{
-        ConfigAccount,
-        Endpoint,
-        EndpointDerivationData,
-    },
-    messages::{
-        GovernancePayloadUpgrade,
-        PayloadGovernanceRegisterChain,
-    },
-    types::*,
-    TokenBridgeError::{
-        InvalidChain,
-        InvalidGovernanceKey,
-    },
-};
-use bridge::{
-    vaa::{
-        ClaimableVAA,
-        DeserializePayload,
-        PayloadMessage,
-    },
-    CHAIN_ID_SOLANA,
-};
-use solana_program::{
-    account_info::AccountInfo,
-    program::invoke_signed,
-    program_error::ProgramError,
-    pubkey::Pubkey,
-    sysvar::{
-        clock::Clock,
-        rent::Rent,
-    },
-};
-use solitaire::{
-    processors::seeded::Seeded,
-    CreationLamports::Exempt,
-    *,
-};
-use std::ops::{
-    Deref,
-    DerefMut,
-};
-
-// Confirm that a ClaimableVAA came from the correct chain, signed by the right emitter.
-fn verify_governance<'a, T>(vaa: &ClaimableVAA<'a, T>) -> Result<()>
-where
-    T: DeserializePayload,
-{
-    let expected_emitter = std::env!("EMITTER_ADDRESS");
-    let current_emitter = format!(
-        "{}",
-        Pubkey::new_from_array(vaa.message.meta().emitter_address)
-    );
-    // Fail if the emitter is not the known governance key, or the emitting chain is not Solana.
-    if expected_emitter != current_emitter || vaa.message.meta().emitter_chain != CHAIN_ID_SOLANA {
-        Err(InvalidGovernanceKey.into())
-    } else {
-        Ok(())
-    }
-}
-
-#[derive(FromAccounts)]
-pub struct UpgradeContract<'b> {
-    /// Payer for account creation (vaa-claim)
-    pub payer: Mut<Signer<Info<'b>>>,
-
-    /// GuardianSet change VAA
-    pub vaa: ClaimableVAA<'b, GovernancePayloadUpgrade>,
-
-    /// PDA authority for the loader
-    pub upgrade_authority: Derive<Info<'b>, "upgrade">,
-
-    /// Spill address for the upgrade excess lamports
-    pub spill: Mut<Info<'b>>,
-
-    /// New contract address.
-    pub buffer: Mut<Info<'b>>,
-
-    /// Required by the upgradeable uploader.
-    pub program_data: Mut<Info<'b>>,
-
-    /// Our own address, required by the upgradeable loader.
-    pub own_address: Mut<Info<'b>>,
-
-    // Various sysvar/program accounts needed for the upgradeable loader.
-    pub rent: Sysvar<'b, Rent>,
-    pub clock: Sysvar<'b, Clock>,
-    pub bpf_loader: Info<'b>,
-    pub system: Info<'b>,
-}
-
-impl<'b> InstructionContext<'b> for UpgradeContract<'b> {
-}
-
-#[derive(BorshDeserialize, BorshSerialize, Default)]
-pub struct UpgradeContractData {}
-
-pub fn upgrade_contract(
-    ctx: &ExecutionContext,
-    accs: &mut UpgradeContract,
-    _data: UpgradeContractData,
-) -> Result<()> {
-    verify_governance(&accs.vaa)?;
-    accs.vaa.verify(ctx.program_id)?;
-
-    accs.vaa.claim(ctx, accs.payer.key)?;
-
-    let upgrade_ix = solana_program::bpf_loader_upgradeable::upgrade(
-        ctx.program_id,
-        &accs.vaa.message.new_contract,
-        accs.upgrade_authority.key,
-        accs.spill.key,
-    );
-
-    let seeds = accs
-        .upgrade_authority
-        .self_bumped_seeds(None, ctx.program_id);
-    let seeds: Vec<&[u8]> = seeds.iter().map(|item| item.as_slice()).collect();
-    let seeds = seeds.as_slice();
-    invoke_signed(&upgrade_ix, ctx.accounts, &[seeds])?;
-
-    Ok(())
-}
-
-#[derive(FromAccounts)]
-pub struct RegisterChain<'b> {
-    pub payer: Mut<Signer<AccountInfo<'b>>>,
-    pub config: ConfigAccount<'b, { AccountState::Initialized }>,
-
-    pub endpoint: Mut<Endpoint<'b, { AccountState::Uninitialized }>>,
-
-    pub vaa: ClaimableVAA<'b, PayloadGovernanceRegisterChain>,
-}
-
-impl<'a> From<&RegisterChain<'a>> for EndpointDerivationData {
-    fn from(accs: &RegisterChain<'a>) -> Self {
-        EndpointDerivationData {
-            emitter_chain: accs.vaa.chain,
-            emitter_address: accs.vaa.endpoint_address,
-        }
-    }
-}
-
-impl<'b> InstructionContext<'b> for RegisterChain<'b> {
-}
-
-#[derive(BorshDeserialize, BorshSerialize, Default)]
-pub struct RegisterChainData {}
-
-pub fn register_chain(
-    ctx: &ExecutionContext,
-    accs: &mut RegisterChain,
-    data: RegisterChainData,
-) -> Result<()> {
-    let derivation_data: EndpointDerivationData = (&*accs).into();
-    accs.endpoint
-        .verify_derivation(ctx.program_id, &derivation_data)?;
-
-    // Claim VAA
-    verify_governance(&accs.vaa)?;
-    accs.vaa.verify(ctx.program_id)?;
-    accs.vaa.claim(ctx, accs.payer.key)?;
-
-    // Create endpoint
-    accs.endpoint
-        .create(&((&*accs).into()), ctx, accs.payer.key, Exempt)?;
-
-    accs.endpoint.chain = accs.vaa.chain;
-    accs.endpoint.contract = accs.vaa.endpoint_address;
-
-    Ok(())
-}

+ 0 - 44
solana/modules/token_bridge/program/src/api/initialize.rs

@@ -1,44 +0,0 @@
-use crate::{
-    accounts::ConfigAccount,
-    types::*,
-};
-use solana_program::{
-    account_info::AccountInfo,
-    msg,
-    program_error::ProgramError,
-    pubkey::Pubkey,
-};
-use solitaire::{
-    CreationLamports::Exempt,
-    *,
-};
-use std::ops::{
-    Deref,
-    DerefMut,
-};
-
-#[derive(FromAccounts)]
-pub struct Initialize<'b> {
-    pub payer: Mut<Signer<AccountInfo<'b>>>,
-
-    pub config: Mut<ConfigAccount<'b, { AccountState::Uninitialized }>>,
-}
-
-#[derive(BorshDeserialize, BorshSerialize, Default)]
-pub struct InitializeData {
-    pub bridge: Pubkey,
-}
-
-impl<'b> InstructionContext<'b> for Initialize<'b> {
-}
-
-pub fn initialize(
-    ctx: &ExecutionContext,
-    accs: &mut Initialize,
-    data: InitializeData,
-) -> Result<()> {
-    // Create the config account
-    accs.config.create(ctx, accs.payer.key, Exempt)?;
-    accs.config.wormhole_bridge = data.bridge;
-    Ok(())
-}

+ 0 - 381
solana/modules/token_bridge/program/src/api/transfer.rs

@@ -1,381 +0,0 @@
-use crate::{
-    accounts::{
-        AuthoritySigner,
-        ConfigAccount,
-        CoreBridge,
-        CustodyAccount,
-        CustodyAccountDerivationData,
-        CustodySigner,
-        EmitterAccount,
-        MintSigner,
-        WrappedDerivationData,
-        WrappedMetaDerivationData,
-        WrappedMint,
-        WrappedTokenMeta,
-    },
-    messages::PayloadTransfer,
-    types::*,
-    TokenBridgeError,
-    TokenBridgeError::{
-        InvalidChain,
-        InvalidFee,
-        WrongAccountOwner,
-    },
-};
-use bridge::{
-    accounts::Bridge,
-    api::{
-        PostMessage,
-        PostMessageData,
-    },
-    types::ConsistencyLevel,
-    vaa::SerializePayload,
-    CHAIN_ID_SOLANA,
-};
-use primitive_types::U256;
-use solana_program::{
-    account_info::AccountInfo,
-    instruction::{
-        AccountMeta,
-        Instruction,
-    },
-    program::{
-        invoke,
-        invoke_signed,
-    },
-    program_error::ProgramError,
-    program_option::COption,
-    pubkey::Pubkey,
-    sysvar::clock::Clock,
-};
-use solitaire::{
-    processors::seeded::{
-        invoke_seeded,
-        Seeded,
-    },
-    CreationLamports::Exempt,
-    *,
-};
-use spl_token::{
-    error::TokenError::OwnerMismatch,
-    state::{
-        Account,
-        Mint,
-    },
-};
-use std::ops::{
-    Deref,
-    DerefMut,
-};
-
-#[derive(FromAccounts)]
-pub struct TransferNative<'b> {
-    pub payer: Mut<Signer<AccountInfo<'b>>>,
-
-    pub config: ConfigAccount<'b, { AccountState::Initialized }>,
-
-    pub from: Mut<Data<'b, SplAccount, { AccountState::Initialized }>>,
-
-    pub mint: Mut<Data<'b, SplMint, { AccountState::Initialized }>>,
-
-    pub custody: Mut<CustodyAccount<'b, { AccountState::MaybeInitialized }>>,
-
-    // This could allow someone to race someone else's tx if they do the approval in a separate tx.
-    // Therefore the approval must be set in the same tx.
-    pub authority_signer: AuthoritySigner<'b>,
-
-    pub custody_signer: CustodySigner<'b>,
-
-    /// CPI Context
-    pub bridge: Mut<CoreBridge<'b, { AccountState::Initialized }>>,
-
-    /// Account to store the posted message
-    pub message: Signer<Mut<Info<'b>>>,
-
-    /// Emitter of the VAA
-    pub emitter: EmitterAccount<'b>,
-
-    /// Tracker for the emitter sequence
-    pub sequence: Mut<Info<'b>>,
-
-    /// Account to collect tx fee
-    pub fee_collector: Mut<Info<'b>>,
-
-    pub clock: Sysvar<'b, Clock>,
-}
-
-impl<'a> From<&TransferNative<'a>> for CustodyAccountDerivationData {
-    fn from(accs: &TransferNative<'a>) -> Self {
-        CustodyAccountDerivationData {
-            mint: *accs.mint.info().key,
-        }
-    }
-}
-
-impl<'b> InstructionContext<'b> for TransferNative<'b> {
-}
-
-#[derive(BorshDeserialize, BorshSerialize, Default)]
-pub struct TransferNativeData {
-    pub nonce: u32,
-    pub amount: u64,
-    pub fee: u64,
-    pub target_address: Address,
-    pub target_chain: ChainID,
-}
-
-pub fn transfer_native(
-    ctx: &ExecutionContext,
-    accs: &mut TransferNative,
-    data: TransferNativeData,
-) -> Result<()> {
-    // Prevent transferring to the same chain.
-    if data.target_chain == CHAIN_ID_SOLANA {
-        return Err(InvalidChain.into());
-    }
-
-    // Verify that the custody account is derived correctly
-    let derivation_data: CustodyAccountDerivationData = (&*accs).into();
-    accs.custody
-        .verify_derivation(ctx.program_id, &derivation_data)?;
-
-    // Verify mints
-    if accs.from.mint != *accs.mint.info().key {
-        return Err(TokenBridgeError::InvalidMint.into());
-    }
-
-    // Fee must be less than amount
-    if data.fee > data.amount {
-        return Err(InvalidFee.into());
-    }
-
-    // Verify that the token is not a wrapped token
-    if let COption::Some(mint_authority) = accs.mint.mint_authority {
-        if mint_authority == MintSigner::key(None, ctx.program_id) {
-            return Err(TokenBridgeError::TokenNotNative.into());
-        }
-    }
-
-    if !accs.custody.is_initialized() {
-        accs.custody
-            .create(&(&*accs).into(), ctx, accs.payer.key, Exempt)?;
-
-        let init_ix = spl_token::instruction::initialize_account(
-            &spl_token::id(),
-            accs.custody.info().key,
-            accs.mint.info().key,
-            accs.custody_signer.key,
-        )?;
-        invoke_signed(&init_ix, ctx.accounts, &[])?;
-    }
-
-    let trunc_divisor = 10u64.pow(8.max(accs.mint.decimals as u32) - 8);
-    // Truncate to 8 decimals
-    let amount: u64 = data.amount / trunc_divisor;
-    let fee: u64 = data.fee / trunc_divisor;
-    // Untruncate the amount to drop the remainder so we don't  "burn" user's funds.
-    let amount_trunc: u64 = amount * trunc_divisor;
-
-    // Transfer tokens
-    let transfer_ix = spl_token::instruction::transfer(
-        &spl_token::id(),
-        accs.from.info().key,
-        accs.custody.info().key,
-        accs.authority_signer.key,
-        &[],
-        amount_trunc,
-    )?;
-    invoke_seeded(&transfer_ix, ctx, &accs.authority_signer, None)?;
-
-    // Pay fee
-    let transfer_ix = solana_program::system_instruction::transfer(
-        accs.payer.key,
-        accs.fee_collector.key,
-        accs.bridge.config.fee,
-    );
-    invoke(&transfer_ix, ctx.accounts)?;
-
-    // Post message
-    let payload = PayloadTransfer {
-        amount: U256::from(amount),
-        token_address: accs.mint.info().key.to_bytes(),
-        token_chain: CHAIN_ID_SOLANA,
-        to: data.target_address,
-        to_chain: data.target_chain,
-        fee: U256::from(fee),
-    };
-    let params = (
-        bridge::instruction::Instruction::PostMessage,
-        PostMessageData {
-            nonce: data.nonce,
-            payload: payload.try_to_vec()?,
-            consistency_level: ConsistencyLevel::Finalized,
-        },
-    );
-
-    let ix = Instruction::new_with_bytes(
-        accs.config.wormhole_bridge,
-        params.try_to_vec()?.as_slice(),
-        vec![
-            AccountMeta::new(*accs.bridge.info().key, false),
-            AccountMeta::new(*accs.message.key, true),
-            AccountMeta::new_readonly(*accs.emitter.key, true),
-            AccountMeta::new(*accs.sequence.key, false),
-            AccountMeta::new(*accs.payer.key, true),
-            AccountMeta::new(*accs.fee_collector.key, false),
-            AccountMeta::new_readonly(*accs.clock.info().key, false),
-            AccountMeta::new_readonly(solana_program::system_program::id(), false),
-            AccountMeta::new_readonly(solana_program::sysvar::rent::ID, false),
-        ],
-    );
-    invoke_seeded(&ix, ctx, &accs.emitter, None)?;
-
-    Ok(())
-}
-
-#[derive(FromAccounts)]
-pub struct TransferWrapped<'b> {
-    pub payer: Mut<Signer<AccountInfo<'b>>>,
-    pub config: ConfigAccount<'b, { AccountState::Initialized }>,
-
-    pub from: Mut<Data<'b, SplAccount, { AccountState::Initialized }>>,
-    pub from_owner: MaybeMut<Signer<Info<'b>>>,
-    pub mint: Mut<WrappedMint<'b, { AccountState::Initialized }>>,
-    pub wrapped_meta: WrappedTokenMeta<'b, { AccountState::Initialized }>,
-
-    pub authority_signer: AuthoritySigner<'b>,
-
-    /// CPI Context
-    pub bridge: Mut<CoreBridge<'b, { AccountState::Initialized }>>,
-
-    /// Account to store the posted message
-    pub message: Signer<Mut<Info<'b>>>,
-
-    /// Emitter of the VAA
-    pub emitter: EmitterAccount<'b>,
-
-    /// Tracker for the emitter sequence
-    pub sequence: Mut<Info<'b>>,
-
-    /// Account to collect tx fee
-    pub fee_collector: Mut<Info<'b>>,
-
-    pub clock: Sysvar<'b, Clock>,
-}
-
-impl<'a> From<&TransferWrapped<'a>> for WrappedDerivationData {
-    fn from(accs: &TransferWrapped<'a>) -> Self {
-        WrappedDerivationData {
-            token_chain: 1,
-            token_address: accs.mint.info().key.to_bytes(),
-        }
-    }
-}
-
-impl<'a> From<&TransferWrapped<'a>> for WrappedMetaDerivationData {
-    fn from(accs: &TransferWrapped<'a>) -> Self {
-        WrappedMetaDerivationData {
-            mint_key: *accs.mint.info().key,
-        }
-    }
-}
-
-impl<'b> InstructionContext<'b> for TransferWrapped<'b> {
-}
-
-#[derive(BorshDeserialize, BorshSerialize, Default)]
-pub struct TransferWrappedData {
-    pub nonce: u32,
-    pub amount: u64,
-    pub fee: u64,
-    pub target_address: Address,
-    pub target_chain: ChainID,
-}
-
-pub fn transfer_wrapped(
-    ctx: &ExecutionContext,
-    accs: &mut TransferWrapped,
-    data: TransferWrappedData,
-) -> Result<()> {
-    // Prevent transferring to the same chain.
-    if data.target_chain == CHAIN_ID_SOLANA {
-        return Err(InvalidChain.into());
-    }
-
-    // Verify that the from account is owned by the from_owner
-    if &accs.from.owner != accs.from_owner.key {
-        return Err(WrongAccountOwner.into());
-    }
-
-    // Verify mints
-    if accs.mint.info().key != &accs.from.mint {
-        return Err(TokenBridgeError::InvalidMint.into());
-    }
-
-    // Fee must be less than amount
-    if data.fee > data.amount {
-        return Err(InvalidFee.into());
-    }
-
-    // Verify that meta is correct
-    let derivation_data: WrappedMetaDerivationData = (&*accs).into();
-    accs.wrapped_meta
-        .verify_derivation(ctx.program_id, &derivation_data)?;
-
-    // Burn tokens
-    let burn_ix = spl_token::instruction::burn(
-        &spl_token::id(),
-        accs.from.info().key,
-        accs.mint.info().key,
-        accs.authority_signer.key,
-        &[],
-        data.amount,
-    )?;
-    invoke_seeded(&burn_ix, ctx, &accs.authority_signer, None)?;
-
-    // Pay fee
-    let transfer_ix = solana_program::system_instruction::transfer(
-        accs.payer.key,
-        accs.fee_collector.key,
-        accs.bridge.config.fee,
-    );
-
-    invoke(&transfer_ix, ctx.accounts)?;
-
-    // Post message
-    let payload = PayloadTransfer {
-        amount: U256::from(data.amount),
-        token_address: accs.wrapped_meta.token_address,
-        token_chain: accs.wrapped_meta.chain,
-        to: data.target_address,
-        to_chain: data.target_chain,
-        fee: U256::from(data.fee),
-    };
-    let params = (
-        bridge::instruction::Instruction::PostMessage,
-        PostMessageData {
-            nonce: data.nonce,
-            payload: payload.try_to_vec()?,
-            consistency_level: ConsistencyLevel::Finalized,
-        },
-    );
-
-    let ix = Instruction::new_with_bytes(
-        accs.config.wormhole_bridge,
-        params.try_to_vec()?.as_slice(),
-        vec![
-            AccountMeta::new(*accs.bridge.info().key, false),
-            AccountMeta::new(*accs.message.key, true),
-            AccountMeta::new_readonly(*accs.emitter.key, true),
-            AccountMeta::new(*accs.sequence.key, false),
-            AccountMeta::new(*accs.payer.key, true),
-            AccountMeta::new(*accs.fee_collector.key, false),
-            AccountMeta::new_readonly(*accs.clock.info().key, false),
-            AccountMeta::new_readonly(solana_program::system_program::id(), false),
-            AccountMeta::new_readonly(solana_program::sysvar::rent::ID, false),
-        ],
-    );
-    invoke_seeded(&ix, ctx, &accs.emitter, None)?;
-
-    Ok(())
-}

+ 0 - 579
solana/modules/token_bridge/program/src/instructions.rs

@@ -1,579 +0,0 @@
-use crate::{
-    accounts::{
-        AuthoritySigner,
-        ConfigAccount,
-        CustodyAccount,
-        CustodyAccountDerivationData,
-        CustodySigner,
-        EmitterAccount,
-        Endpoint,
-        EndpointDerivationData,
-        MintSigner,
-        SplTokenMeta,
-        SplTokenMetaDerivationData,
-        WrappedDerivationData,
-        WrappedMetaDerivationData,
-        WrappedMint,
-        WrappedTokenMeta,
-    },
-    api::{
-        complete_transfer::{
-            CompleteNativeData,
-            CompleteWrappedData,
-        },
-        AttestTokenData,
-        CreateWrappedData,
-        RegisterChainData,
-        TransferNativeData,
-        TransferWrappedData,
-        UpgradeContractData,
-    },
-    messages::{
-        PayloadAssetMeta,
-        PayloadGovernanceRegisterChain,
-        PayloadTransfer,
-    },
-};
-use borsh::BorshSerialize;
-use bridge::{
-    accounts::{
-        Bridge,
-        BridgeConfig,
-        Claim,
-        ClaimDerivationData,
-        FeeCollector,
-        PostedVAA,
-        PostedVAAData,
-        PostedVAADerivationData,
-        Sequence,
-        SequenceDerivationData,
-    },
-    api::ForeignAddress,
-    instructions::hash_vaa,
-    vaa::{
-        ClaimableVAA,
-        PayloadMessage,
-        SerializePayload,
-    },
-    PostVAA,
-    PostVAAData,
-    CHAIN_ID_SOLANA,
-};
-use primitive_types::U256;
-use solana_program::{
-    instruction::{
-        AccountMeta,
-        Instruction,
-    },
-    pubkey::Pubkey,
-};
-use solitaire::{
-    processors::seeded::Seeded,
-    AccountState,
-};
-use spl_token::state::Mint;
-use std::str::FromStr;
-
-pub fn initialize(
-    program_id: Pubkey,
-    payer: Pubkey,
-    bridge: Pubkey,
-) -> solitaire::Result<Instruction> {
-    let config_key = ConfigAccount::<'_, { AccountState::Uninitialized }>::key(None, &program_id);
-    Ok(Instruction {
-        program_id,
-        accounts: vec![
-            AccountMeta::new(payer, true),
-            AccountMeta::new(config_key, false),
-            // Dependencies
-            AccountMeta::new(solana_program::sysvar::rent::id(), false),
-            AccountMeta::new(solana_program::system_program::id(), false),
-        ],
-        data: (crate::instruction::Instruction::Initialize, bridge).try_to_vec()?,
-    })
-}
-
-pub fn complete_native(
-    program_id: Pubkey,
-    bridge_id: Pubkey,
-    payer: Pubkey,
-    message_key: Pubkey,
-    vaa: PostVAAData,
-    to: Pubkey,
-    fee_recipient: Option<Pubkey>,
-    mint: Pubkey,
-    data: CompleteNativeData,
-) -> solitaire::Result<Instruction> {
-    let config_key = ConfigAccount::<'_, { AccountState::Uninitialized }>::key(None, &program_id);
-    let (message_acc, claim_acc) = claimable_vaa(program_id, message_key, vaa.clone());
-    let endpoint = Endpoint::<'_, { AccountState::Initialized }>::key(
-        &EndpointDerivationData {
-            emitter_chain: vaa.emitter_chain,
-            emitter_address: vaa.emitter_address,
-        },
-        &program_id,
-    );
-    let custody_key = CustodyAccount::<'_, { AccountState::Initialized }>::key(
-        &CustodyAccountDerivationData { mint },
-        &program_id,
-    );
-    let custody_signer_key = CustodySigner::key(None, &program_id);
-
-    Ok(Instruction {
-        program_id,
-        accounts: vec![
-            AccountMeta::new(payer, true),
-            AccountMeta::new_readonly(config_key, false),
-            message_acc,
-            claim_acc,
-            AccountMeta::new_readonly(endpoint, false),
-            AccountMeta::new(to, false),
-            if let Some(fee_r) = fee_recipient {
-                AccountMeta::new(fee_r, false)
-            } else {
-                AccountMeta::new(to, false)
-            },
-            AccountMeta::new(custody_key, false),
-            AccountMeta::new_readonly(mint, false),
-            AccountMeta::new_readonly(custody_signer_key, false),
-            // Dependencies
-            AccountMeta::new_readonly(solana_program::sysvar::rent::id(), false),
-            AccountMeta::new_readonly(solana_program::system_program::id(), false),
-            // Program
-            AccountMeta::new_readonly(bridge_id, false),
-            AccountMeta::new_readonly(spl_token::id(), false),
-        ],
-        data: (crate::instruction::Instruction::CompleteNative, data).try_to_vec()?,
-    })
-}
-
-pub fn complete_wrapped(
-    program_id: Pubkey,
-    bridge_id: Pubkey,
-    payer: Pubkey,
-    message_key: Pubkey,
-    vaa: PostVAAData,
-    payload: PayloadTransfer,
-    to: Pubkey,
-    fee_recipient: Option<Pubkey>,
-    data: CompleteWrappedData,
-) -> solitaire::Result<Instruction> {
-    let config_key = ConfigAccount::<'_, { AccountState::Uninitialized }>::key(None, &program_id);
-    let (message_acc, claim_acc) = claimable_vaa(program_id, message_key, vaa.clone());
-    let endpoint = Endpoint::<'_, { AccountState::Initialized }>::key(
-        &EndpointDerivationData {
-            emitter_chain: vaa.emitter_chain,
-            emitter_address: vaa.emitter_address,
-        },
-        &program_id,
-    );
-    let mint_key = WrappedMint::<'_, { AccountState::Uninitialized }>::key(
-        &WrappedDerivationData {
-            token_chain: payload.token_chain,
-            token_address: payload.token_address,
-        },
-        &program_id,
-    );
-    let meta_key = WrappedTokenMeta::<'_, { AccountState::Uninitialized }>::key(
-        &WrappedMetaDerivationData { mint_key },
-        &program_id,
-    );
-    let mint_authority_key = MintSigner::key(None, &program_id);
-
-    Ok(Instruction {
-        program_id,
-        accounts: vec![
-            AccountMeta::new(payer, true),
-            AccountMeta::new_readonly(config_key, false),
-            message_acc,
-            claim_acc,
-            AccountMeta::new_readonly(endpoint, false),
-            AccountMeta::new(to, false),
-            if let Some(fee_r) = fee_recipient {
-                AccountMeta::new(fee_r, false)
-            } else {
-                AccountMeta::new(to, false)
-            },
-            AccountMeta::new(mint_key, false),
-            AccountMeta::new_readonly(meta_key, false),
-            AccountMeta::new_readonly(mint_authority_key, false),
-            // Dependencies
-            AccountMeta::new_readonly(solana_program::sysvar::rent::id(), false),
-            AccountMeta::new_readonly(solana_program::system_program::id(), false),
-            // Program
-            AccountMeta::new_readonly(bridge_id, false),
-            AccountMeta::new_readonly(spl_token::id(), false),
-        ],
-        data: (crate::instruction::Instruction::CompleteWrapped, data).try_to_vec()?,
-    })
-}
-
-pub fn create_wrapped(
-    program_id: Pubkey,
-    bridge_id: Pubkey,
-    payer: Pubkey,
-    message_key: Pubkey,
-    vaa: PostVAAData,
-    payload: PayloadAssetMeta,
-    data: CreateWrappedData,
-) -> solitaire::Result<Instruction> {
-    let config_key = ConfigAccount::<'_, { AccountState::Uninitialized }>::key(None, &program_id);
-    let (message_acc, claim_acc) = claimable_vaa(program_id, message_key, vaa.clone());
-    let endpoint = Endpoint::<'_, { AccountState::Initialized }>::key(
-        &EndpointDerivationData {
-            emitter_chain: vaa.emitter_chain,
-            emitter_address: vaa.emitter_address,
-        },
-        &program_id,
-    );
-    let mint_key = WrappedMint::<'_, { AccountState::Uninitialized }>::key(
-        &WrappedDerivationData {
-            token_chain: payload.token_chain,
-            token_address: payload.token_address,
-        },
-        &program_id,
-    );
-    let mint_meta_key = WrappedTokenMeta::<'_, { AccountState::Uninitialized }>::key(
-        &WrappedMetaDerivationData { mint_key },
-        &program_id,
-    );
-    let mint_authority_key = MintSigner::key(None, &program_id);
-    // SPL Metadata
-    let spl_metadata = SplTokenMeta::key(
-        &SplTokenMetaDerivationData { mint: mint_key },
-        &spl_token_metadata::id(),
-    );
-
-    Ok(Instruction {
-        program_id,
-        accounts: vec![
-            AccountMeta::new(payer, true),
-            AccountMeta::new_readonly(config_key, false),
-            AccountMeta::new_readonly(endpoint, false),
-            message_acc,
-            claim_acc,
-            AccountMeta::new(mint_key, false),
-            AccountMeta::new(mint_meta_key, false),
-            AccountMeta::new(spl_metadata, false),
-            AccountMeta::new_readonly(mint_authority_key, false),
-            // Dependencies
-            AccountMeta::new_readonly(solana_program::sysvar::rent::id(), false),
-            AccountMeta::new_readonly(solana_program::system_program::id(), false),
-            // Program
-            AccountMeta::new_readonly(bridge_id, false),
-            AccountMeta::new_readonly(spl_token::id(), false),
-            AccountMeta::new_readonly(spl_token_metadata::id(), false),
-        ],
-        data: (crate::instruction::Instruction::CreateWrapped, data).try_to_vec()?,
-    })
-}
-
-pub fn register_chain(
-    program_id: Pubkey,
-    bridge_id: Pubkey,
-    payer: Pubkey,
-    message_key: Pubkey,
-    vaa: PostVAAData,
-    payload: PayloadGovernanceRegisterChain,
-    data: RegisterChainData,
-) -> solitaire::Result<Instruction> {
-    let config_key = ConfigAccount::<'_, { AccountState::Uninitialized }>::key(None, &program_id);
-    let (message_acc, claim_acc) = claimable_vaa(program_id, message_key, vaa);
-    let endpoint = Endpoint::<'_, { AccountState::Initialized }>::key(
-        &EndpointDerivationData {
-            emitter_chain: payload.chain,
-            emitter_address: payload.endpoint_address,
-        },
-        &program_id,
-    );
-
-    Ok(Instruction {
-        program_id,
-        accounts: vec![
-            AccountMeta::new(payer, true),
-            AccountMeta::new_readonly(config_key, false),
-            AccountMeta::new(endpoint, false),
-            message_acc,
-            claim_acc,
-            // Dependencies
-            AccountMeta::new(solana_program::sysvar::rent::id(), false),
-            AccountMeta::new(solana_program::system_program::id(), false),
-            // Program
-            AccountMeta::new_readonly(bridge_id, false),
-        ],
-        data: (crate::instruction::Instruction::RegisterChain, data).try_to_vec()?,
-    })
-}
-
-fn claimable_vaa(
-    bridge_id: Pubkey,
-    message_key: Pubkey,
-    vaa: PostVAAData,
-) -> (AccountMeta, AccountMeta) {
-    let claim_key = Claim::<'_, { AccountState::Initialized }>::key(
-        &ClaimDerivationData {
-            emitter_address: vaa.emitter_address,
-            emitter_chain: vaa.emitter_chain,
-            sequence: vaa.sequence,
-        },
-        &bridge_id,
-    );
-
-    (
-        AccountMeta::new_readonly(message_key, false),
-        AccountMeta::new(claim_key, false),
-    )
-}
-
-pub fn transfer_native(
-    program_id: Pubkey,
-    bridge_id: Pubkey,
-    payer: Pubkey,
-    message_key: Pubkey,
-    from: Pubkey,
-    mint: Pubkey,
-    data: TransferNativeData,
-) -> solitaire::Result<Instruction> {
-    let config_key = ConfigAccount::<'_, { AccountState::Uninitialized }>::key(None, &program_id);
-    let custody_key = CustodyAccount::<'_, { AccountState::Initialized }>::key(
-        &CustodyAccountDerivationData { mint },
-        &program_id,
-    );
-
-    let authority_signer_key = AuthoritySigner::key(None, &program_id);
-    let custody_signer_key = CustodySigner::key(None, &program_id);
-    let emitter_key = EmitterAccount::key(None, &program_id);
-
-    // Bridge keys
-    let bridge_config = Bridge::<'_, { AccountState::Uninitialized }>::key(None, &bridge_id);
-    let payload = PayloadTransfer {
-        amount: U256::from(data.amount),
-        token_address: mint.to_bytes(),
-        token_chain: 1,
-        to: data.target_address,
-        to_chain: data.target_chain,
-        fee: U256::from(data.fee),
-    };
-    let sequence_key = Sequence::key(
-        &SequenceDerivationData {
-            emitter_key: &emitter_key,
-        },
-        &bridge_id,
-    );
-    let fee_collector_key = FeeCollector::key(None, &bridge_id);
-
-    Ok(Instruction {
-        program_id,
-        accounts: vec![
-            AccountMeta::new(payer, true),
-            AccountMeta::new_readonly(config_key, false),
-            AccountMeta::new(from, false),
-            AccountMeta::new(mint, false),
-            AccountMeta::new(custody_key, false),
-            AccountMeta::new_readonly(authority_signer_key, false),
-            AccountMeta::new_readonly(custody_signer_key, false),
-            AccountMeta::new(bridge_config, false),
-            AccountMeta::new(message_key, true),
-            AccountMeta::new_readonly(emitter_key, false),
-            AccountMeta::new(sequence_key, false),
-            AccountMeta::new(fee_collector_key, false),
-            AccountMeta::new_readonly(solana_program::sysvar::clock::id(), false),
-            // Dependencies
-            AccountMeta::new_readonly(solana_program::sysvar::rent::id(), false),
-            AccountMeta::new_readonly(solana_program::system_program::id(), false),
-            // Program
-            AccountMeta::new_readonly(bridge_id, false),
-            AccountMeta::new_readonly(spl_token::id(), false),
-        ],
-        data: (crate::instruction::Instruction::TransferNative, data).try_to_vec()?,
-    })
-}
-
-pub fn transfer_wrapped(
-    program_id: Pubkey,
-    bridge_id: Pubkey,
-    payer: Pubkey,
-    message_key: Pubkey,
-    from: Pubkey,
-    from_owner: Pubkey,
-    token_chain: u16,
-    token_address: ForeignAddress,
-    data: TransferWrappedData,
-) -> solitaire::Result<Instruction> {
-    let config_key = ConfigAccount::<'_, { AccountState::Uninitialized }>::key(None, &program_id);
-
-    let wrapped_mint_key = WrappedMint::<'_, { AccountState::Uninitialized }>::key(
-        &WrappedDerivationData {
-            token_chain,
-            token_address,
-        },
-        &program_id,
-    );
-    let wrapped_meta_key = WrappedTokenMeta::<'_, { AccountState::Uninitialized }>::key(
-        &WrappedMetaDerivationData {
-            mint_key: wrapped_mint_key,
-        },
-        &program_id,
-    );
-
-    let authority_signer = AuthoritySigner::key(None, &program_id);
-    let emitter_key = EmitterAccount::key(None, &program_id);
-
-    // Bridge keys
-    let bridge_config = Bridge::<'_, { AccountState::Uninitialized }>::key(None, &bridge_id);
-    let payload = PayloadTransfer {
-        amount: U256::from(data.amount),
-        token_address,
-        token_chain,
-        to: data.target_address,
-        to_chain: data.target_chain,
-        fee: U256::from(data.fee),
-    };
-    let sequence_key = Sequence::key(
-        &SequenceDerivationData {
-            emitter_key: &emitter_key,
-        },
-        &bridge_id,
-    );
-    let fee_collector_key = FeeCollector::key(None, &bridge_id);
-
-    Ok(Instruction {
-        program_id,
-        accounts: vec![
-            AccountMeta::new(payer, true),
-            AccountMeta::new_readonly(config_key, false),
-            AccountMeta::new(from, false),
-            AccountMeta::new_readonly(from_owner, true),
-            AccountMeta::new(wrapped_mint_key, false),
-            AccountMeta::new_readonly(wrapped_meta_key, false),
-            AccountMeta::new_readonly(authority_signer, false),
-            AccountMeta::new(bridge_config, false),
-            AccountMeta::new(message_key, true),
-            AccountMeta::new_readonly(emitter_key, false),
-            AccountMeta::new(sequence_key, false),
-            AccountMeta::new(fee_collector_key, false),
-            AccountMeta::new_readonly(solana_program::sysvar::clock::id(), false),
-            // Dependencies
-            AccountMeta::new_readonly(solana_program::sysvar::rent::id(), false),
-            AccountMeta::new_readonly(solana_program::system_program::id(), false),
-            // Program
-            AccountMeta::new_readonly(bridge_id, false),
-            AccountMeta::new_readonly(spl_token::id(), false),
-        ],
-        data: (crate::instruction::Instruction::TransferWrapped, data).try_to_vec()?,
-    })
-}
-
-pub fn attest(
-    program_id: Pubkey,
-    bridge_id: Pubkey,
-    payer: Pubkey,
-    message_key: Pubkey,
-    mint: Pubkey,
-    nonce: u32,
-) -> solitaire::Result<Instruction> {
-    let config_key = ConfigAccount::<'_, { AccountState::Uninitialized }>::key(None, &program_id);
-    let emitter_key = EmitterAccount::key(None, &program_id);
-
-    // SPL Metadata
-    let spl_metadata = SplTokenMeta::key(
-        &SplTokenMetaDerivationData { mint },
-        &spl_token_metadata::id(),
-    );
-
-    // Mint Metadata
-    let mint_meta = WrappedTokenMeta::<'_, { AccountState::Uninitialized }>::key(
-        &WrappedMetaDerivationData { mint_key: mint },
-        &program_id,
-    );
-
-    // Bridge Keys
-    let bridge_config = Bridge::<'_, { AccountState::Uninitialized }>::key(None, &bridge_id);
-    let sequence_key = Sequence::key(
-        &SequenceDerivationData {
-            emitter_key: &emitter_key,
-        },
-        &bridge_id,
-    );
-    let fee_collector_key = FeeCollector::key(None, &bridge_id);
-
-    Ok(Instruction {
-        program_id,
-        accounts: vec![
-            AccountMeta::new(payer, true),
-            AccountMeta::new(config_key, false),
-            AccountMeta::new_readonly(mint, false),
-            AccountMeta::new_readonly(mint_meta, false),
-            AccountMeta::new_readonly(spl_metadata, false),
-            // Bridge accounts
-            AccountMeta::new(bridge_config, false),
-            AccountMeta::new(message_key, true),
-            AccountMeta::new_readonly(emitter_key, false),
-            AccountMeta::new(sequence_key, false),
-            AccountMeta::new(fee_collector_key, false),
-            AccountMeta::new_readonly(solana_program::sysvar::clock::id(), false),
-            // Dependencies
-            AccountMeta::new(solana_program::sysvar::rent::id(), false),
-            AccountMeta::new(solana_program::system_program::id(), false),
-            // Program
-            AccountMeta::new_readonly(bridge_id, false),
-        ],
-        data: (
-            crate::instruction::Instruction::AttestToken,
-            AttestTokenData { nonce },
-        )
-            .try_to_vec()?,
-    })
-}
-
-pub fn upgrade_contract(
-    program_id: Pubkey,
-    payer: Pubkey,
-    payload_message: Pubkey,
-    emitter: Pubkey,
-    new_contract: Pubkey,
-    spill: Pubkey,
-    sequence: u64,
-) -> Instruction {
-    let claim = Claim::<'_, { AccountState::Uninitialized }>::key(
-        &ClaimDerivationData {
-            emitter_address: emitter.to_bytes(),
-            emitter_chain: CHAIN_ID_SOLANA,
-            sequence,
-        },
-        &program_id,
-    );
-
-    let (upgrade_authority, _) = Pubkey::find_program_address(&["upgrade".as_bytes()], &program_id);
-
-    let (program_data, _) = Pubkey::find_program_address(
-        &[program_id.as_ref()],
-        &solana_program::bpf_loader_upgradeable::id(),
-    );
-
-    Instruction {
-        program_id,
-
-        accounts: vec![
-            AccountMeta::new(payer, true),
-            AccountMeta::new_readonly(payload_message, false),
-            AccountMeta::new(claim, false),
-            AccountMeta::new_readonly(upgrade_authority, false),
-            AccountMeta::new(spill, false),
-            AccountMeta::new(new_contract, false),
-            AccountMeta::new(program_data, false),
-            AccountMeta::new(program_id, false),
-            AccountMeta::new_readonly(solana_program::sysvar::rent::id(), false),
-            AccountMeta::new_readonly(solana_program::sysvar::clock::id(), false),
-            AccountMeta::new_readonly(solana_program::bpf_loader_upgradeable::id(), false),
-            AccountMeta::new_readonly(solana_program::system_program::id(), false),
-        ],
-
-        data: (
-            crate::instruction::Instruction::UpgradeContract,
-            UpgradeContractData {},
-        )
-            .try_to_vec()
-            .unwrap(),
-    }
-}

+ 0 - 87
solana/modules/token_bridge/program/src/lib.rs

@@ -1,87 +0,0 @@
-
-#![feature(adt_const_params)]
-#![deny(unused_must_use)]
-
-// #![cfg(all(target_arch = "bpf", not(feature = "no-entrypoint")))]
-
-#[cfg(feature = "no-entrypoint")]
-pub mod instructions;
-
-#[cfg(feature = "wasm")]
-#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
-extern crate wasm_bindgen;
-
-#[cfg(feature = "wasm")]
-#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
-pub mod wasm;
-
-pub mod accounts;
-pub mod api;
-pub mod messages;
-pub mod types;
-
-pub use api::{
-    attest_token,
-    complete_native,
-    complete_wrapped,
-    create_wrapped,
-    initialize,
-    register_chain,
-    transfer_native,
-    transfer_wrapped,
-    upgrade_contract,
-    AttestToken,
-    AttestTokenData,
-    CompleteNative,
-    CompleteNativeData,
-    CompleteWrapped,
-    CompleteWrappedData,
-    CreateWrapped,
-    CreateWrappedData,
-    Initialize,
-    InitializeData,
-    RegisterChain,
-    RegisterChainData,
-    TransferNative,
-    TransferNativeData,
-    TransferWrapped,
-    TransferWrappedData,
-    UpgradeContract,
-    UpgradeContractData,
-};
-
-use solitaire::*;
-use std::error::Error;
-
-pub enum TokenBridgeError {
-    AlreadyExecuted,
-    InvalidChain,
-    InvalidGovernanceKey,
-    InvalidMetadata,
-    InvalidMint,
-    InvalidPayload,
-    InvalidUTF8String,
-    TokenNotNative,
-    UninitializedMint,
-    WrongAccountOwner,
-    InvalidFee,
-    InvalidRecipient,
-}
-
-impl From<TokenBridgeError> for SolitaireError {
-    fn from(t: TokenBridgeError) -> SolitaireError {
-        SolitaireError::Custom(t as u64)
-    }
-}
-
-solitaire! {
-    Initialize(InitializeData) => initialize,
-    AttestToken(AttestTokenData) => attest_token,
-    CompleteNative(CompleteNativeData) => complete_native,
-    CompleteWrapped(CompleteWrappedData) => complete_wrapped,
-    TransferWrapped(TransferWrappedData) => transfer_wrapped,
-    TransferNative(TransferNativeData) => transfer_native,
-    RegisterChain(RegisterChainData) => register_chain,
-    CreateWrapped(CreateWrappedData) => create_wrapped,
-    UpgradeContract(UpgradeContractData) => upgrade_contract,
-}

+ 0 - 389
solana/modules/token_bridge/program/src/messages.rs

@@ -1,389 +0,0 @@
-use crate::{
-    types::{
-        Address,
-        ChainID,
-    },
-    TokenBridgeError,
-};
-use borsh::{
-    BorshDeserialize,
-    BorshSerialize,
-};
-use bridge::{
-    vaa::{
-        DeserializePayload,
-        SerializePayload,
-    },
-    DeserializeGovernancePayload,
-    SerializeGovernancePayload,
-};
-use byteorder::{
-    BigEndian,
-    ReadBytesExt,
-    WriteBytesExt,
-};
-use primitive_types::U256;
-use solana_program::{
-    native_token::Sol,
-    program_error::{
-        ProgramError,
-        ProgramError::InvalidAccountData,
-    },
-    pubkey::Pubkey,
-};
-use solitaire::SolitaireError;
-use std::{
-    error::Error,
-    io::{
-        Cursor,
-        Read,
-        Write,
-    },
-    str::Utf8Error,
-    string::FromUtf8Error,
-};
-
-#[derive(PartialEq, Debug, Clone)]
-pub struct PayloadTransfer {
-    // Amount being transferred (big-endian uint256)
-    pub amount: U256,
-    // Address of the token. Left-zero-padded if shorter than 32 bytes
-    pub token_address: Address,
-    // Chain ID of the token
-    pub token_chain: ChainID,
-    // Address of the recipient. Left-zero-padded if shorter than 32 bytes
-    pub to: Address,
-    // Chain ID of the recipient
-    pub to_chain: ChainID,
-    // Amount of tokens (big-endian uint256) that the user is willing to pay as relayer fee. Must be <= Amount.
-    pub fee: U256,
-}
-
-impl DeserializePayload for PayloadTransfer {
-    fn deserialize(buf: &mut &[u8]) -> Result<Self, SolitaireError> {
-        let mut v = Cursor::new(buf);
-
-        if v.read_u8()? != 1 {
-            return Err(SolitaireError::Custom(0));
-        };
-
-        let mut am_data: [u8; 32] = [0; 32];
-        v.read_exact(&mut am_data)?;
-        let amount = U256::from_big_endian(&am_data);
-
-        let mut token_address = Address::default();
-        v.read_exact(&mut token_address)?;
-
-        let token_chain = v.read_u16::<BigEndian>()?;
-
-        let mut to = Address::default();
-        v.read_exact(&mut to)?;
-
-        let to_chain = v.read_u16::<BigEndian>()?;
-
-        let mut fee_data: [u8; 32] = [0; 32];
-        v.read_exact(&mut fee_data)?;
-        let fee = U256::from_big_endian(&fee_data);
-
-        if v.position() != v.into_inner().len() as u64 {
-            return Err(InvalidAccountData.into());
-        }
-
-        Ok(PayloadTransfer {
-            amount,
-            token_address,
-            token_chain,
-            to,
-            to_chain,
-            fee,
-        })
-    }
-}
-
-impl SerializePayload for PayloadTransfer {
-    fn serialize<W: Write>(&self, writer: &mut W) -> Result<(), SolitaireError> {
-        // Payload ID
-        writer.write_u8(1)?;
-
-        let mut am_data: [u8; 32] = [0; 32];
-        self.amount.to_big_endian(&mut am_data);
-        writer.write(&am_data)?;
-
-        writer.write(&self.token_address)?;
-        writer.write_u16::<BigEndian>(self.token_chain)?;
-        writer.write(&self.to)?;
-        writer.write_u16::<BigEndian>(self.to_chain)?;
-
-        let mut fee_data: [u8; 32] = [0; 32];
-        self.fee.to_big_endian(&mut fee_data);
-        writer.write(&fee_data)?;
-
-        Ok(())
-    }
-}
-
-#[derive(PartialEq, Debug)]
-pub struct PayloadAssetMeta {
-    // Address of the token. Left-zero-padded if shorter than 32 bytes
-    pub token_address: Address,
-    // Chain ID of the token
-    pub token_chain: ChainID,
-    // Number of decimals of the token
-    pub decimals: u8,
-    // Symbol of the token
-    pub symbol: String,
-    // Name of the token
-    pub name: String,
-}
-
-impl DeserializePayload for PayloadAssetMeta {
-    fn deserialize(buf: &mut &[u8]) -> Result<Self, SolitaireError> {
-        use bstr::ByteSlice;
-
-        let mut v = Cursor::new(buf);
-
-        if v.read_u8()? != 2 {
-            return Err(SolitaireError::Custom(0));
-        };
-
-        let mut token_address = Address::default();
-        v.read_exact(&mut token_address)?;
-
-        let token_chain = v.read_u16::<BigEndian>()?;
-        let decimals = v.read_u8()?;
-
-        let mut symbol_data = vec![0u8; 32];
-        v.read_exact(&mut symbol_data)?;
-        symbol_data.retain(|&c| c != 0);
-        let mut symbol: Vec<char> = symbol_data.chars().collect();
-        symbol.retain(|&c| c != '\u{FFFD}');
-        let symbol: String = symbol.iter().collect();
-
-        let mut name_data = vec![0u8; 32];
-        v.read_exact(&mut name_data)?;
-        name_data.retain(|&c| c != 0);
-        let mut name: Vec<char> = name_data.chars().collect();
-        name.retain(|&c| c != '\u{FFFD}');
-        let name: String = name.iter().collect();
-
-        if v.position() != v.into_inner().len() as u64 {
-            return Err(InvalidAccountData.into());
-        }
-
-        Ok(PayloadAssetMeta {
-            token_address,
-            token_chain,
-            decimals,
-            symbol,
-            name,
-        })
-    }
-}
-
-impl SerializePayload for PayloadAssetMeta {
-    fn serialize<W: Write>(&self, writer: &mut W) -> Result<(), SolitaireError> {
-        // Payload ID
-        writer.write_u8(2)?;
-
-        writer.write(&self.token_address)?;
-        writer.write_u16::<BigEndian>(self.token_chain)?;
-
-        writer.write_u8(self.decimals)?;
-
-        let mut symbol: [u8; 32] = [0; 32];
-        for i in 0..self.symbol.len() {
-            symbol[i] = self.symbol.as_bytes()[i];
-        }
-        writer.write(&symbol)?;
-
-        let mut name: [u8; 32] = [0; 32];
-        for i in 0..self.name.len() {
-            name[i] = self.name.as_bytes()[i];
-        }
-        writer.write(&name)?;
-
-        Ok(())
-    }
-}
-
-#[derive(PartialEq, Debug)]
-pub struct PayloadGovernanceRegisterChain {
-    // Chain ID of the chain to be registered
-    pub chain: ChainID,
-    // Address of the endpoint on the chain
-    pub endpoint_address: Address,
-}
-
-impl SerializeGovernancePayload for PayloadGovernanceRegisterChain {
-    const MODULE: &'static str = "TokenBridge";
-    const ACTION: u8 = 1;
-}
-
-impl DeserializeGovernancePayload for PayloadGovernanceRegisterChain {
-}
-
-impl DeserializePayload for PayloadGovernanceRegisterChain
-where
-    Self: DeserializeGovernancePayload,
-{
-    fn deserialize(buf: &mut &[u8]) -> Result<Self, SolitaireError> {
-        let mut v = Cursor::new(buf);
-        Self::check_governance_header(&mut v)?;
-
-        let chain = v.read_u16::<BigEndian>()?;
-        let mut endpoint_address = [0u8; 32];
-        v.read_exact(&mut endpoint_address)?;
-
-        if v.position() != v.into_inner().len() as u64 {
-            return Err(InvalidAccountData.into());
-        }
-
-        Ok(PayloadGovernanceRegisterChain {
-            chain,
-            endpoint_address,
-        })
-    }
-}
-
-impl SerializePayload for PayloadGovernanceRegisterChain
-where
-    Self: SerializeGovernancePayload,
-{
-    fn serialize<W: Write>(&self, writer: &mut W) -> Result<(), SolitaireError> {
-        self.write_governance_header(writer)?;
-        // Payload ID
-        writer.write_u16::<BigEndian>(self.chain)?;
-        writer.write(&self.endpoint_address[..])?;
-
-        Ok(())
-    }
-}
-
-#[derive(PartialEq, Debug)]
-pub struct GovernancePayloadUpgrade {
-    // Address of the new Implementation
-    pub new_contract: Pubkey,
-}
-
-impl SerializePayload for GovernancePayloadUpgrade {
-    fn serialize<W: Write>(&self, v: &mut W) -> std::result::Result<(), SolitaireError> {
-        self.write_governance_header(v)?;
-        v.write(&self.new_contract.to_bytes())?;
-        Ok(())
-    }
-}
-
-impl DeserializePayload for GovernancePayloadUpgrade
-where
-    Self: DeserializeGovernancePayload,
-{
-    fn deserialize(buf: &mut &[u8]) -> Result<Self, SolitaireError> {
-        let mut c = Cursor::new(buf);
-        Self::check_governance_header(&mut c)?;
-
-        let mut addr = [0u8; 32];
-        c.read_exact(&mut addr)?;
-
-        if c.position() != c.into_inner().len() as u64 {
-            return Err(InvalidAccountData.into());
-        }
-
-        Ok(GovernancePayloadUpgrade {
-            new_contract: Pubkey::new(&addr[..]),
-        })
-    }
-}
-
-impl SerializeGovernancePayload for GovernancePayloadUpgrade {
-    const MODULE: &'static str = "TokenBridge";
-    const ACTION: u8 = 2;
-}
-
-impl DeserializeGovernancePayload for GovernancePayloadUpgrade {
-}
-
-#[cfg(feature = "no-entrypoint")]
-mod tests {
-    use crate::messages::{
-        GovernancePayloadUpgrade,
-        PayloadAssetMeta,
-        PayloadGovernanceRegisterChain,
-        PayloadTransfer,
-    };
-    use bridge::{
-        DeserializePayload,
-        SerializePayload,
-    };
-    use primitive_types::U256;
-    use rand::RngCore;
-    use solana_program::pubkey::Pubkey;
-
-    #[test]
-    pub fn test_serde_transfer() {
-        let mut token_address = [0u8; 32];
-        rand::thread_rng().fill_bytes(&mut token_address);
-        let mut to = [0u8; 32];
-        rand::thread_rng().fill_bytes(&mut to);
-
-        let transfer_original = PayloadTransfer {
-            amount: U256::from(1003),
-            token_address,
-            token_chain: 8,
-            to,
-            to_chain: 1,
-            fee: U256::from(1139),
-        };
-
-        let mut data = transfer_original.try_to_vec().unwrap();
-        let transfer_deser = PayloadTransfer::deserialize(&mut data.as_slice()).unwrap();
-
-        assert_eq!(transfer_original, transfer_deser);
-    }
-
-    #[test]
-    pub fn test_serde_asset_meta() {
-        let mut token_address = [0u8; 32];
-        rand::thread_rng().fill_bytes(&mut token_address);
-
-        let am_original = PayloadAssetMeta {
-            token_address,
-            token_chain: 9,
-            decimals: 13,
-            symbol: "ABKK".to_string(),
-            name: "ZAC".to_string(),
-        };
-
-        let mut data = am_original.try_to_vec().unwrap();
-        let am_deser = PayloadAssetMeta::deserialize(&mut data.as_slice()).unwrap();
-
-        assert_eq!(am_original, am_deser);
-    }
-
-    #[test]
-    pub fn test_serde_gov_upgrade() {
-        let original = GovernancePayloadUpgrade {
-            new_contract: Pubkey::new_unique(),
-        };
-
-        let mut data = original.try_to_vec().unwrap();
-        let deser = GovernancePayloadUpgrade::deserialize(&mut data.as_slice()).unwrap();
-
-        assert_eq!(original, deser);
-    }
-
-    #[test]
-    pub fn test_serde_gov_register_chain() {
-        let mut endpoint_address = [0u8; 32];
-        rand::thread_rng().fill_bytes(&mut endpoint_address);
-
-        let original = PayloadGovernanceRegisterChain {
-            chain: 8,
-            endpoint_address,
-        };
-
-        let mut data = original.try_to_vec().unwrap();
-        let deser = PayloadGovernanceRegisterChain::deserialize(&mut data.as_slice()).unwrap();
-
-        assert_eq!(original, deser);
-    }
-}

+ 0 - 63
solana/modules/token_bridge/program/src/types.rs

@@ -1,63 +0,0 @@
-use borsh::{
-    BorshDeserialize,
-    BorshSerialize,
-};
-use serde::{
-    Deserialize,
-    Serialize,
-};
-use solana_program::pubkey::Pubkey;
-use solitaire::{
-    pack_type,
-    processors::seeded::{
-        AccountOwner,
-        Owned,
-    },
-};
-use spl_token::state::{
-    Account,
-    Mint,
-};
-use spl_token_metadata::state::Metadata;
-
-pub type Address = [u8; 32];
-pub type ChainID = u16;
-
-#[derive(Default, Clone, Copy, BorshDeserialize, BorshSerialize, Serialize, Deserialize)]
-pub struct Config {
-    pub wormhole_bridge: Pubkey,
-}
-
-impl Owned for Config {
-    fn owner(&self) -> AccountOwner {
-        AccountOwner::This
-    }
-}
-
-#[derive(Default, Clone, Copy, BorshDeserialize, BorshSerialize, Serialize, Deserialize)]
-pub struct EndpointRegistration {
-    pub chain: ChainID,
-    pub contract: Address,
-}
-
-impl Owned for EndpointRegistration {
-    fn owner(&self) -> AccountOwner {
-        AccountOwner::This
-    }
-}
-
-#[derive(Default, Clone, Copy, BorshDeserialize, BorshSerialize, Serialize, Deserialize)]
-pub struct WrappedMeta {
-    pub chain: ChainID,
-    pub token_address: Address,
-    pub original_decimals: u8,
-}
-
-impl Owned for WrappedMeta {
-    fn owner(&self) -> AccountOwner {
-        AccountOwner::This
-    }
-}
-
-pack_type!(SplMint, Mint, AccountOwner::Other(spl_token::id()));
-pack_type!(SplAccount, Account, AccountOwner::Other(spl_token::id()));

+ 0 - 449
solana/modules/token_bridge/program/src/wasm.rs

@@ -1,449 +0,0 @@
-use crate::{
-    accounts::{
-        AuthoritySigner,
-        CustodySigner,
-        EmitterAccount,
-        WrappedDerivationData,
-        WrappedMetaDerivationData,
-        WrappedMint,
-        WrappedTokenMeta,
-    },
-    instructions::{
-        attest,
-        complete_native,
-        complete_wrapped,
-        create_wrapped,
-        register_chain,
-        transfer_native,
-        transfer_wrapped,
-        upgrade_contract,
-    },
-    messages::{
-        GovernancePayloadUpgrade,
-        PayloadAssetMeta,
-        PayloadGovernanceRegisterChain,
-        PayloadTransfer,
-    },
-    types::{
-        EndpointRegistration,
-        WrappedMeta,
-    },
-    CompleteNativeData,
-    CompleteWrappedData,
-    CreateWrappedData,
-    RegisterChainData,
-    TransferNativeData,
-    TransferWrappedData,
-};
-use borsh::BorshDeserialize;
-use bridge::{
-    accounts::PostedVAADerivationData,
-    instructions::hash_vaa,
-    vaa::VAA,
-    DeserializePayload,
-    PostVAAData,
-};
-use solana_program::pubkey::Pubkey;
-use solitaire::{
-    processors::seeded::Seeded,
-    AccountState,
-};
-use std::str::FromStr;
-use wasm_bindgen::prelude::*;
-
-#[wasm_bindgen]
-pub fn attest_ix(
-    program_id: String,
-    bridge_id: String,
-    payer: String,
-    message: String,
-    mint: String,
-    nonce: u32,
-) -> JsValue {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let bridge_id = Pubkey::from_str(bridge_id.as_str()).unwrap();
-    let payer = Pubkey::from_str(payer.as_str()).unwrap();
-    let message = Pubkey::from_str(message.as_str()).unwrap();
-    let mint = Pubkey::from_str(mint.as_str()).unwrap();
-
-    let ix = attest(program_id, bridge_id, payer, message, mint, nonce).unwrap();
-
-    JsValue::from_serde(&ix).unwrap()
-}
-
-#[wasm_bindgen]
-pub fn transfer_native_ix(
-    program_id: String,
-    bridge_id: String,
-    payer: String,
-    message: String,
-    from: String,
-    mint: String,
-    nonce: u32,
-    amount: u64,
-    fee: u64,
-    target_address: Vec<u8>,
-    target_chain: u16,
-) -> JsValue {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let bridge_id = Pubkey::from_str(bridge_id.as_str()).unwrap();
-    let payer = Pubkey::from_str(payer.as_str()).unwrap();
-    let message = Pubkey::from_str(message.as_str()).unwrap();
-    let from = Pubkey::from_str(from.as_str()).unwrap();
-    let mint = Pubkey::from_str(mint.as_str()).unwrap();
-
-    let mut target_addr = [0u8; 32];
-    target_addr.copy_from_slice(target_address.as_slice());
-
-    let ix = transfer_native(
-        program_id,
-        bridge_id,
-        payer,
-        message,
-        from,
-        mint,
-        TransferNativeData {
-            nonce,
-            amount,
-            fee,
-            target_address: target_addr,
-            target_chain,
-        },
-    )
-    .unwrap();
-
-    JsValue::from_serde(&ix).unwrap()
-}
-
-#[wasm_bindgen]
-pub fn transfer_wrapped_ix(
-    program_id: String,
-    bridge_id: String,
-    payer: String,
-    message: String,
-    from: String,
-    from_owner: String,
-    token_chain: u16,
-    token_address: Vec<u8>,
-    nonce: u32,
-    amount: u64,
-    fee: u64,
-    target_address: Vec<u8>,
-    target_chain: u16,
-) -> JsValue {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let bridge_id = Pubkey::from_str(bridge_id.as_str()).unwrap();
-    let payer = Pubkey::from_str(payer.as_str()).unwrap();
-    let message = Pubkey::from_str(message.as_str()).unwrap();
-    let from = Pubkey::from_str(from.as_str()).unwrap();
-    let from_owner = Pubkey::from_str(from_owner.as_str()).unwrap();
-
-    let mut target_addr = [0u8; 32];
-    target_addr.copy_from_slice(target_address.as_slice());
-    let mut token_addr = [0u8; 32];
-    token_addr.copy_from_slice(token_address.as_slice());
-
-    let ix = transfer_wrapped(
-        program_id,
-        bridge_id,
-        payer,
-        message,
-        from,
-        from_owner,
-        token_chain,
-        token_addr,
-        TransferWrappedData {
-            nonce,
-            amount,
-            fee,
-            target_address: target_addr,
-            target_chain,
-        },
-    )
-    .unwrap();
-
-    JsValue::from_serde(&ix).unwrap()
-}
-
-#[wasm_bindgen]
-pub fn complete_transfer_native_ix(
-    program_id: String,
-    bridge_id: String,
-    payer: String,
-    vaa: Vec<u8>,
-    fee_recipient: Option<String>,
-) -> JsValue {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let bridge_id = Pubkey::from_str(bridge_id.as_str()).unwrap();
-    let payer = Pubkey::from_str(payer.as_str()).unwrap();
-    let vaa = VAA::deserialize(vaa.as_slice()).unwrap();
-    let payload = PayloadTransfer::deserialize(&mut vaa.payload.as_slice()).unwrap();
-    let message_key = bridge::accounts::PostedVAA::<'_, { AccountState::Uninitialized }>::key(
-        &PostedVAADerivationData {
-            payload_hash: hash_vaa(&vaa.clone().into()).to_vec(),
-        },
-        &bridge_id,
-    );
-    let post_vaa_data = PostVAAData {
-        version: vaa.version,
-        guardian_set_index: vaa.guardian_set_index,
-        timestamp: vaa.timestamp,
-        nonce: vaa.nonce,
-        emitter_chain: vaa.emitter_chain,
-        emitter_address: vaa.emitter_address,
-        sequence: vaa.sequence,
-        consistency_level: vaa.consistency_level,
-        payload: vaa.payload,
-    };
-
-    let ix = complete_native(
-        program_id,
-        bridge_id,
-        payer,
-        message_key,
-        post_vaa_data,
-        Pubkey::new(&payload.to[..]),
-        if let Some(fee_r) = fee_recipient {
-            Some(Pubkey::from_str(fee_r.as_str()).unwrap())
-        } else {
-            None
-        },
-        Pubkey::new(&payload.token_address),
-        CompleteNativeData {},
-    )
-    .unwrap();
-
-    JsValue::from_serde(&ix).unwrap()
-}
-
-#[wasm_bindgen]
-pub fn complete_transfer_wrapped_ix(
-    program_id: String,
-    bridge_id: String,
-    payer: String,
-    vaa: Vec<u8>,
-    fee_recipient: Option<String>,
-) -> JsValue {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let bridge_id = Pubkey::from_str(bridge_id.as_str()).unwrap();
-    let payer = Pubkey::from_str(payer.as_str()).unwrap();
-    let vaa = VAA::deserialize(vaa.as_slice()).unwrap();
-    let payload = PayloadTransfer::deserialize(&mut vaa.payload.as_slice()).unwrap();
-    let message_key = bridge::accounts::PostedVAA::<'_, { AccountState::Uninitialized }>::key(
-        &PostedVAADerivationData {
-            payload_hash: hash_vaa(&vaa.clone().into()).to_vec(),
-        },
-        &bridge_id,
-    );
-    let post_vaa_data = PostVAAData {
-        version: vaa.version,
-        guardian_set_index: vaa.guardian_set_index,
-        timestamp: vaa.timestamp,
-        nonce: vaa.nonce,
-        emitter_chain: vaa.emitter_chain,
-        emitter_address: vaa.emitter_address,
-        sequence: vaa.sequence,
-        consistency_level: vaa.consistency_level,
-        payload: vaa.payload,
-    };
-
-    let ix = complete_wrapped(
-        program_id,
-        bridge_id,
-        payer,
-        message_key,
-        post_vaa_data,
-        payload.clone(),
-        Pubkey::new(&payload.to),
-        if let Some(fee_r) = fee_recipient {
-            Some(Pubkey::from_str(fee_r.as_str()).unwrap())
-        } else {
-            None
-        },
-        CompleteWrappedData {},
-    )
-    .unwrap();
-
-    JsValue::from_serde(&ix).unwrap()
-}
-
-#[wasm_bindgen]
-pub fn create_wrapped_ix(
-    program_id: String,
-    bridge_id: String,
-    payer: String,
-    vaa: Vec<u8>,
-) -> JsValue {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let bridge_id = Pubkey::from_str(bridge_id.as_str()).unwrap();
-    let payer = Pubkey::from_str(payer.as_str()).unwrap();
-    let vaa = VAA::deserialize(vaa.as_slice()).unwrap();
-    let payload = PayloadAssetMeta::deserialize(&mut vaa.payload.as_slice()).unwrap();
-    let message_key = bridge::accounts::PostedVAA::<'_, { AccountState::Uninitialized }>::key(
-        &PostedVAADerivationData {
-            payload_hash: hash_vaa(&vaa.clone().into()).to_vec(),
-        },
-        &bridge_id,
-    );
-    let post_vaa_data = PostVAAData {
-        version: vaa.version,
-        guardian_set_index: vaa.guardian_set_index,
-        timestamp: vaa.timestamp,
-        nonce: vaa.nonce,
-        emitter_chain: vaa.emitter_chain,
-        emitter_address: vaa.emitter_address,
-        sequence: vaa.sequence,
-        consistency_level: vaa.consistency_level,
-        payload: vaa.payload,
-    };
-
-    let ix = create_wrapped(
-        program_id,
-        bridge_id,
-        payer,
-        message_key,
-        post_vaa_data,
-        payload,
-        CreateWrappedData {},
-    )
-    .unwrap();
-
-    JsValue::from_serde(&ix).unwrap()
-}
-
-#[wasm_bindgen]
-pub fn upgrade_contract_ix(
-    program_id: String,
-    bridge_id: String,
-    payer: String,
-    spill: String,
-    vaa: Vec<u8>,
-) -> JsValue {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let bridge_id = Pubkey::from_str(bridge_id.as_str()).unwrap();
-    let spill = Pubkey::from_str(spill.as_str()).unwrap();
-    let vaa = VAA::deserialize(vaa.as_slice()).unwrap();
-    let payload = GovernancePayloadUpgrade::deserialize(&mut vaa.payload.as_slice()).unwrap();
-    let message_key = bridge::accounts::PostedVAA::<'_, { AccountState::Uninitialized }>::key(
-        &PostedVAADerivationData {
-            payload_hash: hash_vaa(&vaa.clone().into()).to_vec(),
-        },
-        &bridge_id,
-    );
-    let ix = upgrade_contract(
-        program_id,
-        Pubkey::from_str(payer.as_str()).unwrap(),
-        message_key,
-        Pubkey::new(&vaa.emitter_address),
-        payload.new_contract,
-        spill,
-        vaa.sequence,
-    );
-    return JsValue::from_serde(&ix).unwrap();
-}
-
-#[wasm_bindgen]
-pub fn register_chain_ix(
-    program_id: String,
-    bridge_id: String,
-    payer: String,
-    vaa: Vec<u8>,
-) -> JsValue {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let bridge_id = Pubkey::from_str(bridge_id.as_str()).unwrap();
-    let payer = Pubkey::from_str(payer.as_str()).unwrap();
-    let vaa = VAA::deserialize(vaa.as_slice()).unwrap();
-    let payload = PayloadGovernanceRegisterChain::deserialize(&mut vaa.payload.as_slice()).unwrap();
-    let message_key = bridge::accounts::PostedVAA::<'_, { AccountState::Uninitialized }>::key(
-        &PostedVAADerivationData {
-            payload_hash: hash_vaa(&vaa.clone().into()).to_vec(),
-        },
-        &bridge_id,
-    );
-    let post_vaa_data = PostVAAData {
-        version: vaa.version,
-        guardian_set_index: vaa.guardian_set_index,
-        timestamp: vaa.timestamp,
-        nonce: vaa.nonce,
-        emitter_chain: vaa.emitter_chain,
-        emitter_address: vaa.emitter_address,
-        sequence: vaa.sequence,
-        consistency_level: vaa.consistency_level,
-        payload: vaa.payload,
-    };
-    let ix = register_chain(
-        program_id,
-        bridge_id,
-        payer,
-        message_key,
-        post_vaa_data,
-        payload,
-        RegisterChainData {},
-    )
-    .unwrap();
-    return JsValue::from_serde(&ix).unwrap();
-}
-
-#[wasm_bindgen]
-pub fn emitter_address(program_id: String) -> Vec<u8> {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let emitter = EmitterAccount::key(None, &program_id);
-
-    emitter.to_bytes().to_vec()
-}
-
-#[wasm_bindgen]
-pub fn custody_signer(program_id: String) -> Vec<u8> {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let custody_signer = CustodySigner::key(None, &program_id);
-
-    custody_signer.to_bytes().to_vec()
-}
-
-#[wasm_bindgen]
-pub fn approval_authority_address(program_id: String) -> Vec<u8> {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let approval_authority = AuthoritySigner::key(None, &program_id);
-
-    approval_authority.to_bytes().to_vec()
-}
-
-#[wasm_bindgen]
-pub fn wrapped_address(program_id: String, token_address: Vec<u8>, token_chain: u16) -> Vec<u8> {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let mut t_addr = [0u8; 32];
-    t_addr.copy_from_slice(&token_address);
-
-    let wrapped_addr = WrappedMint::<'_, { AccountState::Initialized }>::key(
-        &WrappedDerivationData {
-            token_address: t_addr,
-            token_chain,
-        },
-        &program_id,
-    );
-
-    wrapped_addr.to_bytes().to_vec()
-}
-
-#[wasm_bindgen]
-pub fn wrapped_meta_address(program_id: String, mint_address: Vec<u8>) -> Vec<u8> {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let mint_key = Pubkey::new(mint_address.as_slice());
-
-    let wrapped_meta_addr = WrappedTokenMeta::<'_, { AccountState::Initialized }>::key(
-        &WrappedMetaDerivationData { mint_key },
-        &program_id,
-    );
-
-    wrapped_meta_addr.to_bytes().to_vec()
-}
-
-#[wasm_bindgen]
-pub fn parse_wrapped_meta(data: Vec<u8>) -> JsValue {
-    JsValue::from_serde(&WrappedMeta::try_from_slice(data.as_slice()).unwrap()).unwrap()
-}
-
-#[wasm_bindgen]
-pub fn parse_endpoint_registration(data: Vec<u8>) -> JsValue {
-    JsValue::from_serde(&EndpointRegistration::try_from_slice(data.as_slice()).unwrap()).unwrap()
-}

+ 0 - 767
solana/modules/token_bridge/program/tests/common.rs

@@ -1,767 +0,0 @@
-#![allow(warnings)]
-
-use borsh::{
-    BorshDeserialize,
-    BorshSerialize,
-};
-use byteorder::{
-    BigEndian,
-    WriteBytesExt,
-};
-use hex_literal::hex;
-use secp256k1::{
-    Message as Secp256k1Message,
-    PublicKey,
-    SecretKey,
-};
-use sha3::Digest;
-use solana_client::{
-    client_error::ClientError,
-    rpc_client::RpcClient,
-    rpc_config::RpcSendTransactionConfig,
-};
-use solana_program::{
-    borsh::try_from_slice_unchecked,
-    hash,
-    instruction::{
-        AccountMeta,
-        Instruction,
-    },
-    program_pack::Pack,
-    pubkey::Pubkey,
-    system_instruction::{
-        self,
-        create_account,
-    },
-    system_program,
-    sysvar,
-};
-use solana_sdk::{
-    commitment_config::CommitmentConfig,
-    rent::Rent,
-    secp256k1_instruction::new_secp256k1_instruction,
-    signature::{
-        read_keypair_file,
-        Keypair,
-        Signature,
-        Signer,
-    },
-    transaction::Transaction,
-};
-use spl_token::state::Mint;
-use std::{
-    convert::TryInto,
-    env,
-    io::{
-        Cursor,
-        Write,
-    },
-    time::{
-        Duration,
-        SystemTime,
-    },
-};
-
-use token_bridge::{
-    accounts::*,
-    instruction,
-    instructions,
-    types::*,
-    Initialize,
-};
-
-use solitaire::{
-    processors::seeded::Seeded,
-    AccountState,
-};
-
-pub use helpers::*;
-
-/// Simple API wrapper for quickly preparing and sending transactions.
-pub fn execute(
-    client: &RpcClient,
-    payer: &Keypair,
-    signers: &[&Keypair],
-    instructions: &[Instruction],
-    commitment_level: CommitmentConfig,
-) -> Result<Signature, ClientError> {
-    let mut transaction = Transaction::new_with_payer(instructions, Some(&payer.pubkey()));
-    let recent_blockhash = client.get_recent_blockhash().unwrap().0;
-    transaction.sign(&signers.to_vec(), recent_blockhash);
-    client.send_and_confirm_transaction_with_spinner_and_config(
-        &transaction,
-        commitment_level,
-        RpcSendTransactionConfig {
-            skip_preflight: true,
-            preflight_commitment: None,
-            encoding: None,
-        },
-    )
-}
-
-mod helpers {
-    use bridge::types::{
-        ConsistencyLevel,
-        PostedVAAData,
-    };
-    use token_bridge::{
-        CompleteNativeData,
-        CompleteWrappedData,
-        CreateWrappedData,
-        RegisterChainData,
-        TransferNativeData,
-        TransferWrappedData,
-    };
-
-    use super::*;
-    use bridge::{
-        accounts::{
-            FeeCollector,
-            PostedVAADerivationData,
-        },
-        PostVAAData,
-    };
-    use std::ops::Add;
-    use token_bridge::messages::{
-        PayloadAssetMeta,
-        PayloadGovernanceRegisterChain,
-        PayloadTransfer,
-    };
-
-    /// Initialize the test environment, spins up a solana-test-validator in the background so that
-    /// each test has a fresh environment to work within.
-    pub fn setup() -> (Keypair, RpcClient, Pubkey, Pubkey) {
-        let payer = env::var("BRIDGE_PAYER").unwrap_or("./payer.json".to_string());
-        let rpc_address = env::var("BRIDGE_RPC").unwrap_or("http://127.0.0.1:8899".to_string());
-        let payer = read_keypair_file(payer).unwrap();
-        let rpc = RpcClient::new(rpc_address);
-
-        let (program, token_program) = (
-            env::var("BRIDGE_PROGRAM")
-                .unwrap_or("Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o".to_string())
-                .parse::<Pubkey>()
-                .unwrap(),
-            env::var("TOKEN_BRIDGE_PROGRAM")
-                .unwrap_or("B6RHG3mfcckmrYN1UhmJzyS1XX3fZKbkeUcpJe9Sy3FE".to_string())
-                .parse::<Pubkey>()
-                .unwrap(),
-        );
-
-        (payer, rpc, program, token_program)
-    }
-
-    /// Wait for a single transaction to fully finalize, guaranteeing chain state has been
-    /// confirmed. Useful for consistently fetching data during state checks.
-    pub fn sync(client: &RpcClient, payer: &Keypair) {
-        execute(
-            client,
-            payer,
-            &[payer],
-            &[system_instruction::transfer(
-                &payer.pubkey(),
-                &payer.pubkey(),
-                1,
-            )],
-            CommitmentConfig::finalized(),
-        )
-        .unwrap();
-    }
-
-    /// Fetch account data, the loop is there to re-attempt until data is available.
-    pub fn get_account_data<T: BorshDeserialize>(
-        client: &RpcClient,
-        account: &Pubkey,
-    ) -> Option<T> {
-        let account = client
-            .get_account_with_commitment(account, CommitmentConfig::processed())
-            .unwrap();
-        T::try_from_slice(&account.value.unwrap().data).ok()
-    }
-
-    pub fn initialize_bridge(
-        client: &RpcClient,
-        program: &Pubkey,
-        payer: &Keypair,
-    ) -> Result<Signature, ClientError> {
-        let initial_guardians = &[[1u8; 20]];
-        execute(
-            client,
-            payer,
-            &[payer],
-            &[bridge::instructions::initialize(
-                *program,
-                payer.pubkey(),
-                50,
-                2_000_000_000,
-                initial_guardians,
-            )
-            .unwrap()],
-            CommitmentConfig::processed(),
-        )
-    }
-
-    pub fn transfer(
-        client: &RpcClient,
-        from: &Keypair,
-        to: &Pubkey,
-        lamports: u64,
-    ) -> Result<Signature, ClientError> {
-        execute(
-            client,
-            from,
-            &[from],
-            &[system_instruction::transfer(&from.pubkey(), to, lamports)],
-            CommitmentConfig::processed(),
-        )
-    }
-
-    pub fn initialize(
-        client: &RpcClient,
-        program: &Pubkey,
-        payer: &Keypair,
-        bridge: &Pubkey,
-    ) -> Result<Signature, ClientError> {
-        let instruction = instructions::initialize(*program, payer.pubkey(), *bridge)
-            .expect("Could not create Initialize instruction");
-
-        for account in instruction.accounts.iter().enumerate() {
-            println!("{}: {}", account.0, account.1.pubkey);
-        }
-
-        execute(
-            client,
-            payer,
-            &[payer],
-            &[instruction],
-            CommitmentConfig::processed(),
-        )
-    }
-
-    pub fn attest(
-        client: &RpcClient,
-        program: &Pubkey,
-        bridge: &Pubkey,
-        payer: &Keypair,
-        message: &Keypair,
-        mint: Pubkey,
-        nonce: u32,
-    ) -> Result<Signature, ClientError> {
-        let mint_data = Mint::unpack(
-            &client
-                .get_account_with_commitment(&mint, CommitmentConfig::processed())?
-                .value
-                .unwrap()
-                .data,
-        )
-        .expect("Could not unpack Mint");
-
-        let instruction = instructions::attest(
-            *program,
-            *bridge,
-            payer.pubkey(),
-            message.pubkey(),
-            mint,
-            nonce,
-        )
-        .expect("Could not create Attest instruction");
-
-        for account in instruction.accounts.iter().enumerate() {
-            println!("{}: {}", account.0, account.1.pubkey);
-        }
-
-        execute(
-            client,
-            payer,
-            &[payer, message],
-            &[instruction],
-            CommitmentConfig::processed(),
-        )
-    }
-
-    pub fn transfer_native(
-        client: &RpcClient,
-        program: &Pubkey,
-        bridge: &Pubkey,
-        payer: &Keypair,
-        message: &Keypair,
-        from: &Keypair,
-        from_owner: &Keypair,
-        mint: Pubkey,
-        amount: u64,
-    ) -> Result<Signature, ClientError> {
-        let instruction = instructions::transfer_native(
-            *program,
-            *bridge,
-            payer.pubkey(),
-            message.pubkey(),
-            from.pubkey(),
-            mint,
-            TransferNativeData {
-                nonce: 0,
-                amount,
-                fee: 0,
-                target_address: [0u8; 32],
-                target_chain: 2,
-            },
-        )
-        .expect("Could not create Transfer Native");
-
-        for account in instruction.accounts.iter().enumerate() {
-            println!("{}: {}", account.0, account.1.pubkey);
-        }
-
-        execute(
-            client,
-            payer,
-            &[payer, from_owner, message],
-            &[
-                spl_token::instruction::approve(
-                    &spl_token::id(),
-                    &from.pubkey(),
-                    &token_bridge::accounts::AuthoritySigner::key(None, program),
-                    &from_owner.pubkey(),
-                    &[],
-                    amount,
-                )
-                .unwrap(),
-                instruction,
-            ],
-            CommitmentConfig::processed(),
-        )
-    }
-
-    pub fn transfer_wrapped(
-        client: &RpcClient,
-        program: &Pubkey,
-        bridge: &Pubkey,
-        payer: &Keypair,
-        message: &Keypair,
-        from: Pubkey,
-        from_owner: &Keypair,
-        token_chain: u16,
-        token_address: Address,
-        amount: u64,
-    ) -> Result<Signature, ClientError> {
-        let instruction = instructions::transfer_wrapped(
-            *program,
-            *bridge,
-            payer.pubkey(),
-            message.pubkey(),
-            from,
-            from_owner.pubkey(),
-            token_chain,
-            token_address,
-            TransferWrappedData {
-                nonce: 0,
-                amount,
-                fee: 0,
-                target_address: [5u8; 32],
-                target_chain: 2,
-            },
-        )
-        .expect("Could not create Transfer Native");
-
-        for account in instruction.accounts.iter().enumerate() {
-            println!("{}: {}", account.0, account.1.pubkey);
-        }
-
-        execute(
-            client,
-            payer,
-            &[payer, from_owner, message],
-            &[
-                spl_token::instruction::approve(
-                    &spl_token::id(),
-                    &from,
-                    &token_bridge::accounts::AuthoritySigner::key(None, program),
-                    &from_owner.pubkey(),
-                    &[],
-                    amount,
-                )
-                .unwrap(),
-                instruction,
-            ],
-            CommitmentConfig::processed(),
-        )
-    }
-
-    pub fn register_chain(
-        client: &RpcClient,
-        program: &Pubkey,
-        bridge: &Pubkey,
-        message_acc: &Pubkey,
-        vaa: PostVAAData,
-        payload: PayloadGovernanceRegisterChain,
-        payer: &Keypair,
-    ) -> Result<Signature, ClientError> {
-        let instruction = instructions::register_chain(
-            *program,
-            *bridge,
-            payer.pubkey(),
-            *message_acc,
-            vaa,
-            payload,
-            RegisterChainData {},
-        )
-        .expect("Could not create Transfer Native");
-
-        for account in instruction.accounts.iter().enumerate() {
-            println!("{}: {}", account.0, account.1.pubkey);
-        }
-
-        execute(
-            client,
-            payer,
-            &[payer],
-            &[instruction],
-            CommitmentConfig::processed(),
-        )
-    }
-
-    pub fn complete_native(
-        client: &RpcClient,
-        program: &Pubkey,
-        bridge: &Pubkey,
-        message_acc: &Pubkey,
-        vaa: PostVAAData,
-        payload: PayloadTransfer,
-        payer: &Keypair,
-    ) -> Result<Signature, ClientError> {
-        let instruction = instructions::complete_native(
-            *program,
-            *bridge,
-            payer.pubkey(),
-            *message_acc,
-            vaa,
-            Pubkey::new(&payload.to[..]),
-            None,
-            Pubkey::new(&payload.token_address[..]),
-            CompleteNativeData {},
-        )
-        .expect("Could not create Complete Native instruction");
-
-        for account in instruction.accounts.iter().enumerate() {
-            println!("{}: {}", account.0, account.1.pubkey);
-        }
-
-        execute(
-            client,
-            payer,
-            &[payer],
-            &[instruction],
-            CommitmentConfig::processed(),
-        )
-    }
-
-    pub fn complete_transfer_wrapped(
-        client: &RpcClient,
-        program: &Pubkey,
-        bridge: &Pubkey,
-        message_acc: &Pubkey,
-        vaa: PostVAAData,
-        payload: PayloadTransfer,
-        payer: &Keypair,
-    ) -> Result<Signature, ClientError> {
-        let to = Pubkey::new(&payload.to[..]);
-
-        let instruction = instructions::complete_wrapped(
-            *program,
-            *bridge,
-            payer.pubkey(),
-            *message_acc,
-            vaa,
-            payload,
-            to,
-            None,
-            CompleteWrappedData {},
-        )
-        .expect("Could not create Complete Wrapped instruction");
-
-        for account in instruction.accounts.iter().enumerate() {
-            println!("{}: {}", account.0, account.1.pubkey);
-        }
-
-        execute(
-            client,
-            payer,
-            &[payer],
-            &[instruction],
-            CommitmentConfig::processed(),
-        )
-    }
-
-    pub fn create_wrapped(
-        client: &RpcClient,
-        program: &Pubkey,
-        bridge: &Pubkey,
-        message_acc: &Pubkey,
-        vaa: PostVAAData,
-        payload: PayloadAssetMeta,
-        payer: &Keypair,
-    ) -> Result<Signature, ClientError> {
-        let instruction = instructions::create_wrapped(
-            *program,
-            *bridge,
-            payer.pubkey(),
-            *message_acc,
-            vaa,
-            payload,
-            CreateWrappedData {},
-        )
-        .expect("Could not create Create Wrapped instruction");
-
-        for account in instruction.accounts.iter().enumerate() {
-            println!("{}: {}", account.0, account.1.pubkey);
-        }
-
-        execute(
-            client,
-            payer,
-            &[payer],
-            &[instruction],
-            CommitmentConfig::processed(),
-        )
-    }
-
-    pub fn create_mint(
-        client: &RpcClient,
-        payer: &Keypair,
-        mint_authority: &Pubkey,
-        mint: &Keypair,
-    ) -> Result<Signature, ClientError> {
-        execute(
-            client,
-            payer,
-            &[payer, mint],
-            &[
-                solana_sdk::system_instruction::create_account(
-                    &payer.pubkey(),
-                    &mint.pubkey(),
-                    Rent::default().minimum_balance(spl_token::state::Mint::LEN),
-                    spl_token::state::Mint::LEN as u64,
-                    &spl_token::id(),
-                ),
-                spl_token::instruction::initialize_mint(
-                    &spl_token::id(),
-                    &mint.pubkey(),
-                    mint_authority,
-                    None,
-                    0,
-                )
-                .unwrap(),
-            ],
-            CommitmentConfig::processed(),
-        )
-    }
-
-    pub fn create_spl_metadata(
-        client: &RpcClient,
-        payer: &Keypair,
-        metadata_account: &Pubkey,
-        mint_authority: &Keypair,
-        mint: &Keypair,
-        update_authority: &Pubkey,
-        name: String,
-        symbol: String,
-    ) -> Result<Signature, ClientError> {
-        execute(
-            client,
-            payer,
-            &[payer, mint_authority],
-            &[spl_token_metadata::instruction::create_metadata_accounts(
-                spl_token_metadata::id(),
-                *metadata_account,
-                mint.pubkey(),
-                mint_authority.pubkey(),
-                payer.pubkey(),
-                *update_authority,
-                name,
-                symbol,
-                "https://token.org".to_string(),
-                None,
-                0,
-                false,
-                false,
-            )],
-            CommitmentConfig::processed(),
-        )
-    }
-
-    pub fn create_token_account(
-        client: &RpcClient,
-        payer: &Keypair,
-        token_acc: &Keypair,
-        token_authority: Pubkey,
-        mint: Pubkey,
-    ) -> Result<Signature, ClientError> {
-        execute(
-            client,
-            payer,
-            &[payer, token_acc],
-            &[
-                solana_sdk::system_instruction::create_account(
-                    &payer.pubkey(),
-                    &token_acc.pubkey(),
-                    Rent::default().minimum_balance(spl_token::state::Account::LEN),
-                    spl_token::state::Account::LEN as u64,
-                    &spl_token::id(),
-                ),
-                spl_token::instruction::initialize_account(
-                    &spl_token::id(),
-                    &token_acc.pubkey(),
-                    &mint,
-                    &token_authority,
-                )
-                .unwrap(),
-            ],
-            CommitmentConfig::processed(),
-        )
-    }
-
-    pub fn mint_tokens(
-        client: &RpcClient,
-        payer: &Keypair,
-        mint_authority: &Keypair,
-        mint: &Keypair,
-        token_account: &Pubkey,
-        amount: u64,
-    ) -> Result<Signature, ClientError> {
-        execute(
-            client,
-            payer,
-            &[payer, &mint_authority],
-            &[spl_token::instruction::mint_to(
-                &spl_token::id(),
-                &mint.pubkey(),
-                token_account,
-                &mint_authority.pubkey(),
-                &[],
-                amount,
-            )
-            .unwrap()],
-            CommitmentConfig::processed(),
-        )
-    }
-
-    /// Utility function for generating VAA's from message data.
-    pub fn generate_vaa(
-        emitter: Address,
-        emitter_chain: u16,
-        data: Vec<u8>,
-        nonce: u32,
-        sequence: u64,
-    ) -> (PostVAAData, [u8; 32], [u8; 32]) {
-        let mut vaa = PostVAAData {
-            version: 0,
-            guardian_set_index: 0,
-
-            // Body part
-            emitter_chain,
-            emitter_address: emitter,
-            sequence,
-            payload: data,
-            timestamp: SystemTime::now()
-                .duration_since(SystemTime::UNIX_EPOCH)
-                .unwrap()
-                .as_secs() as u32,
-            nonce,
-            consistency_level: ConsistencyLevel::Confirmed as u8,
-        };
-
-        // Hash data, the thing we wish to actually sign.
-        let body = {
-            let mut v = Cursor::new(Vec::new());
-            v.write_u32::<BigEndian>(vaa.timestamp).unwrap();
-            v.write_u32::<BigEndian>(vaa.nonce).unwrap();
-            v.write_u16::<BigEndian>(vaa.emitter_chain).unwrap();
-            v.write(&vaa.emitter_address).unwrap();
-            v.write_u64::<BigEndian>(vaa.sequence).unwrap();
-            v.write_u8(vaa.consistency_level).unwrap();
-            v.write(&vaa.payload).unwrap();
-            v.into_inner()
-        };
-
-        // Hash this body, which is expected to be the same as the hash currently stored in the
-        // signature account, binding that set of signatures to this VAA.
-        let body: [u8; 32] = {
-            let mut h = sha3::Keccak256::default();
-            h.write(body.as_slice()).unwrap();
-            h.finalize().into()
-        };
-
-        let body_hash: [u8; 32] = {
-            let mut h = sha3::Keccak256::default();
-            h.write(&body).unwrap();
-            h.finalize().into()
-        };
-
-        (vaa, body, body_hash)
-    }
-
-    pub fn post_vaa(
-        client: &RpcClient,
-        program: &Pubkey,
-        payer: &Keypair,
-        vaa: PostVAAData,
-    ) -> Result<(), ClientError> {
-        let instruction =
-            bridge::instructions::post_vaa(*program, payer.pubkey(), Pubkey::new_unique(), vaa);
-
-        for account in instruction.accounts.iter().enumerate() {
-            println!("{}: {}", account.0, account.1.pubkey);
-        }
-
-        execute(
-            client,
-            payer,
-            &[payer],
-            &[instruction],
-            CommitmentConfig::processed(),
-        )?;
-
-        Ok(())
-    }
-
-    pub fn post_message(
-        client: &RpcClient,
-        program: &Pubkey,
-        payer: &Keypair,
-        emitter: &Keypair,
-        message: &Keypair,
-        nonce: u32,
-        data: Vec<u8>,
-        fee: u64,
-    ) -> Result<(), ClientError> {
-        // Transfer money into the fee collector as it needs a balance/must exist.
-        let fee_collector = FeeCollector::<'_>::key(None, program);
-
-        // Capture the resulting message, later functions will need this.
-        let instruction = bridge::instructions::post_message(
-            *program,
-            payer.pubkey(),
-            emitter.pubkey(),
-            message.pubkey(),
-            nonce,
-            data,
-            ConsistencyLevel::Confirmed,
-        )
-        .unwrap();
-
-        for account in instruction.accounts.iter().enumerate() {
-            println!("{}: {}", account.0, account.1.pubkey);
-        }
-
-        execute(
-            client,
-            payer,
-            &[payer, emitter, message],
-            &[
-                system_instruction::transfer(&payer.pubkey(), &fee_collector, fee),
-                instruction,
-            ],
-            CommitmentConfig::processed(),
-        )?;
-
-        Ok(())
-    }
-}

+ 0 - 631
solana/modules/token_bridge/program/tests/integration.rs

@@ -1,631 +0,0 @@
-#![allow(warnings)]
-
-use borsh::BorshSerialize;
-use byteorder::{
-    BigEndian,
-    WriteBytesExt,
-};
-use hex_literal::hex;
-use rand::Rng;
-use secp256k1::{
-    Message as Secp256k1Message,
-    PublicKey,
-    SecretKey,
-};
-use sha3::Digest;
-use solana_client::rpc_client::RpcClient;
-use solana_program::{
-    borsh::try_from_slice_unchecked,
-    hash,
-    instruction::{
-        AccountMeta,
-        Instruction,
-    },
-    program_pack::Pack,
-    pubkey::Pubkey,
-    system_instruction::{
-        self,
-        create_account,
-    },
-    system_program,
-    sysvar,
-};
-use solana_sdk::{
-    commitment_config::CommitmentConfig,
-    signature::{
-        read_keypair_file,
-        Keypair,
-        Signer,
-    },
-    transaction::Transaction,
-};
-use solitaire::{
-    processors::seeded::Seeded,
-    AccountState,
-};
-use spl_token::state::Mint;
-use std::{
-    convert::TryInto,
-    io::{
-        Cursor,
-        Write,
-    },
-    time::{
-        Duration,
-        SystemTime,
-    },
-};
-
-use bridge::{
-    accounts::{
-        Bridge,
-        FeeCollector,
-        GuardianSet,
-        GuardianSetDerivationData,
-        PostedVAA,
-        PostedVAADerivationData,
-        SignatureSet,
-    },
-    instruction,
-    types::{
-        BridgeConfig,
-        BridgeData,
-        GovernancePayloadGuardianSetChange,
-        GovernancePayloadSetMessageFee,
-        GovernancePayloadTransferFees,
-        GuardianSetData,
-        MessageData,
-        PostedVAAData,
-        SequenceTracker,
-        SignatureSet as SignatureSetData,
-    },
-    Initialize,
-    PostVAA,
-    PostVAAData,
-    SerializePayload,
-    Signature,
-};
-use primitive_types::U256;
-use std::{
-    collections::HashMap,
-    str::FromStr,
-    time::UNIX_EPOCH,
-};
-use token_bridge::{
-    accounts::{
-        EmitterAccount,
-        WrappedDerivationData,
-        WrappedMint,
-    },
-    messages::{
-        PayloadAssetMeta,
-        PayloadGovernanceRegisterChain,
-        PayloadTransfer,
-    },
-    types::Address,
-};
-
-mod common;
-
-const GOVERNANCE_KEY: [u8; 64] = [
-    240, 133, 120, 113, 30, 67, 38, 184, 197, 72, 234, 99, 241, 21, 58, 225, 41, 157, 171, 44, 196,
-    163, 134, 236, 92, 148, 110, 68, 127, 114, 177, 0, 173, 253, 199, 9, 242, 142, 201, 174, 108,
-    197, 18, 102, 115, 0, 31, 205, 127, 188, 191, 56, 171, 228, 20, 247, 149, 170, 141, 231, 147,
-    88, 97, 199,
-];
-
-struct Context {
-    /// Address of the core bridge contract.
-    bridge: Pubkey,
-
-    /// Shared RPC client for tests to make transactions with.
-    client: RpcClient,
-
-    /// Payer key with a ton of lamports to ease testing with.
-    payer: Keypair,
-
-    /// Track nonces throughout the tests.
-    seq: Sequencer,
-
-    /// Address of the token bridge itself that we wish to test.
-    token_bridge: Pubkey,
-
-    /// Keypairs for mint information, required in multiple tests.
-    mint_authority: Keypair,
-    mint: Keypair,
-    mint_meta: Pubkey,
-
-    /// Keypairs for test token accounts.
-    token_authority: Keypair,
-    token_account: Keypair,
-    metadata_account: Pubkey,
-}
-
-/// Small helper to track and provide sequences during tests. This is in particular needed for
-/// guardian operations that require them for derivations.
-struct Sequencer {
-    sequences: HashMap<[u8; 32], u64>,
-}
-
-impl Sequencer {
-    fn next(&mut self, emitter: [u8; 32]) -> u64 {
-        let entry = self.sequences.entry(emitter).or_insert(0);
-        *entry += 1;
-        *entry - 1
-    }
-
-    fn peek(&mut self, emitter: [u8; 32]) -> u64 {
-        *self.sequences.entry(emitter).or_insert(0)
-    }
-}
-
-#[test]
-fn run_integration_tests() {
-    let (payer, client, bridge, token_bridge) = common::setup();
-
-    // Setup a Bridge to test against.
-    println!("Bridge: {}", bridge);
-    common::initialize_bridge(&client, &bridge, &payer);
-
-    // Context for test environment.
-    let mint = Keypair::new();
-    let mint_pubkey = mint.pubkey();
-    let metadata_pubkey = Pubkey::from_str("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s").unwrap();
-
-    // SPL Token Meta
-    let metadata_seeds = &[
-        "metadata".as_bytes(),
-        metadata_pubkey.as_ref(),
-        mint_pubkey.as_ref(),
-    ];
-
-    let (metadata_key, metadata_bump_seed) = Pubkey::find_program_address(
-        metadata_seeds,
-        &Pubkey::from_str("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s").unwrap(),
-    );
-
-    // Token Bridge Meta
-    use token_bridge::accounts::WrappedTokenMeta;
-    let metadata_account = WrappedTokenMeta::<'_, { AccountState::Uninitialized }>::key(
-        &token_bridge::accounts::WrappedMetaDerivationData {
-            mint_key: mint_pubkey.clone(),
-        },
-        &token_bridge,
-    );
-
-    let mut context = Context {
-        seq: Sequencer {
-            sequences: HashMap::new(),
-        },
-        bridge,
-        client,
-        payer,
-        token_bridge,
-        mint_authority: Keypair::new(),
-        mint,
-        mint_meta: metadata_account,
-        token_account: Keypair::new(),
-        token_authority: Keypair::new(),
-        metadata_account: metadata_key,
-    };
-
-    // Create a mint for use within tests.
-    common::create_mint(
-        &context.client,
-        &context.payer,
-        &context.mint_authority.pubkey(),
-        &context.mint,
-    )
-    .unwrap();
-
-    // Create Token accounts for use within tests.
-    common::create_token_account(
-        &context.client,
-        &context.payer,
-        &context.token_account,
-        context.token_authority.pubkey(),
-        context.mint.pubkey(),
-    )
-    .unwrap();
-
-    // Mint tokens
-    common::mint_tokens(
-        &context.client,
-        &context.payer,
-        &context.mint_authority,
-        &context.mint,
-        &context.token_account.pubkey(),
-        1000,
-    )
-    .unwrap();
-
-    // Initialize the bridge and verify the bridges state.
-    test_initialize(&mut context);
-    test_transfer_native(&mut context);
-    test_attest(&mut context);
-    test_register_chain(&mut context);
-    test_transfer_native_in(&mut context);
-
-    // Create an SPL Metadata account to test attestations for wrapped tokens.
-    common::create_spl_metadata(
-        &context.client,
-        &context.payer,
-        &context.metadata_account,
-        &context.mint_authority,
-        &context.mint,
-        &context.payer.pubkey(),
-        "BTC".to_string(),
-        "Bitcoin".to_string(),
-    )
-    .unwrap();
-
-    let wrapped = test_create_wrapped(&mut context);
-    let wrapped_acc = Keypair::new();
-    common::create_token_account(
-        &context.client,
-        &context.payer,
-        &wrapped_acc,
-        context.token_authority.pubkey(),
-        wrapped,
-    )
-    .unwrap();
-    test_transfer_wrapped_in(&mut context, wrapped_acc.pubkey());
-    test_transfer_wrapped(&mut context, wrapped_acc.pubkey());
-}
-
-fn test_attest(context: &mut Context) -> () {
-    println!("Attest");
-    use token_bridge::{
-        accounts::ConfigAccount,
-        types::Config,
-    };
-
-    let Context {
-        ref payer,
-        ref client,
-        ref bridge,
-        ref token_bridge,
-        ref mint_authority,
-        ref mint,
-        ref mint_meta,
-        ref metadata_account,
-        ..
-    } = context;
-
-    let message = &Keypair::new();
-
-    common::attest(
-        client,
-        token_bridge,
-        bridge,
-        payer,
-        message,
-        mint.pubkey(),
-        0,
-    )
-    .unwrap();
-
-    let emitter_key = EmitterAccount::key(None, &token_bridge);
-    let mint_data = Mint::unpack(
-        &client
-            .get_account_with_commitment(&mint.pubkey(), CommitmentConfig::processed())
-            .unwrap()
-            .value
-            .unwrap()
-            .data,
-    )
-    .unwrap();
-    let payload = PayloadAssetMeta {
-        token_address: mint.pubkey().to_bytes(),
-        token_chain: 1,
-        decimals: mint_data.decimals,
-        symbol: "USD".to_string(),
-        name: "Bitcoin".to_string(),
-    };
-    let payload = payload.try_to_vec().unwrap();
-}
-
-fn test_transfer_native(context: &mut Context) -> () {
-    println!("Transfer Native");
-    use token_bridge::{
-        accounts::ConfigAccount,
-        types::Config,
-    };
-
-    let Context {
-        ref payer,
-        ref client,
-        ref bridge,
-        ref token_bridge,
-        ref mint_authority,
-        ref mint,
-        ref mint_meta,
-        ref token_account,
-        ref token_authority,
-        ..
-    } = context;
-
-    let message = &Keypair::new();
-
-    common::transfer_native(
-        client,
-        token_bridge,
-        bridge,
-        payer,
-        message,
-        token_account,
-        token_authority,
-        mint.pubkey(),
-        100,
-    )
-    .unwrap();
-}
-
-fn test_transfer_wrapped(context: &mut Context, token_account: Pubkey) -> () {
-    println!("TransferWrapped");
-    use token_bridge::{
-        accounts::ConfigAccount,
-        types::Config,
-    };
-
-    let Context {
-        ref payer,
-        ref client,
-        ref bridge,
-        ref token_bridge,
-        ref mint_authority,
-        ref token_authority,
-        ..
-    } = context;
-
-    let message = &Keypair::new();
-
-    common::transfer_wrapped(
-        client,
-        token_bridge,
-        bridge,
-        payer,
-        message,
-        token_account,
-        token_authority,
-        2,
-        [1u8; 32],
-        10000000,
-    )
-    .unwrap();
-}
-
-fn test_register_chain(context: &mut Context) -> () {
-    println!("Register Chain");
-    use token_bridge::{
-        accounts::ConfigAccount,
-        types::Config,
-    };
-
-    let Context {
-        ref payer,
-        ref client,
-        ref bridge,
-        ref token_bridge,
-        ref mint_authority,
-        ref mint,
-        ref mint_meta,
-        ref token_account,
-        ref token_authority,
-        ..
-    } = context;
-
-    let nonce = rand::thread_rng().gen();
-    let emitter = Keypair::from_bytes(&GOVERNANCE_KEY).unwrap();
-    let payload = PayloadGovernanceRegisterChain {
-        chain: 2,
-        endpoint_address: [0u8; 32],
-    };
-    let message = payload.try_to_vec().unwrap();
-
-    let (vaa, _, _) = common::generate_vaa(emitter.pubkey().to_bytes(), 1, message, nonce, 0);
-    common::post_vaa(client, bridge, payer, vaa.clone()).unwrap();
-
-    let mut msg_derivation_data = &PostedVAADerivationData {
-        payload_hash: bridge::instructions::hash_vaa(&vaa).to_vec(),
-    };
-    let message_key =
-        PostedVAA::<'_, { AccountState::MaybeInitialized }>::key(&msg_derivation_data, &bridge);
-
-    common::register_chain(
-        client,
-        token_bridge,
-        bridge,
-        &message_key,
-        vaa,
-        payload,
-        payer,
-    )
-    .unwrap();
-}
-
-fn test_transfer_native_in(context: &mut Context) -> () {
-    println!("TransferNativeIn");
-    use token_bridge::{
-        accounts::ConfigAccount,
-        types::Config,
-    };
-
-    let Context {
-        ref payer,
-        ref client,
-        ref bridge,
-        ref token_bridge,
-        ref mint_authority,
-        ref mint,
-        ref mint_meta,
-        ref token_account,
-        ref token_authority,
-        ..
-    } = context;
-
-    let nonce = rand::thread_rng().gen();
-
-    let payload = PayloadTransfer {
-        amount: U256::from(100),
-        token_address: mint.pubkey().to_bytes(),
-        token_chain: 1,
-        to: token_account.pubkey().to_bytes(),
-        to_chain: 1,
-        fee: U256::from(0),
-    };
-    let message = payload.try_to_vec().unwrap();
-
-    let (vaa, _, _) = common::generate_vaa([0u8; 32], 2, message, nonce, 1);
-    common::post_vaa(client, bridge, payer, vaa.clone()).unwrap();
-    let mut msg_derivation_data = &PostedVAADerivationData {
-        payload_hash: bridge::instructions::hash_vaa(&vaa).to_vec(),
-    };
-    let message_key =
-        PostedVAA::<'_, { AccountState::MaybeInitialized }>::key(&msg_derivation_data, &bridge);
-
-    common::complete_native(
-        client,
-        token_bridge,
-        bridge,
-        &message_key,
-        vaa,
-        payload,
-        payer,
-    )
-    .unwrap();
-}
-
-fn test_transfer_wrapped_in(context: &mut Context, to: Pubkey) -> () {
-    println!("TransferWrappedIn");
-    use token_bridge::{
-        accounts::ConfigAccount,
-        types::Config,
-    };
-
-    let Context {
-        ref payer,
-        ref client,
-        ref bridge,
-        ref token_bridge,
-        ref mint_authority,
-        ref mint,
-        ref mint_meta,
-        ref token_account,
-        ref token_authority,
-        ..
-    } = context;
-
-    let nonce = rand::thread_rng().gen();
-
-    let payload = PayloadTransfer {
-        amount: U256::from(100000000),
-        token_address: [1u8; 32],
-        token_chain: 2,
-        to: to.to_bytes(),
-        to_chain: 1,
-        fee: U256::from(0),
-    };
-    let message = payload.try_to_vec().unwrap();
-
-    let (vaa, _, _) = common::generate_vaa([0u8; 32], 2, message, nonce, rand::thread_rng().gen());
-    common::post_vaa(client, bridge, payer, vaa.clone()).unwrap();
-    let mut msg_derivation_data = &PostedVAADerivationData {
-        payload_hash: bridge::instructions::hash_vaa(&vaa).to_vec(),
-    };
-    let message_key =
-        PostedVAA::<'_, { AccountState::MaybeInitialized }>::key(&msg_derivation_data, &bridge);
-
-    common::complete_transfer_wrapped(
-        client,
-        token_bridge,
-        bridge,
-        &message_key,
-        vaa,
-        payload,
-        payer,
-    )
-    .unwrap();
-}
-
-fn test_create_wrapped(context: &mut Context) -> (Pubkey) {
-    println!("CreateWrapped");
-    use token_bridge::{
-        accounts::ConfigAccount,
-        types::Config,
-    };
-
-    let Context {
-        ref payer,
-        ref client,
-        ref bridge,
-        ref token_bridge,
-        ref mint_authority,
-        ref mint,
-        ref mint_meta,
-        ref token_account,
-        ref token_authority,
-        ..
-    } = context;
-
-    let nonce = rand::thread_rng().gen();
-
-    let payload = PayloadAssetMeta {
-        token_address: [1u8; 32],
-        token_chain: 2,
-        decimals: 7,
-        symbol: "".to_string(),
-        name: "".to_string(),
-    };
-    let message = payload.try_to_vec().unwrap();
-
-    let (vaa, _, _) = common::generate_vaa([0u8; 32], 2, message, nonce, 2);
-    common::post_vaa(client, bridge, payer, vaa.clone()).unwrap();
-    let mut msg_derivation_data = &PostedVAADerivationData {
-        payload_hash: bridge::instructions::hash_vaa(&vaa).to_vec(),
-    };
-    let message_key =
-        PostedVAA::<'_, { AccountState::MaybeInitialized }>::key(&msg_derivation_data, &bridge);
-
-    common::create_wrapped(
-        client,
-        token_bridge,
-        bridge,
-        &message_key,
-        vaa,
-        payload,
-        payer,
-    )
-    .unwrap();
-
-    return WrappedMint::<'_, { AccountState::Initialized }>::key(
-        &WrappedDerivationData {
-            token_chain: 2,
-            token_address: [1u8; 32],
-        },
-        token_bridge,
-    );
-}
-
-fn test_initialize(context: &mut Context) {
-    println!("Initialize");
-    use token_bridge::{
-        accounts::ConfigAccount,
-        types::Config,
-    };
-
-    let Context {
-        ref payer,
-        ref client,
-        ref bridge,
-        ref token_bridge,
-        ..
-    } = context;
-
-    common::initialize(client, token_bridge, payer, &bridge).unwrap();
-
-    // Verify Token Bridge State
-    let config_key = ConfigAccount::<'_, { AccountState::Uninitialized }>::key(None, &token_bridge);
-    let config: Config = common::get_account_data(client, &config_key).unwrap();
-    assert_eq!(config.wormhole_bridge, *bridge);
-}

+ 0 - 20
solana/modules/token_bridge/token-metadata/Cargo.toml

@@ -1,20 +0,0 @@
-[package]
-name = "spl-token-metadata"
-version = "0.0.1"
-description = "Metaplex Metadata"
-authors = ["Metaplex Maintainers <maintainers@metaplex.com>"]
-repository = "https://github.com/metaplex-foundation/metaplex"
-license = "Apache-2.0"
-edition = "2018"
-
-[lib]
-crate-type = ["cdylib", "lib"]
-
-[features]
-no-entrypoint = []
-test-bpf = []
-
-[dependencies]
-borsh = "=0.9.1"
-solana-program = "=1.9.4"
-spl-token = { version = "=3.2.0", features = ["no-entrypoint"] }

+ 0 - 8
solana/modules/token_bridge/token-metadata/README.md

@@ -1,8 +0,0 @@
----
-title: Token Metadata Program
----
-
-Fork of the SPL Token Metadata program from the Metaplex repository, this is
-temporary until there are versioned releases we can compile against. Currently
-the upstream version depends on a version of solana with conflicting versions
-of borsh.

+ 0 - 2
solana/modules/token_bridge/token-metadata/Xargo.toml

@@ -1,2 +0,0 @@
-[target.bpfel-unknown-unknown.dependencies.std]
-features = []

binární
solana/modules/token_bridge/token-metadata/spl_token_metadata.so


+ 0 - 138
solana/modules/token_bridge/token-metadata/src/instruction.rs

@@ -1,138 +0,0 @@
-use crate::state::{
-    Creator,
-    Data,
-    EDITION,
-    EDITION_MARKER_BIT_SIZE,
-    PREFIX,
-};
-use borsh::{
-    BorshDeserialize,
-    BorshSerialize,
-};
-use solana_program::{
-    instruction::{
-        AccountMeta,
-        Instruction,
-    },
-    pubkey::Pubkey,
-    sysvar,
-};
-
-#[repr(C)]
-#[derive(BorshSerialize, BorshDeserialize, PartialEq, Debug, Clone)]
-/// Args for update call
-pub struct UpdateMetadataAccountArgs {
-    pub data: Option<Data>,
-    pub update_authority: Option<Pubkey>,
-    pub primary_sale_happened: Option<bool>,
-}
-
-#[repr(C)]
-#[derive(BorshSerialize, BorshDeserialize, PartialEq, Debug, Clone)]
-/// Args for create call
-pub struct CreateMetadataAccountArgs {
-    /// Note that unique metadatas are disabled for now.
-    pub data: Data,
-    /// Whether you want your metadata to be updateable in the future.
-    pub is_mutable: bool,
-}
-
-#[repr(C)]
-#[derive(BorshSerialize, BorshDeserialize, PartialEq, Debug, Clone)]
-pub struct CreateMasterEditionArgs {
-    /// If set, means that no more than this number of editions can ever be minted. This is immutable.
-    pub max_supply: Option<u64>,
-}
-
-#[repr(C)]
-#[derive(BorshSerialize, BorshDeserialize, PartialEq, Debug, Clone)]
-pub struct MintNewEditionFromMasterEditionViaTokenArgs {
-    pub edition: u64,
-}
-
-/// Instructions supported by the Metadata program.
-#[derive(BorshSerialize, BorshDeserialize, Clone)]
-pub enum MetadataInstruction {
-    /// Create Metadata object.
-    ///   0. `[writable]`  Metadata key (pda of ['metadata', program id, mint id])
-    ///   1. `[]` Mint of token asset
-    ///   2. `[signer]` Mint authority
-    ///   3. `[signer]` payer
-    ///   4. `[]` update authority info
-    ///   5. `[]` System program
-    ///   6. `[]` Rent info
-    CreateMetadataAccount(CreateMetadataAccountArgs),
-
-    /// Update a Metadata
-    ///   0. `[writable]` Metadata account
-    ///   1. `[signer]` Update authority key
-    UpdateMetadataAccount(UpdateMetadataAccountArgs),
-}
-
-/// Creates an CreateMetadataAccounts instruction
-#[allow(clippy::too_many_arguments)]
-pub fn create_metadata_accounts(
-    program_id: Pubkey,
-    metadata_account: Pubkey,
-    mint: Pubkey,
-    mint_authority: Pubkey,
-    payer: Pubkey,
-    update_authority: Pubkey,
-    name: String,
-    symbol: String,
-    uri: String,
-    creators: Option<Vec<Creator>>,
-    seller_fee_basis_points: u16,
-    update_authority_is_signer: bool,
-    is_mutable: bool,
-) -> Instruction {
-    Instruction {
-        program_id,
-        accounts: vec![
-            AccountMeta::new(metadata_account, false),
-            AccountMeta::new_readonly(mint, false),
-            AccountMeta::new_readonly(mint_authority, true),
-            AccountMeta::new(payer, true),
-            AccountMeta::new_readonly(update_authority, update_authority_is_signer),
-            AccountMeta::new_readonly(solana_program::system_program::id(), false),
-            AccountMeta::new_readonly(sysvar::rent::id(), false),
-        ],
-        data: MetadataInstruction::CreateMetadataAccount(CreateMetadataAccountArgs {
-            data: Data {
-                name,
-                symbol,
-                uri,
-                seller_fee_basis_points,
-                creators,
-            },
-            is_mutable,
-        })
-        .try_to_vec()
-        .unwrap(),
-    }
-}
-
-/// update metadata account instruction
-pub fn update_metadata_accounts(
-    program_id: Pubkey,
-    metadata_account: Pubkey,
-    update_authority: Pubkey,
-    new_update_authority: Option<Pubkey>,
-    data: Option<Data>,
-    primary_sale_happened: Option<bool>,
-) -> Instruction {
-    Instruction {
-        program_id,
-        accounts: vec![
-            AccountMeta::new(metadata_account, false),
-            AccountMeta::new_readonly(update_authority, true),
-        ],
-        data: MetadataInstruction::UpdateMetadataAccount(UpdateMetadataAccountArgs {
-            data,
-            update_authority: new_update_authority,
-            primary_sale_happened,
-        })
-        .try_to_vec()
-        .unwrap(),
-    }
-}

+ 0 - 7
solana/modules/token_bridge/token-metadata/src/lib.rs

@@ -1,7 +0,0 @@
-#![allow(warnings)]
-
-pub mod instruction;
-pub mod state;
-pub mod utils;
-
-solana_program::declare_id!("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s");

+ 0 - 126
solana/modules/token_bridge/token-metadata/src/state.rs

@@ -1,126 +0,0 @@
-use crate::utils::try_from_slice_checked;
-use borsh::{
-    BorshDeserialize,
-    BorshSerialize,
-};
-use solana_program::{
-    account_info::AccountInfo,
-    entrypoint::ProgramResult,
-    program_error::ProgramError,
-    pubkey::Pubkey,
-};
-
-/// prefix used for PDAs to avoid certain collision attacks (https://en.wikipedia.org/wiki/Collision_attack#Chosen-prefix_collision_attack)
-pub const PREFIX: &str = "metadata";
-
-/// Used in seeds to make Edition model pda address
-pub const EDITION: &str = "edition";
-
-pub const RESERVATION: &str = "reservation";
-
-pub const MAX_NAME_LENGTH: usize = 32;
-
-pub const MAX_SYMBOL_LENGTH: usize = 10;
-
-pub const MAX_URI_LENGTH: usize = 200;
-
-pub const MAX_METADATA_LEN: usize = 1
-    + 32
-    + 32
-    + MAX_NAME_LENGTH
-    + MAX_SYMBOL_LENGTH
-    + MAX_URI_LENGTH
-    + MAX_CREATOR_LIMIT * MAX_CREATOR_LEN
-    + 2
-    + 1
-    + 1
-    + 198;
-
-pub const MAX_EDITION_LEN: usize = 1 + 32 + 8 + 200;
-
-// Large buffer because the older master editions have two pubkeys in them,
-// need to keep two versions same size because the conversion process actually changes the same account
-// by rewriting it.
-pub const MAX_MASTER_EDITION_LEN: usize = 1 + 9 + 8 + 264;
-
-pub const MAX_CREATOR_LIMIT: usize = 5;
-
-pub const MAX_CREATOR_LEN: usize = 32 + 1 + 1;
-
-pub const MAX_RESERVATIONS: usize = 200;
-
-// can hold up to 200 keys per reservation, note: the extra 8 is for number of elements in the vec
-pub const MAX_RESERVATION_LIST_V1_SIZE: usize = 1 + 32 + 8 + 8 + MAX_RESERVATIONS * 34 + 100;
-
-// can hold up to 200 keys per reservation, note: the extra 8 is for number of elements in the vec
-pub const MAX_RESERVATION_LIST_SIZE: usize = 1 + 32 + 8 + 8 + MAX_RESERVATIONS * 48 + 8 + 8 + 84;
-
-pub const MAX_EDITION_MARKER_SIZE: usize = 32;
-
-pub const EDITION_MARKER_BIT_SIZE: u64 = 248;
-
-#[repr(C)]
-#[derive(BorshSerialize, BorshDeserialize, PartialEq, Debug, Clone, Copy)]
-pub enum Key {
-    Uninitialized,
-    EditionV1,
-    MasterEditionV1,
-    ReservationListV1,
-    MetadataV1,
-    ReservationListV2,
-    MasterEditionV2,
-    EditionMarker,
-}
-
-impl Default for Key {
-    fn default() -> Self {
-        Key::Uninitialized
-    }
-}
-
-#[repr(C)]
-#[derive(BorshSerialize, BorshDeserialize, Default, PartialEq, Debug, Clone)]
-pub struct Data {
-    /// The name of the asset
-    pub name: String,
-    /// The symbol for the asset
-    pub symbol: String,
-    /// URI pointing to JSON representing the asset
-    pub uri: String,
-    /// Royalty basis points that goes to creators in secondary sales (0-10000)
-    pub seller_fee_basis_points: u16,
-    /// Array of creators, optional
-    pub creators: Option<Vec<Creator>>,
-}
-
-#[repr(C)]
-#[derive(Clone, BorshSerialize, BorshDeserialize, Debug, Default)]
-pub struct Metadata {
-    pub key: Key,
-    pub update_authority: Pubkey,
-    pub mint: Pubkey,
-    pub data: Data,
-    // Immutable, once flipped, all sales of this metadata are considered secondary.
-    pub primary_sale_happened: bool,
-    // Whether or not the data struct is mutable, default is not
-    pub is_mutable: bool,
-}
-
-impl Metadata {
-    pub fn from_bytes(a: &[u8]) -> Option<Metadata> {
-        try_from_slice_checked(a, Key::MetadataV1, MAX_METADATA_LEN)
-    }
-
-    pub fn from_account_info(a: &AccountInfo) -> Option<Metadata> {
-        try_from_slice_checked(&a.data.borrow_mut(), Key::MetadataV1, MAX_METADATA_LEN)
-    }
-}
-
-#[repr(C)]
-#[derive(BorshSerialize, BorshDeserialize, PartialEq, Debug, Clone)]
-pub struct Creator {
-    pub address: Pubkey,
-    pub verified: bool,
-    // In percentages, NOT basis points ;) Watch out!
-    pub share: u8,
-}

+ 0 - 66
solana/modules/token_bridge/token-metadata/src/utils.rs

@@ -1,66 +0,0 @@
-use crate::state::{
-    Data,
-    Key,
-    Metadata,
-    EDITION,
-    EDITION_MARKER_BIT_SIZE,
-    MAX_CREATOR_LIMIT,
-    MAX_EDITION_LEN,
-    MAX_EDITION_MARKER_SIZE,
-    MAX_MASTER_EDITION_LEN,
-    MAX_METADATA_LEN,
-    MAX_NAME_LENGTH,
-    MAX_SYMBOL_LENGTH,
-    MAX_URI_LENGTH,
-    PREFIX,
-};
-use borsh::{
-    BorshDeserialize,
-    BorshSerialize,
-};
-use solana_program::{
-    account_info::AccountInfo,
-    borsh::try_from_slice_unchecked,
-    entrypoint::ProgramResult,
-    msg,
-    program::{
-        invoke,
-        invoke_signed,
-    },
-    program_error::ProgramError,
-    program_option::COption,
-    program_pack::{
-        IsInitialized,
-        Pack,
-    },
-    pubkey::Pubkey,
-    system_instruction,
-    sysvar::{
-        rent::Rent,
-        Sysvar,
-    },
-};
-use spl_token::{
-    instruction::{
-        set_authority,
-        AuthorityType,
-    },
-    state::{
-        Account,
-        Mint,
-    },
-};
-use std::convert::TryInto;
-
-pub fn try_from_slice_checked<T: BorshDeserialize>(
-    data: &[u8],
-    data_type: Key,
-    data_size: usize,
-) -> Option<T> {
-    if (data[0] != data_type as u8 && data[0] != Key::Uninitialized as u8)
-        || data.len() != data_size
-    {
-        return None;
-    }
-    try_from_slice_unchecked(data).ok()
-}