Questions tagged [solang]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
19 views

Maybe something wrong with program-examples/tokens/create-token/solang/tests /create-token.ts?

Link is here: https://github.com/solana-developers/program-examples/blob/main/tokens/create-token/solang/tests/create-token.ts It gives two examples. One for creating SPL tokens the other for NFTs. ...
Hikari's user avatar
  • 11
0 votes
0 answers
14 views

Conversion of payable

function flip(address _addr) public payable { total += 1; payable(_addr).transfer(1); } How to call this in Solana: await program.methods .flip(transferToAccount) .accounts({ dataAccount: dataAccount....
Zpay Tech's user avatar
0 votes
0 answers
14 views

how to deploy and interact with multiple contracts like etherjs

I want to deploy solidity contracts which have multiple inheritance ,is there any way to deploy that ?
user7117's user avatar
1 vote
0 answers
70 views

Unable to do the CPI to Orca whirlpool program after obtaining its interface via solang

Description We are unable to correctly finalize the call to the Orca whirlpool program fork after we have obtained the whirlpool interface via the solang idl whirlpool.json command. When doing the CPI,...
Aleksandr Kuperman's user avatar
1 vote
0 answers
29 views

Calling a function on a Solidity contract that is complied using solang

I wrote a simple Solidity contract which I compile to Solana using solang and deployed to a local Solana node using solana program deploy. Here is the contract: // SPDX-License-Identifier: MIT pragma ...
reselbob's user avatar
  • 111
0 votes
1 answer
68 views

Borsh serializing a nested object for a Solana transaction instruction

I have a Solidity function: function add(uint256 a, uint256 b) public pure returns (uint256) { uint256 result = a + b; return result; } That I've migrated over to Solana using ...
reselbob's user avatar
  • 111
1 vote
1 answer
35 views

How to transfer an NFT token from a regular (onCurve) account to a PDA one using Solang

Does anyone have an example of how one can transfer an NFT token from a user account to the PDA one using Solang? The reason is to be able to acquire NFT-s sent by users on a program account (deposit),...
Aleksandr Kuperman's user avatar
0 votes
0 answers
27 views

Problem with testing a name service smart contract written in Solang

I'm trying to run a benchmark for a Solana node using this name service I wrote in Solang within an Anchor project. This is the Solang smart contract. import 'solana'; contract eclipse_ns { ...
Pratham Prasoon's user avatar
2 votes
1 answer
52 views

Solang anchor commands after "anchor init <name> --solidity" yields "Error: No such file or directory (os error 2)"

To reproduce: anchor init <name> --solidity anchor build # output: Error: No such file or directory (os error 2) I have tried many logging options but none showed any relevant information.
CrossedCarpet's user avatar
0 votes
0 answers
39 views

How can I dynamically increase storage space for a program deployed on Solana using Solang?

I have a program that utilizes arrays and mappings, potentially requiring significant storage space. Is there a mechanism to dynamically augment the storage space of the account that deployed the ...
Tiago Soriano's user avatar
2 votes
1 answer
105 views

Is solang stable enough to use in production?

I recently came across solang after spending a lot of time in learning anchor and rust for writing smart contracts. I felt solang as good goto option when compared to rust anchor, As it is very ...
Aravind Makam's user avatar
1 vote
1 answer
159 views

How to send SPL tokens from a contract in Solang?

I'm trying to use the lever/hand example together with the SPL token example, but I keep getting: Error: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: ...
Jonat Yellow's user avatar
1 vote
1 answer
35 views

Lamports not working when dealing with AccountInfo within Solang

When trying to build a program with this function (from one of the exmaples given): function transferSolWithCpi(uint64 lamports) public { AccountInfo from = tx.accounts[0]; // first ...
Jonat Yellow's user avatar
0 votes
1 answer
45 views

Error: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: incorrect program id for instruction

this is my code and error is occur when i calling new method : import * as anchor from "@coral-xyz/anchor"; import { Program } from "@coral-xyz/anchor"; import { Starter } ...
saurav singh's user avatar
4 votes
1 answer
166 views

i can't test my Counter Solang program "Error: unknown signer: "

Guys i have problem testing Solang, if u can help me with this should be great! =) Github Repo: https://github.com/sistemaseltigre/ClasesTwitch/tree/anchor/counter Versions tools: solana-cli 1.16.4 (...
Jesus Silva's user avatar
3 votes
1 answer
162 views

How to use Anchor's `.view()` in frontend without prompting wallet to sign?

Solang currently uses Anchor's .view() to fetch account state from the client. The issue is that when using .view() in a frontend, it also prompts the wallet to sign a transaction. Is there a way to ...
john's user avatar
  • 6,760
1 vote
1 answer
66 views

Interaction with an SPL token using Solang

I am looking to take an SPL token as a payment in my Solang contract, but the transfer function is marked as internal. (function transfer(address from, address to, address owner, uint64 amount) ...
user2837's user avatar
1 vote
1 answer
616 views

Can I call methods(instructions) in solana abi using Javascript?

I have solana abi json file. I want to call methods in json file. How to call methods in json and look up file ? I only use @solana/web3.js and @solana/solidity import { Transaction, SystemProgram,...
Jerry's user avatar
  • 141