Skip to content

Commit

Permalink
Refine Symbiotic Staking
Browse files Browse the repository at this point in the history
  • Loading branch information
akshay111meher committed Dec 30, 2024
1 parent 736b11d commit 61247e6
Show file tree
Hide file tree
Showing 11 changed files with 649 additions and 64 deletions.
5 changes: 0 additions & 5 deletions .cargo/config.toml

This file was deleted.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ members = [
]
resolver = "2"

[profile.dev]
panic = "abort"
debug = true

[profile.release]
strip = true
lto = true
Expand Down
25 changes: 25 additions & 0 deletions binding_patches/src/generator_registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,31 @@
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "generatorAddress",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "token",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "IntendToReduceStake",
"type": "event"
}
]

11 changes: 9 additions & 2 deletions binding_patches/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,17 @@ abigen!(
// Re-export the generated contract bindings to make them accessible when your library is used as a dependency.

abigen!(
UpdateGeneratorMetadataPatch,
GeneratorRegistryPatch,
"./src/generator_registry.json",
event_derives(serde::Deserialize, serde::Serialize)
);

pub use UpdateGeneratorMetadataPatch;
abigen!(
VaultSnapshotPatch,
"./src/vaultsnapshot.json",
event_derives(serde::Deserialize, serde::Serialize)
);

pub use GeneratorRegistryPatch;
pub use UpdateProofMarketplaceMetadataPatch;
pub use VaultSnapshotPatch;
100 changes: 100 additions & 0 deletions binding_patches/src/vaultsnapshot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
[
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "transmitter",
"type": "address"
},
{
"indexed": true,
"internalType": "uint256",
"name": "captureTimestamp",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "index",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "numOfTxs",
"type": "uint256"
},
{
"indexed": true,
"internalType": "bytes32",
"name": "imageId",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "bytes",
"name": "vaultSnapshotData",
"type": "bytes"
},
{
"indexed": false,
"internalType": "bytes",
"name": "proof",
"type": "bytes"
}
],
"name": "VaultSnapshotSubmitted",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "transmitter",
"type": "address"
},
{
"indexed": true,
"internalType": "uint256",
"name": "captureTimestamp",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "index",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "numOfTxs",
"type": "uint256"
},
{
"indexed": true,
"internalType": "bytes32",
"name": "imageId",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "bytes",
"name": "slashResultData",
"type": "bytes"
},
{
"indexed": false,
"internalType": "bytes",
"name": "proof",
"type": "bytes"
}
],
"name": "SlashResultSubmitted",
"type": "event"
}
]
11 changes: 4 additions & 7 deletions kalypso-cli/src/common_deps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1445,9 +1445,8 @@ fn update_proof_marketplace_metadata_patch_instance(
}

pub struct UpdateGeneratorMetaInfo {
pub generator_registry: binding_patches::UpdateGeneratorMetadataPatch<
SignerMiddleware<Provider<Http>, LocalWallet>,
>,
pub generator_registry:
binding_patches::GeneratorRegistryPatch<SignerMiddleware<Provider<Http>, LocalWallet>>,
pub read_generator_registry: bindings::generator_registry::GeneratorRegistry<
SignerMiddleware<Provider<Http>, LocalWallet>,
>,
Expand Down Expand Up @@ -1492,9 +1491,7 @@ fn update_generator_meta_instance(
rpc_url: &str,
) -> Result<
(
binding_patches::UpdateGeneratorMetadataPatch<
SignerMiddleware<Provider<Http>, LocalWallet>,
>,
binding_patches::GeneratorRegistryPatch<SignerMiddleware<Provider<Http>, LocalWallet>>,
LocalWallet,
),
String,
Expand Down Expand Up @@ -1524,7 +1521,7 @@ fn update_generator_meta_instance(
let client_arc = Arc::new(client);

// Initialize the Generator Registry contract instance with the signer-enabled client
let generator_registry = binding_patches::UpdateGeneratorMetadataPatch::new(
let generator_registry = binding_patches::GeneratorRegistryPatch::new(
generator_registry_address,
client_arc.clone(),
);
Expand Down
2 changes: 1 addition & 1 deletion matching_engine/src/generator_lib/generator_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ pub struct GeneratorInfoPerMarket {
pub state: Option<GeneratorState>,
}

#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)]
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone, Default)]
pub struct Generator {
pub address: Address,
pub reward_address: Address,
Expand Down
Loading

0 comments on commit 61247e6

Please sign in to comment.