-
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
14 changed files
with
146 additions
and
11 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 forge-std
updated
4 files
+1 β1 | src/StdStorage.sol | |
+76 β0 | src/Vm.sol | |
+8 β0 | test/StdStorage.t.sol | |
+2 β2 | test/Vm.t.sol |
Submodule solady
updated
66 files
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,45 @@ | ||
// αͺα©GOα π π π π π π π π π π π | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
pragma solidity 0.8.26; | ||
|
||
/// @notice Simple summoner for Dagon (π) group accounts. | ||
/// @custom:version 1.1.1 | ||
contract Summoner { | ||
address internal constant DAGON = 0x000000000000FEb893BB5D63bA33323EdCC237cE; | ||
IAccounts internal constant FACTORY = IAccounts(0x0000000000009f1E546FC4A8F68eB98031846cb8); | ||
|
||
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); | ||
} |