Skip to content

Latest commit

 

History

History
89 lines (59 loc) · 1.9 KB

README.md

File metadata and controls

89 lines (59 loc) · 1.9 KB

DegenFighter contracts

build

The EVM smart contracts for DegenFighter.

Development

Install:

  • Install foundry

  • Run foundryup

  • Run forge install foundry-rs/forge-std

  • Run npm i

  • Run git submodule update --init --recursive

  • Run cp .env.example .env and set the following within:

  • export LOCAL_RPC_URL=http://localhost:8545

  • export ALCHEMY_ETH_GOERLI_RPC_URL=...

  • export ETHERSCAN_API_KEY=...

Test Locally

Run in a new terminal:

anvil --chain-id 1337

Then run in a separate terminal:

make prep-build
make build
make deploy-local

The RPC endpoint defaults to: http://127.0.0.1:8545, chainid: 31337, sender address: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266

The contact addresses will be output as follows:

  Address[proxy]:  0x5FbDB2315678afecb367f032d93F642f64180aa3
  Address[memeToken]:  0x238213078DbD09f2D15F4c14c02300FA1b2A81BB
  Address[multicall]:  0xd85BdcdaE4db1FAEB8eF93331525FE68D7C8B3f0

Deployment

  1. Enter the deployment mnemonic into mnemonic.txt
  2. Deploy a new diamond on Goerli:

To Goerli Testnet

make deploy-goerli newDiamond=true initNewDiamond=true facetAction=0

To zkSync era testnet

First, compile contracts with zksolc

make build-zksync

Then, run the deploy script

make deploy-zksync

Deploy MockTwap

yarn hardhat deploy-zksync --script deployMockTwap.ts

Set MockTwap sqrtPriceX96

yarn hardhat deploy-zksync --script setSqrtPrice.ts

Publish NPM package

Run make release. This will update the NPM version, the CHANGELOG and trigger Github Actions to publish a new NPM package.

The current package is always available at: DegenFighter Github