migrate code to hardhat and adopt unittests
migrate code to hardhat and adopt unittests