Skip to content

eeggfoundation/contracts

Repository files navigation

Eegg Foundation Contracts

Eegg

EEGG token

The EEGG token is an EIP20 token with additional AccessControl and Mint/Burn functionality.

The total supply of the token is 100_000_000, and each token is divisible up to 18 decimal places.

To prevent accidental burns, the token does not allow transfers to the contract itself and to 0x00.

Details

Development

git clone git@github.com:eegggallery/contracts.git
cd contracts
npm install

The repository uses HardHat development environment for Ethereum software. All necessary commands with their config are prepared and can run directy from npm, like:

Test

npm run test

Report Gas

npm run gas

Compile

npm run build

Build merged Solidity contracts

To merge all imports and produce standalone .sol files, run:

npm run merge-contracts

Deploy to localhost

To test you can deploy the contract to the localhost network following these steps:

  1. Start a local node:

    npm run node
  2. In another terminal deploy the contract to the localhost network:

    npx hardhat run scripts/deploy.ts --network localhost

Deployment

The deployment url and private key are securely stored in an environment file .env. The repository includes an .env.example example.

The HardHat hardhat.config.ts resolves the .env automatically. So, there is nothing more to do, just edit your .env.

Supported networks: [Goerli Testnet, Ethereum Mainnet]

You can learn more about other testnets and find links to their faucets on the ethereum.org site.

For Goerli Testnet, for example, your .env file should look like this:

GOERLI_API_URL=https://eth-goerli.g.alchemy.com/v2/<your api key>
GOERLI_PRIVATE_KEY=<your private key>

We're using Alchemy, but pointing url to any Ethereum node or gateway would work. Go grab your ALCHEMY_API_KEY and come back.

Compile the Contract using:

npm run build

Deploy the Contract using:

npx hardhat run scripts/deploy.ts --network goerli

The script will output the Contract Address. Copy and paste this address to save it somewhere, you don't want to lose it.

You can check the Contract Address on Goerli etherscan to see that it has been deployed successfully.