// Reproduce audit findings on a local EVM only; no public RPC or wallet is used. import { readFileSync, writeFileSync } from 'node:fs'; import ganache from 'ganache'; import { BrowserProvider, ContractFactory, Interface } from 'ethers'; import { vestedAt } from '../src/vesting.js'; const artifacts = JSON.parse(readFileSync('artifacts/contracts.json','utf8')); const rpc = ganache.provider({ logging:{quiet:true}, chain:{chainId:4663,hardfork:'shanghai'}, miner:{timestampIncrement:0} }); const provider = new BrowserProvider(rpc); provider.pollingInterval=10; try { const signer = await provider.getSigner(); const deploy = async name => { const contract=await new ContractFactory(artifacts[name].abi,artifacts[name].bytecode,signer).deploy(); await contract.waitForDeployment(); return contract; }; const workspace=await deploy('Veylock'),token=await deploy('TestToken'); const start=BigInt((await provider.getBlock('latest')).timestamp)+100n; const end=(1n<<64n)-1n,total=1000000000000000000000000000000n; await(await token.approve(await workspace.getAddress(),total)).wait(); // The fixture supplies enough tokens for a large-amount precision probe. const balance=await token.balanceOf(await signer.getAddress()); const amount=balance