Skip to content

Commit

Permalink
feat : added governance functions in proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
Arun Jangra authored and Arun Jangra committed Jun 26, 2024
1 parent bf6a990 commit 868ebfd
Show file tree
Hide file tree
Showing 21 changed files with 7,034 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ jobs:

linters_cargo:
name: Run Cargo linters
uses: ./.github/workflows/linters-cargo.yml
uses: ./.github/workflows/cargo-linters.yml
needs: rust_build
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

This repository contains interfaces and functions to interact with starknet solidity contracts.

One can use two options for deploying the implementation contract :

- `deploy_contract_behind_unsafe_proxy` : This will deploy the contract behind a minimal proxy
and can be used for dev purposes.

- `deploy_contract_behind_safe_proxy` : This will deploy the contract behind a safe audited
proxy and setting the implementation and upgrades

## Setup

```bash
Expand Down
1,084 changes: 1,083 additions & 1 deletion crates/l2/starkgate-manager-client/src/artifacts/StarkgateManager.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use ethers::types::Address;
pub struct StarkgateManagerContractClient {
manager: StarkgateManager<LocalWalletSignerMiddleware>,
proxy_support: ProxySupport<LocalWalletSignerMiddleware>,
manager_implementation: StarkgateManager<LocalWalletSignerMiddleware>,
manager_implementation: Address,
}

impl StarkgateManagerContractClient {
Expand All @@ -21,7 +21,7 @@ impl StarkgateManagerContractClient {
Self {
manager: StarkgateManager::new(address, client.clone()),
proxy_support: ProxySupport::new(address, client.clone()),
manager_implementation: StarkgateManager::new(implementation_address, client.clone()),
manager_implementation: implementation_address,
}
}
}
Expand All @@ -43,7 +43,7 @@ impl StarknetContractClient for StarkgateManagerContractClient {
self.manager.address()
}
fn implementation_address(&self) -> Address {
self.manager_implementation.address()
self.manager_implementation
}
fn client(&self) -> Arc<LocalWalletSignerMiddleware> {
self.manager.client()
Expand Down
1,042 changes: 1,041 additions & 1 deletion crates/l2/starkgate-registry-client/src/artifacts/StarkgateRegistry.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use ethers::types::Address;
pub struct StarkgateRegistryContractClient {
registry: StarkgateRegistry<LocalWalletSignerMiddleware>,
proxy_support: ProxySupport<LocalWalletSignerMiddleware>,
registry_implementation: StarkgateRegistry<LocalWalletSignerMiddleware>,
registry_implementation: Address,
}

impl StarkgateRegistryContractClient {
Expand All @@ -21,7 +21,7 @@ impl StarkgateRegistryContractClient {
Self {
registry: StarkgateRegistry::new(address, client.clone()),
proxy_support: ProxySupport::new(address, client.clone()),
registry_implementation: StarkgateRegistry::new(implementation_address, client.clone()),
registry_implementation: implementation_address,
}
}
}
Expand All @@ -42,7 +42,7 @@ impl StarknetContractClient for StarkgateRegistryContractClient {
self.registry.address()
}
fn implementation_address(&self) -> Address {
self.registry_implementation.address()
self.registry_implementation
}
fn client(&self) -> Arc<LocalWalletSignerMiddleware> {
self.registry.client()
Expand Down
1,724 changes: 1,723 additions & 1 deletion crates/l2/starknet-core-contract-client/src/artifacts/Starknet.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub struct StarknetSovereignContractClient {
proxy_support: ProxySupport<LocalWalletSignerMiddleware>,
governance: StarknetGovernance<LocalWalletSignerMiddleware>,
governed_finalizable: GovernedFinalizable<LocalWalletSignerMiddleware>,
core_contract_implementation: StarknetSovereignContract<LocalWalletSignerMiddleware>,
core_contract_implementation: Address,
}

impl StarknetSovereignContractClient {
Expand All @@ -31,10 +31,7 @@ impl StarknetSovereignContractClient {
proxy_support: ProxySupport::new(address, client.clone()),
governance: StarknetGovernance::new(address, client.clone()),
governed_finalizable: GovernedFinalizable::new(address, client.clone()),
core_contract_implementation: StarknetSovereignContract::new(
implementation_address,
client.clone(),
),
core_contract_implementation: implementation_address,
}
}
}
Expand Down Expand Up @@ -77,7 +74,7 @@ impl StarknetContractClient for StarknetSovereignContractClient {
self.core_contract.address()
}
fn implementation_address(&self) -> Address {
self.core_contract_implementation.address()
self.core_contract_implementation
}
fn client(&self) -> Arc<LocalWalletSignerMiddleware> {
self.core_contract.client()
Expand Down
183 changes: 182 additions & 1 deletion crates/l2/starknet-erc20-client/src/artifacts/ERC20Token.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use ethers::types::Address;
pub struct StarknetEthBridgeContractClient {
eth_bridge: StarknetEthBridge<LocalWalletSignerMiddleware>,
proxy_support: ProxySupport<LocalWalletSignerMiddleware>,
eth_bridge_implementation: StarknetEthBridge<LocalWalletSignerMiddleware>,
eth_bridge_implementation: Address,
}

impl StarknetEthBridgeContractClient {
Expand All @@ -22,10 +22,7 @@ impl StarknetEthBridgeContractClient {
Self {
eth_bridge: StarknetEthBridge::new(address, client.clone()),
proxy_support: ProxySupport::new(address, client.clone()),
eth_bridge_implementation: StarknetEthBridge::new(
implementation_address,
client.clone(),
),
eth_bridge_implementation: implementation_address,
}
}
}
Expand All @@ -47,7 +44,7 @@ impl StarknetContractClient for StarknetEthBridgeContractClient {
self.eth_bridge.address()
}
fn implementation_address(&self) -> Address {
self.eth_bridge_implementation.address()
self.eth_bridge_implementation
}
fn client(&self) -> Arc<LocalWalletSignerMiddleware> {
self.eth_bridge.client()
Expand Down
2 changes: 1 addition & 1 deletion crates/l2/starknet-proxy-client/src/artifacts/Proxy.json
Original file line number Diff line number Diff line change
Expand Up @@ -465,4 +465,4 @@
"type": "receive"
}
]
}
}
Loading

0 comments on commit 868ebfd

Please sign in to comment.