Solidity: staking contract with tests and deployment
We are building a single-token staking product for an existing ERC-20 on BNB Chain and need a Solidity developer to write, test and deploy the contracts. The token is already live and immutable, so the staking layer has to work around it rather than modify it.
The scope is a staking contract where users deposit the token and accrue rewards from a funded reward pool at a configurable rate per second. It needs a lock period selectable by the user from three preset durations with a multiplier on the reward rate for longer locks, an emergency withdraw path that forfeits pending rewards, an owner-funded reward pool with a top-up function, and a pause mechanism. Access control should use role-based permissions rather than a single owner address, and the contract must be upgrade-free and non-proxied by design, since we want the simplest possible audit surface. Standard protections are expected as a matter of course, including reentrancy guards on all external state-changing entry points, safe transfer handling for tokens with non-standard return values, and no unbounded loops over user arrays.
Deliverables are the contract source in a Hardhat or Foundry project, a full test suite with at least ninety percent line coverage including edge cases around rounding of reward accrual, zero-balance stakes, reward pool exhaustion and lock expiry boundaries, a gas report for the main functions, deployment and verification scripts for BSC testnet and mainnet, NatSpec comments throughout, and a short technical README describing the reward math and every admin function with its risk. I also want a written list of known limitations and centralisation risks, written plainly, because it goes into our documentation before we approach an auditor.
You are not performing the audit and I am not asking you to sign off on security. I need clean, readable, well-tested code that an audit firm can review without wasting hours on structure. Deployment to mainnet happens only after our own review of testnet behaviour.
Timeline is eighteen days. I will provide the token address, our tokenomics document with the intended reward parameters and access to a private repository. Milestones can be split into contract draft, test suite and coverage report, and testnet deployment with documentation. In your application, please tell me how you would handle reward accrual precision when the staked supply is very small, and which framework you prefer and why.