Skip to main content

Create a Vault

This guide will teach you how to deploy an LSP9Vault contract. This contract can be used to hold assets such as tokens and NFTs. Also can be used with a UniversalProfile and a KeyManager to restrict some addresses (protocols, friends, etc..) to execute and setData on it, instead of setting or executing directly on the profile.

Guide - How to create an LSP9Vault

Deploy an LSP9Vault contract

Check previous guides to learn how to connect to LUKSO's L16 network and load your EOA.

Deploying the vault
import Web3 from 'web3';
import LSP9Vault from '@lukso/lsp-smart-contracts/artifacts/LSP9Vault.json';

const web3 = new Web3('');

const PRIVATE_KEY = '0x...'; // your EOA private key
const myEOA = web3.eth.accounts.wallet.add(PRIVATE_KEY);

// create an instance
let myVault = new web3.eth.Contract(LSP9Vault.abi);

// deploy the vault contract
await myVault
data: LSP9Vault.bytecode,
arguments: ["0x.."] // address of the UniversalProfile
from: myEOA.address,
gas: 5_000_000,
gasPrice: '1000000000',