```\nfunction revoke(address beneficiary) public onlyOwner {\n  TokenAward storage award = getTokenAwardStorage(beneficiary);\n\n  require(award.revocable, "Cannot be revoked");\n  require(!award.revoked, "Already revoked");\n\n  // Figure out how many tokens were owed up until revocation\n  uint256 unreleased = getReleasableAmount(beneficiary);\n  award.released += unreleased;\n\n  uint256 refund = award.amount - award.released;\n\n  // Mark award as revoked\n  award.revoked = true;\n  award.amount = award.released;\n\n  // Transfer owed vested tokens to beneficiary\n  targetToken.safeTransfer(beneficiary, unreleased);\n  // Transfer unvested tokens to owner (revoked amount)\n  targetToken.safeTransfer(owner(), refund);\n\n  emit Released(beneficiary, unreleased);\n  emit Revoked(beneficiary, refund);\n}\n```\n