Skip to content

Commit

Permalink
Check in production that Proph3t is the one adding metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
metaproph3t committed Jul 1, 2024
1 parent 615b5d0 commit feda413
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/generate-verifiable-builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: metadaoproject/anchor-verifiable-build@v0
- uses: metadaoproject/anchor-verifiable-build@v0.1
with:
program: conditional_vault
anchor-version: '0.29.0'
solana-cli-version: '1.17.16'
features: 'production'
- run: 'git pull --rebase'
- run: cp target/deploy/conditional_vault.so ./verifiable-builds
- name: Commit verifiable build back to mainline
Expand Down
1 change: 1 addition & 0 deletions programs/conditional_vault/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ no-idl = []
no-log-ix-name = []
cpi = ["no-entrypoint"]
default = []
production = []

[dependencies]
anchor-lang = { version = "0.29.0", features = ["init-if-needed"] }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
use super::*;

pub mod proph3t_deployer {
use anchor_lang::declare_id;

declare_id!("HfFi634cyurmVVDr9frwu4MjGLJzz9XbAJz981HdVaNz");
}

#[derive(AnchorSerialize, AnchorDeserialize)]
pub struct AddMetadataToConditionalTokensArgs {
pub proposal_number: u64,
Expand Down Expand Up @@ -51,6 +57,11 @@ impl AddMetadataToConditionalTokens<'_> {
VaultError::VaultAlreadySettled
);

#[cfg(feature = "production")]
require_eq!(
self.payer.key(), proph3t_deployer::ID
);

Ok(())
}

Expand Down
9 changes: 2 additions & 7 deletions sdk/src/AutocratClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ export class AutocratClient {
)
.transaction();

const mintConditionalTokensTx = await this.vaultClient
const mintConditionalTokensTx = await this.vaultClient
.mintConditionalTokensIx(baseVault, storedDao.tokenMint, baseTokensToLP)
.postInstructions(
await InstructionUtils.getInstructions(
Expand Down Expand Up @@ -482,12 +482,7 @@ export class AutocratClient {
).transaction();

return [
[
initVaultTx,
mintConditionalTokensTx,
addLiquidityTx,
initTx
],
[initVaultTx, mintConditionalTokensTx, addLiquidityTx, initTx],
{
baseCondVaultAcct: baseVault,
quoteCondVaultAcct: quoteVault,
Expand Down

0 comments on commit feda413

Please sign in to comment.