Skip to content

Commit

Permalink
chore: fill out readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jparklev committed Jun 27, 2024
1 parent 3775e51 commit e26dc7e
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 3 deletions.
1 change: 1 addition & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MAINNET_RPC_URL=
59 changes: 58 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,58 @@
## Rumpel Wallet
# Rumpel Wallet

Rumpel Wallet is a system built atop [Safe](https://docs.gnosis.io/safe/latest/) that allows users to tokenize points earned from personal, custom positions. Each wallet is a standard Safe, which users can manage via the normal Safe app, enhanced with a custom [Safe Module](https://docs.safe.global/advanced/smart-account-modules) and [Safe Guard](https://docs.safe.global/advanced/smart-account-guards).

This is an extension of the Rumpel Point Tokenization protocol, enabling a wider range of points, earned from a wider range of point-earning actions, to be tokenized. Familiarity with the [Point Tokenization Vault](https://github.com/sense-finance/point-tokenization-vault) is recommended before proceeding. The diagram below illustrates how this component fits within the larger system:

<img src="./assets/point-tokenization-system.png" width="500" height="500">

Tl;dr
- Users create and manage unique positions using their Rumpel wallets
- Points accrue as pTokens via the Point Tokenization Vault
- Users can sell their pTokens at any time
- After redemption, the protocol converts points to reward tokens, claims them for users, and transfers them to the vault
- All pToken holders can redeem their pTokens for rewards using the vault

The redemption process will be the same as it has been for the Point Tokenization Vault, just with a new source of reward tokens.


## Components

### Rumpel Module

Enables admin actions on a user's behalf, specifically:
- Claiming reward tokens after point conversion
- Transferring reward tokens to the Point Tokenization Vault for pToken redemption
Includes a permanent, irrevocable blocklist for restricted actions (e.g., transferring user's USDC).

### Rumpel Guard

Restricts wallet actions to admin-allowed <address>.<functionSig> calls. Includes a permanent, irrevocable allowlist for unrestricted user actions (e.g., transferring USDC).

### RumpelWalletFactory

Creates and initializes new Safe wallets with the Rumpel Guard and Rumpel Module.

## Local development

This project uses [Foundry](https://github.com/gakonst/foundry) as the development framework.

### Dependencies

```
forge install
```

### Compilation

```
forge build
```

### Testing

Rename `.env.sample` to `.env` and set the correct environment variables. Then:

```
forge test
```
Binary file added assets/point-tokenization-system.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions src/RumpelModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@ contract RumpelModule is AccessControl {
}
// TODO: what about eth trasnfers?

// No delegatecalls
bool success =
calls[i].safe.execTransactionFromModule(calls[i].to, calls[i].value, calls[i].data, Enum.Operation.Call);
calls[i].safe.execTransactionFromModule(calls[i].to, calls[i].value, calls[i].data, Enum.Operation.Call); // No delegatecalls

if (!success) {
revert ExecFailed(address(calls[i].safe), calls[i].to, calls[i].data);
Expand Down
3 changes: 3 additions & 0 deletions test/RumpelWallet.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ contract RumpelWalletTest is Test {
Counter public counter;
MockERC20 public mockToken;

// Mainnet addresses
ISafeProxyFactory public PROXY_FACTORY = ISafeProxyFactory(0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2);
address public SAFE_SINGLETON = 0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552;
address public RUMPEL_VAULT = 0x1EeEBa76f211C4Dce994b9c5A74BDF25DB649Fa1;
address public POINT_TOKENIZATION_VAULT = 0x1EeEBa76f211C4Dce994b9c5A74BDF25DB649Fa1;

address alice;
uint256 alicePk;
Expand Down Expand Up @@ -341,6 +343,7 @@ contract RumpelWalletTest is Test {
assertEq(mockToken.balanceOf(RUMPEL_VAULT), 0);
}

// e2e vault redemption test
// test owner is blocked for actions not on the whitelist
// - cant disable module
// - cant change guard
Expand Down

0 comments on commit e26dc7e

Please sign in to comment.