-
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.
Merge pull request #13 from forumdaos/jamesmccomish/update-entrypoint
Jamesmccomish/update entrypoint
- Loading branch information
Showing
49 changed files
with
3,265 additions
and
3,012 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules | ||
test/ |
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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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 aa-passkeys-wallet
deleted from
3607aa
Submodule account-abstraction
updated
63 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
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,43 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.13; | ||
|
||
import {Script2} from "../../lib/foundry-deployment-manager/src/utils/Script2.sol"; | ||
|
||
import {console} from "forge-std/console.sol"; | ||
|
||
contract FclEllipticDeployer is Script2 { | ||
function run() public { | ||
address localBroadcaster; | ||
address contractAddress; | ||
string memory chainName; | ||
|
||
// TODO improve this | ||
if (block.chainid == 137) { | ||
chainName = "POLYGON"; | ||
} else if (block.chainid == 80001) { | ||
chainName = "MUMBAI"; | ||
} | ||
|
||
string memory pkEnvVar = string.concat(chainName, "_PRIVATE_KEY"); | ||
try vm.envUint(pkEnvVar) returns (uint256 key) { | ||
localBroadcaster = vm.rememberKey(key); | ||
} catch { | ||
console.log("%s key not found or not parseable as uint", pkEnvVar); | ||
} | ||
|
||
vm.startBroadcast(localBroadcaster); | ||
|
||
// No longer using external validator | ||
bytes memory deploymentBytecode = vm.getCode("FCL_Elliptic_ZZ.sol:FCL_Elliptic_ZZ"); | ||
|
||
console.logBytes(deploymentBytecode); | ||
|
||
assembly { | ||
contractAddress := create2(0, add(deploymentBytecode, 0x20), mload(deploymentBytecode), 0) | ||
} | ||
|
||
vm.stopBroadcast(); | ||
|
||
console.log("Elliptic library deployed at %s", contractAddress); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,35 +1,36 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.13; | ||
|
||
import {ForumAccount} from '../../src/erc4337-account/ForumAccount.sol'; | ||
import {DeploymentSelector} from '../../lib/foundry-deployment-manager/src/DeploymentSelector.sol'; | ||
import {ForumAccount} from "../../src/erc4337-account/ForumAccount.sol"; | ||
import {DeploymentSelector} from "../../lib/foundry-deployment-manager/src/DeploymentSelector.sol"; | ||
|
||
/** | ||
* @dev This contract is used to deploy the ForumAccount contract | ||
* For now this must be run before the ERC4337FactoryDeployer | ||
* Improvements to the deployment manager will allow this to be run in any order | ||
*/ | ||
contract ForumAccountDeployer is DeploymentSelector { | ||
ForumAccount internal account; | ||
ForumAccount internal account; | ||
|
||
function run() public { | ||
innerRun(); | ||
outputDeployment(); | ||
} | ||
// TODO improve the linking of this lib | ||
address internal constant FCL_ELLIPTIC_ZZ = 0xbb93A0Ca0EDb4a726f37433993ED22376CD8387a; | ||
|
||
function innerRun() public { | ||
startBroadcast(); | ||
function run() public { | ||
innerRun(); | ||
outputDeployment(); | ||
} | ||
|
||
// No longer using external validator | ||
bytes memory initData = new bytes(0); | ||
function innerRun() public { | ||
startBroadcast(); | ||
|
||
(address contractAddress, bytes memory deploymentBytecode) = SelectDeployment( | ||
'ForumAccount', | ||
initData | ||
); | ||
// No longer using external validator | ||
bytes memory initData = abi.encode(FCL_ELLIPTIC_ZZ); | ||
|
||
fork.set('ForumAccount', contractAddress, deploymentBytecode); | ||
// ! ENSURE UPDATED VERSION IS SET ON CONTRACT | ||
(address contractAddress, bytes memory deploymentBytecode) = SelectDeployment("ForumAccount", initData); | ||
|
||
stopBroadcast(); | ||
} | ||
fork.set("ForumAccount", contractAddress, deploymentBytecode); | ||
|
||
stopBroadcast(); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,44 +1,79 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.13; | ||
|
||
import {ForumAccount} from '../../src/erc4337-account/ForumAccount.sol'; | ||
import {ForumAccountFactory} from '../../src/erc4337-account/ForumAccountFactory.sol'; | ||
import {ForumAccount} from "../../src/erc4337-account/ForumAccount.sol"; | ||
import {ForumAccountFactory} from "../../src/erc4337-account/ForumAccountFactory.sol"; | ||
|
||
import {DeploymentSelector} from '../../lib/foundry-deployment-manager/src/DeploymentSelector.sol'; | ||
import {DeploymentSelector} from "../../lib/foundry-deployment-manager/src/DeploymentSelector.sol"; | ||
|
||
/** | ||
* @dev This contract is used to deploy the ForumAccountFactory contract | ||
* For now this must be run after the ForumAccountDeployer | ||
* Improvements to the deployment manager will allow this to be run in any order | ||
*/ | ||
contract ForumAccountFactoryDeployer is DeploymentSelector { | ||
address internal forumAccountSingleton; | ||
address internal entryPoint = 0x0576a174D229E3cFA37253523E645A78A0C91B57; | ||
address internal gnosisFallbackHandler = 0xf48f2B2d2a534e402487b3ee7C18c33Aec0Fe5e4; | ||
// New singleton deployed in previous script | ||
address internal forumAccountSingleton; | ||
|
||
function run() public { | ||
innerRun(); | ||
outputDeployment(); | ||
} | ||
// ! ENSURE THIS IS THE CORRECT ADDRESS FOR LATEST VERSION | ||
address internal entryPoint = 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789; // v6 entry point | ||
|
||
function innerRun() public { | ||
startBroadcast(); | ||
address internal gnosisFallbackHandler = 0xf48f2B2d2a534e402487b3ee7C18c33Aec0Fe5e4; | ||
|
||
forumAccountSingleton = fork.get('ForumAccount'); | ||
function run() public { | ||
innerRun(); //outputDeployment(); | ||
} | ||
|
||
bytes memory initData = abi.encode( | ||
forumAccountSingleton, | ||
entryPoint, | ||
gnosisFallbackHandler | ||
); | ||
function innerRun() public { | ||
startBroadcast(); | ||
|
||
(address contractAddress, bytes memory deploymentBytecode) = SelectDeployment( | ||
'ForumAccountFactory', | ||
initData | ||
); | ||
// ! ENSURE UPDATED VERSION IS SET ON CONTRACT | ||
forumAccountSingleton = fork.get("ForumAccount"); | ||
|
||
fork.set('ForumAccountFactory', contractAddress, deploymentBytecode); | ||
address contractAddress; | ||
bytes memory deploymentBytecode; | ||
bytes memory initData; | ||
|
||
stopBroadcast(); | ||
} | ||
if (block.chainid == 137) { | ||
// First deploy staging | ||
initData = abi.encode( | ||
forumAccountSingleton, | ||
entryPoint, | ||
gnosisFallbackHandler, | ||
hex"03b6d35a71a78c74371a51a07459cb30b03a4cbea9885c8b656dd84e4175bce11d00000000", | ||
'{"type":"webauthn.get","challenge":"', | ||
'","origin":"https://staging.forumdaos.com"}' | ||
); | ||
(contractAddress, deploymentBytecode) = SelectDeployment("ForumAccountFactory", initData); | ||
|
||
// Then deploy production | ||
initData = abi.encode( | ||
forumAccountSingleton, | ||
entryPoint, | ||
gnosisFallbackHandler, | ||
hex"15fb388e36f88f11a3606dc4effb11f6a645d5c315366bdc62002118c776cea41d00000000", | ||
'{"type":"webauthn.get","challenge":"', | ||
'","origin":"https://forumdaos.com"}' | ||
); | ||
|
||
// Overwrite the staging address as we will take it from console for now, prod is more important to write | ||
(contractAddress, deploymentBytecode) = SelectDeployment("ForumAccountFactory", initData); | ||
} else { | ||
// Deploy development | ||
initData = abi.encode( | ||
forumAccountSingleton, | ||
entryPoint, | ||
gnosisFallbackHandler, | ||
hex"1584482fdf7a4d0b7eb9d45cf835288cb59e55b8249fff356e33be88ecc546d11d00000000", | ||
'{"type":"webauthn.get","challenge":"', | ||
'","origin":"https://development.forumdaos.com"}' | ||
); | ||
|
||
(contractAddress, deploymentBytecode) = SelectDeployment("ForumAccountFactory", initData); | ||
} | ||
|
||
fork.set("ForumAccountFactory", contractAddress, deploymentBytecode); | ||
|
||
stopBroadcast(); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,38 +1,39 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.13; | ||
|
||
import {ForumGroup} from '../../src/erc4337-group/ForumGroup.sol'; | ||
import {DeploymentSelector} from '../../lib/foundry-deployment-manager/src/DeploymentSelector.sol'; | ||
import {ForumGroup} from "../../src/erc4337-group/ForumGroup.sol"; | ||
import {DeploymentSelector} from "../../lib/foundry-deployment-manager/src/DeploymentSelector.sol"; | ||
|
||
/** | ||
* @dev This contract is used to deploy the ForumGroup contract | ||
* For now this must be run before the ForumGroupFactoryDeployer | ||
* Improvements to the deployment manager will allow this to be run in any order | ||
*/ | ||
contract ForumGroupDeployer is DeploymentSelector { | ||
address internal forumAccountSingleton; | ||
ForumGroup internal forumGroup; | ||
address internal forumAccountSingleton; | ||
ForumGroup internal forumGroup; | ||
|
||
function run() public { | ||
innerRun(); | ||
outputDeployment(); | ||
} | ||
// TODO improve the linking of this lib | ||
address internal constant FCL_ELLIPTIC_ZZ = 0xbb93A0Ca0EDb4a726f37433993ED22376CD8387a; | ||
|
||
function innerRun() public { | ||
startBroadcast(); | ||
function run() public { | ||
innerRun(); | ||
outputDeployment(); | ||
} | ||
|
||
forumAccountSingleton = fork.get('ForumAccount'); | ||
function innerRun() public { | ||
startBroadcast(); | ||
|
||
// No longer using external validator | ||
bytes memory initData = abi.encode(forumAccountSingleton); | ||
// ! ENSURE UPDATED VERSION IS SET ON CONTRACT | ||
forumAccountSingleton = fork.get("ForumAccount"); | ||
|
||
(address contractAddress, bytes memory deploymentBytecode) = SelectDeployment( | ||
'ForumGroup', | ||
initData | ||
); | ||
// No longer using external validator | ||
bytes memory initData = abi.encode(forumAccountSingleton, FCL_ELLIPTIC_ZZ); | ||
|
||
fork.set('ForumGroup', contractAddress, deploymentBytecode); | ||
(address contractAddress, bytes memory deploymentBytecode) = SelectDeployment("ForumGroup", initData); | ||
|
||
stopBroadcast(); | ||
} | ||
fork.set("ForumGroup", contractAddress, deploymentBytecode); | ||
|
||
stopBroadcast(); | ||
} | ||
} |
Oops, something went wrong.