Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fast-bridge: Add fast bridge contract #361

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
49d3d54
added bridge escrow contract
dhruvja Jul 20, 2024
45e42c0
added bridge escrow contract
dhruvja Jul 20, 2024
44423f4
Merge branch 'fast-bridge' of https://github.com/ComposableFi/emulate…
dhruvja Jul 20, 2024
f7d4780
bridge-scrow -> tests.rs (#355)
doradelta Aug 6, 2024
aadd44b
test push alberto
doradelta Aug 7, 2024
f7a5ec8
on_receive_transfer & send_funds_to_user escrow contract
doradelta Aug 8, 2024
44cdd86
on_receive_transfer & send_funds_to_user escrow contract
doradelta Aug 8, 2024
30ecf73
on_receive_transfer & send_funds_to_user escrow contract
doradelta Aug 8, 2024
38d798b
some docs and quick fixes
dhruvja Aug 9, 2024
35c58ee
add timeout method
dhruvja Aug 12, 2024
1d7e0d7
fix receive method argument
dhruvja Aug 12, 2024
a308799
added tests for single domain
dhruvja Aug 13, 2024
2f45602
assert tests conditiosn
dhruvja Aug 13, 2024
9ee7025
bridge escrow - auctioneer_transfer
doradelta Aug 19, 2024
3255b59
remove auctioner_trasnfer() on escrow Program
doradelta Aug 19, 2024
4cd9003
add single domain in intent
dhruvja Aug 20, 2024
01ae66c
update tests and send funds to user method
dhruvja Aug 20, 2024
0e41399
Update lib.rs
doradelta Aug 20, 2024
aec6bf8
Update lib.rs
doradelta Aug 20, 2024
93d26ad
update escrow id
doradelta Aug 20, 2024
f821b35
fmt
dhruvja Aug 22, 2024
b05cb01
pull from master and fix merge conflicts
dhruvja Aug 22, 2024
aa04971
fix clippy
dhruvja Aug 22, 2024
b84d3ee
fix clippy
dhruvja Aug 22, 2024
0a02300
use struct for ix args instead of multiple args
dhruvja Aug 22, 2024
777c22a
fmt
dhruvja Aug 22, 2024
5e86bc1
fix wallet path
dhruvja Aug 22, 2024
c0e7f13
fast-bridge: Send required accounts for cross domain transfer (#375)
dhruvja Aug 26, 2024
15a4ad7
fast-bridge: Emit events for each method. (#374)
dhruvja Aug 26, 2024
6126f31
fast-bridge: Timeouts (#381)
dhruvja Aug 27, 2024
89a44de
remove intent from on receive transfer method
dhruvja Aug 27, 2024
43b9908
add timeout and on receive methods in tests
dhruvja Aug 27, 2024
0772575
change token in to string instead of pubkey
dhruvja Aug 28, 2024
7bfa988
set arbitrary space
dhruvja Aug 29, 2024
4902f26
allocate accounts to heap
dhruvja Aug 30, 2024
4b6e54c
use intent payload instead of string
dhruvja Aug 31, 2024
0986913
Update lib.rs
doradelta Sep 1, 2024
9e63fab
Update lib.rs
doradelta Sep 1, 2024
dcab6ba
hardcode solana ibc address
dhruvja Sep 2, 2024
1603619
Update lib.rs
doradelta Sep 2, 2024
5c569ba
Update lib.rs
doradelta Sep 2, 2024
e938903
avoid deserialization of solana ibc accounts
dhruvja Sep 3, 2024
3acbc6f
change token_mint & receiver_token_account on SplTokenTransfer struct
doradelta Sep 3, 2024
8639a56
box mint and receiver token account
dhruvja Sep 3, 2024
346c2f1
Update lib.rs
doradelta Sep 3, 2024
a543834
Update bridge.rs
doradelta Sep 3, 2024
82d6fcc
Update lib.rs
doradelta Sep 20, 2024
6d03458
Update lib.rs
doradelta Sep 24, 2024
d843604
Update tests.rs
doradelta Sep 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions Anchor.toml
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
[toolchain]

[features]
seeds = false
skip-lint = false

[programs.devnet]
restaking = "8n3FHwYxFgQCQc2FNFkwDUf9mcqupxXcCvgfHbApMLv3"
solana_ibc = "2HLLVco5HvwWriNbUhmVwA2pCetRkpgrqwnjcsZdyTKT"
bridge-escrow = "A5ygmioT2hWFnxpPapY3XyDjwwfMDhnSP1Yxoynd5hs4"
restaking = "9JkWjSfc5Yb5EdTwhxHDx6rh8usXYVFm9KFwqzskVE8t"
solana_ibc = "3JvDhxt87SqKwNSuBPWWSRsfSxzkjzofDh1B6DioqfQ3"

[programs.localnet]
restaking = "8n3FHwYxFgQCQc2FNFkwDUf9mcqupxXcCvgfHbApMLv3"
solana_ibc = "2HLLVco5HvwWriNbUhmVwA2pCetRkpgrqwnjcsZdyTKT"
bridge-escrow = "A5ygmioT2hWFnxpPapY3XyDjwwfMDhnSP1Yxoynd5hs4"
restaking = "9JkWjSfc5Yb5EdTwhxHDx6rh8usXYVFm9KFwqzskVE8t"
solana_ibc = "3JvDhxt87SqKwNSuBPWWSRsfSxzkjzofDh1B6DioqfQ3"

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

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

[workspace]
members = [
"solana/restaking/programs/restaking",
"solana/solana-ibc/programs/solana-ibc"
]
members = ["solana/bridge-escrow/programs/bridge-escrow", "solana/restaking/programs/restaking", "solana/solana-ibc/programs/solana-ibc"]

[scripts]
test = "./solana-test.sh"
Expand Down
43 changes: 43 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ rust-version = "1.71.0"
members = [
"common/*",
"solana/allocator",
"solana/bridge-escrow/programs/*",
"solana/restaking/programs/*",
"solana/signature-verifier",
"solana/solana-ibc/programs/*",
Expand Down
1 change: 1 addition & 0 deletions solana-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ cd ../..
solana program deploy target/deploy/write.so
solana program deploy target/deploy/sigverify.so
cargo test --lib -- --nocapture --include-ignored ::anchor
cargo test --lib -- --nocapture --include-ignored ::escrow
find solana/restaking/tests/ -name '*.ts' \
-exec yarn run ts-mocha -p ./tsconfig.json -t 1000000 {} +
12 changes: 12 additions & 0 deletions solana/bridge-escrow/migrations/deploy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Migrations are an early feature. Currently, they're nothing more than this
// single deploy script that's invoked from the CLI, injecting a provider
// configured from the workspace's Anchor.toml.

const anchor = require("@coral-xyz/anchor");

module.exports = async function (provider) {
// Configure client to use the provider.
anchor.setProvider(provider);

// Add your deploy script here.
};
64 changes: 64 additions & 0 deletions solana/bridge-escrow/programs/bridge-escrow/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
[package]
name = "bridge-escrow"
description = "Created with Anchor"
edition = "2021"
version.workspace = true

[lib]
crate-type = ["cdylib", "lib"]
name = "bridge_escrow"

[features]
# added so that we can compile this along with `solana-ibc` with mocks features. Currently unused.
mocks = []
no-entrypoint = []
no-idl = []
no-log-ix-name = []
cpi = ["no-entrypoint"]
default = []

[dependencies]
anyhow.workspace = true
anchor-lang.workspace = true
anchor-spl = { workspace = true, features = ["metadata"] }
base64.workspace = true
bytemuck = { workspace = true, features = ["must_cast", "zeroable_atomics"] }
derive_more.workspace = true
hex-literal.workspace = true
ibc-client-tendermint-types.workspace = true
ibc-proto.workspace = true
ibc-testkit = { workspace = true, optional = true }
ibc.workspace = true
linear-map.workspace = true
primitive-types.workspace = true
prost.workspace = true
serde.workspace = true
serde_json.workspace = true
spl-associated-token-account.workspace = true
spl-token.workspace = true
strum.workspace = true
tendermint-light-client-verifier.workspace = true
tendermint.workspace = true
uint.workspace = true

guestchain.workspace = true
cf-guest.workspace = true
lib = { workspace = true, features = ["solana-program"] }
memory.workspace = true
solana-allocator = { workspace = true, optional = true }
solana-signature-verifier = { workspace = true, features = ["guest", "library"] }
solana-trie.workspace = true
stdx.workspace = true
trie-ids = { workspace = true, features = ["borsh"] }
wasm = { workspace = true }
itertools = "0.10.5"
solana-ibc = { workspace = true, features = ["cpi"] }

[dev-dependencies]
anchor-client.workspace = true
anyhow.workspace = true
ibc-testkit.workspace = true
insta.workspace = true

lib = { workspace = true, features = ["test_utils"] }
solana-write-account = { workspace = true, features = ["library"] }
2 changes: 2 additions & 0 deletions solana/bridge-escrow/programs/bridge-escrow/Xargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[target.bpfel-unknown-unknown.dependencies.std]
features = []
Loading
Loading