Skip to content

Commit a9328f5

Browse files
committed
deployment by chain family
1 parent 8368e8e commit a9328f5

File tree

77 files changed

+6448
-239
lines changed

Some content is hidden

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

77 files changed

+6448
-239
lines changed

chains/solana/Makefile

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,6 @@ format:
5151
go-tests:
5252
go test -v ./... -json -covermode=atomic -coverpkg=./... -coverprofile=integration_coverage.txt 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci=true -singlepackage=true -hidepassingtests=false -hidepassinglogs=false
5353

54-
.PHONY: ccip-router-contracts-go-tests
55-
ccip-router-contracts-go-tests:
56-
go test -run TestCCIPRouter -v -failfast ./... -json -covermode=atomic -coverpkg=./... -coverprofile=integration_coverage.txt 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci=true -singlepackage=true -hidepassingtests=false -hidepassinglogs=false
57-
58-
.PHONY: test-token-pool-contracts-go-tests
59-
test-token-pool-contracts-go-tests:
60-
go test -run TestBaseTokenPoolHappyPath -v -failfast ./... -json -covermode=atomic -coverpkg=./... -coverprofile=integration_coverage.txt 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci=true -singlepackage=true -hidepassingtests=false -hidepassinglogs=false
61-
6254
.PHONY: build-contracts
6355
build-contracts:
6456
cd ./contracts && anchor build

chains/solana/contracts/Anchor.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,23 @@
22
anchor_version = "0.29.0"
33

44
[features]
5-
resolution = true
5+
seeds = false
66
skip-lint = false
77

8-
[programs.localnet]
8+
[programs.devnet]
99
firedrill_compound = "Dri11NnBPbx85w8a47ZXBZa3Hi7E2xvHAA9Xpyk7UivQ"
1010
firedrill_entrypoint = "Dri11c6TXJXELaZUgQtyw3doxbn7bGXQ6z5LRZ8bMPbc"
1111
firedrill_offramp = "Dri11kiWR5f1oTn5NLm3wmfaDq3cYauR92wrsTxNaudt"
1212
firedrill_onramp = "Dri11Hs4x2gXThgDwvjYoZ7xEPgfKNa5Ys2MWUqay3Tt"
1313
firedrill_token = "Dri11r4S1hY8iMpxNh6UoYZ9hsGgmGUUyZ3zxUb2rpc2"
14+
failing_receiver = "Dri11EwVRViqqkjs7SWV3d3ejcanBGMNrcGhD6HVn756"
1415

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

1819
[provider]
19-
cluster = "devnet"
20-
wallet = "~/.config/solana/id.json"
20+
cluster = "Devnet"
21+
wallet = "/Users/bukata/.config/solana/id.json"
2122

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

chains/solana/contracts/Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chains/solana/contracts/crate/shared/src/common/entrypoint.rs

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
pub mod entrypoint;
21
pub mod seed;

chains/solana/contracts/crate/shared/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,5 @@ use anchor_lang::prelude::*;
33
pub mod common;
44
pub mod ids;
55

6-
pub use common::entrypoint::FiredrillEntrypoint;
7-
86
// Root declare_id required by Anchor macros (even if shared crate isn't deployed)
97
declare_id!("EjrGAZVbao3cu4VwqpaLJ8ggF3RHBAs8ptpYNCHTfa4z");
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[package]
2+
name = "failing_receiver"
3+
version = "0.1.0"
4+
description = "Created with Anchor"
5+
edition = "2021"
6+
7+
[lib]
8+
crate-type = ["cdylib", "lib"]
9+
name = "failing_receiver"
10+
11+
[features]
12+
no-entrypoint = []
13+
no-idl = []
14+
no-log-ix-name = []
15+
cpi = ["no-entrypoint"]
16+
default = []
17+
18+
[dependencies]
19+
anchor-lang = "0.29.0"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[target.bpfel-unknown-unknown.dependencies.std]
2+
features = []
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
use anchor_lang::prelude::*;
2+
3+
declare_id!("Dri11EwVRViqqkjs7SWV3d3ejcanBGMNrcGhD6HVn756");
4+
5+
#[program]
6+
pub mod failing_receiver {
7+
use super::*;
8+
9+
pub fn ccip_receive(_ctx: Context<CcipReceive>, _message: Any2SVMMessage) -> Result<()> {
10+
return err!(CustomError::AlwaysErrors);
11+
}
12+
}
13+
14+
#[derive(Accounts, Debug)]
15+
pub struct CcipReceive {}
16+
17+
#[derive(Debug, Clone, AnchorSerialize, AnchorDeserialize)]
18+
pub struct Any2SVMMessage {
19+
pub message_id: [u8; 32],
20+
pub source_chain_selector: u64,
21+
pub sender: Vec<u8>,
22+
pub data: Vec<u8>,
23+
pub token_amounts: Vec<SVMTokenAmount>,
24+
}
25+
26+
#[derive(Debug, Clone, AnchorSerialize, AnchorDeserialize, Default)]
27+
pub struct SVMTokenAmount {
28+
pub token: Pubkey,
29+
pub amount: u64, // solana local token amount
30+
}
31+
32+
#[error_code]
33+
pub enum CustomError {
34+
#[msg("Always errors.")]
35+
AlwaysErrors,
36+
}

chains/solana/contracts/programs/firedrill_compound/src/lib.rs

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
use anchor_lang::prelude::*;
22
use shared::ids::compound::ID;
3-
use shared::FiredrillEntrypoint;
43

54
#[program]
65
pub mod firedrill_compound {
76
use super::*;
87

8+
pub fn initialize(ctx: Context<Initialize>, token: Pubkey) -> Result<()> {
9+
let compound = &mut ctx.accounts.compound;
10+
compound.owner = ctx.accounts.owner.key();
11+
compound.token = token;
12+
Ok(())
13+
}
14+
915
pub fn emit_usd_per_token_updated(ctx: Context<EmitUsdPerToken>) -> Result<()> {
10-
let entrypoint = &ctx.accounts.entrypoint;
16+
let compound = &ctx.accounts.compound;
1117

12-
let token = entrypoint.token;
18+
let token = compound.token;
1319
let mut value = [0u8; 28];
1420
let val = 1u128.to_le_bytes(); // 16 bytes
1521
value[..16].copy_from_slice(&val);
@@ -25,13 +31,30 @@ pub mod firedrill_compound {
2531
}
2632
}
2733

34+
#[account]
35+
pub struct FiredrillCompound {
36+
pub owner: Pubkey,
37+
pub token: Pubkey,
38+
}
39+
40+
#[derive(Accounts)]
41+
pub struct Initialize<'info> {
42+
#[account(init, payer = payer, space = 8 + 32 + 32)]
43+
pub compound: Account<'info, FiredrillCompound>,
44+
45+
#[account(mut)]
46+
pub payer: Signer<'info>,
47+
48+
#[account()]
49+
pub owner: Signer<'info>,
50+
51+
pub system_program: Program<'info, System>,
52+
}
53+
2854
#[derive(Accounts)]
2955
pub struct EmitUsdPerToken<'info> {
30-
/// CHECK: Only used for event emission context
31-
pub compound: AccountInfo<'info>,
32-
33-
/// Must be passed in to read `.token`
34-
pub entrypoint: Account<'info, FiredrillEntrypoint>,
56+
#[account(mut)]
57+
pub compound: Account<'info, FiredrillCompound>,
3558
}
3659

3760
#[event]

0 commit comments

Comments
 (0)