Skip to content

CookieCommunity/cookie-contract

Repository files navigation

Documentation

This ERC20 token implementation utilizes LayerZero library for Omnichain Fungible token (OFT) and Permit functionality which allows gasless token approvals.

alt text

1) Prerequisite

Installing dependencies

Use proper node version:

nvm use

If using MacOS:

pnpm i @nomicfoundation/edr-darwin-arm64

We recommend using pnpm as a package manager (but you can of course use a package manager of your choice):

pnpm install

2) Compiling and Testing Contracts

Compile contracts:

forge compile

Running tests:

forge test

2) Deploying Contracts

Set up deployer wallet/account:

Please read carefully: To achieve same contract addresses on both network use the same nonce on both chains.

  • Rename .env.example -> .env
  • Choose your preferred means of setting up your deployer wallet/account:

To deploy your contracts to your desired blockchains, run the following command in your project's folder:

npx hardhat lz:deploy

3) Configure Chains

Define chains to support within layerzero.config with list of supported networks

Wire up contracts:

npx hardhat lz:oapp:wire --oapp-config layerzero.config.ts

See configuration:

npx hardhat lz:oapp:config:get:default

4) Bridge Tokens

To bridge from Sepolia Base to Seplia Ethereum:

npx hardhat run scripts/bridge.ts --network base_sepolia

And other way around:

npx hardhat run scripts/bridge.ts --network sepolia

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published