Skip to content

Commit

Permalink
π’€­ Ragequitter Beta: v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
z0r0z committed Apr 30, 2024
1 parent 8d443b2 commit 4be1998
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
RagequitterTest:testDeploy() (gas: 1762199)
RagequitterTest:testDeploy() (gas: 1795880)
RagequitterTest:testInstall() (gas: 34130)
RagequitterTest:testMint() (gas: 79585)
RagequitterTest:testRagequit() (gas: 170325)
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

*Ragequit* redemption for all accounts. Developed and deployed as the [Ragequitter](./src/Ragequitter.sol) solidity singleton.

V1 Deployment: [0x0000000000008743D388E5279B2A9EF87A3115Ae](https://arbiscan.io/address/0x0000000000008743d388e5279b2a9ef87a3115ae#code)

## How it works

Let's say you have a Gnosis Safe or smart account or DAO treasury. And you want to make it so people can take tokens out of your account without a proposal by burning other tokens ("redemption", and those other tokens, "loot"). The classic use case of this is the ["Moloch DAO ragequit"](https://github.com/MolochVentures/moloch/blob/master/contracts/Moloch.sol#L528), which is a game theory mechanism that serves trustless crowdfunding ("tribute") by guaranteeing contributors that they can always get their share of tribute back if they burn loot.
Expand Down
2 changes: 2 additions & 0 deletions docs/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

*Ragequit* redemption for all accounts. Developed and deployed as the [Ragequitter](./src/Ragequitter.sol) solidity singleton.

V1 Deployment: [0x0000000000008743D388E5279B2A9EF87A3115Ae](https://arbiscan.io/address/0x0000000000008743d388e5279b2a9ef87a3115ae#code)

## How it works

Let's say you have a Gnosis Safe or smart account or DAO treasury. And you want to make it so people can take tokens out of your account without a proposal by burning other tokens ("redemption", and those other tokens, "loot"). The classic use case of this is the ["Moloch DAO ragequit"](https://github.com/MolochVentures/moloch/blob/master/contracts/Moloch.sol#L528), which is a game theory mechanism that serves trustless crowdfunding ("tribute") by guaranteeing contributors that they can always get their share of tribute back if they burn loot.
Expand Down
4 changes: 2 additions & 2 deletions docs/src/src/Ragequitter.sol/contract.Ragequitter.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Ragequitter
[Git Source](https://github.com/Moloch-Mystics/ragequit/blob/ed98f5886956972c8e4422a029cd6053d14f537c/src/Ragequitter.sol)
[Git Source](https://github.com/Moloch-Mystics/ragequit/blob/8d443b27797d45370cd001aa46ede3a2766571c4/src/Ragequitter.sol)

**Inherits:**
ERC6909
Expand Down Expand Up @@ -129,7 +129,7 @@ If no `tribute` is set, then function will revert on `safeTransferFrom`.*


```solidity
function contribute(address account, uint256 amount) public payable virtual;
function contribute(address account, uint96 amount) public payable virtual;
```

### install
Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/Ragequitter.sol/interface.IAuth.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IAuth
[Git Source](https://github.com/Moloch-Mystics/ragequit/blob/ed98f5886956972c8e4422a029cd6053d14f537c/src/Ragequitter.sol)
[Git Source](https://github.com/Moloch-Mystics/ragequit/blob/8d443b27797d45370cd001aa46ede3a2766571c4/src/Ragequitter.sol)

Simple authority interface for contracts.

Expand Down
1 change: 1 addition & 0 deletions etherscan.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/accounts
Submodule accounts updated 35 files
+18 βˆ’18 .gas-snapshot
+11 βˆ’3 README.md
+15 βˆ’5 docs/src/README.md
+4 βˆ’0 docs/src/SUMMARY.md
+2 βˆ’2 docs/src/src/Account.sol/contract.Account.md
+1 βˆ’1 docs/src/src/Accounts.sol/contract.Accounts.md
+1 βˆ’1 docs/src/src/authority/Auth.sol/contract.Auth.md
+183 βˆ’0 docs/src/src/authority/Guard.sol/contract.Guard.md
+14 βˆ’0 docs/src/src/authority/Guard.sol/interface.IAccount.md
+14 βˆ’0 docs/src/src/authority/Guard.sol/interface.IERC20.md
+21 βˆ’0 docs/src/src/authority/Guard.sol/interface.IOwnable.md
+4 βˆ’0 docs/src/src/authority/README.md
+1 βˆ’1 docs/src/src/governance/Points.sol/contract.Points.md
+1 βˆ’1 docs/src/src/governance/Points.sol/interface.IERC1271.md
+1 βˆ’1 docs/src/src/governance/Points.sol/interface.IERC20.md
+1 βˆ’1 docs/src/src/governance/Token.sol/contract.Token.md
+7 βˆ’9 docs/src/src/ownership/Keys.sol/contract.Keys.md
+1 βˆ’1 docs/src/src/ownership/Keys.sol/interface.IAuth.md
+1 βˆ’1 docs/src/src/ownership/Keys.sol/interface.IOwnable.md
+1 βˆ’1 docs/src/src/paymasters/NEETH.sol/contract.NEETH.md
+1 βˆ’1 docs/src/src/paymasters/NEETH.sol/interface.IEntryPoint.md
+1 βˆ’1 docs/src/src/paymasters/NEETH.sol/interface.ISwapRouter.md
+1 βˆ’1 docs/src/src/paymasters/Paymaster.sol/contract.Paymaster.md
+1 βˆ’1 docs/src/src/validators/JointValidator.sol/contract.JointValidator.md
+1 βˆ’1 docs/src/src/validators/PaymentValidator.sol/contract.PaymentValidator.md
+1 βˆ’1 docs/src/src/validators/PaymentValidator.sol/interface.IERC20.md
+1 βˆ’1 docs/src/src/validators/PermitValidator.sol/contract.PermitValidator.md
+1 βˆ’1 docs/src/src/validators/PermitValidator.sol/interface.IExecutor.md
+1 βˆ’1 docs/src/src/validators/RecoveryValidator.sol/contract.RecoveryValidator.md
+1 βˆ’1 docs/src/src/validators/RecoveryValidator.sol/interface.ITransferOwnership.md
+1 βˆ’1 docs/src/src/validators/TimeValidator.sol/contract.TimeValidator.md
+1 βˆ’1 docs/src/src/validators/TimeValidator.sol/interface.IOwner.md
+1 βˆ’1 lib/forge-std
+1 βˆ’1 lib/solady
+144 βˆ’0 src/authority/Guard.sol
2 changes: 1 addition & 1 deletion lib/solady
Submodule solady updated 6 files
+524 βˆ’517 .gas-snapshot
+1 βˆ’1 package.json
+11 βˆ’4 src/accounts/ERC1271.sol
+97 βˆ’0 src/utils/P256.sol
+109 βˆ’11 test/ERC6551.t.sol
+95 βˆ’0 test/P256.t.sol
6 changes: 4 additions & 2 deletions src/Ragequitter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,13 @@ contract Ragequitter is ERC6909 {

/// @dev Mints loot shares in exchange for tribute `amount` to an `account`.
/// If no `tribute` is set, then function will revert on `safeTransferFrom`.
function contribute(address account, uint256 amount) public payable virtual {
function contribute(address account, uint96 amount) public payable virtual {
address tribute = _settings[account].tribute;
if (tribute == ETH) _safeTransferETH(account, amount);
else _safeTransferFrom(tribute, msg.sender, account, amount);
_mint(msg.sender, uint256(uint160(account)), amount);
uint256 id = uint256(uint160(account));
_metadata[id].totalSupply += amount;
_mint(msg.sender, id, amount);
}

/// ======================== INSTALLATION ======================== ///
Expand Down

0 comments on commit 4be1998

Please sign in to comment.