Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement proxy contract #66

Merged
merged 29 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
3e52f35
Implement proxy contract
karim-en Apr 9, 2024
a404a79
Add check for previous events
karim-en Apr 9, 2024
882c7ab
Add second solution
karim-en Apr 9, 2024
4521dd0
Revert naming changes from 331c8bf40e969c0659e79449d7c5dd06f537ac65 t…
kiseln Apr 17, 2024
c07183f
Remove second solution for proxy contract. Add necessary functions
kiseln Apr 17, 2024
8b7be73
Add tests for eth custodian proxy
kiseln Apr 18, 2024
f17bc73
Remove leftover variables
kiseln Apr 19, 2024
898d2fc
Remove unused code
kiseln Apr 22, 2024
29b2706
Convert SelectivePausable contract to namespaced storage (eip-7201)
kiseln Apr 22, 2024
4c5b874
Combine withdraw functionality into a single function
kiseln Apr 22, 2024
ec064b5
Add generic admin method on the proxy
kiseln Apr 29, 2024
16da39b
Correct deployment script
kiseln May 6, 2024
c457ab1
Test corrections
kiseln May 9, 2024
b0dd634
Update constant
kiseln May 15, 2024
6b352cf
Fixed event name in tests
kiseln May 15, 2024
ecc9f26
update config
olga24912 May 24, 2024
1ee51e8
add etherscan verififcation
olga24912 Jun 5, 2024
2c30d2c
update admin scripts
olga24912 Jun 5, 2024
ee19546
PAUSED_WITHDRAW -> PAUSED_WITHDRAW_POST_MIGRATION
olga24912 Jun 10, 2024
41ec3a6
add fee for backword compatibility
olga24912 Jun 24, 2024
e810fdc
emit Deposited event in Proxy Contract
olga24912 Jun 26, 2024
d9d860f
Add gap for future implementation of ProofKeeper for the proxy
kiseln Jul 2, 2024
40f67a9
Update gap value
kiseln Jul 2, 2024
c5a28bc
Add `updateAdminLegacy` script
karim-en Jul 3, 2024
acb3076
Fix verification
karim-en Jul 3, 2024
eef0f33
Update hardhat and ethers to v6
karim-en Jul 3, 2024
3f3f420
Fix test
karim-en Jul 3, 2024
02d3f22
Extract block height from proof (#67)
olga24912 Aug 3, 2024
d44af96
Add upgrade script
karim-en Aug 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ After that call: <br />
As a result of the function call you will get the address of the freshly deployed `EthCustodian` that you can put in
your `ethereum-config.json` file in the `ethConnectorAddress` field.

After `ethConnectorAddress` is set, you can run

`$ make eth-deploy-proxy`

to deploy the proxy contract and make it the admin of `EthCustodian`.

### Other scripts

For more advanced usage, please examine the `hardhat.config.js` file which contains a lot of scripts that are performed
Expand Down
350 changes: 350 additions & 0 deletions eth-custodian/.openzeppelin/sepolia.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,350 @@
{
"manifestVersion": "3.2",
"proxies": [
{
"address": "0x4C8afA2fD22dB1c6091A96c382e6546529475B5c",
"txHash": "0x5d7ff3f8b6d8b5f1ba7a4948769e35b4221f0ba451be69d66097dab976cd7545",
"kind": "uups"
}
],
"impls": {
"9346696a759d727ad8297a3bc36e68f05c2afa8a33630ff7e9e3a2378b9b093d": {
"address": "0xfCFF3475142cE152930dE7Aa6da85D855c106812",
"txHash": "0xe20ac4395ad7c790b833f3f33281f58e155d30f30c86be4070d761d3511daccf",
"layout": {
"solcVersion": "0.8.20",
"storage": [
{
"label": "__gap",
"offset": 0,
"slot": "0",
"type": "t_array(t_uint256)50_storage",
"contract": "ProofKeeperGap",
"src": "contracts/ProofKeeperGap.sol:7"
},
{
"label": "_pausedFlags",
"offset": 0,
"slot": "50",
"type": "t_uint256",
"contract": "SelectivePausableUpgradable",
"src": "contracts/SelectivePausableUpgradable.sol:37"
},
{
"label": "preMigrationProducerAccount",
"offset": 0,
"slot": "51",
"type": "t_bytes_storage",
"contract": "EthCustodianProxy",
"src": "contracts/EthCustodianProxy.sol:32"
},
{
"label": "migrationBlockHeight",
"offset": 0,
"slot": "52",
"type": "t_uint64",
"contract": "EthCustodianProxy",
"src": "contracts/EthCustodianProxy.sol:33"
},
{
"label": "ethCustodianImpl",
"offset": 8,
"slot": "52",
"type": "t_contract(EthCustodian)2135",
"contract": "EthCustodianProxy",
"src": "contracts/EthCustodianProxy.sol:35"
}
],
"types": {
"t_address": {
"label": "address",
"numberOfBytes": "20"
},
"t_bool": {
"label": "bool",
"numberOfBytes": "1"
},
"t_bytes32": {
"label": "bytes32",
"numberOfBytes": "32"
},
"t_mapping(t_address,t_bool)": {
"label": "mapping(address => bool)",
"numberOfBytes": "32"
},
"t_mapping(t_bytes32,t_struct(RoleData)25_storage)": {
"label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)",
"numberOfBytes": "32"
},
"t_struct(AccessControlStorage)35_storage": {
"label": "struct AccessControlUpgradeable.AccessControlStorage",
"members": [
{
"label": "_roles",
"type": "t_mapping(t_bytes32,t_struct(RoleData)25_storage)",
"offset": 0,
"slot": "0"
}
],
"numberOfBytes": "32"
},
"t_struct(InitializableStorage)95_storage": {
"label": "struct Initializable.InitializableStorage",
"members": [
{
"label": "_initialized",
"type": "t_uint64",
"offset": 0,
"slot": "0"
},
{
"label": "_initializing",
"type": "t_bool",
"offset": 8,
"slot": "0"
}
],
"numberOfBytes": "32"
},
"t_struct(RoleData)25_storage": {
"label": "struct AccessControlUpgradeable.RoleData",
"members": [
{
"label": "hasRole",
"type": "t_mapping(t_address,t_bool)",
"offset": 0,
"slot": "0"
},
{
"label": "adminRole",
"type": "t_bytes32",
"offset": 0,
"slot": "1"
}
],
"numberOfBytes": "64"
},
"t_uint64": {
"label": "uint64",
"numberOfBytes": "8"
},
"t_array(t_uint256)50_storage": {
"label": "uint256[50]",
"numberOfBytes": "1600"
},
"t_bytes_storage": {
"label": "bytes",
"numberOfBytes": "32"
},
"t_contract(EthCustodian)2135": {
"label": "contract EthCustodian",
"numberOfBytes": "20"
},
"t_uint256": {
"label": "uint256",
"numberOfBytes": "32"
}
},
"namespaces": {
"erc7201:openzeppelin.storage.AccessControl": [
{
"contract": "AccessControlUpgradeable",
"label": "_roles",
"type": "t_mapping(t_bytes32,t_struct(RoleData)25_storage)",
"src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:61",
"offset": 0,
"slot": "0"
}
],
"erc7201:openzeppelin.storage.Initializable": [
{
"contract": "Initializable",
"label": "_initialized",
"type": "t_uint64",
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69",
"offset": 0,
"slot": "0"
},
{
"contract": "Initializable",
"label": "_initializing",
"type": "t_bool",
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73",
"offset": 8,
"slot": "0"
}
]
}
}
},
"11c941e83dcf4b3077416195d38866dd6a19bfa50b4b6f48b442e18bd8d9a69a": {
"address": "0x47996EC1CE791225DcA05fDC7d7eB74e552c05e6",
"txHash": "0x647557339ffd586f4de322a9b23915952cb61c421530a6211fac13e864849db9",
"layout": {
"solcVersion": "0.8.20",
"storage": [
{
"label": "__gap",
"offset": 0,
"slot": "0",
"type": "t_array(t_uint256)50_storage",
"contract": "ProofKeeperGap",
"src": "contracts/ProofKeeperGap.sol:7"
},
{
"label": "_pausedFlags",
"offset": 0,
"slot": "50",
"type": "t_uint256",
"contract": "SelectivePausableUpgradable",
"src": "contracts/SelectivePausableUpgradable.sol:37"
},
{
"label": "preMigrationProducerAccount",
"offset": 0,
"slot": "51",
"type": "t_bytes_storage",
"contract": "EthCustodianProxy",
"src": "contracts/EthCustodianProxy.sol:33"
},
{
"label": "migrationBlockHeight",
"offset": 0,
"slot": "52",
"type": "t_uint64",
"contract": "EthCustodianProxy",
"src": "contracts/EthCustodianProxy.sol:34"
},
{
"label": "ethCustodianImpl",
"offset": 8,
"slot": "52",
"type": "t_contract(EthCustodian)2368",
"contract": "EthCustodianProxy",
"src": "contracts/EthCustodianProxy.sol:36"
}
],
"types": {
"t_address": {
"label": "address",
"numberOfBytes": "20"
},
"t_bool": {
"label": "bool",
"numberOfBytes": "1"
},
"t_bytes32": {
"label": "bytes32",
"numberOfBytes": "32"
},
"t_mapping(t_address,t_bool)": {
"label": "mapping(address => bool)",
"numberOfBytes": "32"
},
"t_mapping(t_bytes32,t_struct(RoleData)25_storage)": {
"label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)",
"numberOfBytes": "32"
},
"t_struct(AccessControlStorage)35_storage": {
"label": "struct AccessControlUpgradeable.AccessControlStorage",
"members": [
{
"label": "_roles",
"type": "t_mapping(t_bytes32,t_struct(RoleData)25_storage)",
"offset": 0,
"slot": "0"
}
],
"numberOfBytes": "32"
},
"t_struct(InitializableStorage)95_storage": {
"label": "struct Initializable.InitializableStorage",
"members": [
{
"label": "_initialized",
"type": "t_uint64",
"offset": 0,
"slot": "0"
},
{
"label": "_initializing",
"type": "t_bool",
"offset": 8,
"slot": "0"
}
],
"numberOfBytes": "32"
},
"t_struct(RoleData)25_storage": {
"label": "struct AccessControlUpgradeable.RoleData",
"members": [
{
"label": "hasRole",
"type": "t_mapping(t_address,t_bool)",
"offset": 0,
"slot": "0"
},
{
"label": "adminRole",
"type": "t_bytes32",
"offset": 0,
"slot": "1"
}
],
"numberOfBytes": "64"
},
"t_uint64": {
"label": "uint64",
"numberOfBytes": "8"
},
"t_array(t_uint256)50_storage": {
"label": "uint256[50]",
"numberOfBytes": "1600"
},
"t_bytes_storage": {
"label": "bytes",
"numberOfBytes": "32"
},
"t_contract(EthCustodian)2368": {
"label": "contract EthCustodian",
"numberOfBytes": "20"
},
"t_uint256": {
"label": "uint256",
"numberOfBytes": "32"
}
},
"namespaces": {
"erc7201:openzeppelin.storage.AccessControl": [
{
"contract": "AccessControlUpgradeable",
"label": "_roles",
"type": "t_mapping(t_bytes32,t_struct(RoleData)25_storage)",
"src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:61",
"offset": 0,
"slot": "0"
}
],
"erc7201:openzeppelin.storage.Initializable": [
{
"contract": "Initializable",
"label": "_initialized",
"type": "t_uint64",
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69",
"offset": 0,
"slot": "0"
},
{
"contract": "Initializable",
"label": "_initializing",
"type": "t_bool",
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73",
"offset": 8,
"slot": "0"
}
]
}
}
}
}
}
Loading
Loading