-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
188 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
[ | ||
{ | ||
"type": "function", | ||
"name": "summon", | ||
"inputs": [ | ||
{ | ||
"name": "summoners", | ||
"type": "tuple[]", | ||
"internalType": "struct Summoner.Ownership[]", | ||
"components": [ | ||
{ | ||
"name": "owner", | ||
"type": "address", | ||
"internalType": "address" | ||
}, | ||
{ | ||
"name": "shares", | ||
"type": "uint96", | ||
"internalType": "uint96" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "threshold", | ||
"type": "uint88", | ||
"internalType": "uint88" | ||
}, | ||
{ | ||
"name": "locked", | ||
"type": "bool", | ||
"internalType": "bool" | ||
}, | ||
{ | ||
"name": "salt", | ||
"type": "bytes12", | ||
"internalType": "bytes12" | ||
} | ||
], | ||
"outputs": [ | ||
{ | ||
"name": "account", | ||
"type": "address", | ||
"internalType": "contract IAccounts" | ||
} | ||
], | ||
"stateMutability": "payable" | ||
}, | ||
{ | ||
"type": "function", | ||
"name": "summonForToken", | ||
"inputs": [ | ||
{ | ||
"name": "token", | ||
"type": "address", | ||
"internalType": "address" | ||
}, | ||
{ | ||
"name": "standard", | ||
"type": "uint8", | ||
"internalType": "enum Summoner.Standard" | ||
}, | ||
{ | ||
"name": "threshold", | ||
"type": "uint88", | ||
"internalType": "uint88" | ||
}, | ||
{ | ||
"name": "salt", | ||
"type": "bytes12", | ||
"internalType": "bytes12" | ||
} | ||
], | ||
"outputs": [ | ||
{ | ||
"name": "account", | ||
"type": "address", | ||
"internalType": "contract IAccounts" | ||
} | ||
], | ||
"stateMutability": "payable" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule accounts
updated
58 files
Submodule solady
updated
23 files
+930 β915 | .gas-snapshot | |
+6 β1 | .github/workflows/ci.yml | |
+1 β1 | package.json | |
+90 β10 | src/accounts/ERC1271.sol | |
+9 β6 | src/accounts/ERC4337.sol | |
+24 β13 | src/accounts/ERC6551.sol | |
+1 β1 | src/utils/CREATE3.sol | |
+27 β23 | src/utils/DeploylessPredeployQueryer.sol | |
+9 β8 | src/utils/LibBit.sol | |
+46 β0 | src/utils/LibClone.sol | |
+191 β0 | src/utils/LibPRNG.sol | |
+2 β3 | src/utils/LibString.sol | |
+1 β1 | src/utils/SSTORE2.sol | |
+47 β28 | test/DeploylessPredeployQueryer.t.sol | |
+2 β0 | test/ERC4337.t.sol | |
+177 β124 | test/ERC4626.t.sol | |
+60 β14 | test/ERC6551.t.sol | |
+32 β0 | test/LibClone.t.sol | |
+245 β0 | test/LibPRNG.t.sol | |
+25 β14 | test/OwnableRoles.t.sol | |
+720 β93 | test/utils/forge-std/Test.sol | |
+1,826 β366 | test/utils/forge-std/Vm.sol | |
+0 β517 | test/utils/forge-std/ds-test/test.sol |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
// αͺα©GOα π π π π π π π π π π π | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
pragma solidity ^0.8.24; | ||
|
||
/// @notice Simple summoner for Dagon (π) group accounts. | ||
/// @custom:version 1.0.0 | ||
contract Summoner { | ||
address internal constant DAGON = 0x0000000000001ADDcB933DD5028159dc965b5b7f; | ||
IAccounts internal constant FACTORY = IAccounts(0x000000000000dD366cc2E4432bB998e41DFD47C7); | ||
|
||
struct Ownership { | ||
address owner; | ||
uint96 shares; | ||
} | ||
|
||
enum Standard { | ||
DAGON, | ||
ERC20, | ||
ERC721, | ||
ERC1155, | ||
ERC6909 | ||
} | ||
|
||
function summon(Ownership[] calldata summoners, uint88 threshold, bool locked, bytes12 salt) | ||
public | ||
payable | ||
returns (IAccounts account) | ||
{ | ||
account = IAccounts( | ||
FACTORY.createAccount{value: msg.value}( | ||
address(this), bytes32(abi.encodePacked(this, salt)) | ||
) | ||
); | ||
for (uint256 i; i != summoners.length; ++i) { | ||
account.execute( | ||
DAGON, | ||
0, | ||
abi.encodeWithSignature( | ||
"mint(address,uint96)", summoners[i].owner, summoners[i].shares | ||
) | ||
); | ||
} | ||
if (locked) { | ||
account.execute(DAGON, 0, abi.encodeWithSignature("setAuth(address)", address(0xdead))); | ||
} | ||
account.execute(DAGON, 0, abi.encodeWithSignature("setThreshold(uint88)", threshold)); | ||
account.execute( | ||
address(account), 0, abi.encodeWithSignature("transferOwnership(address)", DAGON) | ||
); | ||
} | ||
|
||
function summonForToken(address token, Standard standard, uint88 threshold, bytes12 salt) | ||
public | ||
payable | ||
returns (IAccounts account) | ||
{ | ||
account = IAccounts( | ||
FACTORY.createAccount{value: msg.value}( | ||
address(this), bytes32(abi.encodePacked(this, salt)) | ||
) | ||
); | ||
account.execute( | ||
DAGON, 0, abi.encodeWithSignature("setToken(address,uint8)", token, standard) | ||
); | ||
account.execute(DAGON, 0, abi.encodeWithSignature("setThreshold(uint88)", threshold)); | ||
account.execute( | ||
address(account), 0, abi.encodeWithSignature("transferOwnership(address)", DAGON) | ||
); | ||
} | ||
} | ||
|
||
/// @dev Simple interface for Nani (π) user account creation and setup. | ||
interface IAccounts { | ||
function createAccount(address, bytes32) external payable returns (address); | ||
function execute(address, uint256, bytes calldata) external payable returns (bytes memory); | ||
} |