Skip to content

Apegurus/voting-escrow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Voting Escrow V2 w/ Delegation

lint & test Docs License

Voting Escrow based off of the popular Curve Voting Escrow contract. Lock protocol tokens for a period of time and receive voting power in return. Voting Escrow V2 adds delegation to the mix, which isn't available in the original contract, among other improvements and standards.

V2 Additions

  • ERC-5725 Transferrable Vesting NFT: Voting Escrow V2 is ERC-5725 compliant which allows these tokens to be easily integrated into NFT marketplaces and other platforms.
  • ERC-6372: Contract Clock

Deployment and Verification

This project uses special tasks, adapted from Balancer protocol, to deploy and verify contracts which provides methods for saving custom outputs and easily verifying contracts as well as compartmentalizing different types of deployments.

Configuration

  • Copy .env.example and rename to .env
    • Provide the necessary env variables before deployment/verification
    • _MNEMONIC for deployments
    • _API_KEY for verifications
  • hardhat.config.ts: Can be configured with additional networks if needed
    • hardhat/types.ts: Holds network typings which can be updated with more networks.
  • Configure Deployment Variables for each network in deploy.config.ts.
  • Ensure Etherscan API Keys are configured in hardhat.config.ts under etherscan.

Deployment & Verification

  1. Create a deployment script in scripts/deploy. (Use deployLock as a template.)
  2. Use DeployManager to deploy contracts to easily deploy, verify and save the output to the deployments directory.
  3. Run a deployment with npx hardhat run ./scripts/deploy/deployLock.ts --network <network>
  4. Etherscan-like API key should be stored in hardhat.config.ts under etherscan and the DeployManager can use that to verify contracts after deployment.

Linting

This project uses Prettier, an opinionated code formatter, to keep code styles consistent. This project has additional plugins for Solidity support as well.

  • yarn lint: Check Solidity files & TS/JS files
  • yarn lint:fix: Fix Solidity files & TS/JS files

Linting Solidity Code

  • prettier.config.js: Provide config settings for Solidity under overrides.

  • .solhint.json: Provide config settings for solhint.

  • yarn lint:sol: Check Solidity files

  • yarn lint:sol:fix: Fix Solidity files

Build/Publish as NPM Package

  1. Currently this repo uses tsc to build files to dist/.
  2. Files are cherry picked in package.json under files as there are a lot of support files included in this repo.

Consider including only what is needed.

  "files": [
    "dist/index.js",
    "dist/index.d.ts",
    "dist/src/**/*",
    "dist/typechain-types/**/*",
    // "dist/artifacts/**/*"
  ],

Gotchas

  1. Put single quotes around globs in package.json:
    • "lint:ts": "prettier --check './{scripts,tasks,src,hardhat,test}/**/*.ts'"

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •