Skip to content

Commit

Permalink
🪡 ~~ EP
Browse files Browse the repository at this point in the history
  • Loading branch information
z0r0z committed Mar 27, 2024
1 parent 67ab5d4 commit b2989fe
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 44 deletions.
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
ETHERSCAN_API_KEY=
ETHERSCAN_API_KEY=
ARBISCAN_API_KEY=
OPTIMISM_API_KEY=
76 changes: 38 additions & 38 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
DagonScalesTest:testIsValidSignatureALOT() (gas: 34615892725)
DagonTest:testBurn(address,uint96) (runs: 256, μ: 152686, ~: 152686)
DagonScalesTest:testIsValidSignatureALOT() (gas: 34615901934)
DagonTest:testBurn(address,uint96) (runs: 257, μ: 155309, ~: 155309)
DagonTest:testDeploy() (gas: 2071165)
DagonTest:testFailBurnOverBalance(address,uint96) (runs: 256, μ: 187177, ~: 188266)
DagonTest:testFailBurnOverThreshold(address,uint96) (runs: 256, μ: 219385, ~: 220474)
DagonTest:testFailInvalidThresholdExceedsSupply() (gas: 159225)
DagonTest:testFailInvalidThresholdExceedsSupply2() (gas: 164648)
DagonTest:testFailInvalidThresholdNull() (gas: 159003)
DagonTest:testFailIsValidSignature2of3ForInsufficientSignatures() (gas: 199647)
DagonTest:testFailIsValidSignatureOutOfOrder() (gas: 236802)
DagonTest:testFailIsValidSignatureWeighted() (gas: 228779)
DagonTest:testFailIsValidSignatureWeightedERC1155() (gas: 37211)
DagonTest:testFailIsValidSignatureWeightedERC20() (gas: 237845)
DagonTest:testFailIsValidSignatureWeightedERC6909() (gas: 230401)
DagonTest:testFailIsValidSignatureWeightedERC721() (gas: 208731)
DagonTest:testFailSetTokenInvalidStd(address) (runs: 256, μ: 158206, ~: 158206)
DagonTest:testFailTransferFromInactiveAuth(address,address,uint96) (runs: 256, μ: 191684, ~: 192462)
DagonTest:testFailTransferOverBalance(address,address,uint96) (runs: 256, μ: 186347, ~: 187203)
DagonTest:testInstall() (gas: 137340)
DagonTest:testIsValidSignature() (gas: 150156)
DagonTest:testIsValidSignature2of3() (gas: 195923)
DagonTest:testIsValidSignature3of3() (gas: 203451)
DagonTest:testIsValidSignatureMany() (gas: 433994)
DagonTest:testIsValidSignatureOnchain() (gas: 196870)
DagonTest:testIsValidSignatureVeryMany() (gas: 1236406)
DagonTest:testIsValidSignatureWeighted() (gas: 232496)
DagonTest:testIsValidSignatureWeightedERC1155() (gas: 247382)
DagonTest:testIsValidSignatureWeightedERC20() (gas: 247118)
DagonTest:testIsValidSignatureWeightedERC6909() (gas: 247810)
DagonTest:testIsValidSignatureWeightedERC721() (gas: 208432)
DagonTest:testNameAndSymbolAndDecimals(uint256) (runs: 256, μ: 15447, ~: 15447)
DagonTest:testSetAuth(address) (runs: 256, μ: 144810, ~: 144810)
DagonTest:testSetThreshold() (gas: 147316)
DagonTest:testSetToken(address) (runs: 256, μ: 148648, ~: 148648)
DagonTest:testSetURI() (gas: 165614)
DagonTest:testSpoofSignatures(bytes) (runs: 256, μ: 16508, ~: 16437)
DagonTest:testTransfer(address,address,uint88) (runs: 256, μ: 175997, ~: 176853)
DagonTest:testTransferWithAuth(address,address,uint96) (runs: 256, μ: 179556, ~: 180344)
DagonTest:testUserVoted() (gas: 194844)
DagonTest:testFailBurnOverBalance(address,uint96) (runs: 257, μ: 189830, ~: 190527)
DagonTest:testFailBurnOverThreshold(address,uint96) (runs: 257, μ: 222045, ~: 222742)
DagonTest:testFailInvalidThresholdExceedsSupply() (gas: 161136)
DagonTest:testFailInvalidThresholdExceedsSupply2() (gas: 166568)
DagonTest:testFailInvalidThresholdNull() (gas: 160914)
DagonTest:testFailIsValidSignature2of3ForInsufficientSignatures() (gas: 208153)
DagonTest:testFailIsValidSignatureOutOfOrder() (gas: 245308)
DagonTest:testFailIsValidSignatureWeighted() (gas: 237286)
DagonTest:testFailIsValidSignatureWeightedERC1155() (gas: 37217)
DagonTest:testFailIsValidSignatureWeightedERC20() (gas: 246352)
DagonTest:testFailIsValidSignatureWeightedERC6909() (gas: 238917)
DagonTest:testFailIsValidSignatureWeightedERC721() (gas: 217237)
DagonTest:testFailSetTokenInvalidStd(address) (runs: 257, μ: 160117, ~: 160117)
DagonTest:testFailTransferFromInactiveAuth(address,address,uint96) (runs: 257, μ: 193368, ~: 194375)
DagonTest:testFailTransferOverBalance(address,address,uint96) (runs: 257, μ: 188186, ~: 189116)
DagonTest:testInstall() (gas: 139254)
DagonTest:testIsValidSignature() (gas: 152270)
DagonTest:testIsValidSignature2of3() (gas: 196098)
DagonTest:testIsValidSignature3of3() (gas: 203626)
DagonTest:testIsValidSignatureMany() (gas: 434164)
DagonTest:testIsValidSignatureOnchain() (gas: 198984)
DagonTest:testIsValidSignatureVeryMany() (gas: 1236559)
DagonTest:testIsValidSignatureWeighted() (gas: 232671)
DagonTest:testIsValidSignatureWeightedERC1155() (gas: 247557)
DagonTest:testIsValidSignatureWeightedERC20() (gas: 247293)
DagonTest:testIsValidSignatureWeightedERC6909() (gas: 247985)
DagonTest:testIsValidSignatureWeightedERC721() (gas: 208607)
DagonTest:testNameAndSymbolAndDecimals(uint256) (runs: 257, μ: 18378, ~: 18378)
DagonTest:testSetAuth(address) (runs: 257, μ: 146985, ~: 146985)
DagonTest:testSetThreshold() (gas: 149596)
DagonTest:testSetToken(address) (runs: 257, μ: 151457, ~: 151457)
DagonTest:testSetURI() (gas: 167668)
DagonTest:testSpoofSignatures(bytes) (runs: 257, μ: 19365, ~: 19294)
DagonTest:testTransfer(address,address,uint88) (runs: 257, μ: 177715, ~: 179496)
DagonTest:testTransferWithAuth(address,address,uint96) (runs: 257, μ: 181298, ~: 182257)
DagonTest:testUserVoted() (gas: 197077)
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@

Built with *[Foundry](https://github.com/foundry-rs/forge-std)* and *[Solady](https://github.com/vectorized/solady)*.

## Alpha Deployment
## Beta Deployment
> *Signature Validation Limit: ~1774 signatures*
Chain | Address |
----------------|-----------------------------------------|
Ethereum, Arbitrum, Optimism, Sepolia (testnet) | [0x0000000000001ADDcB933DD5028159dc965b5b7f](https://etherscan.io/address/0x0000000000001ADDcB933DD5028159dc965b5b7f#code) |
Ethereum, Arbitrum, Optimism, Base, Polygon (& testnets) | [0x0000000000001ADDcB933DD5028159dc965b5b7f](https://etherscan.io/address/0x0000000000001ADDcB933DD5028159dc965b5b7f#code) |

## Premise

Dagon is a contract singleton system that allows any account to give any token a threshold right to sign for it. It thus supports existing token communities and DAO deployments out-of-the-gate. Dagon is optimized especially for most off-chain voting methods, such as multisig and weighted snapshot proposals, as well, initially offers a platform-agnostic upgrade path into smart account-based governance abstraction following, *e.g.*, [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337).
Dagon is a contract singleton system that allows any smart contract account to give any token a threshold right to sign for it. This means you can add "more owners" to your smart account. It also means you can give these different owners different "weights" to simulate a DAO voting engine or captable. Equal weights are equivalent to a multi-sig or coop. These weights can be associated with existing tokens or created within Dagon itself.

Dagon thus supports existing token communities and DAO deployments out-of-the-gate. This voting format is optimized especially for most off-chain voting methods, like snapshot proposals, as well, initially offers a platform-agnostic upgrade path into smart account-based governance abstraction following, *e.g.*, [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337).

By just validating contract signatures remotely for accounts following [ERC-1271](https://eips.ethereum.org/EIPS/eip-1271), and not dealing with execution or more opinionated proposal logic, Dagon can complement more organizations today, as well as serve as a source of record for the greater DAO ecosystem, which are all free to implement their own custom hooks and checks to Dagon validation. In `V1`, which is focused as a voting engine, the Dagon pattern can be used for offchain polling for any token, including `ERC-20`, `ERC-721`, `ERC-1155`, `ERC-6909`, and includes a native token mint and burn function to allow tokens to upgrade (or new tokens to be issued) under `DAGON` (itself [`ERC-6909`](https://eips.ethereum.org/EIPS/eip-6909)), but can also validate onchain user operations (`userOp`s) that submit ownership to Dagon validation using the [`ERC-173`](https://eips.ethereum.org/EIPS/eip-173) `transferOwnership` flow.

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

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions test/Dagon.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ contract DagonTest is Test {
uint256 internal accountId;
Dagon internal dagon;

address internal constant _ENTRY_POINT = 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789;
address internal constant _ENTRY_POINT = 0x0000000071727De22E5E9d8BAf0edAc6f37da032;

function setUp() public payable {
(alice, alicePk) = makeAddrAndKey("alice");
Expand Down Expand Up @@ -176,7 +176,7 @@ contract DagonTest is Test {
new Dagon();
}

function testNameAndSymbolAndDecimals(uint256 id) public {
function testNameAndSymbolAndDecimals(uint256 id) public view {
assertEq(dagon.name(id), "");
assertEq(dagon.symbol(id), "");
assertEq(dagon.decimals(id), 18);
Expand Down

0 comments on commit b2989fe

Please sign in to comment.