solana-playground / solana-playground

Quickly develop, deploy and test Solana programs from browsers
https://beta.solpg.io
Apache License 2.0
399 stars 135 forks source link

Unable to deploy Solana smart Contract coded in Anchor #192

Open mshoaib112215 opened 3 months ago

mshoaib112215 commented 3 months ago

image

Hello there!

I need help related to the deployment, I deployed my contract Yesterday (29/01/2024) evening but this always shows me this line when I try to deploy my contract even when I want to deploy the hello_anchor simple contract, it shows me this as shown in image.

If anyone helps me, it would be appreciated, and it would make my day :)

acheroncrypto commented 3 months ago

Hey, same as https://github.com/solana-playground/solana-playground/issues/193#issuecomment-1917913749.

Deploying programs require making transactions but devnet doesn't accept transactions currently. It should be fixed soon.

kaiqiangh commented 3 months ago

Hey, same as #193 (comment).

Deploying programs require making transactions but devnet doesn't accept transactions currently. It should be fixed soon.

Hi,

I am still facing the similar issue that is unable to deploy program on devnet.

image
acheroncrypto commented 3 months ago

Can you share browser console logs(F12)?

kaiqiangh commented 3 months ago

Here is the screenshot. The error message is "Transaction simulation failed: This account may not be used to pay transaction fees", but my address on devnet has enough SOL balance.

image
acheroncrypto commented 3 months ago

This error happens when your account is not owned by the System program. Anchor added a check for it in https://github.com/coral-xyz/anchor/pull/2284 but it's still possible to initialize wallet accounts as program accounts since Solana doesn't differentiate them in protocol level. You can check the owner of your account by running

solana account <ADDRESS>

in the terminal.

kaiqiangh commented 3 months ago

yeah, you are right. My address is not owned by the System program. Is it possible to change the ownership? I do not find any solution for that. Thanks

acheroncrypto commented 3 months ago

It should be possible to recover from this by creating a transaction to send funds from that wallet but paying the fee from another wallet. You can create another wallet account and use them in a TS file with pg.wallets.

Also, I'm curious to know how you changed the owner of your wallet account.

kaiqiangh commented 3 months ago

It should be possible to recover from this by creating a transaction to send funds from that wallet but paying the fee from another wallet. You can create another wallet account and use them in a TS file with pg.wallets.

Also, I'm curious to know how you changed the owner of your wallet account.

I forgot what I did to cause this issue. I would try the way you mentioned. Thanks a million.