Open partylikeits1983 opened 3 months ago
this is related https://github.com/0xPolygonMiden/miden-base/issues/550
The problem is storage and the reserved dataslots. However, I don't see why we can't merge a workaround until we have the correct package format
If not critical, I'd prefer not to merge this as we should have a more general solution to accounts with custom code relatively soon (i.e., within the next month or so).
If not critical, I'd prefer not to merge this as we should have a more general solution to accounts with custom code relatively soon (i.e., within the next month or so).
Ok no worries. The partially fillable swap note for the order book note is working and has been extensively tested using mock-datastore.
Is there a way to deploy a custom account to the miden localhost instance? I just need two extra "read-only" procedures in addition to the default account code, get_balance
and get_id
.
I want to deploy to miden-node this account:
use.miden::contracts::wallets::basic->basic_wallet
use.miden::contracts::auth::basic->basic_eoa
use.miden::account
export.basic_wallet::receive_asset
export.basic_wallet::send_asset
export.basic_eoa::auth_tx_rpo_falcon512
export.account::get_balance
export.account::get_id
Is there a way to deploy a custom account to the miden localhost instance? I just need two extra "read-only" procedures in addition to the default account code,
get_balance
andget_id
.
The only way to do that is to create an account programmatically (e.g., instantiate the Account
struct with the code you'd like), the serialize it into .mac
file (via the AccountData struct), and then import the .mac
file in the client using the import
command.
I think given the code you have above, instantiating AccountData
struct and serializing it should be relatively straight-forward.
Feature description
Adding a
create_wallet_with_custom_code
function would make it easier to create wallets with custom code when using the miden-client.I propose adding a function in
miden-lib/src/accounts/wallets/mod.rs
that allows to pass in custom logic when creating a wallet. This function is pretty much a copy ofcreate_basic_wallet
but allows to pass in custom masm code when creating the wallet:Why is this feature needed?
Makes it easier to create wallets with custom logic when using Miden client.