Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 19 additions & 0 deletions packages/hyperbet-avax/keeper/src/idl/lvr_amm.json
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,13 @@
"writable": true,
"signer": true
},
{
"name": "program",
"address": "12E8Lz5w8Qxyj8Fh6LgsCgPDQNJMCLMV1y43LhPrH66w"
},
{
"name": "program_data"
},
{
"name": "system_program",
"address": "11111111111111111111111111111111"
Expand Down Expand Up @@ -721,6 +728,13 @@
"writable": true,
"signer": true
},
{
"name": "program",
"address": "12E8Lz5w8Qxyj8Fh6LgsCgPDQNJMCLMV1y43LhPrH66w"
},
{
"name": "program_data"
},
{
"name": "system_program",
"address": "11111111111111111111111111111111"
Expand Down Expand Up @@ -1791,6 +1805,11 @@
"code": 6028,
"name": "MathFixedPointOverflow",
"msg": "AMM fixed-point overflow"
},
{
"code": 6029,
"name": "UnauthorizedInitializer",
"msg": "Initializer must be the program upgrade authority"
}
],
"types": [
Expand Down
19 changes: 19 additions & 0 deletions packages/hyperbet-avax/keeper/src/idl/lvr_amm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,13 @@ export type LvrAmm = {
"writable": true,
"signer": true
},
{
"name": "program",
"address": "12E8Lz5w8Qxyj8Fh6LgsCgPDQNJMCLMV1y43LhPrH66w"
},
{
"name": "programData"
},
{
"name": "systemProgram",
"address": "11111111111111111111111111111111"
Expand Down Expand Up @@ -727,6 +734,13 @@ export type LvrAmm = {
"writable": true,
"signer": true
},
{
"name": "program",
"address": "12E8Lz5w8Qxyj8Fh6LgsCgPDQNJMCLMV1y43LhPrH66w"
},
{
"name": "programData"
},
{
"name": "systemProgram",
"address": "11111111111111111111111111111111"
Expand Down Expand Up @@ -1797,6 +1811,11 @@ export type LvrAmm = {
"code": 6028,
"name": "mathFixedPointOverflow",
"msg": "AMM fixed-point overflow"
},
{
"code": 6029,
"name": "unauthorizedInitializer",
"msg": "Initializer must be the program upgrade authority"
}
],
"types": [
Expand Down
19 changes: 19 additions & 0 deletions packages/hyperbet-bsc/app/src/idl/lvr_amm.json
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,13 @@
"writable": true,
"signer": true
},
{
"name": "program",
"address": "12E8Lz5w8Qxyj8Fh6LgsCgPDQNJMCLMV1y43LhPrH66w"
},
{
"name": "program_data"
},
{
"name": "system_program",
"address": "11111111111111111111111111111111"
Expand Down Expand Up @@ -721,6 +728,13 @@
"writable": true,
"signer": true
},
{
"name": "program",
"address": "12E8Lz5w8Qxyj8Fh6LgsCgPDQNJMCLMV1y43LhPrH66w"
},
{
"name": "program_data"
},
{
"name": "system_program",
"address": "11111111111111111111111111111111"
Expand Down Expand Up @@ -1791,6 +1805,11 @@
"code": 6028,
"name": "MathFixedPointOverflow",
"msg": "AMM fixed-point overflow"
},
{
"code": 6029,
"name": "UnauthorizedInitializer",
"msg": "Initializer must be the program upgrade authority"
}
],
"types": [
Expand Down
19 changes: 19 additions & 0 deletions packages/hyperbet-bsc/app/src/idl/lvr_amm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,13 @@ export type LvrAmm = {
"writable": true,
"signer": true
},
{
"name": "program",
"address": "12E8Lz5w8Qxyj8Fh6LgsCgPDQNJMCLMV1y43LhPrH66w"
},
{
"name": "programData"
},
{
"name": "systemProgram",
"address": "11111111111111111111111111111111"
Expand Down Expand Up @@ -727,6 +734,13 @@ export type LvrAmm = {
"writable": true,
"signer": true
},
{
"name": "program",
"address": "12E8Lz5w8Qxyj8Fh6LgsCgPDQNJMCLMV1y43LhPrH66w"
},
{
"name": "programData"
},
{
"name": "systemProgram",
"address": "11111111111111111111111111111111"
Expand Down Expand Up @@ -1797,6 +1811,11 @@ export type LvrAmm = {
"code": 6028,
"name": "mathFixedPointOverflow",
"msg": "AMM fixed-point overflow"
},
{
"code": 6029,
"name": "unauthorizedInitializer",
"msg": "Initializer must be the program upgrade authority"
}
],
"types": [
Expand Down
19 changes: 19 additions & 0 deletions packages/hyperbet-bsc/keeper/src/idl/lvr_amm.json
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,13 @@
"writable": true,
"signer": true
},
{
"name": "program",
"address": "12E8Lz5w8Qxyj8Fh6LgsCgPDQNJMCLMV1y43LhPrH66w"
},
{
"name": "program_data"
},
{
"name": "system_program",
"address": "11111111111111111111111111111111"
Expand Down Expand Up @@ -721,6 +728,13 @@
"writable": true,
"signer": true
},
{
"name": "program",
"address": "12E8Lz5w8Qxyj8Fh6LgsCgPDQNJMCLMV1y43LhPrH66w"
},
{
"name": "program_data"
},
{
"name": "system_program",
"address": "11111111111111111111111111111111"
Expand Down Expand Up @@ -1791,6 +1805,11 @@
"code": 6028,
"name": "MathFixedPointOverflow",
"msg": "AMM fixed-point overflow"
},
{
"code": 6029,
"name": "UnauthorizedInitializer",
"msg": "Initializer must be the program upgrade authority"
}
],
"types": [
Expand Down
19 changes: 19 additions & 0 deletions packages/hyperbet-bsc/keeper/src/idl/lvr_amm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,13 @@ export type LvrAmm = {
"writable": true,
"signer": true
},
{
"name": "program",
"address": "12E8Lz5w8Qxyj8Fh6LgsCgPDQNJMCLMV1y43LhPrH66w"
},
{
"name": "programData"
},
{
"name": "systemProgram",
"address": "11111111111111111111111111111111"
Expand Down Expand Up @@ -727,6 +734,13 @@ export type LvrAmm = {
"writable": true,
"signer": true
},
{
"name": "program",
"address": "12E8Lz5w8Qxyj8Fh6LgsCgPDQNJMCLMV1y43LhPrH66w"
},
{
"name": "programData"
},
{
"name": "systemProgram",
"address": "11111111111111111111111111111111"
Expand Down Expand Up @@ -1797,6 +1811,11 @@ export type LvrAmm = {
"code": 6028,
"name": "mathFixedPointOverflow",
"msg": "AMM fixed-point overflow"
},
{
"code": 6029,
"name": "unauthorizedInitializer",
"msg": "Initializer must be the program upgrade authority"
}
],
"types": [
Expand Down
19 changes: 19 additions & 0 deletions packages/hyperbet-evm/keeper/src/idl/lvr_amm.json
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,13 @@
"writable": true,
"signer": true
},
{
"name": "program",
"address": "12E8Lz5w8Qxyj8Fh6LgsCgPDQNJMCLMV1y43LhPrH66w"
},
{
"name": "program_data"
},
{
"name": "system_program",
"address": "11111111111111111111111111111111"
Expand Down Expand Up @@ -721,6 +728,13 @@
"writable": true,
"signer": true
},
{
"name": "program",
"address": "12E8Lz5w8Qxyj8Fh6LgsCgPDQNJMCLMV1y43LhPrH66w"
},
{
"name": "program_data"
},
{
"name": "system_program",
"address": "11111111111111111111111111111111"
Expand Down Expand Up @@ -1791,6 +1805,11 @@
"code": 6028,
"name": "MathFixedPointOverflow",
"msg": "AMM fixed-point overflow"
},
{
"code": 6029,
"name": "UnauthorizedInitializer",
"msg": "Initializer must be the program upgrade authority"
}
],
"types": [
Expand Down
19 changes: 19 additions & 0 deletions packages/hyperbet-evm/keeper/src/idl/lvr_amm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,13 @@ export type LvrAmm = {
"writable": true,
"signer": true
},
{
"name": "program",
"address": "12E8Lz5w8Qxyj8Fh6LgsCgPDQNJMCLMV1y43LhPrH66w"
},
{
"name": "programData"
},
{
"name": "systemProgram",
"address": "11111111111111111111111111111111"
Expand Down Expand Up @@ -727,6 +734,13 @@ export type LvrAmm = {
"writable": true,
"signer": true
},
{
"name": "program",
"address": "12E8Lz5w8Qxyj8Fh6LgsCgPDQNJMCLMV1y43LhPrH66w"
},
{
"name": "programData"
},
{
"name": "systemProgram",
"address": "11111111111111111111111111111111"
Expand Down Expand Up @@ -1797,6 +1811,11 @@ export type LvrAmm = {
"code": 6028,
"name": "mathFixedPointOverflow",
"msg": "AMM fixed-point overflow"
},
{
"code": 6029,
"name": "unauthorizedInitializer",
"msg": "Initializer must be the program upgrade authority"
}
],
"types": [
Expand Down
3 changes: 3 additions & 0 deletions packages/hyperbet-solana/anchor/programs/lvr_amm/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,7 @@ pub enum PredictionMarketError {

#[msg("AMM fixed-point overflow")]
MathFixedPointOverflow,

#[msg("Initializer must be the program upgrade authority")]
UnauthorizedInitializer,
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ pub struct InitializeAdmin<'info> {

#[account(mut)]
pub signer: Signer<'info>,
#[account(
constraint = program.programdata_address()? == Some(program_data.key()) @ PredictionMarketError::UnauthorizedInitializer
)]
pub program: Program<'info, crate::program::LvrAmm>,
#[account(
constraint = program_data.upgrade_authority_address == Some(signer.key()) @ PredictionMarketError::UnauthorizedInitializer
)]
pub program_data: Account<'info, ProgramData>,
pub system_program: Program<'info, System>,
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ pub struct InitializeAmmConfig<'info> {

#[account(mut)]
pub signer: Signer<'info>,
#[account(
constraint = program.programdata_address()? == Some(program_data.key()) @ PredictionMarketError::UnauthorizedInitializer
)]
pub program: Program<'info, crate::program::LvrAmm>,
#[account(
constraint = program_data.upgrade_authority_address == Some(signer.key()) @ PredictionMarketError::UnauthorizedInitializer
)]
pub program_data: Account<'info, ProgramData>,
pub system_program: Program<'info, System>,
}

Expand Down
19 changes: 19 additions & 0 deletions packages/hyperbet-solana/anchor/target/idl/lvr_amm.json
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,13 @@
"writable": true,
"signer": true
},
{
"name": "program",
"address": "12E8Lz5w8Qxyj8Fh6LgsCgPDQNJMCLMV1y43LhPrH66w"
},
{
"name": "program_data"
},
{
"name": "system_program",
"address": "11111111111111111111111111111111"
Expand Down Expand Up @@ -721,6 +728,13 @@
"writable": true,
"signer": true
},
{
"name": "program",
"address": "12E8Lz5w8Qxyj8Fh6LgsCgPDQNJMCLMV1y43LhPrH66w"
},
{
"name": "program_data"
},
{
"name": "system_program",
"address": "11111111111111111111111111111111"
Expand Down Expand Up @@ -1791,6 +1805,11 @@
"code": 6028,
"name": "MathFixedPointOverflow",
"msg": "AMM fixed-point overflow"
},
{
"code": 6029,
"name": "UnauthorizedInitializer",
"msg": "Initializer must be the program upgrade authority"
}
],
"types": [
Expand Down
Loading