-
Notifications
You must be signed in to change notification settings - Fork 15
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 #77 from etherspot/deploy-modular-etherspot-wallet…
…-factory-all-chains - Added scripts, FactoryStaker.sol and deployed and staked new factories
- Loading branch information
Showing
112 changed files
with
20,823 additions
and
74 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
artifacts/@openzeppelin/contracts/access/Ownable.sol/Ownable.dbg.json
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,4 +1,4 @@ | ||
{ | ||
"_format": "hh-sol-dbg-1", | ||
"buildInfo": "../../../../build-info/7810ea4a0b1001fe4f85cee7595e8e6b.json" | ||
"buildInfo": "../../../../build-info/47dc323db6fafbe3d93a9be5111ed9f5.json" | ||
} |
2 changes: 1 addition & 1 deletion
2
artifacts/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/IERC1822Proxiable.dbg.json
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,4 +1,4 @@ | ||
{ | ||
"_format": "hh-sol-dbg-1", | ||
"buildInfo": "../../../../build-info/7810ea4a0b1001fe4f85cee7595e8e6b.json" | ||
"buildInfo": "../../../../build-info/47dc323db6fafbe3d93a9be5111ed9f5.json" | ||
} |
2 changes: 1 addition & 1 deletion
2
artifacts/@openzeppelin/contracts/proxy/beacon/IBeacon.sol/IBeacon.dbg.json
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,4 +1,4 @@ | ||
{ | ||
"_format": "hh-sol-dbg-1", | ||
"buildInfo": "../../../../../build-info/7810ea4a0b1001fe4f85cee7595e8e6b.json" | ||
"buildInfo": "../../../../../build-info/47dc323db6fafbe3d93a9be5111ed9f5.json" | ||
} |
2 changes: 1 addition & 1 deletion
2
artifacts/@openzeppelin/contracts/proxy/utils/Initializable.sol/Initializable.dbg.json
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,4 +1,4 @@ | ||
{ | ||
"_format": "hh-sol-dbg-1", | ||
"buildInfo": "../../../../../build-info/7810ea4a0b1001fe4f85cee7595e8e6b.json" | ||
"buildInfo": "../../../../../build-info/47dc323db6fafbe3d93a9be5111ed9f5.json" | ||
} |
2 changes: 1 addition & 1 deletion
2
artifacts/@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol/UUPSUpgradeable.dbg.json
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,4 +1,4 @@ | ||
{ | ||
"_format": "hh-sol-dbg-1", | ||
"buildInfo": "../../../../../build-info/7810ea4a0b1001fe4f85cee7595e8e6b.json" | ||
"buildInfo": "../../../../../build-info/47dc323db6fafbe3d93a9be5111ed9f5.json" | ||
} |
2 changes: 1 addition & 1 deletion
2
artifacts/@openzeppelin/contracts/utils/Address.sol/Address.dbg.json
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,4 +1,4 @@ | ||
{ | ||
"_format": "hh-sol-dbg-1", | ||
"buildInfo": "../../../../build-info/7810ea4a0b1001fe4f85cee7595e8e6b.json" | ||
"buildInfo": "../../../../build-info/47dc323db6fafbe3d93a9be5111ed9f5.json" | ||
} |
2 changes: 1 addition & 1 deletion
2
artifacts/@openzeppelin/contracts/utils/Context.sol/Context.dbg.json
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,4 +1,4 @@ | ||
{ | ||
"_format": "hh-sol-dbg-1", | ||
"buildInfo": "../../../../build-info/7810ea4a0b1001fe4f85cee7595e8e6b.json" | ||
"buildInfo": "../../../../build-info/47dc323db6fafbe3d93a9be5111ed9f5.json" | ||
} |
2 changes: 1 addition & 1 deletion
2
artifacts/@openzeppelin/contracts/utils/StorageSlot.sol/StorageSlot.dbg.json
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,4 +1,4 @@ | ||
{ | ||
"_format": "hh-sol-dbg-1", | ||
"buildInfo": "../../../../build-info/7810ea4a0b1001fe4f85cee7595e8e6b.json" | ||
"buildInfo": "../../../../build-info/47dc323db6fafbe3d93a9be5111ed9f5.json" | ||
} |
2 changes: 1 addition & 1 deletion
2
artifacts/@openzeppelin/contracts/utils/Strings.sol/Strings.dbg.json
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,4 +1,4 @@ | ||
{ | ||
"_format": "hh-sol-dbg-1", | ||
"buildInfo": "../../../../build-info/7810ea4a0b1001fe4f85cee7595e8e6b.json" | ||
"buildInfo": "../../../../build-info/47dc323db6fafbe3d93a9be5111ed9f5.json" | ||
} |
2 changes: 1 addition & 1 deletion
2
artifacts/@openzeppelin/contracts/utils/cryptography/ECDSA.sol/ECDSA.dbg.json
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,4 +1,4 @@ | ||
{ | ||
"_format": "hh-sol-dbg-1", | ||
"buildInfo": "../../../../../build-info/7810ea4a0b1001fe4f85cee7595e8e6b.json" | ||
"buildInfo": "../../../../../build-info/47dc323db6fafbe3d93a9be5111ed9f5.json" | ||
} |
2 changes: 1 addition & 1 deletion
2
artifacts/@openzeppelin/contracts/utils/math/Math.sol/Math.dbg.json
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,4 +1,4 @@ | ||
{ | ||
"_format": "hh-sol-dbg-1", | ||
"buildInfo": "../../../../../build-info/7810ea4a0b1001fe4f85cee7595e8e6b.json" | ||
"buildInfo": "../../../../../build-info/47dc323db6fafbe3d93a9be5111ed9f5.json" | ||
} |
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,64 @@ | ||
import { ethers } from 'ethers'; | ||
import { HardhatRuntimeEnvironment } from 'hardhat/types'; | ||
import { DeployFunction } from 'hardhat-deploy/types'; | ||
|
||
const deployModular: DeployFunction = async function ( | ||
hre: HardhatRuntimeEnvironment | ||
) { | ||
const { deployments, getNamedAccounts } = hre; | ||
const { deploy, execute, read } = deployments; | ||
const { from } = await getNamedAccounts(); | ||
const ENTRYPOINT_07 = '0x0000000071727De22E5E9d8BAf0edAc6f37da032'; | ||
const IMPLEMENTATION = '0x202A5598bDba2cE62bFfA13EcccB04969719Fad9'; | ||
|
||
console.log('starting deployments...'); | ||
|
||
// Wait for 5 blocks | ||
let currentBlock = await hre.ethers.provider.getBlockNumber(); | ||
while (currentBlock + 5 > (await hre.ethers.provider.getBlockNumber())) {} | ||
|
||
console.log('deploying ModularEtherspotWalletFactory...'); | ||
const factory = await deploy('ModularEtherspotWalletFactory', { | ||
from, | ||
args: [IMPLEMENTATION, from], | ||
log: true, | ||
}); | ||
console.log('ModularEtherspotWalletFactory deployed at:', factory.address); | ||
|
||
// Wait for 5 blocks | ||
currentBlock = await hre.ethers.provider.getBlockNumber(); | ||
while (currentBlock + 5 > (await hre.ethers.provider.getBlockNumber())) {} | ||
|
||
// check implementation set correctly | ||
console.log('Checking implementation in ModularEtherspotWalletFactory...'); | ||
console.log( | ||
`check implementation matches: ${await read( | ||
'ModularEtherspotWalletFactory', | ||
'implementation' | ||
)} == ${IMPLEMENTATION}` | ||
); | ||
|
||
// Wait for 5 blocks | ||
currentBlock = await hre.ethers.provider.getBlockNumber(); | ||
while (currentBlock + 5 > (await hre.ethers.provider.getBlockNumber())) {} | ||
|
||
console.log('Staking ModularEtherspotWalletFactory with EntryPoint...'); | ||
await execute( | ||
'ModularEtherspotWalletFactory', | ||
{ | ||
from, | ||
value: await ethers.utils.parseEther('0.1'), | ||
log: true, | ||
gasLimit: 6e6, | ||
}, | ||
'addStake', | ||
ENTRYPOINT_07, | ||
86400 | ||
); | ||
|
||
console.log(`Done!`); | ||
}; | ||
|
||
deployModular.tags = ['deploy-modular']; | ||
|
||
export default deployModular; |
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,117 @@ | ||
import { ethers } from 'ethers'; | ||
import { HardhatRuntimeEnvironment } from 'hardhat/types'; | ||
import { DeployFunction } from 'hardhat-deploy/types'; | ||
|
||
const deployAllModular: DeployFunction = async function ( | ||
hre: HardhatRuntimeEnvironment | ||
) { | ||
const { deployments, getNamedAccounts } = hre; | ||
const { deploy, execute, read } = deployments; | ||
const { from } = await getNamedAccounts(); | ||
const ENTRYPOINT_07 = '0x0000000071727De22E5E9d8BAf0edAc6f37da032'; | ||
// bytes32(abi.encodePacked("ModularEtherspotWallet:Create2:salt")); | ||
const SALT = | ||
'0x4d6f64756c6172457468657273706f7457616c6c65743a437265617465323a73'; | ||
|
||
console.log('starting deployments...'); | ||
|
||
console.log('deploying ModularEtherspotWallet...'); | ||
const implementation = await deploy('ModularEtherspotWallet', { | ||
deterministicDeployment: SALT, | ||
from, | ||
args: [], | ||
gasLimit: 6e6, | ||
log: true, | ||
}); | ||
console.log(`ModularEtherspotWallet deployed at: ${implementation.address}`); | ||
|
||
// Wait for 5 blocks | ||
let currentBlock = await hre.ethers.provider.getBlockNumber(); | ||
while (currentBlock + 5 > (await hre.ethers.provider.getBlockNumber())) {} | ||
|
||
console.log('deploying ModularEtherspotWalletFactory...'); | ||
const factory = await deploy('ModularEtherspotWalletFactory', { | ||
deterministicDeployment: SALT, | ||
from, | ||
args: [implementation.address, from], | ||
log: true, | ||
}); | ||
console.log('ModularEtherspotWalletFactory deployed at:', factory.address); | ||
|
||
// Wait for 5 blocks | ||
currentBlock = await hre.ethers.provider.getBlockNumber(); | ||
while (currentBlock + 5 > (await hre.ethers.provider.getBlockNumber())) {} | ||
|
||
// check implementation set correctly | ||
console.log('Checking implementation in ModularEtherspotWalletFactory...'); | ||
console.log( | ||
`check implementation matches: ${await read( | ||
'ModularEtherspotWalletFactory', | ||
'implementation' | ||
)} == ${implementation.address}` | ||
); | ||
|
||
// Wait for 5 blocks | ||
currentBlock = await hre.ethers.provider.getBlockNumber(); | ||
while (currentBlock + 5 > (await hre.ethers.provider.getBlockNumber())) {} | ||
|
||
console.log('deploying Bootstrap...'); | ||
const bootstrap = await deploy('Bootstrap', { | ||
deterministicDeployment: SALT, | ||
from, | ||
args: [], | ||
log: true, | ||
}); | ||
console.log('Bootstrap deployed at:', bootstrap.address); | ||
|
||
// Wait for 5 blocks | ||
currentBlock = await hre.ethers.provider.getBlockNumber(); | ||
while (currentBlock + 5 > (await hre.ethers.provider.getBlockNumber())) {} | ||
|
||
console.log('deploying MultipleOwnerECDSAValidator...'); | ||
const ecdsaValidator = await deploy('MultipleOwnerECDSAValidator', { | ||
deterministicDeployment: SALT, | ||
from, | ||
args: [], | ||
log: true, | ||
}); | ||
console.log( | ||
'MultipleOwnerECDSAValidator deployed at:', | ||
ecdsaValidator.address | ||
); | ||
|
||
// Wait for 5 blocks | ||
currentBlock = await hre.ethers.provider.getBlockNumber(); | ||
while (currentBlock + 5 > (await hre.ethers.provider.getBlockNumber())) {} | ||
|
||
// console.log('deploying ERC20SessionKeyValidator...'); | ||
// const sessionKeyValidator = await deploy('ERC20SessionKeyValidator', { | ||
// from, | ||
// args: [], | ||
// log: true, | ||
// }); | ||
// console.log( | ||
// 'ERC20SessionKeyValidator deployed at:', | ||
// sessionKeyValidator.address | ||
// ); | ||
|
||
console.log('Staking ModularEtherspotWalletFactory with EntryPoint...'); | ||
await execute( | ||
'ModularEtherspotWalletFactory', | ||
{ | ||
from, | ||
value: await ethers.utils.parseEther('0.01'), | ||
log: true, | ||
gasLimit: 6e6, | ||
}, | ||
'addStake', | ||
ENTRYPOINT_07, | ||
86400 | ||
); | ||
|
||
console.log(`Done!`); | ||
}; | ||
|
||
deployAllModular.tags = ['deploy-all-modular']; | ||
|
||
export default deployAllModular; |
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,55 @@ | ||
import { HardhatRuntimeEnvironment } from 'hardhat/types'; | ||
import { DeployFunction } from 'hardhat-deploy/types'; | ||
|
||
const verifyAllModular: DeployFunction = async function ( | ||
hre: HardhatRuntimeEnvironment | ||
) { | ||
const { getNamedAccounts } = hre; | ||
const { from } = await getNamedAccounts(); | ||
|
||
const WALLET_FACTORY_ADDRESS = '0xB7361924B4F56af570680d56A03895A16bC54Be0'; | ||
const WALLET_IMPLEMENTATION_ADDRESS = | ||
'0x9A54329dCEc6b961F788bE5017110ac30c76b107'; | ||
const BOOTSTRAP_ADDRESS = '0x805650ce74561C85baA44a8Bd13E19633Fd0F79d'; | ||
const MULTIPLE_OWNER_ECDSA_VALIDATOR_ADDRESS = | ||
'0x68BA597bf6B9097b1D89b8E0D34646D30997f773'; | ||
|
||
console.log('starting verification...'); | ||
console.log('verifying wallet factory...'); | ||
await hre.run('verify:verify', { | ||
address: WALLET_FACTORY_ADDRESS, | ||
contract: | ||
'src/modular-etherspot-wallet/wallet/ModularEtherspotWallet.sol:ModularEtherspotWallet', | ||
constructorArguments: [], | ||
}); | ||
|
||
console.log('verifying wallet implementation...'); | ||
await hre.run('verify:verify', { | ||
address: WALLET_IMPLEMENTATION_ADDRESS, | ||
contract: | ||
'src/modular-etherspot-wallet/wallet/ModularEtherspotWalletFactory.sol:ModularEtherspotWalletFactory', | ||
constructorArguments: [WALLET_FACTORY_ADDRESS, from], | ||
}); | ||
|
||
console.log('verifying bootstrap...'); | ||
await hre.run('verify:verify', { | ||
address: BOOTSTRAP_ADDRESS, | ||
contract: | ||
'src/modular-etherspot-wallet/erc7579-ref-impl/utils/Bootstrap.sol:Bootstrap', | ||
constructorArguments: [], | ||
}); | ||
|
||
console.log('verifying multiple owner ecdsa validator...'); | ||
await hre.run('verify:verify', { | ||
address: MULTIPLE_OWNER_ECDSA_VALIDATOR_ADDRESS, | ||
contract: | ||
'src/modular-etherspot-wallet/modules/validators/MultipleOwnerECDSAValidator.sol:MultipleOwnerECDSAValidator', | ||
constructorArguments: [], | ||
}); | ||
|
||
console.log('completed verification!'); | ||
}; | ||
|
||
verifyAllModular.tags = ['verify-all-modular']; | ||
|
||
export default verifyAllModular; |
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 @@ | ||
50 |
Oops, something went wrong.