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

Cannot use VM alongside other contracts #184

Open
gagdiez opened this issue Apr 6, 2024 · 0 comments
Open

Cannot use VM alongside other contracts #184

gagdiez opened this issue Apr 6, 2024 · 0 comments

Comments

@gagdiez
Copy link

gagdiez commented Apr 6, 2024

The initNear takes a wallet selector as input. Currently, if the wallet selector creates a function access key for a contract that is not the SocialDB (for example, the user wants to login to use hello.near-examples.testnet, the following lines will logOut the user:

near.connectedContractId = walletState?.contract?.contractId;
if (
near.connectedContractId &&
near.connectedContractId !== near.config.contractName
) {
const selector = await near.selector;
const wallet = await selector.wallet();
await wallet.signOut();
near.connectedContractId = null;
walletState = selector.store.getState();
}

This is because the VM is checking if the selector being used is connected to the socialDB, and otherwise calling wallet.signOut

I would expect people to mix interactions with the VM with interactions to other contracts. In fact, I discovered this problem while trying to create a Hello World example that can talk with both BOS components, and a simple hello world smart contract.

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

No branches or pull requests

2 participants