Skip to content

Commit

Permalink
chore: add governance canister as controller
Browse files Browse the repository at this point in the history
  • Loading branch information
zensh committed Oct 11, 2024
1 parent 6e6836d commit fea158e
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 9 deletions.
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ opt-level = 's'

[workspace.package]
edition = "2021"
version = "2.5.0"
version = "2.5.1"
repository = "https://github.com/ldclabs/ic-panda"
keywords = ["canister", "icp", "panda"]
categories = ["web-programming"]
Expand Down
6 changes: 6 additions & 0 deletions canister_ids.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
"ic_message_profile": {
"ic": "ijyxz-wyaaa-aaaaj-qa4qa-cai"
},
"ic_oss_bucket": {
"ic": "532er-faaaa-aaaaj-qncpa-cai"
},
"ic_oss_cluster": {
"ic": "5szpn-tiaaa-aaaaj-qncoq-cai"
},
"ic_panda_ai": {
"ic": "bwwuq-byaaa-aaaan-qmk4q-cai"
},
Expand Down
10 changes: 10 additions & 0 deletions dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,16 @@
"type": "custom",
"wasm": "https://github.com/ldclabs/ic-cose/releases/download/v0.3.2/ic_cose_canister.wasm.gz"
},
"ic_oss_cluster": {
"candid": "https://github.com/ldclabs/ic-oss/releases/download/v0.9.3/ic_oss_cluster.did",
"type": "custom",
"wasm": "https://github.com/ldclabs/ic-oss/releases/download/v0.9.3/ic_oss_cluster.wasm.gz"
},
"ic_oss_bucket": {
"candid": "https://github.com/ldclabs/ic-oss/releases/download/v0.9.3/ic_oss_bucket.did",
"type": "custom",
"wasm": "https://github.com/ldclabs/ic-oss/releases/download/v0.9.3/ic_oss_bucket.wasm.gz"
},
"internet_identity": {
"candid": "https://github.com/dfinity/internet-identity/releases/download/release-2024-06-07/internet_identity.did",
"remote": {
Expand Down
5 changes: 4 additions & 1 deletion src/ic_message_channel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ mod types;

use crate::api_init::ChainArgs;

// "dwv6s-6aaaa-aaaaq-aacta-cai" ICPanda DAO canister id
static DAO_CANISTER: Principal = Principal::from_slice(&[0, 0, 0, 0, 2, 0, 0, 166, 1, 1]);

fn is_controller() -> Result<(), String> {
let caller = ic_cdk::caller();
if ic_cdk::api::is_controller(&caller) {
if caller == DAO_CANISTER || ic_cdk::api::is_controller(&caller) {
Ok(())
} else {
Err("user is not a controller".to_string())
Expand Down
5 changes: 4 additions & 1 deletion src/ic_message_profile/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ mod types;

use crate::api_init::ChainArgs;

// "dwv6s-6aaaa-aaaaq-aacta-cai" ICPanda DAO canister id
static DAO_CANISTER: Principal = Principal::from_slice(&[0, 0, 0, 0, 2, 0, 0, 166, 1, 1]);

fn is_controller() -> Result<(), String> {
let caller = ic_cdk::caller();
if ic_cdk::api::is_controller(&caller) {
if caller == DAO_CANISTER || ic_cdk::api::is_controller(&caller) {
Ok(())
} else {
Err("user is not a controller".to_string())
Expand Down

0 comments on commit fea158e

Please sign in to comment.