Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to clone contracts across networks, or same network. #197

Open
joshuajbouw opened this issue Sep 21, 2022 · 1 comment
Open

Ability to clone contracts across networks, or same network. #197

joshuajbouw opened this issue Sep 21, 2022 · 1 comment

Comments

@joshuajbouw
Copy link
Member

joshuajbouw commented Sep 21, 2022

We do have the ability right now to import contracts from mainnet or testnet into the sandbox and this is a great feature. An improvement would be adding the ability to copy contracts across networks or the same network.

The rationale is that this would enable a user to easily clone and deploy contracts from one account ID to another, and across networks, without having to build a WASM contract on their own or as some admin function if a project requires spinning up new contracts without the use of a factory contract.

@ChaoticTempest
Copy link
Member

An improvement would be adding the ability to copy contracts across networks or the same network.

So to be clear, sandbox has special operations it can do that other networks cannot, like patching arbitrary contract data. A user wouldn't need to call into the constructor method for instance. In this case, if you're suggesting the ability to import contracts from say Mainnet to Testnet or Testnet to Testnet, then the only operations we're allowed here is just purely copying over the WASM bytes. We can actually already do this today with current state of workspaces-rs by utilizing the Worker::view_code and consequently calling into Account::deploy with the bytes.

The rationale is that this would enable a user to easily clone and deploy contracts from one account ID to another, and across networks, without having to build a WASM contract on their own or as some admin function if a project requires spinning up new contracts without the use of a factory contract.

If you need something like being able to import a contract into a different AccountId, then let me add an extra parameter where you can specify the designated AccountId.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: NEW❗
Development

No branches or pull requests

2 participants