I’d like to program a canister (let’s call it canister A) to be able to retrieve the wasm module of another canister (canister B) so that canister A can use the wasm module from canister B to upgrade a third canister (canister C). Is this possible to do?
For context, I’m building a dapp that is designed to be such that ownership of the dapp is easily transferable without the need for technical expertise. To achieve this, i coded the dapp so that it’s backend canister is the controller of: 1.) itself, 2.) the front end canister and 3.) a third “manager” canister that exists only to deliver upgrades to the backend canister since a canister cannot upgrade itself (the manager canister is the only other controller of the backend canister and the manager canister is only controlled by the backend canister and itself).
for each instance of the dapp, a utility NFT is minted. The dapp is programmed to be able to execute updates to its canister settings upon itself but only when called by the principal that is the owner of the corresponding NFT- thus granting the NFT owner sole influence over the dapp’s canister settings.
Eventually, i want to create a DAO that will, among other things, serve as a master copy that the many instances of the dapp will reference when they upgrade themselves. Because the dapps will need to upgrade themselves using the wasm module of the master copy, i need a way for the separate instances of the dapp to be able to retrieve that wasm module programmatically.
Currently, the only method I’ve come up with for programmatically installing a wasm file to a canister is to store the wasm module as a blob in the stable memory of a canister somewhere and call the canister to retrieve the wasm blob that’s stored. This method is not ideal since it requires a trusted party to upload the wasm to the canister where it’s stored and there’s no way for others to verify that the wasm module uploaded to the stable memory is the proper module that corresponds to the code that’s promised.