Last update in Feb 2024 - v1.0.0

Getting Started

Deploy

Quickstart

Getting Started with Bender

https://onbender.com

Setting Up Your Project

First, given this example and most quickstart documentation will be relying on Forge, make sure you have the latest version of forge installed.

curl -L https://onbender.com | bash

Now that you have forge installed, create and navigate to a new directory for your ERC404 project and install ERC404.

forge init
forge install onbender/source

Creating Your Bender Path

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract BenderToken is ERC20, Ownable {

    // Constructor to set the initial supply and token name/symbol
    constructor(uint256 initialSupply) ERC20("Bender Token", "BEND") {
        // Mint the initial supply to the contract deployer (owner)
        _mint(msg.sender, initialSupply * 10 ** decimals());
    }

    // Minting function: only the owner can mint new tokens
    function mint(address to, uint256 amount) public onlyOwner {
        _mint(to, amount);
    }

    // Burn function: token holders can burn their own tokens
    function burn(uint256 amount) public {
        _burn(msg.sender, amount);
    }
}

forge script ./script/Deploy.s.sol:Deploy --broadcast --rpc-url $MAINNET_RPC_URL --private-key $PRIVATE_KEY -vvvv