Core smart contracts for Degis
- Slowmist Audit Snapshot time: Jan 7 10:23
Core smart contracts for Degis including:
- Degis Token & Buyer Token
- Flight Delay Product
- Naughty Price Product
- Lucky Box
- Farming & Purchase Incentive Pool
- Degis Staking
hardhat ^2.7.1
solidity ^0.8.10
typescript ^4.5.3
-
Install node packages
with npm:
npm install
with yarn:
yarn
-
Compile smart contracts
npx hardhat compile
or:
yarn compile
-
Running tests with hardhat network
npx hardhat test
or:
yarn test
-
Deploy to the blockchain
(This way is not maintained, you need to write your own script)
npx hardhart run scripts/deploy/deploy.ts --network {{network name}}
or:
yarn deploy --network {{network name}}
-
In folder "/docs/solidity-docgen", documents are generate by solidity-docgen (from @openzeppelin) in the form of markdown.
yarn docgen
-
In folder "/docs/hardhat-docgen", documents are generated by hardhat-docgen in the form of html.
yarn hardhat-docgen
Run coverage for test:
yarn coverage
- Notes: We are currently using a forked version of solidity-coverage that includes optimizer settings. Ideally we will move to the maintained version after this is fixed on their end.
"solidity-coverage": "https://github.com/jbx-protocol/solidity-coverage.git#0fcd2f608c0e3e00bf66ab62c7610f5ea553fba8"
Verify the contracts with "hardhat-etherscan" plugin:
npx hardhat verify --network {network} DEPLOYED_CONTRACT_ADDRESS "Constructor Argument"
For complex constructor arguments, use scripts:
npx hardhat verify --constructor-args scripts/verify/arguments.js DEPLOYED_CONTRACT_ADDRESS
-
Every time you deploy the contracts, the abis will be put inside deployments folder.
-
All addresses of deployed contracts and tokens will be stored inside the info folder.
We use proxy contracts for some contracts including:
- FarmingPoolUpgradeable
- VoteEscrowedDegis
- PolicyCore (new)
- NaughtyFactory (new)
- NaughtyRouter (new)
- PurchaseIncentiveVault
- ... (the list may be extended later)
The ProxyAdmin contract can upgrade the implementation.
All proxies will share the same proxy admin address.
We will upgrade the owner of ProxyAdmin to be a combination of TimeLock and MultiSig in the future.