-
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 #73 from etherspot/remove-eip712-from-validator-mo…
…dule Remove EIP712 from validator module, remove timestamp checks from session key, redeploy contracts, add scripts
- Loading branch information
Showing
84 changed files
with
8,266 additions
and
3,214 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,3 +51,5 @@ broadcast | |
forge_cache/ | ||
.gas-snapshot | ||
|
||
yarn-error.log | ||
yarn.lock |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
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'; | ||
|
||
console.log('starting deployments...'); | ||
|
||
console.log('deploying ModularEtherspotWallet...'); | ||
const implementation = await deploy('ModularEtherspotWallet', { | ||
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', { | ||
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', { | ||
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', { | ||
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.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,57 @@ | ||
import { HardhatRuntimeEnvironment } from 'hardhat/types'; | ||
import { DeployFunction } from 'hardhat-deploy/types'; | ||
|
||
const verifyModular: DeployFunction = async function ( | ||
hre: HardhatRuntimeEnvironment | ||
) { | ||
const { getNamedAccounts } = hre; | ||
const { from } = await getNamedAccounts(); | ||
|
||
const FACTORY_ADDRESS = '0x5952653F151e844346825050d7157A9a6b46A23A'; | ||
const IMPLEMENTATION_ADDRESS = '0x9A54329dCEc6b961F788bE5017110ac30c76b107'; | ||
const BOOTSTRAP_ADDRESS = '0x805650ce74561C85baA44a8Bd13E19633Fd0F79d'; | ||
const ECDSA_VALIDATOR_ADDRESS = '0x68BA597bf6B9097b1D89b8E0D34646D30997f773'; | ||
const SESSION_KEY_VALIDATOR_ADDRESS = | ||
'0x4ebd86AAF89151b5303DB072e0205C668e31E5E7'; | ||
|
||
console.log('starting verification...'); | ||
|
||
await hre.run('verify:verify', { | ||
address: FACTORY_ADDRESS, | ||
contract: | ||
'src/modular-etherspot-wallet/wallet/ModularEtherspotWalletFactory.sol:ModularEtherspotWalletFactory', | ||
constructorArguments: [IMPLEMENTATION_ADDRESS, from], | ||
}); | ||
|
||
await hre.run('verify:verify', { | ||
address: IMPLEMENTATION_ADDRESS, | ||
contract: | ||
'src/modular-etherspot-wallet/wallet/ModularEtherspotWallet.sol:ModularEtherspotWallet', | ||
constructorArguments: [], | ||
}); | ||
|
||
await hre.run('verify:verify', { | ||
address: BOOTSTRAP_ADDRESS, | ||
contract: | ||
'src/modular-etherspot-wallet/erc7579-ref-impl/utils/Bootstrap.sol:Bootstrap', | ||
constructorArguments: [], | ||
}); | ||
|
||
await hre.run('verify:verify', { | ||
address: ECDSA_VALIDATOR_ADDRESS, | ||
contract: | ||
'src/modular-etherspot-wallet/modules/validators/MultipleOwnerECDSAValidator.sol:MultipleOwnerECDSAValidator', | ||
constructorArguments: [], | ||
}); | ||
|
||
await hre.run('verify:verify', { | ||
address: SESSION_KEY_VALIDATOR_ADDRESS, | ||
contract: | ||
'src/modular-etherspot-wallet/modules/validators/ERC20SessionKeyValidator.sol:ERC20SessionKeyValidator', | ||
constructorArguments: [], | ||
}); | ||
}; | ||
|
||
verifyModular.tags = ['verify-modular']; | ||
|
||
export default verifyModular; |
Oops, something went wrong.