diff --git a/evm/.openzeppelin/arbitrum-one.json b/evm/.openzeppelin/arbitrum-one.json index ab43ba1c..d7fdfc54 100644 --- a/evm/.openzeppelin/arbitrum-one.json +++ b/evm/.openzeppelin/arbitrum-one.json @@ -268,6 +268,267 @@ ] } } + }, + "dceb9abdd23926ddaaafb079c9784a3a659e0f99f18efcd0a5b078f4305302ce": { + "address": "0xB9dE9F72e81d1609E940Fb2217f7286602064881", + "txHash": "0xb65ef7240a84e4d653f0eae261ab35503c8f0f0b618000150c9b7656657b7a2d", + "layout": { + "solcVersion": "0.8.24", + "storage": [ + { + "label": "ethToNearToken", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_address,t_string_storage)", + "contract": "OmniBridge", + "src": "src/omni-bridge/contracts/OmniBridge.sol:24" + }, + { + "label": "nearToEthToken", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_string_memory_ptr,t_address)", + "contract": "OmniBridge", + "src": "src/omni-bridge/contracts/OmniBridge.sol:25" + }, + { + "label": "isBridgeToken", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_address,t_bool)", + "contract": "OmniBridge", + "src": "src/omni-bridge/contracts/OmniBridge.sol:26" + }, + { + "label": "tokenImplementationAddress", + "offset": 0, + "slot": "3", + "type": "t_address", + "contract": "OmniBridge", + "src": "src/omni-bridge/contracts/OmniBridge.sol:28" + }, + { + "label": "nearBridgeDerivedAddress", + "offset": 0, + "slot": "4", + "type": "t_address", + "contract": "OmniBridge", + "src": "src/omni-bridge/contracts/OmniBridge.sol:29" + }, + { + "label": "omniBridgeChainId", + "offset": 20, + "slot": "4", + "type": "t_uint8", + "contract": "OmniBridge", + "src": "src/omni-bridge/contracts/OmniBridge.sol:30" + }, + { + "label": "completedTransfers", + "offset": 0, + "slot": "5", + "type": "t_mapping(t_uint64,t_bool)", + "contract": "OmniBridge", + "src": "src/omni-bridge/contracts/OmniBridge.sol:32" + }, + { + "label": "currentOriginNonce", + "offset": 0, + "slot": "6", + "type": "t_uint64", + "contract": "OmniBridge", + "src": "src/omni-bridge/contracts/OmniBridge.sol:33" + }, + { + "label": "customMinters", + "offset": 0, + "slot": "7", + "type": "t_mapping(t_address,t_address)", + "contract": "OmniBridge", + "src": "src/omni-bridge/contracts/OmniBridge.sol:35" + }, + { + "label": "__gap", + "offset": 0, + "slot": "8", + "type": "t_array(t_uint256)50_storage", + "contract": "OmniBridge", + "src": "src/omni-bridge/contracts/OmniBridge.sol:332" + }, + { + "label": "_wormhole", + "offset": 0, + "slot": "58", + "type": "t_contract(IWormhole)5925", + "contract": "OmniBridgeWormhole", + "src": "src/omni-bridge/contracts/OmniBridgeWormhole.sol:26" + }, + { + "label": "_consistencyLevel", + "offset": 20, + "slot": "58", + "type": "t_uint8", + "contract": "OmniBridgeWormhole", + "src": "src/omni-bridge/contracts/OmniBridgeWormhole.sol:28" + }, + { + "label": "wormholeNonce", + "offset": 21, + "slot": "58", + "type": "t_uint32", + "contract": "OmniBridgeWormhole", + "src": "src/omni-bridge/contracts/OmniBridgeWormhole.sol:29" + } + ], + "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)24_storage)": { + "label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)", + "numberOfBytes": "32" + }, + "t_struct(AccessControlStorage)34_storage": { + "label": "struct AccessControlUpgradeable.AccessControlStorage", + "members": [ + { + "label": "_roles", + "type": "t_mapping(t_bytes32,t_struct(RoleData)24_storage)", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(InitializableStorage)266_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)24_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_contract(IWormhole)5925": { + "label": "contract IWormhole", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_address)": { + "label": "mapping(address => address)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_string_storage)": { + "label": "mapping(address => string)", + "numberOfBytes": "32" + }, + "t_mapping(t_string_memory_ptr,t_address)": { + "label": "mapping(string => address)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint64,t_bool)": { + "label": "mapping(uint64 => bool)", + "numberOfBytes": "32" + }, + "t_string_memory_ptr": { + "label": "string", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint32": { + "label": "uint32", + "numberOfBytes": "4" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + }, + "namespaces": { + "erc7201:openzeppelin.storage.AccessControl": [ + { + "contract": "AccessControlUpgradeable", + "label": "_roles", + "type": "t_mapping(t_bytes32,t_struct(RoleData)24_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" + } + ] + } + } } } } diff --git a/evm/.openzeppelin/base.json b/evm/.openzeppelin/base.json index bf52df1d..b410ab45 100644 --- a/evm/.openzeppelin/base.json +++ b/evm/.openzeppelin/base.json @@ -268,6 +268,267 @@ ] } } + }, + "dceb9abdd23926ddaaafb079c9784a3a659e0f99f18efcd0a5b078f4305302ce": { + "address": "0xEC81aFc3485a425347Ac03316675e58a680b283A", + "txHash": "0x86fdb8388cfb93962ef728558688e370ec90c529b42f831a1d31195883a88247", + "layout": { + "solcVersion": "0.8.24", + "storage": [ + { + "label": "ethToNearToken", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_address,t_string_storage)", + "contract": "OmniBridge", + "src": "src/omni-bridge/contracts/OmniBridge.sol:24" + }, + { + "label": "nearToEthToken", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_string_memory_ptr,t_address)", + "contract": "OmniBridge", + "src": "src/omni-bridge/contracts/OmniBridge.sol:25" + }, + { + "label": "isBridgeToken", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_address,t_bool)", + "contract": "OmniBridge", + "src": "src/omni-bridge/contracts/OmniBridge.sol:26" + }, + { + "label": "tokenImplementationAddress", + "offset": 0, + "slot": "3", + "type": "t_address", + "contract": "OmniBridge", + "src": "src/omni-bridge/contracts/OmniBridge.sol:28" + }, + { + "label": "nearBridgeDerivedAddress", + "offset": 0, + "slot": "4", + "type": "t_address", + "contract": "OmniBridge", + "src": "src/omni-bridge/contracts/OmniBridge.sol:29" + }, + { + "label": "omniBridgeChainId", + "offset": 20, + "slot": "4", + "type": "t_uint8", + "contract": "OmniBridge", + "src": "src/omni-bridge/contracts/OmniBridge.sol:30" + }, + { + "label": "completedTransfers", + "offset": 0, + "slot": "5", + "type": "t_mapping(t_uint64,t_bool)", + "contract": "OmniBridge", + "src": "src/omni-bridge/contracts/OmniBridge.sol:32" + }, + { + "label": "currentOriginNonce", + "offset": 0, + "slot": "6", + "type": "t_uint64", + "contract": "OmniBridge", + "src": "src/omni-bridge/contracts/OmniBridge.sol:33" + }, + { + "label": "customMinters", + "offset": 0, + "slot": "7", + "type": "t_mapping(t_address,t_address)", + "contract": "OmniBridge", + "src": "src/omni-bridge/contracts/OmniBridge.sol:35" + }, + { + "label": "__gap", + "offset": 0, + "slot": "8", + "type": "t_array(t_uint256)50_storage", + "contract": "OmniBridge", + "src": "src/omni-bridge/contracts/OmniBridge.sol:332" + }, + { + "label": "_wormhole", + "offset": 0, + "slot": "58", + "type": "t_contract(IWormhole)5925", + "contract": "OmniBridgeWormhole", + "src": "src/omni-bridge/contracts/OmniBridgeWormhole.sol:26" + }, + { + "label": "_consistencyLevel", + "offset": 20, + "slot": "58", + "type": "t_uint8", + "contract": "OmniBridgeWormhole", + "src": "src/omni-bridge/contracts/OmniBridgeWormhole.sol:28" + }, + { + "label": "wormholeNonce", + "offset": 21, + "slot": "58", + "type": "t_uint32", + "contract": "OmniBridgeWormhole", + "src": "src/omni-bridge/contracts/OmniBridgeWormhole.sol:29" + } + ], + "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)24_storage)": { + "label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)", + "numberOfBytes": "32" + }, + "t_struct(AccessControlStorage)34_storage": { + "label": "struct AccessControlUpgradeable.AccessControlStorage", + "members": [ + { + "label": "_roles", + "type": "t_mapping(t_bytes32,t_struct(RoleData)24_storage)", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(InitializableStorage)266_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)24_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_contract(IWormhole)5925": { + "label": "contract IWormhole", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_address)": { + "label": "mapping(address => address)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_string_storage)": { + "label": "mapping(address => string)", + "numberOfBytes": "32" + }, + "t_mapping(t_string_memory_ptr,t_address)": { + "label": "mapping(string => address)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint64,t_bool)": { + "label": "mapping(uint64 => bool)", + "numberOfBytes": "32" + }, + "t_string_memory_ptr": { + "label": "string", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint32": { + "label": "uint32", + "numberOfBytes": "4" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + }, + "namespaces": { + "erc7201:openzeppelin.storage.AccessControl": [ + { + "contract": "AccessControlUpgradeable", + "label": "_roles", + "type": "t_mapping(t_bytes32,t_struct(RoleData)24_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" + } + ] + } + } } } } diff --git a/evm/hardhat.config.ts b/evm/hardhat.config.ts index 0f7e688f..4d414895 100644 --- a/evm/hardhat.config.ts +++ b/evm/hardhat.config.ts @@ -53,7 +53,7 @@ task("deploy-bridge-token-factory", "Deploys the OmniBridge contract") const omniChainId = networkConfig.omniChainId const wormholeAddress = networkConfig.wormholeAddress - const mpcRootPublicKey = hre.network.name.endsWith("mainnet") + const mpcRootPublicKey = hre.network.name.toLowerCase().endsWith("mainnet") ? mpcRootPublicKeys.mainnet.key : mpcRootPublicKeys.testnet.key diff --git a/evm/src/omni-bridge/contracts/OmniBridge.sol b/evm/src/omni-bridge/contracts/OmniBridge.sol index ceb768e7..e1f7b8c1 100644 --- a/evm/src/omni-bridge/contracts/OmniBridge.sol +++ b/evm/src/omni-bridge/contracts/OmniBridge.sol @@ -309,6 +309,12 @@ contract OmniBridge is proxy.upgradeToAndCall(implementation, bytes("")); } + function setNearBridgeDerivedAddress( + address nearBridgeDerivedAddress_ + ) external onlyRole(DEFAULT_ADMIN_ROLE) { + nearBridgeDerivedAddress = nearBridgeDerivedAddress_; + } + function _normalizeDecimals( uint8 decimals ) internal pure returns (uint8) { diff --git a/near/res/evm_prover.wasm b/near/res/evm_prover.wasm deleted file mode 100755 index 36a9d849..00000000 Binary files a/near/res/evm_prover.wasm and /dev/null differ diff --git a/near/res/omni_bridge.wasm b/near/res/omni_bridge.wasm deleted file mode 100755 index ad42b841..00000000 Binary files a/near/res/omni_bridge.wasm and /dev/null differ diff --git a/near/res/omni_prover.wasm b/near/res/omni_prover.wasm deleted file mode 100755 index 9f0a6bf2..00000000 Binary files a/near/res/omni_prover.wasm and /dev/null differ diff --git a/near/res/omni_token.wasm b/near/res/omni_token.wasm deleted file mode 100755 index aadaa56b..00000000 Binary files a/near/res/omni_token.wasm and /dev/null differ diff --git a/near/res/token_deployer.wasm b/near/res/token_deployer.wasm deleted file mode 100755 index 1b87f957..00000000 Binary files a/near/res/token_deployer.wasm and /dev/null differ diff --git a/near/res/wormhole_omni_prover_proxy.wasm b/near/res/wormhole_omni_prover_proxy.wasm deleted file mode 100755 index a0e09afc..00000000 Binary files a/near/res/wormhole_omni_prover_proxy.wasm and /dev/null differ diff --git a/near/rust-toolchain b/near/rust-toolchain index 49392a56..f9559f0e 100644 --- a/near/rust-toolchain +++ b/near/rust-toolchain @@ -1,3 +1,7 @@ [toolchain] +<<<<<<< HEAD channel = "1.84.0" +======= +channel = "1.80.0" +>>>>>>> main components = ["clippy", "rustfmt"]