R3D4NG3L / PresaleSmartContract

This repository offers a smart contract to manage seed sales / pre-sales. It is written in Solidity for EVM blockchains (e.g. Ethereum, BSC, Cronos, ...).
Apache License 2.0
40 stars 33 forks source link

Errors in deploying the contract #1

Open Ekehi opened 9 months ago

Ekehi commented 9 months ago

please can you attach a set guide on how to deploy this contract all my effort to deploy doesn't work

uemrey0 commented 7 months ago

Hello @Ekehi,

I noticed your request for a guide on how to deploy the ERC20 tokens and associated contracts from this repository. Although I'm not the owner of this repository, I'd like to offer some assistance based on general practices with Truffle and Ethereum smart contract deployment. Below is a step-by-step guide that should help you navigate the deployment process. Please ensure you have the necessary prerequisites before you begin.

If you have any specific questions or run into issues at any step, feel free to ask!


Deploying ERC20 Token and Contracts with Truffle

This guide provides step-by-step instructions on deploying an ERC20 token and related smart contracts using the Truffle Suite on the Ethereum network.

Prerequisites

Step 1: Reviewing the Project

  1. Clone the project from GitHub to your local machine:
    git clone <your_project_github_url>
    cd <cloned_directory>
  2. Open the truffle-config.js file in the project and review the network configurations. This file defines the networks to which you will deploy.

Step 2: Installing Dependencies

  1. Navigate to your project directory and install the dependencies using npm:
    npm install

Step 3: Truffle Configuration

  1. Edit the truffle-config.js file to add your Ethereum network (Mainnet, Ropsten, Rinkeby, etc.) and wallet information. You can use a node provider like Infura or Alchemy.

    Example network configuration:

    networks: {
     ropsten: {
       provider: () => new HDWalletProvider('<your_private_key>', `https://ropsten.infura.io/v3/<your_infura_project_key>`),
       network_id: 3,       // Ropsten's network id
       gas: 5500000,        // Gas limit
       confirmations: 2,    // How many confirmations to wait between deployments
       timeoutBlocks: 200,  // How many blocks before a deployment times out
       skipDryRun: true     // Skip dry run before migrations
     },
    }

Step 4: Compiling Smart Contracts

  1. Compile the smart contracts by running the following command in the terminal:
    truffle compile

Step 5: Deploying Smart Contracts

  1. Write or edit a migration script in the migrations folder, which contains JavaScript files that manage the deployment.
  2. Deploy the smart contracts to your chosen network by running:

    truffle migrate --network <network_name>

    Replace <network_name> with the name of the network you defined in truffle-config.js (e.g., ropsten).

Step 6: Post-Deployment

Additional Tips

Ekehi commented 6 months ago

@uemrey0 thank you for taking your time to high light everything to me i was able to deploy the contract i don't know if you might have tried it yourself i would like to ask a further question on this contract