Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
130d258
Fix/stake factory (#7)
leekt Jun 8, 2023
6f13ecb
Feat/multi owned ecdsa (#8)
leekt Jun 9, 2023
0369fbb
ERC721 actions renamed to token actions and added erc20, erc1155 (#10)
leekt Jun 12, 2023
43835f0
Feat/killswitch (#11)
leekt Jun 26, 2023
daae3e2
udpated the killswitch action (#12)
leekt Jun 28, 2023
ccc01a6
fix: return value on temp kernel (#13)
leekt Jul 12, 2023
5654ca1
deploy script
leekt Jul 12, 2023
8f0f478
Update audit report to include session keys
derekchiang Jul 13, 2023
bc921a7
deployed to optimism, polygon, arbitrum
leekt Jul 21, 2023
5f8e8f4
V2.1 (#25)
leekt Aug 9, 2023
d5dd478
Add audit report
derekchiang Aug 9, 2023
17548bf
Update audit report to latest version
derekchiang Aug 11, 2023
fde9e99
V2.1 typed primitives (#26)
leekt Aug 14, 2023
b76f241
Deploy/v2.1 (#28)
leekt Aug 16, 2023
51b7f6e
Deploy/v2.1 (#29)
leekt Aug 17, 2023
b3919c5
added stake functionality to factory
leekt May 25, 2023
9c5110e
added stake factory to follow the storage access rule for associated …
leekt May 28, 2023
3d62613
renamed to TempKernel
leekt May 28, 2023
a87f555
deploy script
leekt May 28, 2023
fde62f4
changed script a bit
leekt May 28, 2023
2c3b208
renamed to TempKernel
leekt May 28, 2023
63888ff
forge fmt
leekt May 29, 2023
dd2e8ce
removed console.sol
leekt May 29, 2023
8ee174c
removed staker and renamed actions to executor
leekt May 30, 2023
1bc3104
deployed with deterministic deployment
leekt May 31, 2023
4e7b546
script done for session key
leekt Jun 1, 2023
a266905
using simple trick to adapt the storage access rule
leekt Jun 1, 2023
07322c0
feat: added a new SessionKeyOwnedKernelFactory
0xca11 Jun 6, 2023
61b8dfb
fix: SessionKeyOwnedKernel owner data for account creation
0xca11 Jun 6, 2023
253b57d
refactor: expect digest passed to be a hashed typed data already
0xca11 Jun 7, 2023
f7d1b42
Revert "refactor: expect digest passed to be a hashed typed data alre…
0xca11 Jun 10, 2023
b43c2b3
refactor: validate signed typed data and signed eth messages
0xca11 Jun 10, 2023
f3a091e
feat: pull and merge changes from ZeroDev's upstream v2.1
0xca11 Sep 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 19 additions & 2 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
AccountFactoryTest:testAccountFactory(uint256) (runs: 256, μ: 130276, ~: 130276)
KernelTest:testKernel() (gas: 190)
KernelExecutionTest:test_mode_2() (gas: 593614)
KernelExecutionTest:test_mode_2() (gas: 611256)
KernelExecutionTest:test_mode_2_1() (gas: 589400)
KernelExecutionTest:test_mode_2_erc165() (gas: 2485466)
KernelExecutionTest:test_revert_when_mode_disabled() (gas: 192767)
KernelExecutionTest:test_sudo() (gas: 216219)
KernelHelperTest:testIntersect(uint48,uint48,uint48,uint48) (runs: 256, μ: 2379, ~: 2383)
KernelTest:test_disable_mode() (gas: 170757)
KernelTest:test_disable_mode() (gas: 172824)
KernelTest:test_external_call_default() (gas: 28844)
KernelTest:test_external_call_execution() (gas: 520197)
KernelTest:test_initialize_twice() (gas: 20515)
KernelTest:test_initialize_twice() (gas: 20537)
KernelTest:test_set_default_validator() (gas: 427634)
KernelTest:test_set_default_validator() (gas: 429679)
KernelTest:test_set_execution() (gas: 477930)
KernelTest:test_set_execution() (gas: 479975)
KernelTest:test_validate_signature() (gas: 171911)
KernelTest:test_validate_signature() (gas: 175529)
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
branch = v4.8.2
[submodule "lib/solady"]
path = lib/solady
url = https://github.com/vectorized/solady
Binary file modified audits/kalos_v1.pdf
Binary file not shown.
Binary file added audits/kalos_v2_1.pdf
Binary file not shown.
34 changes: 34 additions & 0 deletions broadcast/DeployECDSAValidator.s.sol/1/run-1692154943.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"transactions": [
{
"hash": "0x1e807ae181a24f2c44339f04aa56222c11fbc0d53b5458ae9e65a45382f309a4",
"transactionType": "CREATE2",
"contractName": "ECDSAValidator",
"contractAddress": "0xd9AB5096a832b9ce79914329DAEE236f8Eea0390",
"function": null,
"arguments": null,
"transaction": {
"type": "0x02",
"from": "0x9775137314fe595c943712b0b336327dfa80ae8a",
"to": "0x4e59b44847b379578588920ca78fbf26c0b4956c",
"gas": "0x6e303",
"value": "0x0",
"data": "0x000000000000000000000000000000000000000000000000000000000000000060808060405234610016576104ee908161001c8239f35b600080fdfe60406080815260048036101561001457600080fd5b600091823560e01c80630c959556146101d557806320709efc1461019b578063333daf921461015b5780633a871cdd1461010d578381638fc925aa146100c85750639ea9bd591461006457600080fd5b346100c457806003193601126100c45761007c610296565b9160243567ffffffffffffffff81116100c057936100a08392602096369101610263565b5050338152808552205490516001600160a01b0392831691909216148152f35b8480fd5b8280fd5b92905060203660031901126101095780359067ffffffffffffffff8211610104576100f591369101610263565b50503382528160205281205580f35b505050fd5b5050fd5b50600319836060368301126101545783359167ffffffffffffffff831161015757610160908336030112610154575060209261014d916024359101610348565b9051908152f35b80fd5b5080fd5b5082346101545781600319360112610154576024359067ffffffffffffffff8211610154575060209261019461014d9236908301610263565b9135610464565b838234610157576020366003190112610157576020916001600160a01b03908290826101c5610296565b1681528085522054169051908152f35b509060203660031901126100c45780359067ffffffffffffffff821161025f5761020191369101610263565b6014116100c4573560601c90338352826020528220805490826bffffffffffffffffffffffff60a01b831617905560018060a01b0316337f381c0d11398486654573703c51ee8210ce9461764d133f9f0e53b6a5397053318480a480f35b8380fd5b9181601f840112156102915782359167ffffffffffffffff8311610291576020838186019501011161029157565b600080fd5b600435906001600160a01b038216820361029157565b903590601e1981360301821215610291570180359067ffffffffffffffff82116102915760200191813603831361029157565b92919267ffffffffffffffff918281116103325760405192601f8201601f19908116603f011684019081118482101761033257604052829481845281830111610291578281602093846000960137010152565b634e487b7160e01b600052604160045260246000fd5b600092916001600160a01b039084833583811690819003610157578152806020528260408220541693826020527b19457468657265756d205369676e6564204d6573736167653a0a33328252603c60042091846103be6101408401946103b86103b187876102ac565b36916102df565b906103ee565b1686146103e557506103b16103d793926103b8926102ac565b16036103df57565b60019150565b96505050505050565b60207f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a19392608060405193838301516040526040830151928360605260416000988995869485526060840151851a885210915114165afa508251923d1561045757606052604052565b638baa579f90526004601cfd5b3360009081526020819052604081205490936001600160a01b03918216939192836104996104933685876102df565b836103ee565b1685146104e6576104d7926103b8916020527b19457468657265756d205369676e6564204d6573736167653a0a33328752603c6004209236916102df565b16036104e05790565b50600190565b50505050509056",
"nonce": "0xf",
"accessList": []
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [],
"libraries": [],
"pending": [
"0x1e807ae181a24f2c44339f04aa56222c11fbc0d53b5458ae9e65a45382f309a4"
],
"returns": {},
"timestamp": 1692154943,
"chain": 1,
"multi": false,
"commit": "4d26148"
}
49 changes: 49 additions & 0 deletions broadcast/DeployECDSAValidator.s.sol/1/run-1692154962.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"transactions": [
{
"hash": "0x1e807ae181a24f2c44339f04aa56222c11fbc0d53b5458ae9e65a45382f309a4",
"transactionType": "CREATE2",
"contractName": "ECDSAValidator",
"contractAddress": "0xd9AB5096a832b9ce79914329DAEE236f8Eea0390",
"function": null,
"arguments": null,
"transaction": {
"type": "0x02",
"from": "0x9775137314fe595c943712b0b336327dfa80ae8a",
"to": "0x4e59b44847b379578588920ca78fbf26c0b4956c",
"gas": "0x6e303",
"value": "0x0",
"data": "0x000000000000000000000000000000000000000000000000000000000000000060808060405234610016576104ee908161001c8239f35b600080fdfe60406080815260048036101561001457600080fd5b600091823560e01c80630c959556146101d557806320709efc1461019b578063333daf921461015b5780633a871cdd1461010d578381638fc925aa146100c85750639ea9bd591461006457600080fd5b346100c457806003193601126100c45761007c610296565b9160243567ffffffffffffffff81116100c057936100a08392602096369101610263565b5050338152808552205490516001600160a01b0392831691909216148152f35b8480fd5b8280fd5b92905060203660031901126101095780359067ffffffffffffffff8211610104576100f591369101610263565b50503382528160205281205580f35b505050fd5b5050fd5b50600319836060368301126101545783359167ffffffffffffffff831161015757610160908336030112610154575060209261014d916024359101610348565b9051908152f35b80fd5b5080fd5b5082346101545781600319360112610154576024359067ffffffffffffffff8211610154575060209261019461014d9236908301610263565b9135610464565b838234610157576020366003190112610157576020916001600160a01b03908290826101c5610296565b1681528085522054169051908152f35b509060203660031901126100c45780359067ffffffffffffffff821161025f5761020191369101610263565b6014116100c4573560601c90338352826020528220805490826bffffffffffffffffffffffff60a01b831617905560018060a01b0316337f381c0d11398486654573703c51ee8210ce9461764d133f9f0e53b6a5397053318480a480f35b8380fd5b9181601f840112156102915782359167ffffffffffffffff8311610291576020838186019501011161029157565b600080fd5b600435906001600160a01b038216820361029157565b903590601e1981360301821215610291570180359067ffffffffffffffff82116102915760200191813603831361029157565b92919267ffffffffffffffff918281116103325760405192601f8201601f19908116603f011684019081118482101761033257604052829481845281830111610291578281602093846000960137010152565b634e487b7160e01b600052604160045260246000fd5b600092916001600160a01b039084833583811690819003610157578152806020528260408220541693826020527b19457468657265756d205369676e6564204d6573736167653a0a33328252603c60042091846103be6101408401946103b86103b187876102ac565b36916102df565b906103ee565b1686146103e557506103b16103d793926103b8926102ac565b16036103df57565b60019150565b96505050505050565b60207f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a19392608060405193838301516040526040830151928360605260416000988995869485526060840151851a885210915114165afa508251923d1561045757606052604052565b638baa579f90526004601cfd5b3360009081526020819052604081205490936001600160a01b03918216939192836104996104933685876102df565b836103ee565b1685146104e6576104d7926103b8916020527b19457468657265756d205369676e6564204d6573736167653a0a33328752603c6004209236916102df565b16036104e05790565b50600190565b50505050509056",
"nonce": "0xf",
"accessList": []
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [
{
"transactionHash": "0x1e807ae181a24f2c44339f04aa56222c11fbc0d53b5458ae9e65a45382f309a4",
"transactionIndex": "0xc",
"blockHash": "0xbb24851954e2f94de22291ff3d28f8f60c534a5816bbd905ba9ba5c280f4c0f9",
"blockNumber": "0x11181e7",
"from": "0x9775137314fE595c943712B0b336327dfa80aE8A",
"to": "0x4e59b44847b379578588920cA78FbF26c0B4956C",
"cumulativeGasUsed": "0x263b57",
"gasUsed": "0x4fcb6",
"contractAddress": null,
"logs": [],
"status": "0x1",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"type": "0x2",
"effectiveGasPrice": "0x6b12eeec4"
}
],
"libraries": [],
"pending": [],
"returns": {},
"timestamp": 1692154962,
"chain": 1,
"multi": false,
"commit": "4d26148"
}
49 changes: 49 additions & 0 deletions broadcast/DeployECDSAValidator.s.sol/1/run-latest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"transactions": [
{
"hash": "0x1e807ae181a24f2c44339f04aa56222c11fbc0d53b5458ae9e65a45382f309a4",
"transactionType": "CREATE2",
"contractName": "ECDSAValidator",
"contractAddress": "0xd9AB5096a832b9ce79914329DAEE236f8Eea0390",
"function": null,
"arguments": null,
"transaction": {
"type": "0x02",
"from": "0x9775137314fe595c943712b0b336327dfa80ae8a",
"to": "0x4e59b44847b379578588920ca78fbf26c0b4956c",
"gas": "0x6e303",
"value": "0x0",
"data": "0x000000000000000000000000000000000000000000000000000000000000000060808060405234610016576104ee908161001c8239f35b600080fdfe60406080815260048036101561001457600080fd5b600091823560e01c80630c959556146101d557806320709efc1461019b578063333daf921461015b5780633a871cdd1461010d578381638fc925aa146100c85750639ea9bd591461006457600080fd5b346100c457806003193601126100c45761007c610296565b9160243567ffffffffffffffff81116100c057936100a08392602096369101610263565b5050338152808552205490516001600160a01b0392831691909216148152f35b8480fd5b8280fd5b92905060203660031901126101095780359067ffffffffffffffff8211610104576100f591369101610263565b50503382528160205281205580f35b505050fd5b5050fd5b50600319836060368301126101545783359167ffffffffffffffff831161015757610160908336030112610154575060209261014d916024359101610348565b9051908152f35b80fd5b5080fd5b5082346101545781600319360112610154576024359067ffffffffffffffff8211610154575060209261019461014d9236908301610263565b9135610464565b838234610157576020366003190112610157576020916001600160a01b03908290826101c5610296565b1681528085522054169051908152f35b509060203660031901126100c45780359067ffffffffffffffff821161025f5761020191369101610263565b6014116100c4573560601c90338352826020528220805490826bffffffffffffffffffffffff60a01b831617905560018060a01b0316337f381c0d11398486654573703c51ee8210ce9461764d133f9f0e53b6a5397053318480a480f35b8380fd5b9181601f840112156102915782359167ffffffffffffffff8311610291576020838186019501011161029157565b600080fd5b600435906001600160a01b038216820361029157565b903590601e1981360301821215610291570180359067ffffffffffffffff82116102915760200191813603831361029157565b92919267ffffffffffffffff918281116103325760405192601f8201601f19908116603f011684019081118482101761033257604052829481845281830111610291578281602093846000960137010152565b634e487b7160e01b600052604160045260246000fd5b600092916001600160a01b039084833583811690819003610157578152806020528260408220541693826020527b19457468657265756d205369676e6564204d6573736167653a0a33328252603c60042091846103be6101408401946103b86103b187876102ac565b36916102df565b906103ee565b1686146103e557506103b16103d793926103b8926102ac565b16036103df57565b60019150565b96505050505050565b60207f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a19392608060405193838301516040526040830151928360605260416000988995869485526060840151851a885210915114165afa508251923d1561045757606052604052565b638baa579f90526004601cfd5b3360009081526020819052604081205490936001600160a01b03918216939192836104996104933685876102df565b836103ee565b1685146104e6576104d7926103b8916020527b19457468657265756d205369676e6564204d6573736167653a0a33328752603c6004209236916102df565b16036104e05790565b50600190565b50505050509056",
"nonce": "0xf",
"accessList": []
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [
{
"transactionHash": "0x1e807ae181a24f2c44339f04aa56222c11fbc0d53b5458ae9e65a45382f309a4",
"transactionIndex": "0xc",
"blockHash": "0xbb24851954e2f94de22291ff3d28f8f60c534a5816bbd905ba9ba5c280f4c0f9",
"blockNumber": "0x11181e7",
"from": "0x9775137314fE595c943712B0b336327dfa80aE8A",
"to": "0x4e59b44847b379578588920cA78FbF26c0B4956C",
"cumulativeGasUsed": "0x263b57",
"gasUsed": "0x4fcb6",
"contractAddress": null,
"logs": [],
"status": "0x1",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"type": "0x2",
"effectiveGasPrice": "0x6b12eeec4"
}
],
"libraries": [],
"pending": [],
"returns": {},
"timestamp": 1692154962,
"chain": 1,
"multi": false,
"commit": "4d26148"
}
34 changes: 34 additions & 0 deletions broadcast/DeployECDSAValidator.s.sol/10/run-1692128913.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"transactions": [
{
"hash": "0xba526e1950db6c4e43c5ecea204773f340ffb69f04f46c12e5cfc5ba86a176d7",
"transactionType": "CREATE2",
"contractName": "ECDSAValidator",
"contractAddress": "0xd9AB5096a832b9ce79914329DAEE236f8Eea0390",
"function": null,
"arguments": null,
"transaction": {
"type": "0x02",
"from": "0x9775137314fe595c943712b0b336327dfa80ae8a",
"to": "0x4e59b44847b379578588920ca78fbf26c0b4956c",
"gas": "0x6e303",
"value": "0x0",
"data": "0x000000000000000000000000000000000000000000000000000000000000000060808060405234610016576104ee908161001c8239f35b600080fdfe60406080815260048036101561001457600080fd5b600091823560e01c80630c959556146101d557806320709efc1461019b578063333daf921461015b5780633a871cdd1461010d578381638fc925aa146100c85750639ea9bd591461006457600080fd5b346100c457806003193601126100c45761007c610296565b9160243567ffffffffffffffff81116100c057936100a08392602096369101610263565b5050338152808552205490516001600160a01b0392831691909216148152f35b8480fd5b8280fd5b92905060203660031901126101095780359067ffffffffffffffff8211610104576100f591369101610263565b50503382528160205281205580f35b505050fd5b5050fd5b50600319836060368301126101545783359167ffffffffffffffff831161015757610160908336030112610154575060209261014d916024359101610348565b9051908152f35b80fd5b5080fd5b5082346101545781600319360112610154576024359067ffffffffffffffff8211610154575060209261019461014d9236908301610263565b9135610464565b838234610157576020366003190112610157576020916001600160a01b03908290826101c5610296565b1681528085522054169051908152f35b509060203660031901126100c45780359067ffffffffffffffff821161025f5761020191369101610263565b6014116100c4573560601c90338352826020528220805490826bffffffffffffffffffffffff60a01b831617905560018060a01b0316337f381c0d11398486654573703c51ee8210ce9461764d133f9f0e53b6a5397053318480a480f35b8380fd5b9181601f840112156102915782359167ffffffffffffffff8311610291576020838186019501011161029157565b600080fd5b600435906001600160a01b038216820361029157565b903590601e1981360301821215610291570180359067ffffffffffffffff82116102915760200191813603831361029157565b92919267ffffffffffffffff918281116103325760405192601f8201601f19908116603f011684019081118482101761033257604052829481845281830111610291578281602093846000960137010152565b634e487b7160e01b600052604160045260246000fd5b600092916001600160a01b039084833583811690819003610157578152806020528260408220541693826020527b19457468657265756d205369676e6564204d6573736167653a0a33328252603c60042091846103be6101408401946103b86103b187876102ac565b36916102df565b906103ee565b1686146103e557506103b16103d793926103b8926102ac565b16036103df57565b60019150565b96505050505050565b60207f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a19392608060405193838301516040526040830151928360605260416000988995869485526060840151851a885210915114165afa508251923d1561045757606052604052565b638baa579f90526004601cfd5b3360009081526020819052604081205490936001600160a01b03918216939192836104996104933685876102df565b836103ee565b1685146104e6576104d7926103b8916020527b19457468657265756d205369676e6564204d6573736167653a0a33328752603c6004209236916102df565b16036104e05790565b50600190565b50505050509056",
"nonce": "0x7",
"accessList": []
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [],
"libraries": [],
"pending": [
"0xba526e1950db6c4e43c5ecea204773f340ffb69f04f46c12e5cfc5ba86a176d7"
],
"returns": {},
"timestamp": 1692128913,
"chain": 10,
"multi": false,
"commit": "4d26148"
}
Loading