Skip to content

Commit c4d5d80

Browse files
committed
Merge branch 'vaporif/relayer-controlled-metadata' of github.com:cosmos/solidity-ibc-eureka into vaporif/relayer-controlled-metadata
2 parents 867c91b + e8602c2 commit c4d5d80

File tree

7 files changed

+402
-41
lines changed

7 files changed

+402
-41
lines changed

flake.lock

Lines changed: 38 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
foundry.url = "github:shazow/foundry.nix/main";
1212
rust-overlay.url = "github:oxalica/rust-overlay";
1313
natlint.url = "github:srdtrk/natlint";
14+
sp1 = {
15+
url = "github:vaporif/sp1-overlay";
16+
inputs.nixpkgs.follows = "nixpkgs";
17+
};
1418
};
1519

1620
outputs = inputs:
@@ -24,6 +28,7 @@
2428
(import inputs.rust-overlay)
2529
inputs.foundry.overlay
2630
inputs.solc.overlay
31+
inputs.sp1.overlays.default
2732
];
2833
};
2934

@@ -32,7 +37,6 @@
3237
common = import ./nix/common.nix {inherit pkgs;};
3338
solidity = import ./nix/solidity.nix {inherit pkgs inputs system;};
3439
node-modules = import ./nix/node-modules.nix {inherit pkgs;};
35-
3640
anchor = pkgs.callPackage ./nix/anchor.nix {};
3741
solana-agave = pkgs.callPackage ./nix/agave.nix {
3842
inherit (pkgs) rust-bin;
@@ -42,7 +46,18 @@
4246
in {
4347
devShells = {
4448
default = pkgs.mkShell {
45-
buildInputs = rust.packages ++ go.packages ++ common.packages ++ solidity.packages ++ [node-modules];
49+
buildInputs =
50+
rust.packages
51+
++ go.packages
52+
++ common.packages
53+
++ solidity.packages
54+
++ [
55+
node-modules
56+
]
57+
++ (with pkgs.sp1."v5.2.4"; [
58+
cargo-prove
59+
sp1-rust-toolchain
60+
]);
4661
inherit (rust) NIX_LD_LIBRARY_PATH;
4762
inherit (rust.env) RUST_SRC_PATH;
4863
shellHook =
@@ -53,11 +68,6 @@
5368
ln -sfn "${node-modules}/node_modules" node_modules
5469
fi
5570
fi
56-
57-
if [ ! -x "$HOME/.sp1/bin/cargo-prove" ]; then
58-
echo "SP1 toolchain is not installed. To install:"
59-
echo "https://docs.succinct.xyz/docs/sp1/getting-started/install"
60-
fi
6171
'';
6272
};
6373

programs/solana/programs/ift/src/helpers.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ use crate::state::IFTAppMintState;
1515
pub fn mint_to_account<'info>(
1616
mint_state: &mut IFTAppMintState,
1717
clock: &Clock,
18-
mint: &InterfaceAccount<'info, Mint>,
19-
to: &InterfaceAccount<'info, TokenAccount>,
18+
mint: &mut InterfaceAccount<'info, Mint>,
19+
token_account: &mut InterfaceAccount<'info, TokenAccount>,
2020
mint_authority: &AccountInfo<'info>,
2121
token_program: &Interface<'info, TokenInterface>,
2222
amount: u64,
@@ -33,12 +33,16 @@ pub fn mint_to_account<'info>(
3333

3434
let mint_accounts = MintTo {
3535
mint: mint.to_account_info(),
36-
to: to.to_account_info(),
36+
to: token_account.to_account_info(),
3737
authority: mint_authority.to_account_info(),
3838
};
3939
let mint_ctx =
4040
CpiContext::new_with_signer(token_program.to_account_info(), mint_accounts, signer_seeds);
41-
token_interface::mint_to(mint_ctx, amount)
41+
token_interface::mint_to(mint_ctx, amount)?;
42+
43+
mint.reload()?;
44+
token_account.reload()?;
45+
Ok(())
4246
}
4347

4448
const fn current_day(clock: &Clock) -> u64 {

programs/solana/programs/ift/src/instructions/admin.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ pub fn admin_mint(ctx: Context<AdminMint>, msg: AdminMintMsg) -> Result<()> {
223223
mint_to_account(
224224
&mut ctx.accounts.app_mint_state,
225225
&clock,
226-
&ctx.accounts.mint,
227-
&ctx.accounts.receiver_token_account,
226+
&mut ctx.accounts.mint,
227+
&mut ctx.accounts.receiver_token_account,
228228
&ctx.accounts.mint_authority,
229229
&ctx.accounts.token_program,
230230
msg.amount,

0 commit comments

Comments
 (0)