Discover our Success Stories: Real World Solutions for Today’s Challenges

INSIGHTS

Digital Insider

Case Studies

HOW DIGITAL SERVICES ARE HELPING BUSINESSES EVERYDAY

Lend Up

A Deep Dive into the Challenges and Solutions of a Troubled System

Supreme

Improving Order Fulfillment.

The Doctors Clinic Group

Blending Science and Technology with Data-Led Transformation

Research​

Discover a treasure trove of insightful research, visionary ideas, and collaborative contributions meticulously curated by our experts in the dynamic realms of technology and business.

Payment Association
Want to learn about the contribution of digital assets in the payments industry? Read the latest report on Crypto assets from The Payments Association made in collaboration with our director, Manish Garg and other industry leaders from the space.
BIS - CPMI Consultation
Curious about how ISO 20022 can revolutionize cross-border payments? Read VE3's response to consulation for ISO 20022 harmonization requiremnets for enhancing cross border payments.

Webinars​

Stay ahead of the curve with our upcoming webinars, where we share valuable insights, practical advice, and actionable strategies to help you delve into the intricate technology and business landscape.

Riding the Cloud Wave

May 17, 2023

Streamlining the cloud migration journey has never been easier, especially for small and medium-sized businesses operating within budget constraints. Our expert panelists developed a strategic and commitment-free plan of action, tailored specifically to empower businesses to migrate to the cloud seamlessly and optimize their cloud spending.

Newsletter that immerses you to our latest research and insights

We are passionately helping businesses to navigate through the ever-evolving digital landscape. With the rapid evolution of technology and the rise of digital channels, it’s more important than ever for businesses to have a robust digital presence, develop a comprehensive strategy and stay up-to-date with industry updates.
Digital Insider
World Clock
Loading...
Loading...
Loading...

Ethers.js Code Example:

const { ethers } = require('ethers');

// Connect to a local Ethereum node
const provider = new ethers.providers.JsonRpcProvider('http://localhost:8545');

// Get the balance of an Ethereum account
const getBalance = async (address) => {
  const balance = await provider.getBalance(address);
  console.log(`Account balance: ${ethers.utils.formatEther(balance)} ETH`);
};

// Deploy a smart contract
const deployContract = async (contractData, wallet) => {
  const factory = new ethers.ContractFactory(contractData.abi, contractData.bytecode, wallet);
  const contract = await factory.deploy();

  console.log(`Contract deployed at address: ${contract.address}`);
};

// Usage examples
getBalance('0x1234567890abcdef');
deployContract(contractData, wallet);
    

Web.js Code Example:

const Web3 = require('web3');

// Connect to a local Ethereum node
const web3 = new Web3('http://localhost:8545');

// Get the balance of an Ethereum account
const getBalance = async (address) => {
  const balance = await web3.eth.getBalance(address);
  console.log(`Account balance: ${web3.utils.fromWei(balance, 'ether')} ETH`);
};

// Deploy a smart contract
const deployContract = async (contractData, account) => {
  const contract = new web3.eth.Contract(contractData.abi);
  const deployTx = contract.deploy({ data: contractData.bytecode });
  const gasEstimate = await deployTx.estimateGas();

  const deployReceipt = await deployTx.send({
    from: account,
    gas: gasEstimate,
  });

  console.log(`Contract deployed at address: ${deployReceipt.contractAddress}`);
};

// Usage examples
getBalance('0x1234567890abcdef');
deployContract(contractData, '0xabcdef1234567890');
    

Ethers.js Code Examples:

1. Interacting with a Smart Contract:

const { ethers } = require('ethers');

// Connect to a local Ethereum node
const provider = new ethers.providers.JsonRpcProvider('http://localhost:8545');

// Define the contract ABI and address
const contractABI = [...];
const contractAddress = '0xabcdef1234567890';

// Create a contract instance
const contract = new ethers.Contract(contractAddress, contractABI, provider);

// Call a contract method
const result = await contract.someMethod(...);
console.log(`Result: ${result}`);

// Listen to contract events
contract.on('EventName', (eventArgs) => {
  console.log('Event received:', eventArgs);
})
    

2. Signing and Sending a Transaction:

const { ethers } = require('ethers');

// Connect to a local Ethereum node
const provider = new ethers.providers.JsonRpcProvider('http://localhost:8545');

// Create a wallet instance from a private key
const privateKey = '0xabcdef1234567890...';
const wallet = new ethers.Wallet(privateKey, provider);

// Specify the transaction parameters
const txParams = {
  to: '0xabcdef1234567890',
  value: ethers.utils.parseEther('1.0'),
  gasLimit: 21000,
  gasPrice: ethers.utils.parseUnits('30', 'gwei'),
  nonce: await provider.getTransactionCount(wallet.address),
};

// Sign and send the transaction
const signedTx = await wallet.signTransaction(txParams);
const txResponse = await provider.sendTransaction(signedTx);
console.log(`Transaction hash: ${txResponse.hash}`);
    

Web3.js Code Examples:

1. Interacting with a Smart Contract:

const Web3 = require('web3');

// Connect to a local Ethereum node
const web3 = new Web3('http://localhost:8545');

// Define the contract ABI and address
const contractABI = [...];
const contractAddress = '0xabcdef1234567890';

// Create a contract instance
const contract = new web3.eth.Contract(contractABI, contractAddress);

// Call a contract method
const result = await contract.methods.someMethod(...).call();
console.log(`Result: ${result}`);

// Listen to contract events
contract.events.EventName({}, (error, event) => {
  if (!error) {
    console.log('Event received:', event.returnValues);
  }
});
    

2. Signing and Sending a Transaction:

const Web3 = require('web3');

// Connect to a local Ethereum node
const web3 = new Web3('http://localhost:8545');

// Create a new account using the web3 library
const account = web3.eth.accounts.create();

// Specify the transaction parameters
const txParams = {
  to: '0xabcdef1234567890',
  value: web3.utils.toWei('1', 'ether'),
  gas: 21000,
  gasPrice: web3.utils.toWei('30', 'gwei'),
  nonce: await web3.eth.getTransactionCount(account.address),
};

// Sign and send the transaction
const signedTx = await account.signTransaction(txParams);
const txReceipt = await web3.eth.sendSignedTransaction(signedTx.rawTransaction);
console.log(`Transaction hash: ${txReceipt.transactionHash}`);