what is adelante?

This is a code generation tool to aid in the rapid prototyping of smart contracts built with solidity

if you like it, send me a coffee 🙂

Eth address: 0x4A079D4417b522762C72dB9643234FCC4683a40E

how can I make it work??


npm install adelante


yarn add adelante

then run:

npx adelante

you will be asked some questions to generate an adelante.json file

As of version 1.1.1 you can:

  • generate inline functions or extract them to their own files
  • generate inline components or extract them to their own files
  • use a combination of the two, e.g inline functions and extracted components (javascript support and other options coming soon!)

its reccomended that you

to install the dependencies

  • copy your abi file into the root project directory
  • define the path to your abi file in the adelante.json file (if you didnt do it when you generated the adelante file)
  • run npx adelante and it will output the files to a directory named after your contract name (more output options comming soon)

Currently it:

Creates functions to interact with smart contract functions

The functions will return data if it is expected, otherwise it will not generate a return statement.

import { getContract } from '../utils/utils';

export default async function getTotalUnits() {
  try {
    const { ethereum } = window;
    const contract = getContract(ethereum);
    const data = await contract.getTotalUnits();
    return data;
  catch (error) {

Creates React components for the functions

These components have inputs and a button to call the smart contract function along with state and a handleChange function

import React, { useState } from 'react';
import purchaseUnit from '../functions/purchaseUnit';

type State = {
  [key: string]: string

export default function PurchaseUnit() {
  const [state, setState] = useState<State>({})
  const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
    const { name, value } =
    setState((prevState) => {
      return {
        [name]: value

  return (
    <div id="functionBox">
      <div id="heading">
        <p>Function inputs: (uint16 _amount: number)</p>
        <div id="inputs">
        <input name="_amount" onChange={handleChange} type="number" placeholder="_amount"/>

      <button onClick={async () => await purchaseUnit(state?._amount)} value="">purchaseUnit</button>
  • creates the index.ts, index.html & App files
  • populates the appfile with the components

import React from 'react';

import FundWithdraw from './components/fundWithdraw';
import GetInvestor from './components/getInvestor';
import GetRemainingUnits from './components/getRemainingUnits';
import GetTotalUnits from './components/getTotalUnits';
import PurchaseUnit from './components/purchaseUnit';

export default function App() {
  return (
    <div className="home-page">
      <FundWithdraw />
      <GetInvestor />
      <GetRemainingUnits />
      <GetTotalUnits />
      <PurchaseUnit />


Things to note:

  • with payable functions an ethers.utils.parseEther() is generated in the function file but an amount is not provided

how come? payable functions dont require the ether amount to de defined as an argument in the function inputs (these are recorded in the contract abi which is the source for the code generation)


View Github