LogoLogo
WebsiteDiscordTelegramX (Twitter)
  • About LightLink
    • What is LightLink?
    • Low Gas Fees
    • Enterprise Mode With Zero Fees
    • Benefits of Enterprise Mode
  • Using LightLink
    • Connecting a Wallet
    • Adding LL Tokens to Your Wallet
    • Bridging Assets
    • Getting Testnet Tokens
    • Use Cases
  • Building on LightLink
    • Live Networks
    • EVM and Solidity Basics
    • Smart Contracts
    • Boneh-Lynn-Shacham Signatures (BLS)
    • JSON-RPC Specification
    • Enterprise Mode Overview
    • Enabling Enterprise Mode
    • Developer AI Support
  • Tools for Developers
    • Bolt for Gasless NFT Minting
    • Block Explorers
    • Clients
    • IDEs
    • Toolchains
    • Data Indexers
    • Oracles and Random Number Generators
    • Deployed Contracts
    • SPACE ID Web3 Name SDK
  • Achitecture & Design
    • LightLink Protocol: Deep Dive
    • Bridge Architecture
    • Live Contracts Addresses
  • Miscellaneous
    • Brand Assets
    • Security Audits
    • Ecosystem Growth Program
Powered by GitBook
On this page
  • Development
  • Testing
  • Deployment
  • Verification
  1. Building on LightLink

Smart Contracts

PreviousEVM and Solidity BasicsNextBoneh-Lynn-Shacham Signatures (BLS)

Last updated 11 months ago

Development

The most popular Browser-Based IDE for Solidity development is . It is easy to install and use, and it also offers a feature to connect your MetaMask wallet to a contract in the development phase and test it in a real-life-like environment.

Most local IDEs have Solidity plugins or extensions with syntax highlighting. For example, many Solidity developers use with additional .

and provide a more comprehensive environment with automated testing, private virtual EVM network deployment, and dummy accounts to interact with.

is another popular environment for developing, testing, and deploying smart contracts written in Solidity for EVM chains.

Testing

is a tool to spin up a private EVM blockchain to test smart contract behavior in a simulated environment.

is a tool for spotting common mistakes and security flaws and suggesting best practices and style.

Deployment

Smart contracts must be deployed on the blockchain to become accessible.

We recommend using as it is one of the most used tools, and there are plenty of tutorials on using it. First, configure Hardhat to use the LightLink Pegasus network. To do this, install Hardhat, create the project, find the hardhat.config.ts file, and change the network parameters:

const config: HardhatUserConfig = {
 solidity: {
   version: '0.8.17',
 },
 networks: {
   // for mainnet
   'lightlink-mainnet': {
     url: 'https://replicator.phoenix.lightlink.io/rpc/v1',
     accounts: [process.env.WALLET_KEY as string],
     gasPrice: 1000000000,
   },
   // for testnet
   'lightlink-testnet': {
     url: 'https://replicator.pegasus.lightlink.io/rpc/v1',
     accounts: [process.env.WALLET_KEY as string],
     gasPrice: 1000000000,
   },
   // for local dev environment
   'base-local': {
     url: 'http://localhost:8545',
     accounts: [process.env.WALLET_KEY as string],
     gasPrice: 1000000000,
   },
 },
 defaultNetwork: 'hardhat',
};

To deploy the contract, put the network argument in the final command:

npx hardhat run scripts/deploy.ts --network lightlink-testnet

Verification

customChains: [
  {
    network: 'phoenix',
    chainId: 1890,
    urls: {
      apiURL: 'https://phoenix.lightlink.io/api',
      browserURL: 'https://phoenix.lightlink.io',
    },
  },
  {
    network: 'pegasus',
    chainId: 1891,
    urls: {
      apiURL: 'https://pegasus.lightlink.io/api',
      browserURL: 'https://pegasus.lightlink.io',
    },
  },
],

Please read the for more examples of installing and using Hardhat.

The contracts can be manually verified using Blockscout Explorer (, ). Verification ensures that the deployed bytecode matches the human-readable Solidity code, confirming that the developers are not attempting to deceive users.

Additionally, developers can verify the code using IDE plugins. An example is the , which can be used with the following code:

Remix
Visual Studio Code
Solidity plugins
Truffle
Ganache
Hardhat
Ganache
Solhint
Hardhat
official documentation
Mainnet
Testnet
Hardhat Verifier plugin