Node version: 16.15.0
If you use another version, please use n to manage.
Factory: 0x0000000000000000000000000000000000134238
yarn
Copy config file and add you id and private key:
cp example.config.ts config.ts
Compile the contracts:
npx hardhat compile
Arguments for deployment scripts
--owner -> Deployer address
--token -> Staking LP token address
--campaign -> Deployed campaign address
--reward -> Reward token address
--duration -> Reward duration in seconds
--amount -> Reward amount
--spenderaccountid -> Deployed campaign id
- Deploy Factory
yarn deployFactory
- Deploy Campaign
Edit --factory
, --owner
and --token
in package.json
yarn deployCampaign
- Enable Reward
Edit --campaign
, --reward
, --duration
in package.json
yarn enableReward
- Approve reward token
Edit --spenderaccountid
and --tokenid
in package.json
yarn approveToken
- Send rewards
Edit --campaign
, --reward
and --amount
in package.json
yarn sendReward
In order for you to run tests, you must uncomment the line in hardhat.config.ts
:
// require('@hashgraph/hardhat-hethers'); // UNCOMMENT WHEN EXECUTING SCRIPTS; COMMENT WHEN RUNNING TESTS
and you must run the hedera-local-node
prior to running the tests.
Once you have both prerequisites done, you need to run:
npx hardhat test