Voter Splitter lets owners of on-chain governance tokens temporarily transfer their voting power to someone else. How it works: 1. Users can lock governance tokens in a vault and receive that many ERC20 vote tokens. After creation, the user controls the vault and the wrapped tokens. 2. The user can sell the vault, which is an ERC721 NFT. The vault controls the underlying votes on e.g. Compound for a few months. 3. At any time, the owner of the vault can close their position by redeeming enough wrapped tokens to cover the underlying tokens in the vault. They will receive the original governance tokens. 3. Every 50000 blocks – about every 3 months – all outstanding vaults expire. Anyone can close an expired vault by redeeming enough wrapped tokens to cover the underlying tokens in the vault. CONTRACT: `createVault(uint256 amount)` - locks `amount` of underlying governance tokens in a vote vault. Caller receives `amount` of wrapped governance tokens and an NFT that represents the vault. `closeOwnVault(uint vaultId)` - the owner of the given vault can close their vault by redeeming enough wrapped tokens to cover the balance of the tokens locked in the vault. `closeExpiredVault(uint vaultId)` - anyone can close an expired vault by redeeming enough wrapped tokens to cover the balance of the tokens locked in the vault. VAULT: `vote(uint proposalId, bool support)` - votes yea/nay on the given `proposalId` on the underlying governance. `delegate(address delegatee)` - delegate to someone on the underlying governance, with vote weight equal to the locked tokens. also implements ERC721 functions such as `transferFrom(address from, address to, uint256 tokenId)` WRAPPED TOKEN: implements ERC20 functions such as `transfer(address recipient, uint256 amount)` The vault owner can call `closeOwnVault()` if they have enough wrapped governance tokens to cover the underlying tokens in the vault. Closing the vault redeems the wrapped tokens for the underlying tokens. Every 50000 blocks, all vaults expire. Anyone can call `closeExpiredVault()` on an expired vault if they have enough wrapped governance tokens. Closing the vault redeems the wrapped tokens for the underlying tokens.
How It's Made