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
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.
- Copy .env.example and rename to
.env- Provide the necessary
envvariables before deployment/verification _MNEMONICfor deployments_API_KEYfor verifications
- Provide the necessary
- 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.
- Create a deployment script in scripts/deploy. (Use deployLock as a template.)
- Use DeployManager to deploy contracts to easily deploy, verify and save the output to the deployments directory.
- Run a deployment with
npx hardhat run ./scripts/deploy/deployLock.ts --network <network> - Etherscan-like API key should be stored in hardhat.config.ts under
etherscanand the DeployManager can use that to verify contracts after deployment.
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 filesyarn lint:fix: Fix Solidity files & TS/JS files
-
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
- Currently this repo uses
tscto build files todist/. - Files are cherry picked in package.json under
filesas 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/**/*"
],- Put single quotes around globs in
package.json:"lint:ts": "prettier --check './{scripts,tasks,src,hardhat,test}/**/*.ts'"