Solana Smart Contracts
Solana smart contracts, known as Programs, are written primarily in Rust and compatible with the Solana runtime environment, delivering high throughput, near-instant finality, and low transaction fees. Solana Programs allow users to automate complex on-chain logic, manage tokens and digital assets, and interact with Solana's native services such as the SPL Token Program and Solana Program Library (SPL).
Adding and setting up a Solana Program requires the same 3 stages as other smart contracts on the Custody Infrastructure system.
These are:
- Adding the Program to the Impenetrable vault.
- Mapping the functions
- Defining the functions in the transaction page for delegation
Prerequisites
- A preexisting Solana Program. You need easy access to the following information regarding the contract throughout this process:
- The contract address and network information
- The contract's source code
Adding and mapping a Solana smart contract program
Locate the smart contract you wish to add using a Solana Explorer website, such as https://solana.fm/ or https://explorer.solana.com/
Copy down the following information from the smart contract program:
- Contract address
- Function data names and parameters (found under the Program IDL section or GitHub link for the Smart Contract Program)
In the Impenetrable Vault, select the Smart Contract menu option.
To start a Solana smart contract select Add Solana Program.

The Add Program Function window opens.
Note: The Custody Infrastructure system comes with preinstalled Solana programs. To load these programs see Add a preconfigured Solana Smart contract ProgramAdd a preconfigured Solana Smart contract Program.
To create a new Solana contract enter:
- Program Name - any name that describes to your team the purpose of this smart contract).
- Contract Address - taken from the Smart Contract found on the internet

- Map the Contract Functions listed in the Program IDL/ GitHub section:
- Select Add. The Add Program Function window appears.
- Type the Function Name and Description.
- Select a Function Discriminator from the drop down list.
- To Add Function Accounts, which are optional depending on the function, select Add. The Add Account window opens.
- Type the Account Name as listed in the WASM data.
- Select the exact Account Type for the parameter as listed in the WASM data.
- Add a default address. This field is optional.
- Select OK.

- Repeat this process until all the parameters for this function are listed.
- Follow the same process to add Function Parameters to this program.
- Select OK to complete and add the Program Function.
- Repeat this process until all of the functions for the contract are mapped and listed in the New Solana Program window.
- Select OK. The Smart Contract now appears in the list on the Smart Contracts page.
Update the Transaction Policies to include Solana
It can be easy to forgot to add or update your system Transaction Policies to include the new Solana currency if this is the first time you are adding this type of Smart Contract.
To update the Transaction Policies:
- Select Policy Management from the main menu. In the Transaction Policies select a policy to update by selecting the
edit icon.
- In the To - Address list select the Solana SOL contacts to add to the Transaction policy.

- In the Currencies section, under Allow in Policy, ensure that the Smart contract function calls box is ticked.

- Complete the rest of the policy and select Save policy.
Now that a transaction policy is updated you can make Solana transactions.
Create a Solana Smart Contract transaction
To create a Stellar transaction:
Open Transactions from the main menu. Select the Account and the SOL currency. Then select New Tranascation.
The Create Solana Transaction window opens.
Select the Program Call box. Select Yes to switch transaction modes. Select the
load program button and the Choose Program window opens.
Select a program function and select OK. The Program name and Address are automatically filled.

To add an Instruction select Edit. The Choose program function window opens. Select a function and select OK. The Solana Program Data window opens.
Add the relevant data for the Program, such as Contact or Account information and the parameter value. Select OK.

Repeat this process to add extra programs using the + Add Instruction button. Select Send to complete the transaction.
A Verification window appears. Check the Desktop/ Mobile app for the code. The Impenetrable Vault performs a Dry run of the smart contract transaction to ensure it will run on the coin network. The results will also appear in the Desktop/ Mobile app pop up window.
If the Dry run is successful, a Success message appears.
If the Dry runs fails the pop up window will show the error log and the problem data that caused the transaction to fail and you have to make changes to the transaction so that it passes the Dry run test.
When the Dry run transaction is successful, the Update branch window opens.
The Branch ID will appear in the Desktop/ Mobile app pop up window or in the Proxy Desktop section. Enter the Branch ID and select Set Branch.
The transaction is sent and appears in the Transactions Page.
Add a preconfigured Solana Smart Contract Program
The Custody Infrastructure system comes with 3 preconfigured Solana smart contracts that can be added from the Smart Contracts page.
In the Smart Contracts page, Select Add Solana Contract.
Select Load in the Add Program Function window.
The Choose Smart Contract window opens listing 3 contracts:
- Token
- Token 2022
- System
Follow the instructions above to add or edit the program functions as needed.
Removing a Solana Smart Contract
To remove a Solana, or any other type of, Smart Contract see Removing a Smart Contract from the systemRemoving a Smart Contract from the system.