Let's some code speak from myself:
https://github.com/vladprotocol/alife-contracts/blob/master/contracts/NftFarmV2.sol
https://github.com/vladprotocol/alife-contracts/blob/master/test/NftMinting.test.js (test-case is not complete yet)....
Member since June 2021