Before running any command, you need to create a .env file and set a BIP-39 compatible mnemonic as an environment
variable. Follow the example in .env.example. If you don't already have a mnemonic, use this website to generate one.
Then, proceed with installing dependencies:
yarn install
yarn add hardhat
yarn add hardhat-docgenCompile the smart contracts with Hardhat:
$ npx hardhat compileCompile the smart contracts and generate TypeChain artifacts:
$ yarn run typechainLint the Solidity code:
$ yarn lint:solLint the TypeScript code:
$ yarn lint:tsRun the Mocha tests:
$ npx hardhat testGenerate the code coverage report:
$ yarn add hardhat-coverage
$ npx hardhat coverage --testfiles "./test"Delete the smart contract artifacts, the coverage reports and the Hardhat cache:
$ npx hardhat cleanDeploy the contracts to Rinkeby Network:
Token Contract
$ npx hardhat deploy:SynthetixToken --network rinkebyStacking Contract
$ npx hardhat deploy:SynthetixContractStaking --network rinkebyVerify the contracts on Etherscan programatically:
Token Contract
$ npx hardhat verify <address_of_the_deployed_token_contract> --network rinkeby <name_of_the_token> <symbol_of_the_token> Stacking Contract
$ npx hardhat verify <address_of_the_deployed_stacking_contract> --network rinkeby <address_of_token_used_on_deployment>If you use VSCode, you can enjoy syntax highlighting for your Solidity code via the hardhat-vscode extension.
These contracts are not audited, use at your own risk!